Пример #1
0
 private void Awake()
 {
     StartDialogEvent       = StartDialog;
     ShowInGameDialogEvent  = ShowInGameDialog;
     IShowInGameDialogEvent = IShowInGameDialog;
     _IInGameDialog         = IInGameDialog();
 }
Пример #2
0
 void NewChatLineAdded(EventE e)
 {
     if (chatIsHidden)
     {
         GetComponent <AudioSource>().Play();
         namebar.color = color2;
     }
 }
Пример #3
0
 // This is how you "publish" and event. All it entails is looking up
 // the event type and calling the delegate containing all the handlers
 public void Fire(EventE e)
 {
     Type type = e.GetType();
     EventE.Handler handlers;
     if (registeredHandlers.TryGetValue(type, out handlers))
     {
         handlers(e);
     }
 }
Пример #4
0
    public void Fire(EventE e)
    {
        EventDelegate del;

        if (delegates.TryGetValue(e.GetType(), out del))
        {
            del.Invoke(e);
        }
    }
Пример #5
0
        public void Tick()
        {
            _ticks++;

            if (_ticks % 10 == 0)
            {
                var @event = new EventE();
                _eventBus.Emit(this, @event);
            }
        }
Пример #6
0
    // Call this method to queue an event...
    public void QueueEvent(EventE e)
    {
        // insert at the head of the line since the
        // queue will be processed in reverse order
        queuedEvents.Insert(0, e);

        // NOTE: To my knowledge this method makes
        // NO guarantees regarding thread safety and you
        // should not use this with multiple threads
    }
Пример #7
0
    void HandTouchedEvent(EventE e)
    {
        if ((int)Services.Main.dialogue.variableStorage.GetValue("$gettingthehint").AsNumber > 0)
        {
            Services.GameManager.dateSuccess = true;
        }
        else
        {
            noashands.DOMove(new Vector3(0, 9f, 0), 2f).OnComplete(() => noahandback = true);

            handBackOff = true;
        }
    }
Пример #8
0
    void HandTouchedEvent(EventE e)
    {
        if ((int)storage.GetValue("$gettingthehint").AsNumber == 1)
        {
            dialogue.StartDialogue("GotTheHint");
        }
        else
        {
            int bustedVal = (int)storage.GetValue("$busted").AsNumber;
            prevNode = dialogue.currentNodeName;

            dialogue.StartDialogue("Busted" + bustedVal);
        }
    }
Пример #9
0
    void HandRejectedEvent(EventE e)
    {
        //storage.SetValue("$busted", new Yarn.Value(storage.GetValue("$busted").AsNumber + 1f));
        //dialogue.StartDialogue(prevNode);
        if (storage.GetValue("$busted").AsNumber > 3f)
        {
            dialogue.Stop();

            Services.SceneStackManager.Swap <EndScreen>();
        }
        else
        {
            dialogue.StartDialogue(prevNode);
        }
    }
    void signal(char c)
    {
        switch (c)
        {
        case '0':
            break;

        case '1':
            Debug.Log("got called?");
            Event1.Invoke();
            break;

        case '2':
            Event2.Invoke();
            break;

        case '3':
            Event3.Invoke();
            break;

        case '4':
            Event4.Invoke();
            break;

        case '5':
            Event5.Invoke();
            break;

        case '6':
            Event6.Invoke();
            break;

        case '7':
            Event7.Invoke();
            break;

        case '8':
            Event8.Invoke();
            break;

        case '9':
            Event9.Invoke();
            break;

        case 'a':
            EventA.Invoke();
            break;

        case 'b':
            EventB.Invoke();
            break;

        case 'c':
            EventC.Invoke();
            break;

        case 'd':
            EventD.Invoke();
            break;

        case 'e':
            EventE.Invoke();
            break;

        case 'f':
            EventF.Invoke();
            break;

        case 'g':
            EventG.Invoke();
            break;

        case 'h':
            EventH.Invoke();
            break;

        case 'i':
            EventI.Invoke();
            break;

        case 'j':
            EventJ.Invoke();
            break;

        case 'k':
            EventK.Invoke();
            break;
        }
    }
Пример #11
0
 private void OnEvent(object sender, EventE @event)
 {
     Debug.Log($"{nameof(ListenerE)} received {@event} from {sender}");
 }
Пример #12
0
 public void Queue(EventE e)
 {
     lock (queueLock) {
         queuedEvents.Add(e);
     }
 }
Пример #13
0
 void HandRejectedEvent(EventE e)
 {
     transform.DOMove(defaultPos, 1f).OnComplete(() => HandFinishedBackingOff());
 }