/// <summary> /// Updates <see cref="ImagePlane" /> with <see cref="ImageTexture" />. /// </summary> public virtual void DisplayImage() { InitializeImagePlane(); PlaceImagePlane(); imagePlaneMaterial.mainTexture = ImageTexture; ImagePlane.SetActive(true); }
/// <summary> /// Hides <see cref="ImagePlane"/>. /// </summary> private void OnDisable() { #if UNITY_EDITOR if (!UnityEditor.EditorApplication.isPlayingOrWillChangePlaymode) { ImagePlane.SetActive(false); Reset(); } #endif }
/// <summary> /// Shows <see cref="ImagePlane"/> and calls <see cref="SetArucoObject"/>. /// </summary> private void OnEnable() { #if UNITY_EDITOR if (!UnityEditor.EditorApplication.isPlayingOrWillChangePlaymode && ArucoObject) { Create(); Display(); ImagePlane.SetActive(true); } #endif }
/// <summary> /// Resets <see cref="Image" />, <see cref="ImageTexture" /> and <see cref="ImagePlane" />. /// </summary> public virtual void ResetImage() { Image = null; ImageTexture = null; if (imagePlaneMaterial != null) { imagePlaneMaterial.mainTexture = null; } if (ImagePlane != null) { ImagePlane.SetActive(false); } }
/// <summary> /// Draw the <see cref="ImageTexture"/> on the <see cref="ImagePlane"/>. /// </summary> public virtual void Draw() { ImagePlane.SetActive(true); ImagePlane.GetComponent <Renderer>().material.mainTexture = ImageTexture; }