本文整理汇总了C#中UnityEngine.GetImage方法的典型用法代码示例。如果您正苦于以下问题:C# UnityEngine.GetImage方法的具体用法?C# UnityEngine.GetImage怎么用?C# UnityEngine.GetImage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine
的用法示例。
在下文中一共展示了UnityEngine.GetImage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BitmapChar
public BitmapChar(ConfigNode node, UnityEngine.Texture2D texture)
{
if (node.GetValue("character") == "_space_") character = ' ';
else if (node.GetValue("character") == "_open_brace_") character = '{';
else if (node.GetValue("character") == "_close_brace_") character = '}';
else character = node.GetValue("character")[0];
vx = float.Parse(node.GetValue("vx"));
vy = float.Parse(node.GetValue("vy"));
vw = float.Parse(node.GetValue("vw"));
vh = float.Parse(node.GetValue("vh"));
cw = float.Parse(node.GetValue("cw"));
Rectangle rect = new Rectangle();
rect.x = int.Parse(node.GetValue("x"));
rect.y = int.Parse(node.GetValue("y"));
rect.w = int.Parse(node.GetValue("w"));
rect.h = int.Parse(node.GetValue("h"));
Orientation orientation = Orientation.UPRIGHT;
if (node.HasValue("orientation")) orientation = (Orientation)ConfigNode.ParseEnum(typeof(Orientation), node.GetValue("orientation"));
image = texture.GetImage(rect);
switch (orientation)
{
case Orientation.FLIPPED_XY:
image.flipXY(false);
break;
case Orientation.INVERTED:
image.flipVertically();
break;
case Orientation.UPRIGHT:
default:
break;
}
}