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(); }
// public method public void SelectOption(int idx) { AnimationState astate = CutsceneController.GetAnimState(m_Dialog.CC); astate.speed = m_prevAnimSpeed;//resume the anim OneMsgOption opt = m_AllOptions.m_Options[idx]; string info = opt.m_ExtraInfo; m_Dialog.CC.SendMessage(m_AllOptions.m_Function, info); enabled = false; }