private void Awake() { StartDialogEvent = StartDialog; ShowInGameDialogEvent = ShowInGameDialog; IShowInGameDialogEvent = IShowInGameDialog; _IInGameDialog = IInGameDialog(); }
void NewChatLineAdded(EventE e) { if (chatIsHidden) { GetComponent <AudioSource>().Play(); namebar.color = color2; } }
// 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); } }
public void Fire(EventE e) { EventDelegate del; if (delegates.TryGetValue(e.GetType(), out del)) { del.Invoke(e); } }
public void Tick() { _ticks++; if (_ticks % 10 == 0) { var @event = new EventE(); _eventBus.Emit(this, @event); } }
// 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 }
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; } }
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); } }
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; } }
private void OnEvent(object sender, EventE @event) { Debug.Log($"{nameof(ListenerE)} received {@event} from {sender}"); }
public void Queue(EventE e) { lock (queueLock) { queuedEvents.Add(e); } }
void HandRejectedEvent(EventE e) { transform.DOMove(defaultPos, 1f).OnComplete(() => HandFinishedBackingOff()); }