Exemplo n.º 1
0
 public void SetupEyes(Material material, Texture texture, Texture mask, Color color)
 {
     AvatarUtils.MapSharedMaterialsRecursively(assetContainer.transform,
                                               (mat) =>
     {
         material.SetTexture(AvatarUtils._EyesTexture, texture);
         material.SetTexture(AvatarUtils._IrisMask, mask);
         material.SetColor(AvatarUtils._EyeTint, color);
         return(material);
     },
                                               "eyes");
 }
Exemplo n.º 2
0
    public void SetupMouth(Material material, Texture texture, Color color)
    {
        AvatarUtils.MapSharedMaterialsRecursively(assetContainer.transform,
                                                  (mat) =>
        {
            material.SetTexture(AvatarUtils._BaseMap, texture);

            //NOTE(Brian): This isn't an error, we must also apply skin color to this mat
            material.SetColor(AvatarUtils._BaseColor, color);
            return(material);
        },
                                                  "mouth");
    }
Exemplo n.º 3
0
    public void SetupEyebrows(Material material, Texture texture, Color color)
    {
        var eyebrowsMaterial = new Material(material);

        AvatarUtils.MapSharedMaterialsRecursively(assetContainer.transform,
                                                  (mat) =>
        {
            eyebrowsMaterial.SetTexture(AvatarUtils._BaseMap, texture);

            //NOTE(Brian): This isn't an error, we must also apply hair color to this mat
            eyebrowsMaterial.SetColor(AvatarUtils._BaseColor, color);

            return(eyebrowsMaterial);
        },
                                                  "eyebrows");
    }
Exemplo n.º 4
0
    public void SetupEyes(Material material, Texture texture, Texture mask, Color color)
    {
        if (assetContainer?.transform == null)
        {
            Debug.LogWarning("Tried to setup eyes when the asset not ready");
            return;
        }

        AvatarUtils.MapSharedMaterialsRecursively(assetContainer.transform,
                                                  (mat) =>
        {
            material.SetTexture(AvatarUtils._EyesTexture, texture);
            material.SetTexture(AvatarUtils._IrisMask, mask);
            material.SetColor(AvatarUtils._EyeTint, color);
            return(material);
        },
                                                  "eyes");
    }
Exemplo n.º 5
0
    public void SetupEyebrows(Material material, Texture texture, Color color)
    {
        if (assetContainer?.transform == null)
        {
            Debug.LogWarning("Tried to setup eyebrows when the asset not ready");
            return;
        }

        AvatarUtils.MapSharedMaterialsRecursively(assetContainer.transform,
                                                  (mat) =>
        {
            material.SetTexture(AvatarUtils._BaseMap, texture);

            //NOTE(Brian): This isn't an error, we must also apply hair color to this mat
            material.SetColor(AvatarUtils._BaseColor, color);

            return(material);
        },
                                                  "eyebrows");
    }
Exemplo n.º 6
0
    public void SetupMouth(Material material, Texture texture, Texture mask, Color color)
    {
        if (assetContainer?.transform == null)
        {
            Debug.LogWarning("Tried to setup mouth when the asset not ready");
            return;
        }

        AvatarUtils.MapSharedMaterialsRecursively(assetContainer.transform,
                                                  (mat) =>
        {
            material.SetTexture(AvatarUtils._BaseMap, texture);
            material.SetTexture(AvatarUtils._TintMask, mask);

            //NOTE(Brian): This isn't an error, we must also apply skin color to this mat
            material.SetColor(AvatarUtils._BaseColor, color);
            return(material);
        },
                                                  "mouth");
    }