private void EventDispatcher(HandGestureEvent e) { if (e == null) { throw new NullReferenceException($"{nameof(HandGestureEvent)} can not be null, please check {nameof(MADUnityIntegrator)} logic."); } else if (e is HandDetected) { EventHandDetected?.Invoke((HandDetected)e); } else if (e is Click) { EventClick?.Invoke((Click)e); } else if (e is Grab) { EventGrab?.Invoke((Grab)e); } else if (e is Hold) { EventHold?.Invoke((Hold)e); } else { throw new NotImplementedException($"Fail to dispatch {nameof(HandGestureEvent)}, non implement type detected."); } }
public void RaisePostBackEvent(string eventArgument) { if (eventArgument.ToUpper().Contains("DAYCLICK")) { DayClick?.Invoke(this, new DayClickEventArgs() { Date = eventArgument.Replace("DAYCLICK*", "") }); } else if (eventArgument.ToUpper().Contains("EVENTCLICK")) { EventClick?.Invoke(this, new EventClickEventArgs() { EventId = eventArgument.Replace("EVENTCLICK*", "") }); } }
private void Start() { btnJoinRoom.onClick.AddListener(() => ClickRoom.Invoke(txtRoomName.text) ); }