Ejemplo n.º 1
0
    private void Setup()
    {
        mFirstLand = false; //once landed, enable tentacles

        gameObject.layer = Main.layerEnemyNoPlayerProjectile;

        mStatus = Status.Active;

        //tentacles
        if(mTentacles == null) {
            mTentacles = GetComponentsInChildren<Tentacle>(true);
            mTentacleParents = new Transform[mTentacles.Length];
        }

        for(int i = 0; i < mTentacles.Length; i++) {
            Tentacle t = mTentacles[i];
            //t.gameObject.SetActiveRecursively(true);
            t.gameObject.layer = Main.layerEnemyNoPlayerProjectile;
            t.boss = this;
            mTentacleParents[i] = t.transform.parent;

        }

        mNumActiveTentacles = mTentacles.Length;

        //eyes
        if(mEyes == null) {
            mEyes = GetComponentsInChildren<Eye>(true);
            mEyeParents = new Transform[mEyes.Length];
        }

        for(int i = 0; i < mEyes.Length; i++) {
            Eye e = mEyes[i];
            //e.gameObject.SetActiveRecursively(true);
            e.gameObject.layer = Main.layerEnemyNoPlayerProjectile;
            e.boss = this;
            mEyeParents[i] = e.transform.parent;

        }

        mNumActiveEyes = mEyes.Length;
    }
Ejemplo n.º 2
0
    protected override void OnDestroy()
    {
        base.OnDestroy();

        mTentacleParents = null;
        mTentacles = null;

        mEyes = null;
        mEyeParents = null;
    }