public void ShowDebugInfo(int _level, bool _active, GUIStyle _textStyle) { _textStyle.normal.textColor = _active ? Color.green : new Color(0.5f, 0.5f, 0.5f); GUILayout.BeginHorizontal(); GUILayout.Space(5); GUILayout.Label(new string('\t', _level) + name, _textStyle, new GUILayoutOption[] { }); GUILayout.EndHorizontal(); for (int i = 0; i < children.Count; ++i) { State s = children[i]; s.ShowDebugInfo(_level + 1, currentStates.IndexOf(s) != -1, _textStyle); } }
// ------------------------------------------------------------------ // Desc: // ------------------------------------------------------------------ public void ShowDebugInfo(int _level, bool _active, GUIStyle _textStyle, Transition _t) { Color colorEnter = Color.green; Color colorExit = Color.red; Color colorActive = Color.blue; Color colorDeactive = new Color(0.5f, 0.5f, 0.5f); if (EditorGUIUtility.isProSkin) { colorEnter = Color.yellow; colorExit = Color.red; colorActive = Color.green; colorDeactive = new Color(0.4f, 0.4f, 0.4f); } string suffix = ""; if (_active) { if (inTransition) { _textStyle.fontStyle = FontStyle.Bold; suffix = " *"; } else { _textStyle.fontStyle = FontStyle.Normal; } _textStyle.normal.textColor = colorActive; } else { _textStyle.fontStyle = FontStyle.Normal; if (_t != null) { if (_t.source == this) { suffix = " >>>"; _textStyle.normal.textColor = colorExit; } else if (_t.target == this) { suffix = " <<<"; _textStyle.normal.textColor = colorEnter; } else { _textStyle.normal.textColor = colorDeactive; } } else { _textStyle.normal.textColor = colorDeactive; } } GUILayout.BeginHorizontal(); GUILayout.Space(5); GUILayout.Label(new string('\t', _level) + name + suffix, _textStyle, new GUILayoutOption[] {}); GUILayout.EndHorizontal(); for (int i = 0; i < children.Count; ++i) { State s = children[i]; s.ShowDebugInfo(_level + 1, currentStates.IndexOf(s) != -1, _textStyle, inTransition ? currentTransition : _t); } }