public void TryCastAbility(Ability ability)
    {
        if (selectedUnit == null || selectedUnit.Owner != player)
        {
            inGameUi.ShowMessage("You don't control this unit", Color.red);
            inGameUi.Invoke("HideMessage", 3f);
            return;
        }

        string error;

        if (!ability.CanCast(out error))
        {
            inGameUi.ShowMessage(error, Color.red);
            inGameUi.Invoke("HideMessage", 3f);
        }
        else
        {
            selectedUnit.GetComponent <UnitController>().StopAll();
            ability.Cast();
        }
    }
Пример #2
0
 public override void StartTargeting()
 {
     enabled = true;
     inputManager.Add(this);
     if (ui != null)
     {
         ui.ShowMessage(targetingMessage, messageColor);
     }
     if (arrow != null)
     {
         arrow.gameObject.SetActive(true);
     }
 }
Пример #3
0
 void OnPreRound(Round round)
 {
     inGameUi.ShowStore();
     inGameUi.ShowMessage(round.name, Color.yellow);
 }
Пример #4
0
 void OnPreRound(Round round)
 {
     // TODO: show store
     inGameUi.ShowMessage(round.name, Color.yellow);
 }