コード例 #1
0
    // Update is called once per frame
    void Update()
    {
        if (GameManager.Instance.state == GameManager.State.Countdown)
        {
            UpdatePhysics();
            UpdateCamera(true);
        }
        else if (GameManager.Instance.state == GameManager.State.Playing)
        {
            switch (state)
            {
            case State.Disabled:
                timeSinceLastHit += Time.deltaTime;
                if (timeSinceLastHit < disabledTime)
                {
                    UpdatePhysics();
                    UpdateCamera(true);
                    //radiusVelocity /= .5f*Time.deltaTime;
                }
                else
                {
                    state = State.Alive;
                }
                break;

            case State.Alive:
                gamepad.EndVibration();
                UpdateSteering();
                UpdateCamera(true);
                UpdateHarpoon();
                UpdatePhysics();
                UpdateQuack();
                break;

            case State.Paused:

                break;

            case State.Dead:
                scaleTimer += Time.deltaTime;
                if (meshRef != null)
                {
                    meshRef.transform.localScale *= (2.0f - scaleTimer) / 2.0f;
                }
                UpdateCamera(false);
                break;
            }
        }
    }