void Start() { mTrackableBehaviour = GetComponent <TrackableBehaviour>(); if (mTrackableBehaviour) { mTrackableBehaviour.RegisterOnTrackableStatusChanged(OnTrackableStateChanged); } }
// Start is called before the first frame update void Start() { mTrackableBehaviour = GetComponent <TrackableBehaviour>(); if (mTrackableBehaviour) { mTrackableBehaviour.RegisterOnTrackableStatusChanged(OnTrackableStatusChanged); //TrackableBehaviourのStatusが変更された時にRegisterOnTrackableStatusChangedが呼ばれる } }
void Start() { StartCoroutine(DownloadAndCache()); mTrackableBehaviour = GetComponent <TrackableBehaviour>(); if (mTrackableBehaviour) { mTrackableBehaviour.RegisterOnTrackableStatusChanged(OnTrackableStateChanged); } }
protected virtual void Start() { mTrackableBehaviour = GetComponent <TrackableBehaviour>(); if (mTrackableBehaviour) { mTrackableBehaviour.RegisterOnTrackableStatusChanged(OnTrackableStatusChanged); mTrackableBehaviour.RegisterOnTrackableStatusInfoChanged(OnTrackableStatusInfoChanged); } }
protected virtual void Start() { trackingText = GameObject.FindWithTag("Tracking Status").GetComponent <Text>(); mTrackableBehaviour = GetComponent <TrackableBehaviour>(); if (mTrackableBehaviour) { mTrackableBehaviour.RegisterOnTrackableStatusChanged(OnTrackableStatusChanged); } }
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); } }
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); } }
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); }
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が呼ばれる } }
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が呼ばれる } } } }
protected virtual void OnEnable() { _trackableBehaviour = GetComponent <TrackableBehaviour>(); _trackableBehaviour.RegisterOnTrackableStatusChanged(OnTrackableStateChanged); }
private void Awake() { mTrackableBehaviour = GetComponent <TrackableBehaviour>(); mTrackableBehaviour.RegisterOnTrackableStatusChanged(OnTrackableStateChanged); }