Esempio n. 1
0
    protected void Update()
    {
        if (transform.position.y < -15)
        {
            Respawn();
        }

        if (autoAdjustRotation)
        {
            this.transform.eulerAngles = new Vector3(initialRotation.x, this.transform.eulerAngles.y, initialRotation.z);
        }

        if (this.transform.position.x - lastPos.x > 0.02f)
        {
            this.transform.eulerAngles = new Vector3(this.transform.eulerAngles.x, 180, this.transform.eulerAngles.z);
            lastPos = this.transform.position;
        }
        else if (this.transform.position.x - lastPos.x < -0.02f)
        {
            this.transform.eulerAngles = new Vector3(this.transform.eulerAngles.x, 0, this.transform.eulerAngles.z);
            lastPos = this.transform.position;
        }

        if (isLocalPlayer)
        {
            if (playerState.State != currentPlayerState)
            {
                CmdChangeState(playerState.State);
            }
            playerState.Update(Time.deltaTime);
            PlayerUpdate();

            if (specialDisabled)
            {
                coodDownRemaining   -= Time.deltaTime;
                specialCoodDown.text = coodDownRemaining.ToString("F0");
                if (coodDownRemaining < 0)
                {
                    specialDisabled = false;
                    specialCoodDown.transform.parent.gameObject.SetActive(false);
                }
            }
        }
        //Debug.LogError("state - " + playerState.State);
    }
Esempio n. 2
0
 public void ForceUpdate()
 {
     fsmObject.Update();
 }