How would I do a GUI.Skin fade? , I know how to do a button, scene and a GUI Fade but for me its really impossible to fade the GUI.Skin.
And I already searched google for this… no answers.
This is my current code:
using UnityEngine;
using System.Collections;
[ExecuteInEditMode]
public class GUI_Button : MonoBehaviour {
public bool debugMode = false;
public string title = string.Empty;
private float alpha= 1.0f;
public Texture2D buttonImage = null;
public Rect position = new Rect(15,15,150,150);
public GUISkin skin = null;
void Update () {
}
void OnGUI() {
GUI.skin = skin;
if(debugMode || Application.isPlaying) {
if(GUI.Button(position, buttonImage))
{
transform.position += new Vector3(0, 1.5f, 0);
}
}
}
}
This is my other code where I spawn the GUI.Skin
using UnityEngine;
using System.Collections;
public class Pause : MonoBehaviour {
float count=0.5f;
public GameObject myCube;
public Vector3 spawnSpot = new Vector3(0,2,0);
void Start() {
}
void Update() {
if(Input.GetMouseButtonDown(1)) {
GameObject cubeSpawn = (GameObject)Instantiate(myCube, new Vector3(0,2,0), transform.rotation);
} else {
if(Input.GetMouseButtonUp(1)) {
Destroy(GameObject.Find("lolz(Clone)"), 1);
}
}
}
}