// Waiting for initialization IEnumerator Start() { yield return(new WaitUntil(() => this.GetComponent <CloudRecoBehaviour>() != null)); mCloudRecoBehaviour = this.GetComponent <CloudRecoBehaviour>(); mCloudRecoBehaviour.CloudRecoEnabled = false; }
private bool ChangeCameraDirection(CameraDevice.CameraDirection direction) { // This takes care of stopping and starting the targetFinder internally upon switching the camera CloudRecoBehaviour cloudRecoBehaviour = GameObject.FindObjectOfType(typeof(CloudRecoBehaviour)) as CloudRecoBehaviour; cloudRecoBehaviour.CloudRecoEnabled = false; bool directionSupported = false; bool needsObjectTrackerRestart = stopRunningObjectTracker(); CameraDevice.Instance.Stop(); CameraDevice.Instance.Deinit(); if (CameraDevice.Instance.Init(direction)) { directionSupported = true; } CameraDevice.Instance.Start(); if (needsObjectTrackerRestart) { restartRunningObjectTracker(); } cloudRecoBehaviour.CloudRecoEnabled = true; return(directionSupported); }
/// <summary> /// Register for events at the CloudRecoBehaviour /// </summary> void Start() { if (VuforiaConfiguration.Instance.Vuforia.LicenseKey == string.Empty) { errorTitle = "Cloud Reco Init Error"; errorMsg = "Vuforia License Key not found. Cloud Reco requires a valid license."; ShowError(errorTitle, errorMsg); } // Look up the gameobject containing the ImageTargetTemplate: mParentOfImageTargetTemplate = ImageTargetTemplate.gameObject; // Register this event handler at the cloud reco behaviour CloudRecoBehaviour cloudRecoBehaviour = GetComponent <CloudRecoBehaviour>(); if (cloudRecoBehaviour) { cloudRecoBehaviour.RegisterEventHandler(this); } // Remember cloudRecoBehaviour for later mCloudRecoBehaviour = cloudRecoBehaviour; // At start we hide the requesting message panel SetCloudActivityIconVisible(false); }
// Use this for initialization void Start() { // register this event handler at the cloud reco behaviour /*mCloudRecoBehaviour = GetComponent<CloudRecoBehaviour>(); * * if (mCloudRecoBehaviour) * { * mCloudRecoBehaviour.RegisterEventHandler(this); * }*/ /* Added ===========================================================================*/ print("All " + Resources.FindObjectsOfTypeAll <UnityEngine.Object>().Length); mParentOfImageTargetTemplate = ImageTargetTemplate.gameObject; // register this event handler at the cloud reco behaviour CloudRecoBehaviour cloudRecoBehaviour = GetComponent <CloudRecoBehaviour>(); if (cloudRecoBehaviour) { cloudRecoBehaviour.RegisterEventHandler(this); } // remember cloudRecoBehaviour for later mCloudRecoBehaviour = cloudRecoBehaviour; /*================================================================================== */ //LoadingPrefab.SetActive(false); loadSignInUPUI(); }
// Use this for initialization void Start() { // register this event handler at the cloud reco behaviour /*mCloudRecoBehaviour = GetComponent<CloudRecoBehaviour>(); * * if (mCloudRecoBehaviour) * { * mCloudRecoBehaviour.RegisterEventHandler(this); * }*/ /* Added ===========================================================================*/ mParentOfImageTargetTemplate = ImageTargetTemplate.gameObject; // register this event handler at the cloud reco behaviour CloudRecoBehaviour cloudRecoBehaviour = GetComponent <CloudRecoBehaviour>(); if (cloudRecoBehaviour) { cloudRecoBehaviour.RegisterEventHandler(this); } // remember cloudRecoBehaviour for later mCloudRecoBehaviour = cloudRecoBehaviour; /*================================================================================== */ }
void Start() { // setup BookInformationParser mBookInformationParser = new BookInformationParser(); mBookInformationParser.SetBookObject(AugmentationObject); TrackableBehaviour trackableBehaviour = AugmentationObject.transform.parent.GetComponent <TrackableBehaviour>(); if (trackableBehaviour) { trackableBehaviour.RegisterTrackableEventHandler(this); } mCloudRecoBehaviour = (CloudRecoBehaviour)FindObjectOfType(typeof(CloudRecoBehaviour)); mUISkin = Resources.Load("UserInterface/ButtonSkins") as GUISkin; mButtonGUIStyles = new Dictionary <string, GUIStyle>(); foreach (GUIStyle customStyle in mUISkin.customStyles) { mButtonGUIStyles.Add(customStyle.name, customStyle); } HideObject(); }
/// <summary> /// Cloud Reco error UI elements. /// </summary> // public Canvas m_CloudErrorCanvas; // public UnityEngine.UI.Text m_CloudErrorTitle; // public UnityEngine.UI.Text m_CloudErrorText; // public UnityEngine.UI.Image m_CloudActivityIcon; #endregion //PUBLIC_MEMBERS #region MONOBEHAVIOUR_METHODS /// <summary> /// register for events at the CloudRecoBehaviour /// </summary> void Start() { if (VuforiaConfiguration.Instance.Vuforia.LicenseKey == string.Empty) { errorTitle = "Cloud Reco Init Error"; errorMsg = "Vuforia License Key not found. Cloud Reco requires a valid license."; ShowError(errorTitle, errorMsg); } // m_TrackableSettings = FindObjectOfType<TrackableSettings>(); m_CloudContentManager = FindObjectOfType <CloudContentManager>(); // register this event handler at the cloud reco behaviour m_CloudRecoBehaviour = GetComponent <CloudRecoBehaviour>(); if (m_CloudRecoBehaviour) { m_CloudRecoBehaviour.RegisterEventHandler(this); } //Grabbing all of the objects shows = GameObject.Find("Shows"); map = GameObject.Find("Map"); countdown = GameObject.Find("Countdown"); magIssue = GameObject.Find("MagIssue"); }
/// <summary> /// Register for events at the CloudRecoBehaviour /// </summary> void Start() { authReference = Firebase.Auth.FirebaseAuth.DefaultInstance; authUser = authReference.CurrentUser; if (authUser == null) { SceneManager.LoadScene("LoginScene"); } storage = Firebase.Storage.FirebaseStorage.DefaultInstance; FirebaseApp.DefaultInstance.SetEditorDatabaseUrl("https://card-677f1.firebaseio.com/"); // Register this event handler at the CloudRecoBehaviour m_CloudRecoBehaviour = GetComponent <CloudRecoBehaviour>(); if (m_CloudRecoBehaviour) { m_CloudRecoBehaviour.RegisterEventHandler(this); } /* * if (m_CloudActivityIcon) * { * m_CloudActivityIcon.enabled = false; * } */ }
// Use this for initialization void Start() { floorPlaneImageObjA = GameObject.FindGameObjectWithTag("floorPlanImg"); floorPlaneImageObjB = GameObject.FindGameObjectWithTag("floorPlanImgA"); // floorPlaneImageObj.SetActive (showMessage); floorPlaneImageObj = floorPlaneImageObjA; emojiImage = GameObject.FindGameObjectWithTag("emoji"); button3317Obj = GameObject.FindGameObjectWithTag("available3317"); button3333Obj = GameObject.FindGameObjectWithTag("available"); button3339Obj = GameObject.FindGameObjectWithTag("unavailable"); pano3317Image = GameObject.FindGameObjectWithTag("3317pano"); pano3333Image = GameObject.FindGameObjectWithTag("3333pano"); successMsg = GameObject.FindGameObjectWithTag("successMsg"); reserveButton = GameObject.FindGameObjectWithTag("reserveButton"); successMsg.SetActive(false); reserveButton.SetActive(false); emojiImage.SetActive(showMessage); pano3317Image.SetActive(showMessage); pano3333Image.SetActive(showMessage); button3317Obj.SetActive(showMessage); button3333Obj.SetActive(showMessage); button3339Obj.SetActive(showMessage); floorPlaneImageObj.SetActive(showMessage); floorPlaneImageObjA.SetActive(showMessage); floorPlaneImageObjB.SetActive(showMessage); mCloudRecoBehaviour = GetComponent <CloudRecoBehaviour> (); if (mCloudRecoBehaviour) { mCloudRecoBehaviour.RegisterEventHandler(this); } }
private void Start() { // register this event handler at the cloud reco behaviour _mCloudRecoBehaviour = GetComponent <CloudRecoBehaviour>(); RegisterEventHandlers(); }
/// <summary> /// Handles new search results /// </summary> /// <param name="targetSearchResult"></param> public void OnNewSearchResult(TargetFinder.TargetSearchResult targetSearchResult) { // This code demonstrates how to reuse an ImageTargetBehaviour for new search results and modifying it according to the metadata // Depending on your application, it can make more sense to duplicate the ImageTargetBehaviour using Instantiate(), // or to create a new ImageTargetBehaviour for each new result // Vuforia will return a new object with the right script automatically if you use // TargetFinder.EnableTracking(TargetSearchResult result, string gameObjectName) string model_name = targetSearchResult.MetaData; //Check if the metadata isn't null if (targetSearchResult.MetaData == null) { return; } Debug.Log("Metadata value is " + model_name); BundleURL = model_name; StartCoroutine(DownloadAndCache()); // First clear all trackables mImageTracker.TargetFinder.ClearTrackables(false); // enable the new result with the same ImageTargetBehaviour: ImageTargetBehaviour imageTargetBehaviour = mImageTracker.TargetFinder.EnableTracking(targetSearchResult, mParentOfImageTargetTemplate) as ImageTargetBehaviour; // ADD THIS TO STOP CLOUD SCAN CloudRecoBehaviour cloudRecoBehaviour = GetComponent <CloudRecoBehaviour>(); cloudRecoBehaviour.enabled = false; //if extended tracking was enabled from the menu, we need to start the extendedtracking on the newly found trackble. if (CloudRecognitionUIEventHandler.ExtendedTrackingIsEnabled) { imageTargetBehaviour.ImageTarget.StartExtendedTracking(); } }
protected override void Start() { base.Start(); m_CloudRecoBehaviour = FindObjectOfType <CloudRecoBehaviour>(); m_CloudContentManager = FindObjectOfType <CloudContentManager>(); }
// Start is called before the first frame update void Start() { mCloudRecoBehaviour = GetComponent <CloudRecoBehaviour>(); if (mCloudRecoBehaviour) { mCloudRecoBehaviour.RegisterEventHandler(this); } }
void Start() { mCloudRecoBehaviour = FindObjectOfType <CloudRecoBehaviour>(); if (mCloudRecoBehaviour) { mCloudRecoBehaviour.RegisterEventHandler(this); } }
public void CuntinueCloudReco() { // CameraDevice.Instance.Init(CameraDevice.CameraDirection.CAMERA_DEFAULT);//启用新的摄像头,实例化 CameraDevice.Instance.Start(); //打开当前的摄像头 // This takes care of stopping and starting the targetFinder internally upon switching the camera CloudRecoBehaviour cloudRecoBehaviour = GameObject.FindObjectOfType(typeof(CloudRecoBehaviour)) as CloudRecoBehaviour; //找到当前的云识别组件 cloudRecoBehaviour.CloudRecoEnabled = true; //启用云识别 }
// Use this for initialization void Start() { // register this event handler at the cloud reco behaviour mCloudRecoBehaviour = GetComponent <CloudRecoBehaviour>(); if (mCloudRecoBehaviour) { mCloudRecoBehaviour.RegisterEventHandler(this); } }
void Awake() { mCloudRecoBehaviour = GetComponent <CloudRecoBehaviour>(); mCloudRecoBehaviour.RegisterOnInitializedEventHandler(OnInitialized); mCloudRecoBehaviour.RegisterOnInitErrorEventHandler(OnInitError); mCloudRecoBehaviour.RegisterOnUpdateErrorEventHandler(OnUpdateError); mCloudRecoBehaviour.RegisterOnStateChangedEventHandler(OnStateChanged); mCloudRecoBehaviour.RegisterOnNewSearchResultEventHandler(OnNewSearchResult); }
//FONCTION AU DEBUT DU SCRIPT// void Start() { mcloudRecoBehaviour = GetComponent <CloudRecoBehaviour>(); // lancement de la reconnaissance cloud if (mcloudRecoBehaviour) { mcloudRecoBehaviour.RegisterEventHandler(this); // lancement des dectections d'évenements selon le scan du marqueur } }
/// <summary> /// Register for events at the CloudRecoBehaviour /// </summary> void Start() { // Register this event handler at the CloudRecoBehaviour m_CloudRecoBehaviour = GetComponent <CloudRecoBehaviour>(); if (m_CloudRecoBehaviour) { m_CloudRecoBehaviour.RegisterEventHandler(this); } }
// Renders a label to visualize the CloudRecoBehaviour public void OnSceneGUI() { CloudRecoBehaviour crb = (CloudRecoBehaviour)target; GUIStyle guiStyle = new GUIStyle { alignment = TextAnchor.LowerRight, fontSize = 18, normal = { textColor = Color.white } }; Handles.Label(crb.transform.position, "Cloud\nRecognition", guiStyle); }
//bool isImage; //Sprite_renderer ImageHolder; #endregion // PRIVATE_MEMBERS #region MONOBEHAVIOUR_METHODS protected override void Start() { base.Start(); isVideoPlayer = false; //isImage = false; m_CloudRecoBehaviour = FindObjectOfType <CloudRecoBehaviour>(); m_CloudContentManager = FindObjectOfType <CloudContentManager>(); //ImageHolder = GameObject.Find("imageHolder").GetComponent<Sprite_renderer>(); }
// Start is called before the first frame update void Start() { CloudRecoBehaviour cloudRecoBehaviour = GetComponent <CloudRecoBehaviour>(); if (cloudRecoBehaviour) { cloudRecoBehaviour.RegisterEventHandler(this); } mcloudRecoBrhaviour = cloudRecoBehaviour; }
private void Start() { mCloudRecoBehaviour = GetComponent <CloudRecoBehaviour>(); if ((bool)mCloudRecoBehaviour) { mCloudRecoBehaviour.RegisterEventHandler(this); } MainPlayer = GameObject.Find("Player"); Hide(MainPlayer); }
// Start is called before the first frame update void Start() { mCloudRecoBehaviour = GetComponent <CloudRecoBehaviour>(); MainPlayer = GameObject.Find("Player"); if (mCloudRecoBehaviour) { mCloudRecoBehaviour.RegisterEventHandler(this); } }
void Start() { m_Camera = DigitalEyewearARController.Instance.PrimaryCamera ?? Camera.main; m_Renderer = GetComponent <Renderer>(); m_CloudRecoBehaviour = FindObjectOfType <CloudRecoBehaviour>(); // Cache the Cloud enable state so that we can reset the scanline // when the enabled state changes cachedEnabledState = CloudEnabled; }
void Start() { m_Camera = Camera.main; m_Renderer = GetComponent <Renderer>(); m_CloudRecoBehaviour = FindObjectOfType <CloudRecoBehaviour>(); // Cache the Cloud enable state so that we can reset the scanline // when the enabled state changes cachedEnabledState = CloudEnabled; }
void Start() { mCloudRecoBehaviour = GetComponent <CloudRecoBehaviour>(); if (mCloudRecoBehaviour) { Debug.Log("Working?"); mCloudRecoBehaviour.RegisterEventHandler(this); } }
//---------------------- Unity call back function---------------------------------- //--------------------------初始化当前脚本变量------------------------------------ private void Awake() { cloudrecobehaviour = GetComponent <CloudRecoBehaviour>(); if (cloudrecobehaviour) { cloudrecobehaviour.RegisterEventHandler(this); } sm = Scannermanager.Getinstance(); Stopscanning(); }
// Use this for initialization void Start() { CloudRecoBehaviour cloudReco = GetComponent <CloudRecoBehaviour>(); if (cloudReco) { cloudReco.RegisterEventHandler(this); } cloud = cloudReco; }
void Start() { speaker = GetComponent <AudioSource>(); speaker.Play(1); imageIndex = 0; this.cloudRecoBehaviour = GetComponent <CloudRecoBehaviour>(); if (this.cloudRecoBehaviour) { this.cloudRecoBehaviour.RegisterEventHandler(this); } }
/// <summary> /// register for events at the CloudRecoBehaviour /// </summary> void Start() { // look up the gameobject containing the ImageTargetTemplate: mParentOfImageTargetTemplate = ImageTargetTemplate.gameObject; // intialize the ErrorMsg class //ErrorMsg.Init(); // register this event handler at the cloud reco behaviour CloudRecoBehaviour cloudRecoBehaviour = GetComponent<CloudRecoBehaviour>(); if (cloudRecoBehaviour) { cloudRecoBehaviour.RegisterEventHandler(this); } // remember cloudRecoBehaviour for later mCloudRecoBehaviour = cloudRecoBehaviour; // load and remember all used textures: //mRequestingTexture = Resources.Load("UserInterface/TextureRequesting") as Texture; }
// Use this for initialization void Start() { // register this event handler at the cloud reco behaviour mCloudRecoBehaviour = GetComponent<CloudRecoBehaviour>(); if (mCloudRecoBehaviour) { mCloudRecoBehaviour.RegisterEventHandler(this); } }
void Start() { mCloudRecoBehaviour = GetComponent<CloudRecoBehaviour>(); if (mCloudRecoBehaviour) { mCloudRecoBehaviour.RegisterEventHandler(this); } }
void Start() { // setup BookInformationParser mBookInformationParser = new BookInformationParser(); mBookInformationParser.SetBookObject(AugmentationObject); TrackableBehaviour trackableBehaviour = AugmentationObject.transform.parent.GetComponent<TrackableBehaviour>(); if (trackableBehaviour) { trackableBehaviour.RegisterTrackableEventHandler(this); } mCloudRecoBehaviour = (CloudRecoBehaviour)FindObjectOfType(typeof(CloudRecoBehaviour)); mUISkin = Resources.Load("UserInterface/ButtonSkins") as GUISkin; mButtonGUIStyles = new Dictionary<string,GUIStyle>(); foreach (GUIStyle customStyle in mUISkin.customStyles) mButtonGUIStyles.Add(customStyle.name, customStyle); HideObject(); }