Ejemplo n.º 1
0
        internal void HandleScriptMessage(Message m, byte component)
        {
            UNetworkBehaviour b = cachedBehaviours[component];

            if (b.enabled)
            {
                b.HandleMessage(m);
            }
        }
Ejemplo n.º 2
0
        internal void HandleBehaviourSyncMessage(UMsgSyncState msg)
        {
            UNetworkBehaviour beh = cachedBehaviours[msg.netComponentId];

            NetBuffer reader = new NetBuffer();

            reader.Data = msg.data;

            beh.Deserialize(reader, false);
        }
Ejemplo n.º 3
0
        public UMsgSyncState(UNetworkBehaviour networkObject)
        {
            targetNetID    = networkObject.netId;
            netComponentId = networkObject.componentId;

            NetBuffer state = new NetBuffer();

            networkObject.Serialize(state, false);

            data = state.Data;
        }
Ejemplo n.º 4
0
        public UMsgScriptMessage(UNetworkBehaviour source, Message originalMessage)
        {
            netid          = source.identity.netId;
            netComponentId = source.componentId;

            NetBuffer buffer = new NetBuffer();

            originalMessage.Write(buffer);

            originalMessageId = originalMessage.hashCode;
            messageData       = buffer.Data;
        }
Ejemplo n.º 5
0
        public UMsgScriptMessage(UNetworkBehaviour source, Message originalMessage, int serializationBufferSize)
        {
            netid          = source.identity.netId;
            netComponentId = source.componentId;

            NetBuffer buffer = new NetBuffer();

            buffer.EnsureBufferSize(8 * serializationBufferSize);
            originalMessage.Write(buffer);

            originalMessageId = originalMessage.hashCode;
            messageData       = buffer.Data;
        }