Exemple #1
0
        /// <summary>
        ///     Updates <see cref="ImagePlane" /> with <see cref="ImageTexture" />.
        /// </summary>
        public virtual void DisplayImage()
        {
            InitializeImagePlane();
            PlaceImagePlane();

            imagePlaneMaterial.mainTexture = ImageTexture;
            ImagePlane.SetActive(true);
        }
Exemple #2
0
            /// <summary>
            /// Hides <see cref="ImagePlane"/>.
            /// </summary>
            private void OnDisable()
            {
#if UNITY_EDITOR
                if (!UnityEditor.EditorApplication.isPlayingOrWillChangePlaymode)
                {
                    ImagePlane.SetActive(false);
                    Reset();
                }
#endif
            }
Exemple #3
0
            /// <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
            }
Exemple #4
0
 /// <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);
     }
 }
Exemple #5
0
 /// <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;
 }