示例#1
0
        public void SpawnAtRelative(MyEntity parentEntity, Matrix relativeMatrix, Vector3 relativeVelocity)
        {
            Debug.Assert(Sync.IsServer, "Spawning can be called only on the server!");
            Debug.Assert(Identity != null, "Spawning with empty identity!");
            if (!Sync.IsServer || Identity == null)
            {
                return;
            }

            var character = MyCharacter.CreateCharacterRelative(parentEntity, relativeMatrix, relativeVelocity, Identity.DisplayName, Identity.Model, Identity.ColorMask, false);

            Sync.Players.SetPlayerCharacter(this, character);
            Sync.Players.RevivePlayer(this);
        }