private void AddTransitionsAndGuardConditions <TState, TTrigger>(HierarchicalStateMachine <TState, TTrigger> stateMachine)
        {
            if (_transitions.Count > 0)
            {
                for (int i = 0; i < _transitions.Count; i++)
                {
                    var current = _transitions[i];

                    TState   stateFrom = (TState)current.StateFrom;
                    TState   stateTo   = (TState)current.StateTo;
                    TTrigger trigger   = (TTrigger)current.Trigger;

                    var transition = new Transition <TState, TTrigger>(stateFrom, trigger, stateTo);

                    stateMachine.AddTransition(transition);

                    for (int j = 0; j < current.GuardConditions.Length; j++)
                    {
                        IGuardCondition guardCondition;

                        if (current.GuardConditions[j].InstantiateThis)
                        {
                            guardCondition = Instantiate(current.GuardConditions[j]);
                        }
                        else
                        {
                            guardCondition = current.GuardConditions[j];
                        }

                        stateMachine.AddGuardConditionTo(transition, guardCondition);
                    }
                }
            }
        }