Beispiel #1
0
        // Awake.

        void Awake()
        {
            destroyOffscreen = GetComponent <DestroyWeaponOffscreen>();
            destroyOffscreen.EventDestroy += OnEventDestroy;

            collision = GetComponent <CollisionWithAsteroid>();
            collision.EventCollision += OnCollisionWithAsteroid;
        }
        //===================================================
        // UNITY METHODS
        //===================================================

        /// <summary>
        /// Awake.
        /// </summary>
        void Awake()
        {
            controller = GetComponent <PlayerController>();

            collisionWithAsteroid = GetComponent <CollisionWithAsteroid>();
            collisionWithAsteroid.EventCollision += OnCollisionWithAsteroid;

            playerDeath = GetComponent <PlayerDeath>();
            playerDeath.EventDieComplete += OnDeathComplete;

            shield = GetComponent <PlayerShield>();
        }