本文整理汇总了C#中Rect.Denormalized方法的典型用法代码示例。如果您正苦于以下问题:C# Rect.Denormalized方法的具体用法?C# Rect.Denormalized怎么用?C# Rect.Denormalized使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rect
的用法示例。
在下文中一共展示了Rect.Denormalized方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Draw
public void Draw(Rect area) {
width = area.Denormalized().width - GUI.skin.box.padding.left - GUI.skin.box.padding.right;
GUILayout.BeginArea(area.Denormalized(), GUI.skin.GetStyle(style));
GUILayout.BeginVertical("", GUILayout.ExpandHeight(false));
GUILayout.BeginHorizontal("label", GUILayout.ExpandHeight(false));
pColor = GUI.color;
pcColor = GUI.contentColor;
int i = 0;
int safety = 0;
usedThisLine = 0;
//Super bad hack to make the shit not break on handling the last line.
//Re-do this function to fix this process.
//Shouldn't have to rely on a hack like this.
string msg = str + " \\w \n";
while (i < msg.Length && safety++ < 100) {
int nextLine;
int nextEscape;
nextLine = msg.IndexOf('\n', i);
nextEscape = msg.IndexOf('\\', i);
if (nextLine == -1) { nextLine = msg.Length + 100; }
if (nextEscape == -1) { nextEscape = msg.Length + 100; }
int pos = msg.IndexOf(' ', i);
int len = pos - i;
string s;
if (pos == -1) {
len = msg.Length - i;
}
//Handle this stupid hack//
if (pos == msg.Length - 1) {
return;
}
if (nextEscape < nextLine) {
if (nextEscape < pos) {
if (nextEscape+1 < msg.Length) {
char c = msg[nextEscape+1];
s = msg.Substring(i, nextEscape - i);
Label(s);
ChangeColor(c);
} else {
s = msg.Substring(i, nextEscape - i);
Label(s);
}
i = nextEscape + 2;
continue;
}
} else if (nextLine < nextEscape) {
if (nextLine < pos) {
s = msg.Substring(i, nextLine - i);
Label(s);
Newline();
i = nextLine+1;
continue;
}
}
if (len == 0) {
i = pos + 1;
continue;
}
s = msg.Substring(i, len);
if (s[0] == '\\') {
char c = s[1];
ChangeColor(c);
//i = pos + 1;
//continue;
//s = s.Substring(2);
}
Label(s);
//.........这里部分代码省略.........