HandleAnimMsg() private method

private HandleAnimMsg ( AnimationMessage msg, NetworkReader reader ) : void
msg UnityEngine.Networking.NetworkSystem.AnimationMessage
reader NetworkReader
return void
示例#1
0
        // ------------------ server message handlers -------------------

        static internal void OnAnimationServerMessage(NetworkMessage netMsg)
        {
            netMsg.ReadMessage(s_AnimationMessage);

            if (LogFilter.logDev)
            {
                Debug.Log("OnAnimationMessage for netId=" + s_AnimationMessage.netId + " conn=" + netMsg.conn);
            }

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

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

            if (animSync != null)
            {
                NetworkReader reader = new NetworkReader(s_AnimationMessage.parameters);
                animSync.HandleAnimMsg(s_AnimationMessage, reader);

                NetworkServer.SendToReady(go, MsgType.Animation, s_AnimationMessage);
            }
        }
示例#2
0
        internal static void OnAnimationServerMessage(NetworkMessage netMsg)
        {
            netMsg.ReadMessage <AnimationMessage>(NetworkAnimator.s_AnimationMessage);
            if (LogFilter.logDev)
            {
                Debug.Log(string.Concat(new object[]
                {
                    "OnAnimationMessage for netId=",
                    NetworkAnimator.s_AnimationMessage.netId,
                    " conn=",
                    netMsg.conn
                }));
            }
            GameObject gameObject = NetworkServer.FindLocalObject(NetworkAnimator.s_AnimationMessage.netId);

            if (gameObject == null)
            {
                return;
            }
            NetworkAnimator component = gameObject.GetComponent <NetworkAnimator>();

            if (component != null)
            {
                NetworkReader reader = new NetworkReader(NetworkAnimator.s_AnimationMessage.parameters);
                component.HandleAnimMsg(NetworkAnimator.s_AnimationMessage, reader);
                NetworkServer.SendToReady(gameObject, 40, NetworkAnimator.s_AnimationMessage);
            }
        }
示例#3
0
        internal static void OnAnimationClientMessage(NetworkMessage netMsg)
        {
            netMsg.ReadMessage <AnimationMessage>(s_AnimationMessage);
            GameObject obj2 = ClientScene.FindLocalObject(s_AnimationMessage.netId);

            if (obj2 != null)
            {
                NetworkAnimator component = obj2.GetComponent <NetworkAnimator>();
                if (component != null)
                {
                    NetworkReader reader = new NetworkReader(s_AnimationMessage.parameters);
                    component.HandleAnimMsg(s_AnimationMessage, reader);
                }
            }
        }
示例#4
0
        internal static void OnAnimationClientMessage(NetworkMessage netMsg)
        {
            netMsg.ReadMessage <AnimationMessage>(NetworkAnimator.s_AnimationMessage);
            GameObject gameObject = ClientScene.FindLocalObject(NetworkAnimator.s_AnimationMessage.netId);

            if (gameObject == null)
            {
                return;
            }
            NetworkAnimator component = gameObject.GetComponent <NetworkAnimator>();

            if (component != null)
            {
                NetworkReader reader = new NetworkReader(NetworkAnimator.s_AnimationMessage.parameters);
                component.HandleAnimMsg(NetworkAnimator.s_AnimationMessage, reader);
            }
        }
示例#5
0
        internal static void OnAnimationServerMessage(NetworkMessage netMsg)
        {
            netMsg.ReadMessage(s_AnimationMessage);
            if (LogFilter.logDev)
            {
                Debug.Log("OnAnimationMessage for netId=" + s_AnimationMessage.netId + " conn=" + netMsg.conn);
            }
            GameObject gameObject = NetworkServer.FindLocalObject(s_AnimationMessage.netId);

            if (!(gameObject == null))
            {
                NetworkAnimator component = gameObject.GetComponent <NetworkAnimator>();
                if (component != null)
                {
                    NetworkReader reader = new NetworkReader(s_AnimationMessage.parameters);
                    component.HandleAnimMsg(s_AnimationMessage, reader);
                    NetworkServer.SendToReady(gameObject, 40, s_AnimationMessage);
                }
            }
        }
        internal static void OnAnimationServerMessage(NetworkMessage netMsg)
        {
            netMsg.ReadMessage <AnimationMessage>(NetworkAnimator.s_AnimationMessage);
            if (LogFilter.logDev)
            {
                Debug.Log((object)("OnAnimationMessage for netId=" + (object)NetworkAnimator.s_AnimationMessage.netId + " conn=" + (object)netMsg.conn));
            }
            GameObject localObject = NetworkServer.FindLocalObject(NetworkAnimator.s_AnimationMessage.netId);

            if ((Object)localObject == (Object)null)
            {
                return;
            }
            NetworkAnimator component = localObject.GetComponent <NetworkAnimator>();

            if (!((Object)component != (Object)null))
            {
                return;
            }
            NetworkReader reader = new NetworkReader(NetworkAnimator.s_AnimationMessage.parameters);

            component.HandleAnimMsg(NetworkAnimator.s_AnimationMessage, reader);
            NetworkServer.SendToReady(localObject, (short)40, (MessageBase)NetworkAnimator.s_AnimationMessage);
        }