Exemplo n.º 1
0
        public void ApplyCharacter()
        {
            for (int i = 0; i < PlayerColor.Length; i++)
            {
                PlayerColorStatic[i] = PlayerColor[i];
            }
            for (int i = 0; i < PlayerSkinMaterial.Length; i++)
            {
                PlayerSkinMaterialStatic[i] = PlayerSkinMaterial[i];
            }

            foreach (Material Go in PlayerSkinMaterial)
            {
                Go.SetColor("_Color", PlayerColorStatic[PlayerSkin]);
            }

            if (Player.PlayerMission.Level == 0 && PlayerController.PlayerModelActive)
            {
                foreach (GameObject Go in PlayerModelsMale)
                {
                    if (PlayerGender == 0)
                    {
                        if (!Go.activeSelf)
                        {
                            Go.SetActive(true);
                        }
                    }
                    else
                    {
                        Go.SetActive(false);
                    }
                }

                foreach (GameObject Go in PlayerModelsFemale)
                {
                    if (PlayerGender == 1)
                    {
                        if (!Go.activeSelf)
                        {
                            Go.SetActive(true);
                        }
                    }
                    else
                    {
                        Go.SetActive(false);
                    }
                }

                DisableModelsSkins();
            }
            else if (PlayerController.PlayerModelActive)
            {
                foreach (GameObject Go in PlayerModelsMaleSkin)
                {
                    if (PlayerGender == 0)
                    {
                        if (!Go.activeSelf)
                        {
                            Go.SetActive(true);
                        }
                    }
                    else
                    {
                        Go.SetActive(false);
                    }
                }

                foreach (GameObject Go in PlayerModelsFemaleSkin)
                {
                    if (PlayerGender == 1)
                    {
                        if (!Go.activeSelf)
                        {
                            Go.SetActive(true);
                        }
                    }
                    else
                    {
                        Go.SetActive(false);
                    }
                }

                DisableModels();
            }

            if (!PlayerController.PlayerModelActive)
            {
                DisableModels();
                DisableModelsSkins();
            }
        }