void Hit()
 {
     trail.Stop();
     transform.position = new Vector3(-1000,-1000,-1000);
     BulletState = BulletStateEnum.Waiting;
     currWaitTime = waitingTime;
 }
 void Shooting()
 {
     transform.position = new Vector3(transform.position.x,transform.position.y+Time.deltaTime*bulletSpeed,transform.position.z);
     if (transform.position.y >= Barrier.position.y) {
         BulletState = BulletStateEnum.Hit;
     }
 }
 void OnTriggerEnter(Collider other)
 {
     if (other.tag == "alien")
     {
         BulletState = BulletStateEnum.Hit;
     }
 }
    IEnumerator initialFire()
    {
        yield return(new WaitForSeconds(initialDelay));

        BulletState = BulletStateEnum.ShouldShoot;
        yield break;
    }
 void Hit()
 {
     trail.Stop();
     transform.position = new Vector3(-1000, -1000, -1000);
     BulletState        = BulletStateEnum.Waiting;
     currWaitTime       = waitingTime;
 }
 public bool fire()
 {
     if (BulletState == BulletStateEnum.Available) {
         BulletState = BulletStateEnum.ShouldShoot;
         return true;
     }
     return false;
 }
 void Waiting()
 {
     currWaitTime -= Time.deltaTime;
     if (currWaitTime <= 0)
     {
         BulletState = BulletStateEnum.ShouldShoot;
     }
 }
 void Shooting()
 {
     transform.position = new Vector3(transform.position.x, transform.position.y + Time.deltaTime * bulletSpeed, transform.position.z);
     if (transform.position.y >= Barrier.position.y)
     {
         BulletState = BulletStateEnum.Hit;
     }
 }
 void ShouldShoot()
 {
     Debug.Log("Shoot");
     transform.position = Human.position;
     //gameObject.SetActive(true);
     trail.Play();
     Camera.main.GetComponent <MainScript>().playPew();
     BulletState = BulletStateEnum.Shooting;
 }
Beispiel #10
0
 public bool fire()
 {
     if (BulletState == BulletStateEnum.Available)
     {
         BulletState = BulletStateEnum.ShouldShoot;
         return(true);
     }
     return(false);
 }
Beispiel #11
0
 void ShouldShoot()
 {
     Debug.Log("Shoot");
     transform.position = Human.position;
     //gameObject.SetActive(true);
     trail.Play();
     Camera.main.GetComponent<MainScript>().playPew();
     BulletState = BulletStateEnum.Shooting;
 }
Beispiel #12
0
 void OnTriggerEnter(Collider other)
 {
     if (other.tag == "alien") {
         BulletState = BulletStateEnum.Hit;
     }
 }
Beispiel #13
0
 IEnumerator initialFire()
 {
     yield return new WaitForSeconds(initialDelay);
     BulletState = BulletStateEnum.ShouldShoot;
     yield break;
 }
Beispiel #14
0
 public void disable()
 {
     BulletState = BulletStateEnum.Available;
 }
Beispiel #15
0
 void Waiting()
 {
     currWaitTime-=Time.deltaTime;
     if (currWaitTime <= 0) {
         BulletState = BulletStateEnum.ShouldShoot;
     }
 }
Beispiel #16
0
 public void disable()
 {
     BulletState = BulletStateEnum.Available;
 }