public override IGameSparksTimer GetTimer() { var timer = new UnityTimer(); timer.SetController(timerController); return(timer); }
/// <summary> /// Creates and returns an <see cref="ITimer"/>. /// </summary> public ITimer CreateTimer(float timeout) { UnityTimer timer = new UnityTimer(timeout); registeredTimers.Add(timer); return(timer); }
void CancelTimer() { if (m_timer != null) { m_timer.Cancel(); m_timer = null; } }
public void SetVisible(float duration, bool startState) { gameObject.SetActive(startState); UnityTimer.Call(duration, () => { gameObject.SetActive(!startState); }); }
public virtual void OnTrackableStateChanged(TrackableBehaviour.Status previousStatus, TrackableBehaviour.Status newStatus) { Debug.Log("tracking " + Identifier + " curr=" + IsTracking + " state=" + newStatus); /* * if (m_trackableBehaviour && m_trackableBehaviour.VuMarkTarget != null && m_trackableBehaviour.VuMarkTarget.InstanceId != null) * { * Debug.Log("tracking " + m_trackableBehaviour.VuMarkTarget.InstanceId + * " curr=" + IsTracking + * " state=" + newStatus); * } */ if (newStatus == TrackableBehaviour.Status.DETECTED || newStatus == TrackableBehaviour.Status.TRACKED || newStatus == TrackableBehaviour.Status.EXTENDED_TRACKED) { if (m_trackingTimer != null) { m_trackingTimer.Cancel(); m_trackingTimer = null; } if (!IsTracking) { StartExtendedTracking(); OnTrackingFound(); } else if (newStatus == TrackableBehaviour.Status.EXTENDED_TRACKED) { if (m_trackingTimer != null) { m_trackingTimer.Cancel(); m_trackingTimer = null; } m_trackingTimer = UnityTimer.Call(3, StopExtendedTracking); } } else { if (IsTracking) { OnTrackingLost(); } } /* * if (VuforiaWorld.Instance.TrackingConditionMonitor != null) * { * VuforiaWorld.Instance.TrackingConditionMonitor.TrackingMarkersUpdated(); * } */ }
public override IGameSparksTimer GetTimer() { #if INCLUDE_IL2CPP && !UNITY_XBOXONE return(new GameSparksTimer()); #else var timer = new UnityTimer(); timer.SetController(timerController); return(timer); #endif }
public override IGameSparksTimer GetTimer() { #if INCLUDE_IL2CPP && !UNITY_XBOXONE return new GameSparksTimer(); #else var timer = new UnityTimer(); timer.SetController(timerController); return timer; #endif }
public override void DidShow() { if (m_timer != null) { m_timer.Cancel(); } m_timer = UnityTimer.Call(Time, () => { if (Panel) { Panel.Back(); } }); base.DidShow(); }
// Use this for initialization void Awake() { if (m_instance == null) { m_instance = this; } else { Destroy(this); } if (m_eventDatabase == null) { m_eventDatabase = new Dictionary <RoomWall, RoomUnityEvent>(); } m_rotationTick = new WaitForSeconds(Time.deltaTime); m_rotationRefresh = new UnityTimer(); m_rotationRefresh.Start(0); // make timer load up with 0 wait StartCoroutine(SetupRoom()); }
//Lazy Singleton void Awake(){ Instance=this; }
public override IGameSparksTimer GetTimer () { var timer = new UnityTimer(); timer.SetController(timerController); return timer; }
private void CreateRefreshWaypointsTimer() { m_RefreshWaypointsTimer = new UnityTimer(RefreshWaypoints, 0.2f); }
public override void Populate(ResourcePanelData <Notification> data) { CancelTimer(); base.Populate(data); var imageUrl = data.Resource.ImageUrl; if (ImagePane) { ImagePane.SetActive(imageUrl != null); } if (NoImagePane) { NoImagePane.SetActive(imageUrl == null); } Text titleText; Text messageText; // Supports different layout for notifications with and without images. if (imageUrl != null && Image) { titleText = ImageTitle ?? NoImageTitle; messageText = ImageMessage ?? NoImageMessage; ImageLoader.LoadImageOnThread(imageUrl, Image); } else { titleText = NoImageTitle ?? ImageTitle; messageText = NoImageMessage ?? ImageMessage; } if (titleText) { titleText.text = data.Resource.Title; } if (messageText) { messageText.text = data.Resource.Message; } if (Vibrate || data.Resource.Vibrate) { Handheld.Vibrate(); } if (Data.Resource.Sound != null) { var localUrl = WebServices.Instance.MediaDownloadManager.GetPathForItem(Data.Resource.Sound.Url); Platform.Instance.ForegroundAudioChannel.Play(new Uri(localUrl)); } if (AutoDismiss) { m_timer = UnityTimer.Call(DismissTime, Back); } }