Exemple #1
0
        public override void Read(INetworkConnection connection, BinaryReader message)
        {
            CameraBroadcaster.ChangeType changeType = (CameraBroadcaster.ChangeType)message.ReadByte();

            if (CameraBroadcaster.HasFlag(changeType, CameraBroadcaster.ChangeType.Properties))
            {
                isMainCamera = message.ReadBoolean();
                cullingMask  = message.ReadInt32();

                if (isMainCamera)
                {
                    Camera mainCamera = Camera.main;
                    if (mainCamera)
                    {
                        mainCamera.cullingMask = cullingMask;
                    }
                }
            }
        }
        public override void Read(SocketEndpoint sendingEndpoint, BinaryReader message)
        {
            CameraBroadcaster.ChangeType changeType = (CameraBroadcaster.ChangeType)message.ReadByte();

            if (CameraBroadcaster.HasFlag(changeType, CameraBroadcaster.ChangeType.Properties))
            {
                isMainCamera = message.ReadBoolean();
                cullingMask  = message.ReadInt32();

                if (isMainCamera)
                {
                    Camera mainCamera = Camera.main;
                    if (mainCamera)
                    {
                        mainCamera.cullingMask = cullingMask;
                    }
                }
            }
        }