예제 #1
0
 private void Start()
 {
     player        = FindObjectOfType <PlayerMovement>();
     animator      = GetComponent <Animator>();
     health        = GetComponent <Health>();
     enemyMovement = GetComponent <EnemyMovementRanged>();
     audioSource   = GetComponent <AudioSource>();
 }
    float timer;                              // Timer for counting up to the next attack.


    void Awake()
    {
        // Setting up the references.
        homeBase       = GameObject.FindGameObjectWithTag("Base");
        player         = GameObject.FindGameObjectWithTag("Player");
        playerHealth   = player.GetComponent <PlayerHealth> ();
        homeBaseHealth = homeBase.GetComponent <PlayerHome> ();
        enemyHealth    = GetComponent <EnemyHealth>();
        movement       = GetComponent <EnemyMovementRanged> ();
        anim           = GetComponent <Animator> ();
    }