public void ApplyPlayerColor(Dictionary <string, Color[]> pixelIndex, INitroxPlayer nitroxPlayer)
        {
            Color[] suitPixelIndexes  = pixelIndex[REINFORCED_SUIT_INDEX_KEY];
            Color[] armsTexturePixels = pixelIndex[REINFORCED_SUIT_ARMS_INDEX_KEY];
            Color[] glovePixelIndexes = pixelIndex[REINFORCED_GLOVES_INDEX_KEY];

            GameObject         playerModel       = nitroxPlayer.PlayerModel;
            Color              playerColor       = nitroxPlayer.PlayerSettings.PlayerColor.ToUnity();
            IColorSwapStrategy colorSwapStrategy = new HueSwapper(playerColor);

            SkinnedMeshRenderer reinforcedSuitRenderer = playerModel.GetRenderer(REINFORCED_SUIT_GAME_OBJECT_NAME);

            reinforcedSuitRenderer.material.UpdateMainTextureColors(suitPixelIndexes);
            reinforcedSuitRenderer.material.SetTexture("_MainTex", reinforcedSuitRenderer.material.mainTexture);
            reinforcedSuitRenderer.material.SetTexture("_SpecTex", reinforcedSuitRenderer.material.mainTexture);

            reinforcedSuitRenderer.materials[1].UpdateMainTextureColors(armsTexturePixels);
            reinforcedSuitRenderer.materials[1].SetTexture("_MainTex", reinforcedSuitRenderer.materials[1].mainTexture);
            reinforcedSuitRenderer.materials[1].SetTexture("_SpecTex", reinforcedSuitRenderer.materials[1].mainTexture);

            SkinnedMeshRenderer reinforcedGlovesRenderer = playerModel.GetRenderer(REINFORCED_GLOVES_GAME_OBJECT_NAME);

            reinforcedGlovesRenderer.material.UpdateMainTextureColors(glovePixelIndexes);
        }
Exemplo n.º 2
0
        public void ApplyPlayerColor(Dictionary <string, Color[]> pixelIndex, INitroxPlayer nitroxPlayer)
        {
            Color[] pixels = pixelIndex[FINS_INDEX_EY];

            GameObject playerModel = nitroxPlayer.PlayerModel;

            SkinnedMeshRenderer basicFinRenderer = playerModel.GetRenderer(FINS_GAME_OBJECT_NAME);

            basicFinRenderer.material.UpdateMainTextureColors(pixels);
            basicFinRenderer.material.SetTexture("_MainTex", basicFinRenderer.material.mainTexture);
            basicFinRenderer.material.SetTexture("_SpecTex", basicFinRenderer.material.mainTexture);

            SkinnedMeshRenderer chargedFinRenderer = playerModel.GetRenderer(CHARGED_FINS_GAME_OBJECT_NAME);

            chargedFinRenderer.material.UpdateMainTextureColors(pixels);
            chargedFinRenderer.material.SetTexture("_MainTex", chargedFinRenderer.material.mainTexture);
            chargedFinRenderer.material.SetTexture("_SpecTex", chargedFinRenderer.material.mainTexture);

            SkinnedMeshRenderer glideFinRenderer = playerModel.GetRenderer(GLIDE_FINS_GAME_OBJECT_NAME);

            glideFinRenderer.material.UpdateMainTextureColors(pixels);
            glideFinRenderer.material.SetTexture("_MainTex", glideFinRenderer.material.mainTexture);
            glideFinRenderer.material.SetTexture("_SpecTex", glideFinRenderer.material.mainTexture);
        }
Exemplo n.º 3
0
        public Action <ColorSwapAsyncOperation> CreateColorSwapTask(INitroxPlayer nitroxPlayer)
        {
            GameObject         playerModel       = nitroxPlayer.PlayerModel;
            Color              playerColor       = nitroxPlayer.PlayerSettings.PlayerColor;
            IColorSwapStrategy colorSwapStrategy = new HueSwapper(playerColor);

            SkinnedMeshRenderer rebreatherRenderer = playerModel.GetRenderer(REBREATHER_GAME_OBJECT_NAME);

            rebreatherRenderer.material.ApplyClonedTexture();

            FixRebreatherMaterials(playerModel, rebreatherRenderer);

            Color[] texturePixels = rebreatherRenderer.material.GetMainTexturePixels();

            return(operation =>
            {
                HsvSwapper rebreatherFilter = new HsvSwapper(colorSwapStrategy);
                rebreatherFilter.SetHueRange(0f, 25f);

                rebreatherFilter.SwapColors(texturePixels);

                operation.UpdateIndex(REBREATHER_INDEX_KEY, texturePixels);
            });
        }
Exemplo n.º 4
0
 public void BeginApplyPlayerColor(INitroxPlayer player)
 {
     Multiplayer.Main.StartCoroutine(ApplyPlayerColor(player, colorSwapManagers));
 }
Exemplo n.º 5
0
 public PlayerModelDirector(INitroxPlayer player)
 {
     this.player = player;
 }
Exemplo n.º 6
0
        private static void SetInGamePingColor(INitroxPlayer player, PingInstance ping)
        {
            uGUI_Pings pings = Object.FindObjectOfType <uGUI_Pings>();

            pings.OnColor(ping.GetInstanceID(), player.PlayerSettings.PlayerColor.ToUnity());
        }