コード例 #1
0
 private void Update()
 {
     if (bird == null || (bird != null && !bird.IsDead()))
     {
         offset = new Vector2(xVelcocity, 0);
         material.mainTextureOffset += offset * Time.deltaTime;
     }
 }
コード例 #2
0
    // 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;
        }
    }
コード例 #3
0
 // Update is called once per frame
 void Update()
 {
     if (!bird.IsDead())
     {
         transform.Translate(Vector3.left * speed * Time.deltaTime, Space.World);
     }
 }
コード例 #4
0
    void OnTriggerExit2D(Collider2D collision)
    {
        BirdController bird = collision.gameObject.GetComponent <BirdController>();

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