// Update is called once per frame
    private void Update()
    {
        switch (currentState)
        {
        case (TurnState.PROCESSING):
            UpgradeProgressBar();
            break;

        case (TurnState.CHOOSEACTION):
            if (BSM.PlayerInBattle.Count == 0)
            {
                BSM.battleStates = BattleStateMachine.PerformAction.LOSE;
            }
            else
            {
                ChooseAction();
                currentState = TurnState.WAITING;
            }
            break;

        case (TurnState.WAITING):
            break;

        case (TurnState.ACTION):
            StartCoroutine(TimeForAction());
            break;

        case (TurnState.DEAD):
            if (!isAlive)
            {
                return;
            }
            else
            {
                //Change tag of enemy
                this.gameObject.tag = "DeadEnemy";
                //Not selectable by player
                BSM.EnemyInBattle.Remove(this.gameObject);
                //disable hand cursor
                HandCursor.SetActive(false);
                //remove all input player attack
                if (BSM.EnemyInBattle.Count > 0)
                {
                    for (int i = 0; i < BSM.PerformList.Count; i++)
                    {
                        if (i != 0)
                        {
                            if (BSM.PerformList[i].AttackerGameObject == this.gameObject)
                            {
                                BSM.PerformList.Remove(BSM.PerformList[i]);
                            }
                            else if (BSM.PerformList[i].AttackerTarget == this.gameObject)
                            {
                                BSM.PerformList[i].AttackerTarget = BSM.EnemyInBattle[Random.Range(0, BSM.EnemyInBattle.Count)];
                            }
                        }
                    }
                }
                //change color / play animation
                this.gameObject.GetComponent <SpriteRenderer>().material.color = new Color32(105, 105, 105, 255);
                ThisEntity.DeadInBattle(true);
                //reset enemy buttons
                BSM.EnemyButtons();
                //check alive
                BSM.battleStates = BattleStateMachine.PerformAction.CHECKALIVE;
                isAlive          = false;
            }
            break;
        }
    }