コード例 #1
0
ファイル: FsmGUI.cs プロジェクト: mgal1213/310318_GPWorkshop
        /// <summary>
        /// Draw scroolView.
        /// </summary>
        public override void OnGUIBeforeWindows()
        {
            // Create styles?
            if (s_Styles == null)
            {
                s_Styles = new Styles();
            }

            // Draw the background and create a gui group
            GUI.BeginGroup(position, string.Empty, s_Styles.background);

            // Opens scroolView.
            var posWithoutScrollView = position;

            if (!BehaviourMachinePrefs.showScrollView)
            {
                posWithoutScrollView.width  += 16f;
                posWithoutScrollView.height += 16f;
            }
            m_ScrollView = GUI.BeginScrollView(posWithoutScrollView, m_ScrollView, m_ViewRect);
            DrawGrid();

            // Calculate view rect?
            if (Event.current.type == EventType.Layout && StateGUI.draggedWindow != -1)
            {
                CalculateViewRect();
            }

            // Draw transitions arrows only for repaint events.
            else if (Event.current.type == EventType.Repaint && m_StatesGUI != null)
            {
                for (int i = 0; i < m_StatesGUI.Length; i++)
                {
                    m_StatesGUI[i].DrawTransitionArrows();
                }
            }
        }
コード例 #2
0
ファイル: FsmGUI.cs プロジェクト: xclouder/godbattle
        /// <summary> 
        /// Draw scroolView.
        /// </summary>
        public override void OnGUIBeforeWindows () {
            // Create styles?
            if (s_Styles == null)
                s_Styles = new Styles();

            // Draw the background and create a gui group
            GUI.BeginGroup(position, string.Empty, s_Styles.background);

            // Opens scroolView.
            var posWithoutScrollView = position;
            if (!BehaviourMachinePrefs.showScrollView) {
                posWithoutScrollView.width += 16f;
                posWithoutScrollView.height += 16f;
            }
            m_ScrollView = GUI.BeginScrollView(posWithoutScrollView, m_ScrollView, m_ViewRect);
            DrawGrid();

            // Calculate view rect?
            if (Event.current.type == EventType.Layout && StateGUI.draggedWindow != -1) {
                CalculateViewRect();
            }
            
            // Draw transitions arrows only for repaint events.
            else if (Event.current.type == EventType.Repaint && m_StatesGUI != null) {
                for (int i = 0; i < m_StatesGUI.Length; i++)
                    m_StatesGUI[i].DrawTransitionArrows();
            }
        }