Log in or register to post comments

SimpleCloudHandler Script Error

April 23, 2017 - 1:34pm #1

I'am using this tutorial: https://library.vuforia.com/articles/Solution/How-To-Create-a-Simple-Cloud-Recognition-App-in-Unity

And Unity 5.6.0xf3 Linux, Vuforia-unity-6-2-10-unitypackage

 

But there are many erros:

OnLevelWasLoaded was found on VuforiaAbstractBehaviour

This message has been deprecated and will be removed in a later version of Unity.

Add a delegate to SceneManager.sceneLoaded instead to get notifications after scene loading has completed

Assets/Vuforia/Scripts/SimpleCloudHandler.cs(5,50): error CS0246: The type or namespace name `ICloudRecoEventHandler' could not be found. Are you missing `Vuforia' using directive?

Assets/Vuforia/Scripts/SimpleCloudHandler.cs(6,9): error CS0246: The type or namespace name `CloudRecoBehaviour' could not be found. Are you missing `Vuforia' using directive?

Assets/Vuforia/Scripts/SimpleCloudHandler.cs(28,26): error CS0246: The type or namespace name `TargetFinder' could not be found. Are you missing `Vuforia' using directive?

Assets/Vuforia/Scripts/SimpleCloudHandler.cs(32,28): error CS0246: The type or namespace name `TargetFinder' could not be found. Are you missing `Vuforia' using directive?

Assets/Vuforia/Scripts/SimpleCloudHandler.cs(44,31): error CS0246: The type or namespace name `TargetFinder' could not be found. Are you missing `Vuforia' using directive?

Error building Player because scripts have compile errors in the editor

 

My script utilized:

using System.Collections;

using System.Collections.Generic;

using UnityEngine;

public class SimpleCloudHandler : MonoBehaviour, ICloudRecoEventHandler {

private CloudRecoBehaviour mCloudRecoBehaviour;

private bool mIsScanning = false;

private string mTargetMetadata = "";

// Use this for initialization

void Start () {

mCloudRecoBehaviour = GetComponent<CloudRecoBehaviour>(); 



if (mCloudRecoBehaviour){

  mCloudRecoBehaviour.RegisterEventHandler(this);

  }

}



// Update is called once per frame

void Update () {

 

}



public void OnInitialized() {

     Debug.Log ("Cloud Reco initialized");

}



public void OnInitError(TargetFinder.InitState initError) {

     Debug.Log ("Cloud Reco init error " + initError.ToString());

}



public void OnUpdateError(TargetFinder.UpdateState updateError) {

   Debug.Log ("Cloud Reco update error " + updateError.ToString());

}

public void OnStateChanged(bool scanning) {

mIsScanning = scanning;

      if (scanning){

    ImageTracker tracker = TrackerManager.Instance.GetTracker<ImageTracker>();

    tracker.TargetFinder.ClearTrackables(false);

    }

}

public void OnNewSearchResult(TargetFinder.TargetSearchResult targetSearchResult) {

    // do something with the target metadata

    mTargetMetadata = targetSearchResult.MetaData;

    // stop the target finder (i.e. stop scanning the cloud)

    mCloudRecoBehaviour.CloudRecoEnabled = false;

}

void OnGUI() {

    // Display current 'scanning' status

    GUI.Box (new Rect(100,100,200,50), mIsScanning ? "Scanning" : "Not scanning");

    // Display metadata of latest detected cloud-target

    GUI.Box (new Rect(100,200,200,50), "Metadata: " + mTargetMetadata);

    // If not scanning, show button

    // so that user can restart cloud scanning

    if (!mIsScanning) {

        if (GUI.Button(new Rect(100,300,200,50), "Restart Scanning")) {

        // Restart TargetFinder

        mCloudRecoBehaviour.CloudRecoEnabled = true;

        }

    }

}

}

 

SimpleCloudHandler Script Error

January 11, 2018 - 10:32am #2

Hey there, 

I just ran across this post.... It looks to me from here that the solution is in the error message itself. 

Assets/Vuforia/Scripts/SimpleCloudHandler.cs(5,50): error CS0246: The type or namespace name `ICloudRecoEventHandler' could not be found. Are you missing `Vuforia' using directive?

Try adding the following:

...

using UnityEngine;

using Vuforia;

public class SimpleCloudHandler : MonoBehaviour, ICloudRecoEventHandler {

...

Hope this helps. :)

Log in or register to post comments