/// <summary> /// Disable Vuforia /// Disables Vuforia behaviour. /// </summary> /// <param name="evt"></param> private void DisableVuforia(KIXEvent evt) { PositionalDeviceTracker _deviceTracker = TrackerManager.Instance.GetTracker <PositionalDeviceTracker>(); _deviceTracker?.Reset(); VuforiaBehaviour.Instance.enabled = false; }
/// <summary> /// Fire /// Fires an KIXEvent /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void Fire(KIXEvent e, object sender = null) { OnEvent(e, sender); if (listeners_.ContainsKey(e.Type.ToString())) { FireEvent(e); } }
void OnRecreate(KIXEvent evt) { Destroy(PlaneFinderOBJ.transform.GetComponent <PlaneFinderBehaviour>()); var pfb = PlaneFinderOBJ.AddComponent <PlaneFinderBehaviour>(); pfb.OnAutomaticHitTest = eventCallee; pfb.Height = 1.4f; pfb.PlaneIndicator = PlaneIndicatorPrefab; pfb.HitTestMode = HitTestMode.AUTOMATIC; }
/// <summary> /// Initialize Vuforia /// Resgisters a handler to Vuforia Started event. /// Initis Vuforia. /// </summary> void InitializeVuforia(KIXEvent evt) { VuforiaBehaviour.Instance.enabled = true; if (!_callBackRegistered) { Vuforia.VuforiaRuntime.Instance.InitVuforia(); } _callBackRegistered = true; }
public void Watch(object obj_to_track, string property_name, KIXEvent event_to_send) { Type objType = obj_to_track.GetType(); PropertyInfo property = objType.GetProperty(property_name); var currentValue = property.GetValue(obj_to_track); var watchOBJ = new KIXWatchObject { target = obj_to_track, targetType = obj_to_track.GetType(), value = currentValue, property = property, changeEvent = event_to_send }; watchObjects_.Add(watchOBJ); }
/// <summary> /// Fire Delayed Event /// Fires an Event after a MS delay /// </summary> /// <param name="evt">KIXEvent</param> /// <param name="delayInMS">int</param> /// <returns></returns> private static IEnumerator FireDelayedEvent(KIXEvent evt, int delayInMS) { int timer = delayInMS / 10; while (timer > 0) { yield return(new UnityEngine.WaitForSeconds(0.01f)); --timer; } KIX.Instance.FireEvent(evt); }
/// <summary> /// Fire Event /// Fires an KIXEvent to listeners that registered to that /// specific event. /// </summary> /// <param name="evt">KIXEvent</param> public void FireEvent(KIXEvent evt) { if (!listeners_.ContainsKey(evt.Type.ToString())) { KIX.Instance.Fire(evt, this); } else { var list = listeners_[evt.Type.ToString()].ToArray(); for (int i = 0; i < list.Length; ++i) { list[i](evt); } } }
void OnTrackerReset(KIXEvent evt) { _positionalDeviceTracker = TrackerManager.Instance.GetTracker <PositionalDeviceTracker>(); _positionalDeviceTracker?.Reset(); }
private void OnKIXShowEvent(KIXEvent evt) { ToggleViewVisibility(true); }
private void OnSwitchToAutomatic(KIXEvent evt) { SwitchToAutomatic(); }
private void OnSwitchToInteractive(KIXEvent evt) { SwitchToInteractive(); }
public void FireDelayedKIXEvent(KIXEvent evt, int delayInMS) { KIX.Instance.FireDelayed(evt, delayInMS, this); }
public void FireKIXEvent(KIXEvent evt) { KIX.Instance.FireEvent(evt); }
/// <summary> /// On KIX Event /// Proxy method for all KIX events. /// and relays it to a method proxy. /// </summary> /// <param name="evt">KIXEvent</param> public virtual void OnKIXEvent(KIXEvent evt) { throw new NotImplementedException("OnKIXEvent has not yet been implmentented, please override and imnplement OnKIXEvent( KIXEvent evt );"); }
/// <summary> /// OnEvent /// Fired when an KIX event has occured. /// </summary> /// <param name="e"></param> private void OnEvent(KIXEvent e, object sender = null) { var handler = Events; handler?.Invoke(e); }
private void OnKIXHideEvent(KIXEvent evt) { ToggleViewVisibility(false); }
/// <summary> /// Fire Delayed /// Fires an KIXEvent after a defined delay in ms. /// </summary> /// <param name="e">KIXEvent to fire</param> /// <param name="delayInMS">float</param> /// <param name="sender">object</param> public void FireDelayed(KIXEvent e, int delayInMS, UnityEngine.MonoBehaviour sender) { sender.StartCoroutine(FireDelayedEvent(e, delayInMS)); }