public void CanMove() { //Selects current unit if (!canAct) { canMove = true; CellGridState.OnUnitClicked(CurrentUnit); CellGridState.SelectMove(); } }
public void CanAttack() { if (!canMove) { canAct = true; CellGridState.OnUnitClicked(CurrentUnit); CurrentUnit.CurrentSkill = Skills [0]; CurrentUnit.CurrentSkill.SkillActivator(CurrentUnit); CellGridState.OnCellAttack(); } }
public void Magic() { if (!canMove) { canAct = true; CellGridState.OnUnitClicked(CurrentUnit); Debug.Log("enters magic"); CurrentUnit.CurrentSkill = Skills[1]; if (CurrentUnit.ImaginationPoints >= CurrentUnit.CurrentSkill.IPcost) { Debug.Log("passes if"); CurrentUnit.CurrentSkill.SkillActivator(CurrentUnit); CellGridState.OnCellAttack(); } } }
public void RealityBreak() { if (!canMove) { canAct = true; CellGridState.OnUnitClicked(CurrentUnit); Debug.Log("enters magic"); CurrentUnit.CurrentSkill = Skills [2]; if (CurrentUnit.RealityBreak == 100) { Debug.Log("passes if"); CurrentUnit.CurrentSkill.SkillActivator(CurrentUnit); CellGridState.OnCellAttack(); } } }
private void OnUnitClicked(object sender, EventArgs e) { if (!EventSystem.current.IsPointerOverGameObject()) { GenericUnit unit = sender as GenericUnit; CellGridStateUnitSelected selected = CellGridState as CellGridStateUnitSelected; if (unit.PlayerNumber == 0) { } else { CellGridState.OnUnitClicked(sender as Unit); if (!isActionDone && selected.IsUnitInRange(sender as Unit)) { EndTurn(); } } } }
/// <summary> /// Method makes turn transitions. It is called by player at the end of his turn. /// </summary> public void TurnCycle(object sender, System.EventArgs e)//code for a single turn of a unit { Unit shifted = unitTurnOrder[0]; unitTurnOrder.RemoveAt(0); unitTurnOrder.Add(shifted); unitTurnOrder[0].OnTurnStart(); CurrentPlayerNumber = unitTurnOrder[0].PlayerNumber; if (unitTurnOrder[0].PlayerNumber == 0) { Players[0].Play(this); CellGridState.OnUnitClicked(unitTurnOrder[0]); } else { Players[1].GetComponent <NaiveAiPlayer>().SinglePlay(this, unitTurnOrder[0]); } print("Current Num: " + CurrentPlayerNumber); }
private void OnUnitClicked(object sender, EventArgs e) { CellGridState.OnUnitClicked(sender as Unit); }
private void OnUnitClicked(Unit unit) { CellGridState.OnUnitClicked(unit); }
private void OnUnitClicked(object sender, EventArgs e) { CellGridState.OnUnitClicked(sender as Unit); UnityEngine.Debug.Log("選ばれました"); }
private void OnUnitClicked(object sender, EventArgs e) { //Can only attack when is units turn and player selected action CellGridState.OnUnitClicked(sender as Unit); }