コード例 #1
0
        private IEnumerator __RandomizeTrigger()
        {
            while (true)
            {
                if (_useFNA && _fna != null)
                {
                    _fna.SetTrigger(_triggerTest);
                    if (DoubleParams)
                    {
                        _fna.SetTrigger(_triggerTest2);
                    }
                }
                else if (_networkAnimator != null)
                {
                    _networkAnimator.SetTrigger(_triggerTest);
                    if (DoubleParams)
                    {
                        _networkAnimator.SetTrigger(_triggerTest2);
                    }
                }

                yield return(new WaitForSeconds(ReturnWaitRange()));
            }
        }
コード例 #2
0
        /// <summary>
        /// Jumps.
        /// </summary>
        private void Jump()
        {
            if (!_jump)
            {
                return;
            }
            _jump = false;

            string jumpString = "Jump";

            _animator.SetTrigger(jumpString);
            if (_flexNetworkAnimator != null)
            {
                _flexNetworkAnimator.SetTrigger(Animator.StringToHash(jumpString));
            }
        }
コード例 #3
0
        private void Update()
        {
            if (base.hasAuthority)
            {
                //Move.
                float horizontal = Input.GetAxis("Horizontal");
                float moveRate   = 1f;
                transform.position += new Vector3(horizontal, 0f, 0f) * moveRate * Time.deltaTime;

                //Animator.
                _animator.SetFloat("Horizontal", horizontal);

                if (Input.GetKeyDown(KeyCode.Space))
                {
                    _fna.SetTrigger("Jump");
                }
            }
        }
コード例 #4
0
 private void CmdJump()
 {
     _fna.SetTrigger("Jump");
 }