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

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