Esempio n. 1
0
    // Update is called once per frame
    public override void Update()
    {
        float deltaTime = Time.deltaTime;

        lastInput = curInput;
        curInput  = controller.GetInput();
        Vector3 desiredMoveVector = new Vector3(curInput.axisX, curInput.axisY);

        motor.SetDesiredMoveVector(desiredMoveVector);

        motor.UpdateMotor(deltaTime);
        UpdateAttached(deltaTime);

        if (stomachTimer != null && stomachTimer.Tick(deltaTime))
        {
            ad.stomach = Mathf.Max(ad.stomach - 1, 0);
            if (ad.stomach == 0)
            {
                ad.hp -= 1;
            }
        }
    }