コード例 #1
0
ファイル: Entity.cs プロジェクト: Streus/Makhai
        public void OnShieldRecharged(Entity subject)
        {
            foreach (Status s in statuses)
            {
                s.OnShieldRecharged(subject);
            }

            shieldRecharged?.Invoke(subject);
        }
コード例 #2
0
        public void TriggerEvent(string eventName, GameObject src, EventArgs args)
        {
            BasicEvent basicEvent = GetEvent(eventName);

            Debug.Log("in manager, triggering event");
            if (basicEvent != null)
            {
                Debug.Log("in manager, got event, triggered");
                basicEvent.Invoke(src, args);
            }
        }
コード例 #3
0
 private void Next()
 {
     if (TryGetCardPhase(out Card card))
     {
         _store.CurrentCard = card;
         _onChangeCard?.Invoke(new CardPayload(
                                   card,
                                   GetBackgroundColor(),
                                   _feedbackMap.GetSprite(card.AcceptFeedback),
                                   _feedbackMap.GetSprite(card.RejectFeedback),
                                   GetOutcome(card)));
         ChangeState(GameState.Card);
     }
     else
     {
         _onEndGame?.Invoke();
         ChangeState(GameState.TitleScreen);
     }
 }
コード例 #4
0
ファイル: Entity.cs プロジェクト: Streus/Makhai
        public bool OnDeath(Entity subject)
        {
            bool continueDeath = true;

            foreach (Status s in statuses)
            {
                if (!s.OnDeath(subject))
                {
                    continueDeath = false;
                }
            }

            if (continueDeath)
            {
                death?.Invoke(subject);
                return(true);
            }
            return(false);
        }
コード例 #5
0
 public void Begin()
 {
     CleanUp();
     Next();
     _onBeginGame?.Invoke();
 }
コード例 #6
0
 /// <summary>
 /// Signal to the GameManager that the user has left-swiped on the current card.
 /// </summary>
 private void RequestReject() => _onReject?.Invoke();
コード例 #7
0
 /// <summary>
 /// Signal to the GameManager that the user has right-swiped on the current card.
 /// </summary>
 private void RequestAccept() => _onAccept?.Invoke();
コード例 #8
0
 /// <summary>
 /// Signal to the GameManager that the game should start.
 /// </summary>
 private void RequestBegin() => _begin?.Invoke();