public void PrepareDoSkill(int which) // 1 - defaultSkill, 2 - equippedSkill { requirePawnSelection = false; requireCellSelection = false; currentStatus = Status.PrepareDoSkill; validSkillTarget = false; gameInteraction.SetIsPawnAction(true); attackPanel.OnSkill(which); try { Monster monster = (Monster)selectedPawn; if (monster != null) { //uilog.UpdateLog("<color="+TextColor.BlueColor+">"+monster.Name +"</color> is trying to do skill"); gameInteraction.SetIsPawnAction(true); switch (which) { case 1: selectedSkill = 1; monster.PrepareSkillOne(); break; case 2: int equippedSkill = monster.GetEquippedSkill(); if (equippedSkill == 3) { selectedSkill = 3; monster.PrepareSkillThree(); } else if (equippedSkill == 5) { selectedSkill = 5; monster.PrepareSkillFive(); } else { ClearStatus(); } break; default: ClearStatus(); break; } } } catch (InvalidCastException ex) { Debug.Log(ex.StackTrace); try { Enemy enemy = (Enemy)selectedPawn; } catch (InvalidCastException ex2) { Debug.Log(ex2.StackTrace); } } }