public void RemoveStatus <StatusType>() where StatusType : NodeStatus
        {
            var status = GetComponent <StatusType>();

            if (status != null)
            {
                OnStatusRemoved?.Invoke(status);
                Destroy(status);
            }
        }
Exemple #2
0
 public void RemovePermanentStatus(CharacterStatusType statusType)
 {
     foreach (var s in _permanentStatuses)
     {
         if (s.Type == statusType)
         {
             _permanentStatuses.Remove(s);
             UpdateWorldState(statusType, false);
             OnStatusRemoved?.Invoke(s);
             return;
         }
     }
 }
Exemple #3
0
        public void TickTurn_Status()
        {
            if (IsDead)
            {
                return;
            }

            for (var i = 0; i < _timedStatuses.Count; i++)
            {
                var s = _timedStatuses[i];
                s.Life--;
                if (s.Life <= 0)
                {
                    _timedStatuses.RemoveAt(i);
                    i--;

                    UpdateWorldState(s.Type, false);
                    OnStatusRemoved?.Invoke(s);
                }
            }
        }