This MonoBehaviour implements the Cloud Reco Event handling for this sample. It registers itself at the CloudRecoBehaviour and is notified of new search results as well as error messages The current state is visualized and new results are enabled using the TargetFinder API.
Inheritance: MonoBehaviour, ICloudRecoEventHandler
Exemplo n.º 1
0
    /// <summary>
    /// Draws a custom UI for the cloud reco event handler inspector
    /// </summary>
    public override void OnInspectorGUI()
    {
        // record potential changes for this object
        Undo.RecordObject(target, "Inspector Change");

        CloudRecoEventHandler creh = (CloudRecoEventHandler)target;

        EditorGUILayout.HelpBox("Here you can set the ImageTargetBehaviour from the scene that will be used to augment new cloud reco search results.", MessageType.Info);
        bool allowSceneObjects = !EditorUtility.IsPersistent(target);

        creh.ImageTargetTemplate = (ImageTargetBehaviour)EditorGUILayout.ObjectField("Image Target Template",
                                                                                     creh.ImageTargetTemplate, typeof(ImageTargetBehaviour), allowSceneObjects);

        creh.scanLine = (ScanLine)EditorGUILayout.ObjectField("Scan Line",
                                                              creh.scanLine, typeof(ScanLine), true);

        creh.cloudErrorCanvas = (UnityEngine.Canvas)EditorGUILayout.ObjectField("Cloud Reco Error Canvas",
                                                                                creh.cloudErrorCanvas, typeof(UnityEngine.Canvas), true);

        creh.cloudErrorTitle = (UnityEngine.UI.Text)EditorGUILayout.ObjectField("Cloud Reco Error Title",
                                                                                creh.cloudErrorTitle, typeof(UnityEngine.UI.Text), true);

        creh.cloudErrorText = (UnityEngine.UI.Text)EditorGUILayout.ObjectField("Cloud Reco Error Text",
                                                                               creh.cloudErrorText, typeof(UnityEngine.UI.Text), true);


        if (GUI.changed)
        {
            EditorUtility.SetDirty(creh);
        }
    }
Exemplo n.º 2
0
    /// <summary>
    /// Draws a custom UI for the cloud reco event handler inspector
    /// </summary>
    public override void OnInspectorGUI()
    {
        CloudRecoEventHandler crehb = (CloudRecoEventHandler)target;

        EditorGUILayout.HelpBox("Here you can set the ImageTargetBehaviour from the scene that will be used to augment new cloud reco search results.", MessageType.Info);
        bool allowSceneObjects = !EditorUtility.IsPersistent(target);

        crehb.ImageTargetTemplate = (ImageTargetBehaviour)EditorGUILayout.ObjectField("Image Target Template",
                                                                                      crehb.ImageTargetTemplate, typeof(ImageTargetBehaviour), allowSceneObjects);
    }
Exemplo n.º 3
0
    public void OnClickLink()
    {
        Debug.Log("OnClickLink click!");

        GameObject CloudRecognition = GameObject.Find("CloudRecognition");

        Debug.Log("CloudRecognition:" + CloudRecognition);
        CloudRecoEventHandler CloudRecoEventHandler = CloudRecognition.GetComponent <CloudRecoEventHandler>();

        Debug.Log("CloudRecoEventHandler:" + CloudRecoEventHandler);
        Debug.Log("CloudRecoEventHandler.targetMenuURL:" + CloudRecoEventHandler.targetMenuURL);

        Application.OpenURL(CloudRecoEventHandler.targetMenuURL);
    }
Exemplo n.º 4
0
//	//@ToDo 共通化したい
//	private VideoPlaybackBehaviour PickVideo()
//	{
//		VideoPlaybackBehaviour[] behaviours = GameObject.FindObjectsOfType<VideoPlaybackBehaviour>();
//		foreach (VideoPlaybackBehaviour vb in behaviours)
//		{
//			return vb;
//		}
//		return null;
//	}
//
    IEnumerator StartUnityVideo()
    {
        yield return(new WaitForSeconds(2));

        Debug.Log("StartUnityVideo");

        GameObject CloudRecognition = GameObject.Find("CloudRecognition");

        Debug.Log("CloudRecognition:" + CloudRecognition);
        CloudRecoEventHandler CloudRecoEventHandler = CloudRecognition.GetComponent <CloudRecoEventHandler>();

        Debug.Log("CloudRecoEventHandler:" + CloudRecoEventHandler);
        Debug.Log("CloudRecoEventHandler.targetMovieURL:" + CloudRecoEventHandler.targetMovieURL);


        Handheld.PlayFullScreenMovie(CloudRecoEventHandler.targetMovieURL, Color.black, FullScreenMovieControlMode.Full, FullScreenMovieScalingMode.AspectFit);

        Debug.Log("FIN Iniciando video");
        yield break;
    }
Exemplo n.º 5
0
    protected override void Start()
    {
        base.Start();

        m_CloudRecoEventHandler = FindObjectOfType <CloudRecoEventHandler>();
    }