Time Rewizer  v.1.1
Created by: Mark Oostveen
MarkOostveen.TimeRewizer.Editor.Baking.BaseCustomEditorBaked< T0, T1, T2, T3, T4, T5 > Class Template Referenceabstract

Starts window of given type. please give all listed types below to setup editor window for baking T0: Type of window being outputted T1: Baker type used T2: Type of Cache Object used T3: Setting type being used T4: Properties type Used by baker T5: Properties type being used to save data by Cache object More...

+ Inheritance diagram for MarkOostveen.TimeRewizer.Editor.Baking.BaseCustomEditorBaked< T0, T1, T2, T3, T4, T5 >:
+ Collaboration diagram for MarkOostveen.TimeRewizer.Editor.Baking.BaseCustomEditorBaked< T0, T1, T2, T3, T4, T5 >:

Protected Member Functions

virtual void OnEnable ()
 Get's Editor Target More...
 
void Initialize (string defaultSettingsName, string cacheName, Func< T5, T4 > conversion, Func< T4, T5 > resersedConversion, Func< T2, T1, List< T4 >> loadAssetOverwrite=default)
 initialization More...
 
abstract void Clean ()
 
void DestroyAndCleanup ()
 Deletes bake when no snapshots are present within bake, deletes baker cache More...
 

Protected Attributes

T0 m_EditorWindow
 simulating object More...
 
ScriptableBake m_ScriptableObject
 scriptable bake linked to this object More...
 
T1 m_Target
 reference to target script More...
 

Package Functions

T0 StartWindow ([CanBeNull] Action startupAction=null)
 Start the editor window More...
 

Detailed Description

Starts window of given type. please give all listed types below to setup editor window for baking T0: Type of window being outputted T1: Baker type used T2: Type of Cache Object used T3: Setting type being used T4: Properties type Used by baker T5: Properties type being used to save data by Cache object

Template Parameters
T0
T1
T2
T3
T4
T5
Type Constraints
T0 :EditorWindow 
T0 :IBakeWindow<T1> 
T1 :MonoBehaviour 
T1 :IBaker<T4> 
T2 :ScriptableObject 
T2 :ICache<T5> 
T3 :ScriptableObject 
T3 :ISetting 
T4 :IProperties 
T4 :ICloneable 
T5 :IProperties 

Member Function Documentation

◆ Clean()

◆ DestroyAndCleanup()

void MarkOostveen.TimeRewizer.Editor.Baking.BaseCustomEditorBaked< T0, T1, T2, T3, T4, T5 >.DestroyAndCleanup ( )
protected

Deletes bake when no snapshots are present within bake, deletes baker cache

146  {
147  StartWindow();
148  Clean();
149  EditorRewizeSystemUtility.DestroyAsset(EditorRewizeSystemUtility.GetCache<T2>(m_Target.gameObject, m_EditorWindow.CacheName));
150 
151  if (m_ScriptableObject.Count == 0)
152  EditorRewizeSystemUtility.DestroyAsset(m_ScriptableObject);
153 
154  m_EditorWindow.Close();
155  DestroyImmediate(m_Target, false);
156  }

◆ Initialize()

void MarkOostveen.TimeRewizer.Editor.Baking.BaseCustomEditorBaked< T0, T1, T2, T3, T4, T5 >.Initialize ( string  defaultSettingsName,
string  cacheName,
Func< T5, T4 >  conversion,
Func< T4, T5 >  resersedConversion,
Func< T2, T1, List< T4 >>  loadAssetOverwrite = default 
)
protected

initialization

Parameters
defaultSettingsName
cacheName
conversion
resersedConversion
loadAssetOverwrite
83  {
84  m_SettingsName = defaultSettingsName;
85  m_CacheName = cacheName;
86 
87  m_Conversion = conversion;
88 
89  m_ResersedConversion = resersedConversion;
90 
91  m_LoadOverwrite = loadAssetOverwrite;
92 
93  if (EditorRewizeSystemUtility.GetSetting<T3>(defaultSettingsName) == null)
94  {
95  EditorRewizeSystemUtility.CreateScriptableSettings<T3>(
96  defaultSettingsName);
97  }
98 
99  if (Application.isPlaying)
100  {
101  if (EditorRewizeSystemUtility.CheckRecordingState<T3>(m_SettingsName))
102  {
103  StartWindow();
104  }
105  }
106  else
107  {
108  if (EditorRewizeSystemUtility.CheckActiveState<T3>(m_SettingsName))
109  {
110  StartWindow();
111  }
112  }
113  }

◆ OnEnable()

◆ StartWindow()

T0 MarkOostveen.TimeRewizer.Editor.Baking.BaseCustomEditorBaked< T0, T1, T2, T3, T4, T5 >.StartWindow ( [CanBeNull] Action  startupAction = null)
package

Start the editor window

119  {
120  (ScriptableBake bake, T0 window) =
121  EditorRewizeSystemUtility.InitializeEditorWindow
122  <T0, T1, T2, T3, T4, T5>(
123  m_SettingsName,
124  m_Target,
125  m_CacheName
126  , new PropertyConversion<T4, T5>(
127  m_Conversion,
128  m_ResersedConversion)
129  , Clean
130  , m_LoadOverwrite
131  , startupAction
132  );
133 
134  m_EditorWindow = window;
135  m_ScriptableObject = bake;
136 
137  return window;
138  }

Member Data Documentation

◆ m_EditorWindow

T0 MarkOostveen.TimeRewizer.Editor.Baking.BaseCustomEditorBaked< T0, T1, T2, T3, T4, T5 >.m_EditorWindow
protected

simulating object

◆ m_ScriptableObject

ScriptableBake MarkOostveen.TimeRewizer.Editor.Baking.BaseCustomEditorBaked< T0, T1, T2, T3, T4, T5 >.m_ScriptableObject
protected

scriptable bake linked to this object

◆ m_Target

T1 MarkOostveen.TimeRewizer.Editor.Baking.BaseCustomEditorBaked< T0, T1, T2, T3, T4, T5 >.m_Target
protected

reference to target script