OnUnitClicked() public method

public OnUnitClicked ( Unit, unit ) : void
unit Unit,
return void
Example #1
0
 public void CanMove()
 {
     //Selects current unit
     if (!canAct)
     {
         canMove = true;
         CellGridState.OnUnitClicked(CurrentUnit);
         CellGridState.SelectMove();
     }
 }
Example #2
0
    public void CanAttack()
    {
        if (!canMove)
        {
            canAct = true;
            CellGridState.OnUnitClicked(CurrentUnit);

            CurrentUnit.CurrentSkill = Skills [0];
            CurrentUnit.CurrentSkill.SkillActivator(CurrentUnit);

            CellGridState.OnCellAttack();
        }
    }
Example #3
0
    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();
            }
        }
    }
Example #4
0
    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();
            }
        }
    }
Example #5
0
 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();
             }
         }
     }
 }
Example #6
0
    /// <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);
    }
Example #7
0
 private void OnUnitClicked(object sender, EventArgs e)
 {
     CellGridState.OnUnitClicked(sender as Unit);
 }
Example #8
0
 private void OnUnitClicked(Unit unit)
 {
     CellGridState.OnUnitClicked(unit);
 }
Example #9
0
 private void OnUnitClicked(object sender, EventArgs e)
 {
     CellGridState.OnUnitClicked(sender as Unit);
     UnityEngine.Debug.Log("選ばれました");
 }
Example #10
0
 private void OnUnitClicked(object sender, EventArgs e)
 {
     //Can only attack when is units turn and player selected action
     CellGridState.OnUnitClicked(sender as Unit);
 }