public static void Clear() { EventRegistry.SendEvent(BLOCK_UI, new BlockInfo() { key = null, visible = false }); }
public static void Show(object k) { EventRegistry.SendEvent(BLOCK_UI, new BlockInfo() { key = k, visible = true }); }
public static void Hide(object k) { EventRegistry.SendEvent(BLOCK_UI, new BlockInfo() { key = k, visible = false }); }
protected virtual void OnEnable() { if (reg == null) { reg = new EventRegistry(); InitEvents(reg); } reg.RegisterEvents(); }
void Update() { acceleration = Input.acceleration; lowPassValue = Vector3.Lerp(lowPassValue, acceleration, lowPassFilterFactor); deltaAcceleration = acceleration - lowPassValue; if (deltaAcceleration.sqrMagnitude >= shakeDetectionThreshold) { // Perform your "shaking actions" here, with suitable guards in the if check above, if necessary to not, to not fire again if they're already being performed. EventRegistry.SendEvent("device.shake", null); } }
void OnSelect(bool selected) { if (selected) { EventRegistry.SendEvent(onSelect, this); } else { EventRegistry.SendEvent(onDeselect, this); } }
void OnPress(bool pressed) { if (pressed) { EventRegistry.SendEvent(onPress, this); } else { EventRegistry.SendEvent(onRelease, this); } }
void OnHover(bool isOver) { if (isOver) { EventRegistry.SendEvent(onHoverOver, this); } else { EventRegistry.SendEvent(onHoverOut, this); } }
void OnDisable() { EventRegistry.DeregisterListener(BLOCK_UI, OnBlock); SceneManager.sceneLoaded -= OnSceneLoaded; }
void OnEnable() { EventRegistry.RegisterListener(BLOCK_UI, OnBlock); SceneManager.sceneLoaded += OnSceneLoaded; }
void OnDragOut(GameObject go) { EventRegistry.SendEvent(onDragOut, this); }
void OnDoubleClick() { EventRegistry.SendEvent(onDoubleClick, this); }
void OnClick() { EventRegistry.SendEvent(onClick, this); }
protected abstract void InitEvents(EventRegistry reg);