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 void SetVisible(float duration, bool startState) { gameObject.SetActive(startState); UnityTimer.Call(duration, () => { gameObject.SetActive(!startState); }); }
public override void DidShow() { if (m_timer != null) { m_timer.Cancel(); } m_timer = UnityTimer.Call(Time, () => { if (Panel) { Panel.Back(); } }); base.DidShow(); }
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); } }