Exemple #1
0
 public void Init(CharacterLogic character, Sprite iconSprite)
 {
     disposable  = new CompositeDisposable();
     logic       = character;
     icon.sprite = iconSprite;
     icon.color  = Color.white;
     hpBar.transform.parent.gameObject.SetActive(true);
     disposable.Add(character.isDead.Subscribe(isDead =>
     {
         if (isDead == true)
         {
             SetEmpty();
             disposable.Dispose();
         }
     }));
     disposable.Add(character.Hp.Subscribe(hp =>
     {
         hpBar.fillAmount = hp / (float)character.maxHp.Value;
     }));
     disposable.Add(character.info.Subscribe(info =>
     {
         if (info != string.Empty)
         {
             infoText.text = info;
             infoTextAnimation.Play().Forget();
         }
     }));
 }
 public void Init()
 {
     disposable = new CompositeDisposable();
     GameManager.Instance.turnBeginSubject.Subscribe(turn =>
     {
         nextTurnText.text = $"Turn {turn} Start";
         GameManager.Instance.beginTurnTasks.Add(nextTurnAnimation.Play());
     });
 }