Пример #1
0
 void Start()
 {
     mTrackableBehaviour = GetComponent <TrackableBehaviour>();
     if (mTrackableBehaviour)
     {
         mTrackableBehaviour.RegisterOnTrackableStatusChanged(OnTrackableStateChanged);
     }
 }
Пример #2
0
 // Start is called before the first frame update
 void Start()
 {
     mTrackableBehaviour = GetComponent <TrackableBehaviour>();
     if (mTrackableBehaviour)
     {
         mTrackableBehaviour.RegisterOnTrackableStatusChanged(OnTrackableStatusChanged);  //TrackableBehaviourのStatusが変更された時にRegisterOnTrackableStatusChangedが呼ばれる
     }
 }
Пример #3
0
 void Start()
 {
     StartCoroutine(DownloadAndCache());
     mTrackableBehaviour = GetComponent <TrackableBehaviour>();
     if (mTrackableBehaviour)
     {
         mTrackableBehaviour.RegisterOnTrackableStatusChanged(OnTrackableStateChanged);
     }
 }
Пример #4
0
    protected virtual void Start()
    {
        mTrackableBehaviour = GetComponent <TrackableBehaviour>();

        if (mTrackableBehaviour)
        {
            mTrackableBehaviour.RegisterOnTrackableStatusChanged(OnTrackableStatusChanged);
            mTrackableBehaviour.RegisterOnTrackableStatusInfoChanged(OnTrackableStatusInfoChanged);
        }
    }
Пример #5
0
    protected virtual void Start()
    {
        trackingText        = GameObject.FindWithTag("Tracking Status").GetComponent <Text>();
        mTrackableBehaviour = GetComponent <TrackableBehaviour>();

        if (mTrackableBehaviour)
        {
            mTrackableBehaviour.RegisterOnTrackableStatusChanged(OnTrackableStatusChanged);
        }
    }
Пример #6
0
    protected virtual void Start()
    {
        mTrackableBehaviour = GetComponent <TrackableBehaviour>();

        if (mTrackableBehaviour)
        {
            mTrackableBehaviour.RegisterOnTrackableStatusChanged(OnTrackableStatusChanged);
        }

        //Register / add the AudioSource as object
        soundTarget = (AudioSource)gameObject.AddComponent <AudioSource>();
    }
    //public bool FirstTrigger { set => firstTrigger = value; }

    protected virtual void Start()
    {
        firstTrigger = true;

        exhibitAudioManager = FindObjectOfType <ExhibitAudioManager>();

        mTrackableBehaviour = GetComponent <TrackableBehaviour>();

        if (mTrackableBehaviour)
        {
            mTrackableBehaviour.RegisterOnTrackableStatusChanged(OnTrackableStatusChanged);
        }
    }
Пример #8
0
    protected virtual void Start()
    {
        // Componente do objeto de áudio
        GameObject objetoDeAudio = GameObject.Find("ObjetoDeAudio");

        // Player de áudio
        audioPlayer = objetoDeAudio.GetComponent <AudioSource>();


        mTrackableBehaviour = GetComponent <TrackableBehaviour>();

        if (mTrackableBehaviour)
        {
            mTrackableBehaviour.RegisterOnTrackableStatusChanged(OnTrackableStatusChanged);
        }
    }
Пример #9
0
        protected virtual void Start()
        {
            trackableBehaviour_ = GetComponent <TrackableBehaviour>();

            if (trackableBehaviour_)
            {
                trackableBehaviour_.RegisterOnTrackableStatusChanged(OnTrackableStatusChanged);
            }


            //if (_transform == null) {
            //    _transform = this.transform;
            //}
            // mTrackableBehaviour = GetComponent<TrackableBehaviour>();
            //if (mTrackableBehaviour)
            //    mTrackableBehaviour.RegisterTrackableEventHandler(this);
        }
Пример #10
0
    void CreateImageTargetFromSideloadedTexture()
    {
        var objectTracker = TrackerManager.Instance.GetTracker <ObjectTracker>();//Trackerオブジェクト(空)を生成


        var runtimeImageSource = objectTracker.RuntimeImageSource;//RuntimeImageSourceはDataSet内の画像ファイルから新しいTrackableを作成するためのやつ

        runtimeImageSource.SetFile(VuforiaUnity.StorageType.STORAGE_APPRESOURCE, "Vuforia/takashi.jpg", 0.15f, "takashi");
        var dataset            = objectTracker.CreateDataSet();
        var trackableBehaviour = dataset.CreateTrackable(runtimeImageSource, "takashi");

        trackableBehaviour.gameObject.AddComponent <DefaultTrackableEventHandler>();
        objectTracker.ActivateDataSet(dataset);

        mTrackableBehaviour = trackableBehaviour.GetComponent <TrackableBehaviour>();
        if (mTrackableBehaviour)
        {
            mTrackableBehaviour.RegisterOnTrackableStatusChanged(OnTrackableStatusChanged);//TrackableBehaviourのStatusが変更された時にRegisterOnTrackableStatusChangedが呼ばれる
        }
    }
Пример #11
0
    IEnumerator CreateImageTargetFromDownloadedTexture()
    {
        using (UnityWebRequest uwr = UnityWebRequestTexture.GetTexture("https://mizuma-art.co.jp/wp-content/uploads/2018/01/27_yuzuyu-2.jpg"))//外部リソースの開放にはusingを使うことが多い
        {
            yield return(uwr.SendWebRequest());

            if (uwr.isNetworkError || uwr.isHttpError)
            {
                Debug.Log(uwr.error);
            }
            else
            {
                var objectTracker = TrackerManager.Instance.GetTracker <ObjectTracker>();


                var texture = DownloadHandlerTexture.GetContent(uwr);


                var runtimeImageSource = objectTracker.RuntimeImageSource;
                runtimeImageSource.SetImage(texture, 0.15f, "myTargetName");


                var dataset            = objectTracker.CreateDataSet();
                var trackableBehaviour = dataset.CreateTrackable(runtimeImageSource, "myTargetName");

                trackableBehaviour.gameObject.AddComponent <DefaultTrackableEventHandler>();


                objectTracker.ActivateDataSet(dataset);

                mTrackableBehaviour = trackableBehaviour.GetComponent <TrackableBehaviour>();
                if (mTrackableBehaviour)
                {
                    mTrackableBehaviour.RegisterOnTrackableStatusChanged(OnTrackableStatusChanged);//TrackableBehaviourのStatusが変更された時にRegisterOnTrackableStatusChangedが呼ばれる
                }
            }
        }
    }
Пример #12
0
 protected virtual void OnEnable()
 {
     _trackableBehaviour = GetComponent <TrackableBehaviour>();
     _trackableBehaviour.RegisterOnTrackableStatusChanged(OnTrackableStateChanged);
 }
Пример #13
0
 private void Awake()
 {
     mTrackableBehaviour = GetComponent <TrackableBehaviour>();
     mTrackableBehaviour.RegisterOnTrackableStatusChanged(OnTrackableStateChanged);
 }