示例#1
0
        void ReadParameters(NetworkReader reader, bool autoSend)
        {
            m_AnimatorControllerParameters = m_Animator.parameters;
            for (int i = 0; i < m_AnimatorControllerParameters.Length; i++)
            {
                if (autoSend && !GetParameterAutoSend(i))
                {
                    continue;
                }

                m_AnimatorControllerParameter = m_AnimatorControllerParameters[i];
                if (m_AnimatorControllerParameter.type == AnimatorControllerParameterType.Int)
                {
                    int newValue = (int)reader.ReadPackedUInt32();
                    m_Animator.SetInteger(m_AnimatorControllerParameter.nameHash, newValue);

                    SetRecvTrackingParam(m_AnimatorControllerParameter.name + ":" + newValue, i);
                }

                if (m_AnimatorControllerParameter.type == AnimatorControllerParameterType.Float)
                {
                    float newFloatValue = reader.ReadSingle();
                    m_Animator.SetFloat(m_AnimatorControllerParameter.nameHash, newFloatValue);

                    SetRecvTrackingParam(m_AnimatorControllerParameter.name + ":" + newFloatValue, i);
                }

                if (m_AnimatorControllerParameter.type == AnimatorControllerParameterType.Bool)
                {
                    bool newBoolValue = reader.ReadBoolean();
                    m_Animator.SetBool(m_AnimatorControllerParameter.nameHash, newBoolValue);

                    SetRecvTrackingParam(m_AnimatorControllerParameter.name + ":" + newBoolValue, i);
                }
            }
        }
 public override void Deserialize(UnityEngine.Networking.NetworkReader reader)
 {
     slotId      = reader.ReadByte();
     loadedState = reader.ReadBoolean();
 }
示例#3
0
 protected override bool DeserializeItem(NetworkReader reader)
 {
     return(reader.ReadBoolean());
 }
示例#4
0
 protected override bool DeserializeItem(NetworkReader reader) =>
 reader.ReadBoolean();