void Awake() { //Get the Master. GameObject.Find is here because assigning via inspector is getting cumbersome if (!MasterObject) { MasterObject = GameObject.FindGameObjectWithTag("GameController"); } Master = (IGUIMaster)MasterObject.GetComponent(typeof(IGUIMaster)); OriginalColor = guiTexture.color; FadedColor = new Color(0.5f, 0.5f, 0.5f, 0.1f); IsMouseDown = false; IsClickable = true; ButtonHoldTimer = 0; ToggleStateInternal = 0; }
void Awake() { //Get the Master. GameObject.Find is here because assigning via inspector is getting cumbersome if(!MasterObject) MasterObject = GameObject.FindGameObjectWithTag("GameController"); Master = (IGUIMaster)MasterObject.GetComponent(typeof(IGUIMaster)); OriginalColor = guiTexture.color; FadedColor = new Color(0.5f, 0.5f, 0.5f, 0.1f); IsMouseDown = false; IsClickable = true; ButtonHoldTimer = 0; ToggleStateInternal = 0; }