Class VisjectSurfaceWindow<TAsset, TSurface, TPreview>
The base class for editor windows that use FlaxEditor.Surface.VisjectSurface for content editing. Note: it uses ClonedAssetEditorWindowBase which is creating cloned asset to edit/preview.
Inheritance
Namespace: FlaxEditor.Surface
Assembly: FlaxEngine.CSharp.dll
Syntax
public abstract class VisjectSurfaceWindow<TAsset, TSurface, TPreview> : ClonedAssetEditorWindowBase<TAsset>, IComparable, IDrawable, IEditable, IContentItemOwner, IVisjectSurfaceWindow, IVisjectSurfaceOwner, ISurfaceContext where TAsset : Asset where TSurface : VisjectSurface where TPreview : AssetPreview
Type Parameters
TAsset
|
TSurface
|
TPreview
|
Constructors
VisjectSurfaceWindow(Editor, AssetItem, Boolean)
Initializes a new instance of the VisjectSurfaceWindow<TAsset, TSurface, TPreview> class.
Declaration
protected VisjectSurfaceWindow(Editor editor, AssetItem item, bool useTabs = false)
Parameters
Editor
editor
The editor. |
FlaxEditor.Content.AssetItem
item
The item. |
System.Boolean
useTabs
if set to |
Fields
_isWaitingForSurfaceLoad
True if window is waiting for asset load to load surface.
Declaration
protected bool _isWaitingForSurfaceLoad
Field Value
System.Boolean
|
_paramValueChange
True if parameter value has been changed (special path for handling modifying surface parameters in properties editor).
Declaration
protected bool _paramValueChange
Field Value
System.Boolean
|
_preview
The asset preview.
Declaration
protected TPreview _preview
Field Value
TPreview
|
_propertiesEditor
The properties editor.
Declaration
protected CustomEditorPresenter _propertiesEditor
Field Value
FlaxEditor.CustomEditors.CustomEditorPresenter
|
_redoButton
Redo button on a toolstrip.
Declaration
protected ToolStripButton _redoButton
Field Value
FlaxEditor.GUI.ToolStripButton
|
_refreshPropertiesOnLoad
True if window is waiting for asset load to refresh properties editor.
Declaration
protected bool _refreshPropertiesOnLoad
Field Value
System.Boolean
|
_saveButton
Save button on a toolstrip.
Declaration
protected ToolStripButton _saveButton
Field Value
FlaxEditor.GUI.ToolStripButton
|
_split1
The primary split panel.
Declaration
protected readonly SplitPanel _split1
Field Value
FlaxEngine.GUI.SplitPanel
|
_split2
The secondary split panel.
Declaration
protected readonly SplitPanel _split2
Field Value
FlaxEngine.GUI.SplitPanel
|
_surface
The surface.
Declaration
protected TSurface _surface
Field Value
TSurface
|
_tabs
The tabs control. Valid only if window is using tabs instead of just properties.
Declaration
protected Tabs _tabs
Field Value
FlaxEditor.GUI.Tabs.Tabs
|
_tmpAssetIsDirty
True if temporary asset is dirty, otherwise false.
Declaration
protected bool _tmpAssetIsDirty
Field Value
System.Boolean
|
_undo
_undoButton
Undo button on a toolstrip.
Declaration
protected ToolStripButton _undoButton
Field Value
FlaxEditor.GUI.ToolStripButton
|
Properties
CanEditSurfaceOnAssetLoadError
Gets a value indicating whether this window can edit asset surface on asset load error (eg. to fix asset loading issue due to graph problem).
Declaration
protected virtual bool CanEditSurfaceOnAssetLoadError { get; }
Property Value
System.Boolean
|
NewParameterTypes
The new parameter types enum type to use. Null to disable adding new parameters.
Declaration
public abstract IEnumerable<ScriptType> NewParameterTypes { get; }
Property Value
System.Collections.Generic.IEnumerable<FlaxEditor.Scripting.ScriptType>
|
Implements
ParentContext
Declaration
public VisjectSurfaceContext ParentContext { get; }
Property Value
FlaxEditor.Surface.VisjectSurfaceContext
|
Preview
Gets the asset preview.
Declaration
public TPreview Preview { get; }
Property Value
TPreview
|
Surface
Gets the Visject Surface.
Declaration
public TSurface Surface { get; }
Property Value
TSurface
|
SurfaceAsset
SurfaceData
Declaration
public abstract byte[] SurfaceData { get; set; }
Property Value
System.Byte[]
|
SurfaceName
Declaration
public abstract string SurfaceName { get; }
Property Value
System.String
|
Undo
Gets the undo history context for this window.
Declaration
public Undo Undo { get; }
Property Value
Undo
|
UseLayoutData
Gets a value indicating whether window uses custom layout data.
Declaration
public override bool UseLayoutData { get; }
Property Value
System.Boolean
|
Overrides
VisjectAsset
Gets the asset edited by the window.
Declaration
public Asset VisjectAsset { get; }
Property Value
Asset
|
Implements
VisjectSurface
Gets the Visject surface editor.
Declaration
public VisjectSurface VisjectSurface { get; }
Property Value
FlaxEditor.Surface.VisjectSurface
|
Implements
Methods
GetParameter(Int32)
Gets the asset parameter.
Declaration
public object GetParameter(int index)
Parameters
System.Int32
index
The zero-based parameter index. |
Returns
System.Object
The value. |
Implements
LoadSurface()
Loads the surface from the asset. Called during Update(Single) when asset is loaded and surface is missing.
Declaration
protected abstract bool LoadSurface()
Returns
System.Boolean
True if failed, otherwise false. |
OnAssetLinked()
Called when asset gets linked and window can setup UI for it.
Declaration
protected override void OnAssetLinked()
Overrides
OnContextCreated(VisjectSurfaceContext)
Declaration
public void OnContextCreated(VisjectSurfaceContext context)
Parameters
FlaxEditor.Surface.VisjectSurfaceContext
context
|
OnDestroy()
Method called when managed instance should be destroyed
Declaration
public override void OnDestroy()
Overrides
OnLayoutDeserialize()
Called when during windows layout deserialization if window has no layout data to load. Can be used to restore default UI layout.
Declaration
public override void OnLayoutDeserialize()
Overrides
OnLayoutDeserialize(XmlElement)
Called when during windows layout deserialization. Each window can use it to load custom interface data (eg. splitter position).
Declaration
public override void OnLayoutDeserialize(XmlElement node)
Parameters
System.Xml.XmlElement
node
The Xml document node. |
Overrides
OnLayoutSerialize(XmlWriter)
Called when during windows layout serialization. Each window can use it to store custom interface data (eg. splitter position).
Declaration
public override void OnLayoutSerialize(XmlWriter writer)
Parameters
System.Xml.XmlWriter
writer
The Xml writer. |
Overrides
OnParamAddUndo()
Called when parameter add undo action is performed.
Declaration
public virtual void OnParamAddUndo()
Implements
OnParamEditAttributesUndo()
Called when parameter edit attributes undo action is performed.
Declaration
public virtual void OnParamEditAttributesUndo()
Implements
OnParamRemoveUndo()
Called when parameter remove undo action is performed.
Declaration
public virtual void OnParamRemoveUndo()
Implements
OnParamRenameUndo()
Called when parameter rename undo action is performed.
Declaration
public virtual void OnParamRenameUndo()
Implements
OnPropertyEdited()
Called when the asset properties proxy object gets edited.
Declaration
protected virtual void OnPropertyEdited()
OnSurfaceClose()
Declaration
public void OnSurfaceClose()
OnSurfaceEditedChanged()
Declaration
public void OnSurfaceEditedChanged()
OnSurfaceEditingStart()
Called when surface gets loaded and user can edit it.
Declaration
protected virtual void OnSurfaceEditingStart()
OnSurfaceGraphEdited()
Declaration
public void OnSurfaceGraphEdited()
RefreshTempAsset()
Refreshes temporary asset to see changes live when editing the surface.
Declaration
public bool RefreshTempAsset()
Returns
System.Boolean
True if cannot refresh it, otherwise false. |
Save()
Tries to save asset changes if it has been edited.
Declaration
public override void Save()
Overrides
SaveSurface()
Saves the surface to the asset. Called during Update(Single) when asset is loaded and surface is missing.
Declaration
protected abstract bool SaveSurface()
Returns
System.Boolean
True if failed, otherwise false. |
SetParameter(Int32, Object)
Sets the asset parameter.
Declaration
public virtual void SetParameter(int index, object value)
Parameters
System.Int32
index
The zero-based parameter index. |
System.Object
value
The value to set. |
Implements
ShowWholeGraph()
Shows the whole surface graph.
Declaration
public void ShowWholeGraph()
UnlinkItem()
Unlinks the item. Removes reference to it and unbinds all events.
Declaration
protected override void UnlinkItem()
Overrides
Update(Single)
Perform control update and all its children
Declaration
public override void Update(float deltaTime)
Parameters
System.Single
deltaTime
Delta time in seconds |
Overrides
UpdateToolstrip()
Updates the toolstrip buttons and other controls. Called after some window events.
Declaration
protected override void UpdateToolstrip()
Overrides
Events
SurfaceLoaded
Event called when surface gets loaded (eg. after opening the window).
Declaration
public event Action SurfaceLoaded
Event Type
System.Action
|