如何在同一对象上统一显示两个纹理?

时间:2019-03-06 17:10:18

标签: c# unity3d

我正在Unity中制作游戏,我的角色需要从我的网站加载两个纹理并将其应用到玩家(一个用于皮肤,一个用于面部)。面部纹理应该覆盖皮肤,但我不知道该怎么做。

这是我当前的代码:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TextureLoader : MonoBehaviour {

    public string url = "http://localhost/img/Build.png";

    IEnumerator Start()
    {
        // Start a download of the given URL
        using (WWW www = new WWW(url))
        {
            // Wait for download to complete
            yield return www;

            // assign texture
            Renderer renderer = GetComponent<Renderer>();
            renderer.material.mainTexture = www.texture;
        }
    }
}

因为统一显示我的图像Alpha通道为黑色图像 like I show here,我在着色器中使用了透明层。

The result is that I see the skin and the face with a conflict and I see both glitching (photo)

那么您能建议我一种显示两种着色器而又没有那种故障的方法吗?

0 个答案:

没有答案