コード例 #1
0
    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
ファイル: Game.cs プロジェクト: Torlyers/GameEngineeringIII
 void OnPreRound(Round round)
 {
     // TODO: show store
     inGameUi.ShowMessage(round.name, Color.yellow);
 }