Example #1
0
        private void OnDrawGizmos()
        {
            if (v == null)
            {
                return;
            }

            string[] elements = v.GetExtraVisualizationElements();

            for (int i = 0; i < elements.Length; i++)
            {
                GizmosUtils.DrawText(GUI.skin, elements[i], transform.position + displacement, Color.magenta, 9, i * 10);
            }
        }
        public void Display()
        {
            if (FSM == null)
            {
                return;
            }

            foreach (var state in objs)
            {
                foreach (var transition in state.Value.transitions)
                {
                    transition.timeSinceLastUsed += Time.deltaTime;

                    Color d = (transition.timeSinceLastUsed < TRANSITION_DISPLAY_TIME) ? Color.green : new Color(1, 1, 1, 0.2f);

                    GizmosUtils.DrawArrow(GUI.skin, origin.position + state.Value.displacement, origin.position + objs[transition.endName].displacement, LINE_WIDTH, d);
                }

                Color c = (state.Key.ToString() == FSM.CurrentState.ToString()) ? Color.green : new Color(1, 1, 1, 0.6f);
                GUI.color = c;

                GizmosUtils.DrawText(GUI.skin, state.Key.ToString(), state.Value.displacement + origin.position, c, FONT_SIZE);
            }
        }