Esempio n. 1
0
        private void InitializeLocalPlayerState()
        {
            ILocalNitroxPlayer  localPlayer         = NitroxServiceLocator.LocateService <ILocalNitroxPlayer>();
            PlayerModelDirector playerModelDirector = new PlayerModelDirector(localPlayer);

            playerModelDirector
            .AddDiveSuit();

            playerModelDirector.Construct();
        }
Esempio n. 2
0
        private IEnumerator InitializeLocalPlayerState()
        {
            ILocalNitroxPlayer localPlayer = NitroxServiceLocator.LocateService <ILocalNitroxPlayer>();
            IEnumerable <IColorSwapManager> colorSwapManagers = NitroxServiceLocator.LocateService <IEnumerable <IColorSwapManager> >();

            ColorSwapAsyncOperation swapOperation = new ColorSwapAsyncOperation(localPlayer, colorSwapManagers).BeginColorSwap();

            yield return(new WaitUntil(() => swapOperation.IsColorSwapComplete()));

            swapOperation.ApplySwappedColors();
        }
Esempio n. 3
0
        private IEnumerator InitializeLocalPlayerState()
        {
            ILocalNitroxPlayer localPlayer = NitroxServiceLocator.LocateService <ILocalNitroxPlayer>();
            IEnumerable <IColorSwapManager> colorSwapManagers = NitroxServiceLocator.LocateService <IEnumerable <IColorSwapManager> >();

            ColorSwapAsyncOperation swapOperation = new ColorSwapAsyncOperation(localPlayer, colorSwapManagers).BeginColorSwap();

            yield return(new WaitUntil(() => swapOperation.IsColorSwapComplete()));

            swapOperation.ApplySwappedColors();

            // UWE developers added noisy logging for non-whitelisted components during serialization.
            // We add NitroxEntiy in here to avoid a large amount of log spam.
            ProtobufSerializer.componentWhitelist.Add(nameof(NitroxEntity));
        }
Esempio n. 4
0
        private IEnumerator InitializeLocalPlayerState()
        {
            ILocalNitroxPlayer localPlayer = NitroxServiceLocator.LocateService <ILocalNitroxPlayer>();
            IEnumerable <IColorSwapManager> colorSwapManagers = NitroxServiceLocator.LocateService <IEnumerable <IColorSwapManager> >();

            ColorSwapAsyncOperation swapOperation = new ColorSwapAsyncOperation(localPlayer, colorSwapManagers).BeginColorSwap();

            yield return(new WaitUntil(() => swapOperation.IsColorSwapComplete()));

            swapOperation.ApplySwappedColors();

            // UWE developers added noisy logging for non-whitelisted components during serialization.
            // We add NitroxEntiy in here to avoid a large amount of log spam.
            HashSet <string> whiteListedSerializableComponents = (HashSet <string>)ReflectionHelper.ReflectionGet <ProtobufSerializer>(null, "componentWhitelist", false, true);

            whiteListedSerializableComponents.Add("NitroxEntity");
        }
Esempio n. 5
0
 public void ResetModel(ILocalNitroxPlayer localPlayer)
 {
     Body = Object.Instantiate(localPlayer.BodyPrototype);
     Body.SetActive(true);
     PlayerModel = Body.RequireGameObject("player_view");
 }
Esempio n. 6
0
 public PlayerManager(IPacketSender packetSender, ILocalNitroxPlayer localPlayer, PlayerModelManager playerModelManager)
 {
     this.packetSender       = packetSender;
     this.localPlayer        = localPlayer;
     this.playerModelManager = playerModelManager;
 }
Esempio n. 7
0
 public PlayerManager(ILocalNitroxPlayer localPlayer)
 {
     this.localPlayer = localPlayer;
 }
Esempio n. 8
0
 public PlayerManager(ILocalNitroxPlayer localPlayer, PlayerModelManager playerModelManager)
 {
     this.localPlayer        = localPlayer;
     this.playerModelManager = playerModelManager;
 }