Esempio n. 1
0
 private void Update()
 {
     if (bird == null || (bird != null && !bird.IsDead()))
     {
         offset = new Vector2(xVelcocity, 0);
         material.mainTextureOffset += offset * Time.deltaTime;
     }
 }
    // Update is called once per frame
    void LateUpdate()
    {
        switch (state)
        {
        case State.Ready:
            if (Input.GetButtonDown("Fire1"))
            {
                GameStart();
            }
            break;

        case State.Play:
            if (bird.IsDead())
            {
                GameOver();
            }
            break;

        case State.GameOver:
            if (Input.GetButtonDown("Fire1"))
            {
                Reload();
            }
            break;
        }
    }
Esempio n. 3
0
 // Update is called once per frame
 void Update()
 {
     if (!bird.IsDead())
     {
         transform.Translate(Vector3.left * speed * Time.deltaTime, Space.World);
     }
 }
Esempio n. 4
0
    void OnTriggerExit2D(Collider2D collision)
    {
        BirdController bird = collision.gameObject.GetComponent <BirdController>();

        if (bird && !bird.IsDead())
        {
            bird.AddScore(1);
        }
    }
 private void Update()
 {
     if (this.gameObject.activeInHierarchy == false)
     {
         Destroy(this.gameObject);
     }
     if (!bird.IsDead())
     {
         transform.Translate(Vector3.left * speed * Time.deltaTime, Space.World);
     }
 }