void OnGUI() { GUIUtil.PushSkin(m_Skin); Rect wndRect = new Rect(0, Screen.height - WND_HEIGHT, Screen.width, WND_HEIGHT); GUI.Box(wndRect, ""); GUILayout.BeginArea(wndRect); { GUILayout.Label(m_AllOptions.m_Prompt); m_scrollPos = GUILayout.BeginScrollView(m_scrollPos); { List <OneMsgOption> opts = m_AllOptions.m_Options; for (int idx = 0; idx < opts.Count; ++idx) { OneMsgOption oneOpt = opts[idx]; if (GUILayout.Button(oneOpt.m_Text)) { SelectOption(idx); } } } GUILayout.EndScrollView(); } GUILayout.EndArea(); GUIUtil.PopSkin(); }
void OnGUI() { GUIUtil.PushSkin(m_Skin); Rect wndRect = new Rect(0, Screen.height - WND_HEIGHT, Screen.width, WND_HEIGHT); Rect imgRect = new Rect(); NormalParagraph p = m_Paragraphs[m_ParagraphIdx]; if (p.m_SpeakerAvatarImg != null) { imgRect.xMin = 0; imgRect.yMin = wndRect.yMin; imgRect.width = p.m_SpeakerAvatarImg.width; imgRect.height = p.m_SpeakerAvatarImg.height; if (imgRect.height > WND_HEIGHT) { imgRect.y = Screen.height - imgRect.height; } } GUI.Box(wndRect, ""); if (p.m_SpeakerAvatarImg != null) { GUIUtil.PushGUIColor(Color.white); GUI.DrawTexture(imgRect, p.m_SpeakerAvatarImg); GUIUtil.PopGUIColor(); } Rect textRect = new Rect(wndRect); textRect.xMin = imgRect.width + 20f; textRect.xMax -= 20f; GUILayout.BeginArea(textRect); { GUILayout.Label(p.m_SpeakerName); GUIUtil.PushGUIEnable(false); GUILayout.TextArea(p.m_Text); GUIUtil.PopGUIEnable(); } GUILayout.EndArea(); GUIUtil.PopSkin(); }
void OnGUI() { if (m_AllowManualControl) { GUILayout.BeginHorizontal(); { GUILayout.Label(m_CtrlImg); } GUILayout.EndHorizontal(); GUIUtil.PushSkin(m_Skin); GUILayout.BeginArea(new Rect(Screen.width - 100, 0, 100, 50)); { GUILayout.Label(string.Format("{0}/{1}", m_HP, m_MaxHP)); } GUILayout.EndArea(); GUIUtil.PopSkin(); } }