示例#1
0
    void Update()
    {
        if (_IsGetControl)
        {
            _CtController.SimpleMove(new Vector3(Input.GetAxis("Horizontal") * FloSpeed, 0, Input.GetAxis("Vertical") * FloSpeed));

            if (IsGetMagic)
            {
                timer -= Time.deltaTime;
                if (Input.GetButtonDown("Fire1") && timer <= 0)
                {
                    timer = _FloTimerReset;
                    GameObject.Instantiate(GoMagicPrefab, transform.position, Quaternion.identity);
                }
            }
        }

        if (Input.GetKeyDown(KeyCode.Q))
        {
            if (_IsGetControl && _IsGetControlTrex)
            {
                AudioManager.PlayAudioEffectA("GetTrex");
                TrexScript.SendMessage("GetControl");
                this.LoseControl();
            }
            else if (!_IsGetControl && _IsGetControlTrex)
            {
                AudioManager.PlayAudioEffectA("GetTrex");
                TrexScript.SendMessage("LoseControl");
                this.GetControl();
            }
        }
    }