Пример #1
0
        float timer;                                // Timer for counting up to the next attack.


        void Awake()
        {
            // Setting up the references.
            player       = GameObject.FindGameObjectWithTag("Player");
            sentry       = GameObject.FindGameObjectWithTag("Sentry");
            playerHealth = player.GetComponent <PlayerHealth> ();
            sentryHealth = sentry?.GetComponent <SentryHealth>();
            sentryComp   = sentry?.GetComponent <Sentry>();
            enemyHealth  = GetComponent <EnemyHealth>();
            anim         = GetComponent <Animator> ();
        }
Пример #2
0
        bool isDead;                                                // Whether the sentry is dead.


        void Awake()
        {
            // Setting up the references.
            part         = GetComponent <ParticleSystem>();
            sentryAudio  = GetComponent <AudioSource>();
            sentryComp   = GetComponent <Sentry>();
            playerSentry = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerSentry>();

            // Set the initial health of the sentry.
            currentHealth = startingHealth;
        }