Ejemplo n.º 1
0
 public void SwapSkins(int skinIndex)
 {
     if (skinIndex >= playerStats.allZoeRecolors.Length || skinIndex < 0)
     {
         Debug.Log("Tried selecting a skin that was out of bounds in the 'allZoeRecolors'-array, skinIndex was: " + skinIndex);
         return;
     }
     else
     {
         ZoeRecolor recolor = playerStats.allZoeRecolors[skinIndex];
         foreach (SkinnedMeshRenderer mRend in headMaterialRenderers)
         {
             ChangeMaterialInRenderer(mRend, recolor.zoeHeadMaterial);
         }
         foreach (SkinnedMeshRenderer mRend in bodyMaterialRenderers)
         {
             ChangeMaterialInRenderer(mRend, recolor.zoeBodyMaterial);
         }
         foreach (SkinnedMeshRenderer mRend in outfitMaterialRenderers)
         {
             ChangeMaterialInRenderer(mRend, recolor.zoeOutfitMaterial);
         }
         //scarfMat.material.SetColor("_colourAttr", recolor.scarfColor);
         //scarfParticleMat.GetComponent<ParticleSystemRenderer>().material.SetColor("_colourAttr", recolor.scarfParticleColor);
         Debug.Log("Changed skin to skin #" + skinIndex);
     }
 }
Ejemplo n.º 2
0
    public ZoeRecolor defaultZoeRecolor; //The one to select if no other skin has been selected.

    public void SetCurrentZoeRecolor(int zoeRecolorIndex)
    {
        //Call "ChangeZoeRecolor" event that is listened for by skinswapper.cs on the zoe-CGI nested prefab. (Only if there is a recolor with the corresponding index though)
        if (allZoeRecolors[zoeRecolorIndex] != null)
        {
            currentZoeRecolor = allZoeRecolors[zoeRecolorIndex];
            changeZoeRecolor.Raise(zoeRecolorIndex);
        }
    }