コード例 #1
0
        public override bool ProcessUpdate(JediumBehaviourMessage message)
        {
            if (!Initialized)
            {
                return(false);
            }

            if (message == null)
            {
                return(false); //no empty
            }
            if (message.GetBehaviourType() != GetComponentTypeIndex())
            {
                return(false);
            }

            JediumCharacterControllerMessage msg = (JediumCharacterControllerMessage)message;

            //_charAnimator.SetFloat("V",msg.V);
            //_charAnimator.SetFloat("H",msg.H);
            //_charAnimator.SetBool("Jump",msg.Jump);
            _walkBeh.SetVH(msg.V, msg.H, msg.Jump);
            _lastV    = msg.V;
            _lastH    = msg.H;
            _lastJump = msg.Jump;
            //_charAnimator.SetBool("Jump",msg.);

            return(true);
            // throw new System.NotImplementedException();
        }
コード例 #2
0
        public void SetControllerParams(float v, float h, bool jump)
        {
            if (!Initialized)
            {
                return;
            }

            if (Test.Instance._clientId == _parent.OwnerId)
            {
                if (Mathf.Abs(_lastV - v) > 0.1f || Mathf.Abs(_lastH - h) > 0.1f || _lastJump != jump)
                {
                    JediumCharacterControllerMessage msg = new JediumCharacterControllerMessage(v, h, jump);
                    _updater.AddUpdate(msg);
                }
            }
        }