private void Awake() { if (m_SelectedCharacter == null) { m_SelectedCharacter = GameObject.FindObjectOfType <Brain>(); } if (m_SelectionManager == null) { m_SelectionManager = GameObject.FindObjectOfType <ClickToSelect>(); } if (m_SelectionManager == null && m_SelectedCharacter == null) { Debug.LogWarning("The StatsUIController has neither a ClickToSelect selection manager or a pre-defined SelectedCharacter. Disabliing the StatsUIController."); this.enabled = false; } }
void Awake() { //If click to select is not added then add if(!this.GetComponent<ClickToSelect>()) { selectionScript = this.gameObject.AddComponent<ClickToSelect>(); //selectionScript.thisBldgScript = this; } //set trigger layers //layer 30 is building selection this.gameObject.layer = 30; //layer 31 is for triggering actions with NPCs. if(scriptTrigger != null) { scriptTrigger.gameObject.layer = 31; } registerHouse(); }
void Awake() { //If click to select is not added then add if(!this.GetComponent<ClickToSelect>()) { selectionScript = this.gameObject.AddComponent<ClickToSelect>(); selectionScript.thisBldgScript = this; } //set trigger layers //layer 30 is building selection this.gameObject.layer = 30; //layer 31 is for triggering actions with NPCs. if(scriptTrigger != null) { scriptTrigger.gameObject.layer = 31; } //Get Selected Building UI Script selBldgScript = Selected_BuildingHooks.singleton; }