示例#1
0
        public static PAUndo CreateInstance(PAWorkspace workspace)
        {
            var undo = ScriptableObject.CreateInstance <PAUndo>();

            undo.Workspace = workspace;
            return(undo);
        }
示例#2
0
        private void OpenFile(PixelArt target)
        {
            if (Workspace?.Target == target)
            {
                return;
            }

            if (Workspace != null)
            {
                CloseFile();
            }

            Workspace = new PAWorkspace(this)
            {
                name = "Workspace"
            };
            rootVisualElement.Add(Workspace);

            // Load the Saved preferences
            Workspace.Canvas.ForegroundColor = ColorUtility.TryParseHtmlString(EditorPrefs.GetString("com.noz.pixelart.ForegroundColor"), out var foregroundColor) ?
                                               foregroundColor :
                                               Color.white;
            Workspace.Canvas.BackgroundColor = ColorUtility.TryParseHtmlString(EditorPrefs.GetString("com.noz.pixelart.BackgroundColor"), out var backgroundColor) ?
                                               backgroundColor :
                                               Color.white;

            Workspace.OpenFile(target);

            RefreshTitle();
        }
 public PAAnimationOptions(PAWorkspace worksapce, PAAnimation animation)
 {
     _workspace = worksapce;
     _animation = animation;
 }