示例#1
0
            public UpdateTransformMessage(NetworkInstanceId id, Vector3 position, Quaternion rotation, Vector3 childPosition, Quaternion childRotation, Vector3 velocity)
            {
                this.type = UpdateTransform;

                objectId           = id;
                relayPosition      = position.GetSerializableVector();
                relayRotation      = rotation.GetSerializableVector();
                childRelayPosition = childPosition.GetSerializableVector();
                childRelayRotation = childRotation.GetSerializableVector();
                relayVelocity      = velocity.GetSerializableVector();
            }
示例#2
0
        private void Update()
        {
            _position = transform.position.GetSerializableVector();
            _rotation = transform.rotation.GetSerializableVector();

            if (ServerStage.active)
            {
                foreach (SyncVar var in syncVarDictionary.Values)
                {
                    if (var.IsChanged())
                    {
                        SendVariableUpdate(var);
                        var.Equalize();
                    }
                }
            }
        }
示例#3
0
 private void Awake()
 {
     _position = transform.position.GetSerializableVector();
     _rotation = transform.rotation.GetSerializableVector();
 }
示例#4
0
        public SpawnCommand(int ownerId, NetworkInstanceId id, string name, NetworkSyncVector3 position, NetworkSyncQuaternion rotation, NetworkSyncVarValue syncVarValues, NetworkSpawnArgs args)
        {
            this.id      = id;
            this.ownerId = ownerId;
            this.name    = name;

            this.position = position;
            this.rotation = rotation;

            this.syncVarValues = syncVarValues;
            this.arguments     = args;
        }