예제 #1
0
        /// <summary>
        /// Cleans up when finished.
        /// </summary>
        internal static void Close()
        {
            if (gameObject != null)
            {
                // Destroy gameobject components.
                GameObject.Destroy(_renderer);
                GameObject.Destroy(gameObject);

                // Let the garbage collector cleanup.
                _generator = null;
                _renderer  = null;
                gameObject = null;
            }
        }
예제 #2
0
        /// <summary>
        /// Creates our renderer GameObject.
        /// </summary>
        internal static void Create()
        {
            try
            {
                // If no instance already set, create one.
                if (gameObject == null)
                {
                    // Give it a unique name for easy finding with ModTools.
                    gameObject = new GameObject("RICOThumbnailRenderer");
                    gameObject.transform.parent = UIView.GetAView().transform;

                    // Add our queue manager and renderer directly to the gameobject.
                    _renderer  = gameObject.AddComponent <UIPreviewRenderer>();
                    _generator = new ThumbnailGenerator();
                }
            }
            catch (Exception e)
            {
                Logging.LogException(e, "exception creating renderer");
            }
        }