本文整理汇总了C#中UnityEngine.Texture2D.set_name方法的典型用法代码示例。如果您正苦于以下问题:C# Texture2D.set_name方法的具体用法?C# Texture2D.set_name怎么用?C# Texture2D.set_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.Texture2D
的用法示例。
在下文中一共展示了Texture2D.set_name方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetColorTexture
private static Texture2D GetColorTexture(Color color)
{
Texture2D myTexture = new Texture2D(1, 16);
myTexture.set_name("Color Texture by Hedgehog Team");
myTexture.hideFlags = HideFlags.HideInInspector;
myTexture.filterMode = FilterMode.Bilinear;
myTexture.hideFlags = HideFlags.DontSave;
for (int i = 0; i < 16; i++)
{
myTexture.SetPixel(0, i, color);
}
myTexture.Apply();
return myTexture;
}
示例2: CreateGradientTexture
private static Texture2D CreateGradientTexture( )
{
Texture2D myTexture = new Texture2D(1, 16);
myTexture.set_name("Gradient Texture by Hedgehog Team");
myTexture.hideFlags = HideFlags.HideInInspector;
myTexture.filterMode = FilterMode.Bilinear;
myTexture.hideFlags = HideFlags.DontSave;
float start=0.4f;
float end= 0.8f;
float step = (end-start)/16;
Color color = new Color(start,start,start);
Color pixColor = color;
for (int i = 0; i < 16; i++)
{
pixColor = new Color (pixColor.r+step, pixColor.b+step, pixColor.b+step,0.5f);
myTexture.SetPixel(0, i, pixColor);
}
myTexture.Apply();
return myTexture;
}