本文整理汇总了C#中UnityEngine.Rect.GetInnerRect方法的典型用法代码示例。如果您正苦于以下问题:C# Rect.GetInnerRect方法的具体用法?C# Rect.GetInnerRect怎么用?C# Rect.GetInnerRect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.Rect
的用法示例。
在下文中一共展示了Rect.GetInnerRect方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FillWindow
protected override void FillWindow(Rect inRect)
{
Vector2 vector = new Vector2(inRect.width - 16f, 48f);
Vector2 vector2 = new Vector2(100f, vector.y - 12f);
inRect.height -= 45f;
List<FileInfo> list = SaveFiles.AllSaveFiles.ToList<FileInfo>();
float num = vector.y + 8f;
float height = (float)list.Count * num;
Rect viewRect = new Rect(0f, 0f, inRect.width - 16f, height);
Rect position = new Rect(inRect.AtZero());
position.height -= this.bottomAreaHeight;
this.scrollPosition = GUI.BeginScrollView(position, this.scrollPosition, viewRect);
float num2 = 0f;
foreach (FileInfo current in list)
{
Rect rect = new Rect(0f, num2, vector.x, vector.y);
Widgets.DrawMenuSection(rect);
Rect innerRect = rect.GetInnerRect(6f);
GUI.BeginGroup(innerRect);
string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(current.Name);
if (MapFiles.IsAutoSave(fileNameWithoutExtension))
{
GUI.color = DialogList.AutosaveTextColor;
}
else
{
GUI.color = DialogList.ManualSaveTextColor;
}
Rect position2 = new Rect(15f, 0f, innerRect.width, innerRect.height);
GUI.skin.label.alignment = TextAnchor.MiddleLeft;
GenFont.SetFontSmall();
GUI.Label(position2, fileNameWithoutExtension);
GUI.color = Color.white;
Rect position3 = new Rect(220f, 0f, innerRect.width, innerRect.height);
GenFont.SetFontTiny();
GUI.color = new Color(1f, 1f, 1f, 0.5f);
GUI.Label(position3, current.LastWriteTime.ToString());
GUI.color = Color.white;
GUI.skin.label.alignment = TextAnchor.UpperLeft;
GenFont.SetFontSmall();
float num3 = vector.x - 12f - vector2.x - vector2.y;
Rect butRect = new Rect(num3, 0f, vector2.x, vector2.y);
if (Widgets.TextButton(butRect, this.interactButLabel))
{
this.DoMapEntryInteraction(Path.GetFileNameWithoutExtension(current.Name));
}
Rect rect2 = new Rect(num3 + vector2.x + 5f, 0f, vector2.y, vector2.y);
if (Widgets.ImageButton(rect2, ButtonText.DeleteX))
{
FileInfo localFile = current;
Find.UIRoot.layers.Add(new Dialog_Confirm("ConfirmDelete".Translate(new object[]
{
localFile.Name
}), delegate
{
localFile.Delete();
}, true));
}
TooltipHandler.TipRegion(rect2, "DeleteThisSavegame".Translate());
GUI.EndGroup();
num2 += vector.y + 8f;
}
GUI.EndScrollView();
this.DoSpecialSaveLoadGUI(inRect.AtZero());
}
示例2: FillCard
private static void FillCard(Colonist colonist)
{
Rect rect = new Rect(0f, 0f, 300f, 30f);
DrawEnterName(rect, colonist);
Display_GenderRaceAge(colonist);
Rect rect2 = new Rect(0f, 40f, 300f, 500f);
Rect rect3 = new Rect(rect2.xMax + 17f, 40f, 280f, 385f);
Rect rect4 = new Rect(rect3.xMax, 40f, 280f, 500f);
Rect rect5 = new Rect(rect2.xMax + 17f, 385f, 280f, 160f);
Rect innerRect = rect2.GetInnerRect(10f);
Rect innerRect2 = rect3.GetInnerRect(10f);
Rect innerRect3 = rect4.GetInnerRect(10f);
Rect innerRect4 = rect5.GetInnerRect(10f);
DrawBackstory(innerRect, colonist);
DrawSkills(innerRect2, colonist);
DrawStyle(innerRect3, colonist);
DrawPassions(innerRect4, colonist);
}