コード例 #1
0
    public void EnemyPopUp(Fears fear)
    {
        OnEnemyEvent();
        int n = 0;

        switch (fear)
        {
        case Fears.DRAGON:
            n = 0;
            break;

        case Fears.GHOST:
            n = 1;
            break;

        case Fears.TROLL:
            n = 2;
            break;
        }

        for (int i = 0; i < enemies.Length; i++)
        {
            if (i == n)
            {
                enemies[i].SetActive(true);
            }
            else
            {
                enemies[i].SetActive(false);
            }
        }

        enemies[n].transform.parent.gameObject.SetActive(true);
        StartCoroutine(DissapearEnemyPopUp(n));
    }
コード例 #2
0
ファイル: GameController.cs プロジェクト: Gracepu/HerosPath
 private void ActivateEnemyPopup()
 {
     try {
         Fears fears = (Fears)UnityEngine.Random.Range(0, 3);
         UIManager.Instance.EnemyPopUp(fears);
         OnReceiveFear(fears);
         allowEnemy = 0f;
     } catch (NullReferenceException e) { }
 }
コード例 #3
0
 public void ReducePatienceBecauseOfFear(Fears fear)
 {
     if (fear == this.fear)
     {
         StartCoroutine(PatienceIndicator(Color.red));
         AudioManager.Instance.CharacterScream();
         patience            -= 10;
         patienceSlider.value = patience;
     }
 }
コード例 #4
0
        public void ExecuteStep(CharacterSheet character)
        {
            var strategy = character.Strategy;
            var selected = fearGateway.Choose(strategy.FearCount);
            var fears    = new Fears();

            foreach (var q in selected)
            {
                fears.Add(CharacterSentenceGenerator.Create(character, q));
            }
            character.Add(fears);
        }