예제 #1
0
        public void RemoveStatus <StatusType>() where StatusType : NodeStatus
        {
            var status = GetComponent <StatusType>();

            if (status != null)
            {
                OnStatusRemoved?.Invoke(status);
                Destroy(status);
            }
        }
예제 #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;
         }
     }
 }
예제 #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);
                }
            }
        }