bool Init() { // make sure we have everything we need before this function ends! // if (this.IconLocTarget == null){ // isFullyInit = false; // return isFullyInit; // } CommandCenter tempCC = this.IconLocTarget.GetComponent <CommandCenter>(); if (tempCC == null) { Debug.Log("" + gameObject.name + " No tempCC attached to IconLocTarget"); isFullyInit = false; return(isFullyInit); } // We're attached to an enemy, now we can processes it _myCommandCenter = tempCC; FUIWindowToggles testWindow = this.GetComponent <FUIWindowToggles>(); if (testWindow == null) { Debug.Log("" + gameObject.name + " No window attached to IconLocTarget"); isFullyInit = false; return(isFullyInit); } myWindow = testWindow; isFullyInit = true; return(isFullyInit); }
// Use this for initialization void Start() { myWindow = GetComponent <FUIWindowToggles>(); }