Exemplo n.º 1
0
        void Init()
        {
            if (m_Initialized)
            {
                return;
            }

            m_Initialized = true;
            m_AnimSync    = target as NetworkAnimator;

            m_AnimatorProperty = serializedObject.FindProperty("m_Animator");
        }
        void Init()
        {
            if (m_Initialized)
            {
                return;
            }

            m_Initialized = true;
            m_AnimSync    = target as NetworkAnimator;

            m_AnimatorProperty = serializedObject.FindProperty("m_Animator");
            m_AnimatorLabel    = new GUIContent("Animator", "The Animator component to synchronize.");
        }
Exemplo n.º 3
0
        internal static void OnAnimationTriggerServerMessage(NetworkMessage netMsg)
        {
            AnimationTriggerMessage msg = netMsg.ReadMessage <AnimationTriggerMessage>();

            if (LogFilter.Debug)
            {
                Debug.Log("OnAnimationTriggerMessage for netId=" + msg.netId + " conn=" + netMsg.conn);
            }

            GameObject go = NetworkServer.FindLocalObject(msg.netId);

            if (go == null)
            {
                return;
            }
            NetworkAnimator animSync = go.GetComponent <NetworkAnimator>();

            if (animSync != null)
            {
                animSync.HandleAnimTriggerMsg(msg.hash);

                NetworkServer.SendToReady(go, (short)MsgType.AnimationTrigger, msg);
            }
        }
Exemplo n.º 4
0
        internal static void OnAnimationParametersServerMessage(NetworkMessage netMsg)
        {
            AnimationParametersMessage msg = netMsg.ReadMessage <AnimationParametersMessage>();

            if (LogFilter.Debug)
            {
                Debug.Log("OnAnimationParametersMessage for netId=" + msg.netId + " conn=" + netMsg.conn);
            }

            GameObject go = NetworkServer.FindLocalObject(msg.netId);

            if (go == null)
            {
                return;
            }
            NetworkAnimator animSync = go.GetComponent <NetworkAnimator>();

            if (animSync != null)
            {
                NetworkReader reader = new NetworkReader(msg.parameters);
                animSync.HandleAnimParamsMsg(msg, reader);
                NetworkServer.SendToReady(go, (short)MsgType.AnimationParameters, msg);
            }
        }