public void ClearTask()
            {
                if (viewport != null)
                {
                    viewport.AttachedScene = null;
                }

                generator?.DetachAndOrDestroyScene();

                currentTask   = null;
                generator     = null;
                demandedFrame = -1;
            }
예제 #2
0
            static void CreatePreviewGeneratorForResource(string virtualFileName, out object objectOfPreview, out PreviewImageGenerator generator)
            {
                generator = null;

                var resource = ResourceManager.LoadResource(virtualFileName, true);

                objectOfPreview = resource.ResultComponent;
                if (objectOfPreview != null)
                {
                    var previewClass = GetPreviewClass(objectOfPreview);
                    if (previewClass != null)
                    {
                        generator = (PreviewImageGenerator)Activator.CreateInstance(previewClass);
                    }
                }
            }