public static CandiceBehaviorStates RotateTo(CandiceBehaviorNode rootNode)
        {
            CandiceBehaviorStates state = CandiceBehaviorStates.SUCCESS;

            try
            {
                float desiredAngle = 180;
                int   direction    = 1;
                float angle        = Vector3.Angle((rootNode.aiController.MainTarget.transform.position - rootNode.aiController.transform.position), rootNode.aiController.transform.right);
                if (angle > 90)
                {
                    angle = 360 - angle;
                }
                if (angle > desiredAngle)
                {
                    direction = -1;
                }

                float rotation = (direction * rootNode.aiController.RotationSpeed) * Time.deltaTime;
                rootNode.aiController.transform.Rotate(0, rotation, 0);
            }
            catch (Exception e)
            {
                state = CandiceBehaviorStates.FAILURE;
                Debug.LogError("CandiceDefaultBehaviors.RotateTo: " + e.Message);
            }

            return(state);
        }
        public static CandiceBehaviorStates MoveForwardWithSlopeAlignment(CandiceBehaviorNode rootNode)
        {
            CandiceAIController agent = rootNode.aiController;

            agent.IsMoving = true;

            /*if (rootNode.aiController.hasAnimations)
             * {
             *  if (rootNode.aiController.animationType == AnimationType.CodeBased)
             *  {
             *      if (!agent.currentAnimation.Equals(agent.moveAnimationName))
             *      {
             *          agent.currentAnimation = agent.moveAnimationName;
             *          agent.Animator.Play(agent.moveAnimationName);
             *      }
             *  }
             *  else
             *      agent.Animator.SetBool(agent.moveTransitionParameter, true);
             * }*/

            //rootNode.aiController.Animator.SetFloat("characterSpeed", rootNode.aiController.movementSpeed);
            CandiceBehaviorStates state = CandiceBehaviorStates.SUCCESS;

            try
            {
                agent.movementModule.MoveForwardWithSlopeAlignment(agent.transform, agent);
            }
            catch (Exception e)
            {
                state = CandiceBehaviorStates.FAILURE;
                Debug.LogError("DefaultBehaviors.MoveTo: " + e.Message);
            }

            return(state);
        }
        public static CandiceBehaviorStates SetAttackTarget(CandiceBehaviorNode rootNode)
        {
            CandiceBehaviorStates state = CandiceBehaviorStates.FAILURE;
            CandiceAIController   agent = rootNode.aiController;

            try
            {
                if (agent.MainTarget != null)
                {
                    agent.AttackTarget = agent.MainTarget;
                    state = CandiceBehaviorStates.SUCCESS;
                }
                else
                {
                    Debug.LogError("CandiceDefaultBehaviors.SetAttackTarget: Main Target is NULL");
                }
            }
            catch (Exception e)
            {
                state = CandiceBehaviorStates.FAILURE;
                Debug.LogError("CandiceDefaultBehaviors.SetAttackTarget: " + e.Message);
            }
            return(state);
        }