bool Init() { // make sure we're connected to a BaseEnemy if (this.IconLocTarget == null) { isFullyInit = false; return(isFullyInit); } // check to make sure its active, as the enemies are now pooled if (!IconLocTarget.activeSelf) { isFullyInit = false; return(isFullyInit); } BaseEnemy tempEnemy = this.IconLocTarget.GetComponent <BaseEnemy>(); if (tempEnemy == null) { Debug.Log("" + gameObject.name + " No Enemy attached to IconLocEnemy"); isFullyInit = false; return(isFullyInit); } // We're attached to an enemy, now we can processes it _enemy = tempEnemy; // check to see if its a seeker _isSeeker = false; SeekerScript tempSeeker = this.IconLocTarget.GetComponent <SeekerScript>(); if (tempSeeker != null) { _isSeeker = true; } else { _isSeeker = false; } //Hide the cannon icon untill use //CannonIcon.gameObject.SetActive(false); BG.alpha = 0.0f; CannonIcon.alpha = 0.0f; // make sure we're on //Activate(); isFullyInit = true; return(isFullyInit); }
// Use this for initialization protected override void Start() { // from Basic Enemy base.Start(); objectAim = ToyBox.GetPandora().Bot_01.gameObject; // start the state machine timer _launchClockTime = Time.time; seeker = this.gameObject.GetComponent <SeekerScript>(); if (seeker) { // we have a seeker script attached. isSeeker = true; } }