コード例 #1
0
        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();
        }
コード例 #2
0
        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();
        }
コード例 #3
0
        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();
            }
        }
コード例 #4
0
        void OnGUI()
        {
            m_SMR = EditorGUILayout.ObjectField(m_SMR, typeof(SkinnedMeshRenderer), true) as SkinnedMeshRenderer;

            bool bValid = (m_SMR != null);

            GUIUtil.PushGUIEnable(bValid);
            if (EUtil.Button(m_bShowing ? "Stop!" : "Run!", Color.white))
            {
                m_bShowing = !m_bShowing;
                if (m_bShowing)
                {
                    SceneView.onSceneGUIDelegate += this.OnSceneGUI;
                }
                else
                {
                    SceneView.onSceneGUIDelegate -= this.OnSceneGUI;
                }

                SceneView.lastActiveSceneView.Repaint();
            }
            GUIUtil.PopGUIEnable();
        }
コード例 #5
0
        void OnGUI()
        {
            float alpha = _GetAlpha();

            float sw = Screen.width;
            float sh = Screen.height;

            Rect rc = new Rect();

            rc.x      = m_xScale * sw + m_xOffset;
            rc.y      = m_yScale * sh + m_yOffset;
            rc.width  = m_wScale * sw + m_wOffset;
            rc.height = m_hScale * sh + m_hOffset;

            Color c = new Color(1, 1, 1, alpha);

            GUIUtil.PushGUIColor(c);
            //GUIUtil.PushDepth(m_GUIDepth);
            GUI.depth = m_GUIDepth;
            GUI.DrawTexture(rc, m_Tex);
            //GUIUtil.PopDepth();
            GUIUtil.PopGUIColor();
        }