示例#1
0
    void OnTriggerEnter(Collider c)
    {
        BalaEnemiga balaenem = c.gameObject.GetComponent <BalaEnemiga> ();

        if (balaenem != null)
        {
            audioDano.Play();
        }

        if (ManagerLevel.instancia.vidas <= 1)
        {
            Destroy(this.gameObject);
            SceneManager.LoadScene(2);
        }
    }
示例#2
0
 public override void Execute()
 {
     base.Execute();
     if (_npc.actionTimer <= 0)
     {
         BalaEnemiga _instatiate = GameObject.Instantiate(_npc.bullet);
         _instatiate.transform.position = _npc.spawnpoint.position;
         Vector3 dir = _npc.transform.forward;
         if (_npc.target)
         {
             _instatiate.transform.forward = _npc.transform.forward = dir;
         }
         _instatiate.target = _npc.target;
         _npc.actionTimer   = _npc.shootCoolDown;
     }
 }