private void Start()
 {
     startTimeBtwAttack = 0.1f;
     rb         = GetComponent <Rigidbody>();
     compPlayer = GetComponent <PlayerContloller>();
     enemyStun  = GetComponent <EnemyType2>();
 }
    void OnTriggerStay(Collider other)
    {
        EnemyType2 controller = other.GetComponent <EnemyType2>();

        if (other.gameObject.name == "Ruby")
        {
        }
    }
예제 #3
0
 void Start()
 {
     health          = maxHealth;
     enemyController = GetComponent <EnemyType2>();
     enemyRuner      = GetComponent <Enemy1>();
     player          = GameObject.Find("Ruby");
     CameraShake     = GameObject.Find("Main Camera");
     CameraShake.GetComponent <Animator>();
     playerConytoller = player.GetComponent <PlayerContloller>();
     slider.value     = CalculateHealth();
 }
예제 #4
0
    void OnTriggerEnter(Collider info)
    {
        if (info.tag == "Player" && !steppedOn)
        {
            if (enemyType == 1)
            {
                enm1 = enemy.GetComponent <EnemyType1> () as EnemyType1;
                enm1.SpawnEnemy1(GameObject.FindGameObjectWithTag("Player"), spawnPoint);
            }
            else
            {
                enm2 = enemy.GetComponent <EnemyType2> () as EnemyType2;
                enm2.SpawnEnemy2(GameObject.FindGameObjectWithTag("Player"), spawnPoint);
            }

            steppedOn = true;
        }
    }
예제 #5
0
 public override void Reset()
 {
     if (type == 1)
     {
         scType1         = gameObject.GetComponent <EnemyType1> () as EnemyType1;
         scType1.enabled = true;
         SpawnPos        = scType1.GetSpawnPosition();
         scType1.OnReset();
     }
     else
     {
         scType2         = gameObject.GetComponent <EnemyType2> () as EnemyType2;
         scType2.enabled = true;
         SpawnPos        = scType2.GetSpawnPosition();
         scType2.OnReset();
     }
     transform.position = SpawnPos;
     bxCol         = GetComponent <BoxCollider> () as BoxCollider;
     bxCol.enabled = true;
 }
예제 #6
0
 void Awake()
 {
     _type2instance = this;
     SetSprChild(sprChild);
     base.Deactivate();
 }
예제 #7
0
 public FollowAndShoot(EnemyType2 enemy)
 {
     _enemyType2 = enemy;
 }