Esempio n. 1
0
    void FixedUpdate()
    {
        UpdateDecays();
        float hRaw = CrossPlatformInputManager.GetAxisRaw("Horizontal");
        float vRaw = CrossPlatformInputManager.GetAxisRaw("Vertical");

        if (Mathf.Abs(hRaw) > 0 || Mathf.Abs(vRaw) > 0)
        {
            float   rInputMag = 1.0f / Mathf.Sqrt(hRaw * hRaw + vRaw * vRaw);
            Vector3 inputUnit = new Vector3(hRaw * rInputMag, vRaw * rInputMag, 0);
            transform.Translate(speed * inputUnit);
        }
        if (dialogInputDecay <= 0.0f && Input.GetKey("c"))
        {
            dialogInputDecay = dialogInputDelay;
            dialogCtrl.AlterActiveChoice(-1);
        }
        else if (dialogInputDecay <= 0.0f && Input.GetKey("f"))
        {
            dialogInputDecay = dialogInputDelay;
            dialogCtrl.AlterActiveChoice(1);
        }

        if (dialogInputDecay <= 0.0f && Input.GetKey("e"))
        {
            dialogInputDecay = dialogInputDelay;
            dialogCtrl.ChooseActiveChoice();
        }
    }