Пример #1
0
    // Use this for initialization
    void Start()
    {
        timer = 0;
        GameObject player = GameObject.FindGameObjectWithTag("Player");

        behaviorScript = player.GetComponent <IronManBehaviourScript>();
    }
    // Use this for initialization
    void Start()
    {
        startingPoint = GameObject.Find("starting-point");
        endingPoint   = GameObject.Find("ending-point");
        GameObject player = GameObject.FindGameObjectWithTag("Player");

        behaviorScript = player.GetComponent <IronManBehaviourScript>();
    }
Пример #3
0
 // Use this for initialization
 void Start()
 {
     anim           = GetComponent <Animator>();
     player         = GameObject.FindGameObjectWithTag("Player");
     enemyHealth    = GetComponent <EnemyHealth>();
     playerHealth   = player.GetComponent <PlayerHealth> ();
     playerAnim     = player.GetComponent <Animator> ();
     agent          = GetComponent <NavMeshAgent>();
     playerShoot    = player.GetComponent <PlayerShoot>();
     playerMovement = player.GetComponent <IronManBehaviourScript>();
 }
Пример #4
0
 public void TakeDamage(int amount, Vector3 hitPoint)
 {
     if (isDead)
     {
         return;
     }
     currentHealth -= amount;
     hitParticles.transform.position = hitPoint;
     hitParticles.Play();
     if (currentHealth <= 0)
     {
         GameObject             player       = GameObject.FindGameObjectWithTag("Player");
         IronManBehaviourScript playerScript = player.GetComponent <IronManBehaviourScript>();
         playerScript.score += pointValueOnKill;
         audio.PlayOneShot(scoreUp, 1.0f);
         Death();
     }
     PlayLaserSound();
 }