Esempio n. 1
0
    // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
    //override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    //{
    //
    //}

    // OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks
    //override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    //{
    //
    //}

    // OnStateExit is called when a transition ends and the state machine finishes evaluating this state
    override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        RotatorMenu actionManager = animator.transform.parent.GetComponent <RotatorMenu>();

        actionManager.IsRotating = false;
        actionManager.SetSelectedToHoverState();
    }
Esempio n. 2
0
 // Start is called before the first frame update
 void Start()
 {
     this.RotatorMenu = MenuRouter.EnabledMenus["Player Rotator Menu"] as RotatorMenu;
     if (TurnStatusStartingValue)
     {
         BattleEncounterType = (TurnStatus)TurnStatusStartingValue.Value;
     }
     Invoke("StartBattleEncounter", .2f);
 }
Esempio n. 3
0
    // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
    override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        TurnManager turnManagerRef = animator.GetComponentInParent <StageDirector>().TurnManagerRef;

        //check if the unit turns are still remaining
        //End turn if no more units left to act
        if (!turnManagerRef.Players.Any(p => p.CanAct))
        {
            turnManagerRef.StartEnemyTurn();
        }
        else
        {
            RotatorMenu  rotatorMenu     = turnManagerRef.RotatorMenu;
            Stack <Menu> openedMenuStack = rotatorMenu.MenuRouter.OpenedMenus;
            if (openedMenuStack.Count == 0 || openedMenuStack.Peek() != rotatorMenu)
            {
                rotatorMenu.ShowDialogue();
            }
            else
            {
                rotatorMenu.Show();
            }
        }
    }
 private void OnEnable()
 {
     this.ParentMenu = transform.parent.parent.GetComponentInChildren <RotatorMenu>();
 }
 private void Reset()
 {
     RotaterMenu = transform.parent.GetComponent <RotatorMenu>();
 }
 void Start()
 {
     RotatorMenu = GetComponent <RotatorMenu>();
 }