Time Rewizer  v.1.1
Created by: Mark Oostveen
MarkOostveen.TimeRewizer.Editor.Baking.InternalValueCustomInspector Class Reference

custom editor for position and rotation rewinding More...

+ Inheritance diagram for MarkOostveen.TimeRewizer.Editor.Baking.InternalValueCustomInspector:
+ Collaboration diagram for MarkOostveen.TimeRewizer.Editor.Baking.InternalValueCustomInspector:

Public Member Functions

override void OnInspectorGUI ()
 drawing the custom inspector on the game object More...
 

Protected Member Functions

override void OnEnable ()
 Get's Editor Target More...
 
override void Clean ()
 
void Initialize (string defaultSettingsName, string cacheName, Func< T5, T4 > conversion, Func< T4, T5 > resersedConversion, Func< T2, T1, List< T4 >> loadAssetOverwrite=default)
 initialization More...
 
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

custom editor for position and rotation rewinding

Member Function Documentation

◆ Clean()

override void MarkOostveen.TimeRewizer.Editor.Baking.InternalValueCustomInspector.Clean ( )
protectedvirtual

Implements MarkOostveen.TimeRewizer.Editor.Baking.BaseCustomEditorBaked< PropertySelectionEditorWindow, InternalValueBaker, InternalValueRewizeWindowCache, InternalValueRewizeSettings, InternalValueBaker.PropertyInfo, InternalValueBaker.PropertyInfo >.

37  {
38  m_Target.Load();
39 
40  List<InternalValueBaker.PropertyInfo> snapshots = m_Target.Snapshots;
41 
42  PropertySelectionEditorWindow window = null;
43 
44  void Operationmethod()
45  {
46  for (int i = 0; i < snapshots.Count; i++)
47  {
48  InternalValueBaker.PropertyInfo property = snapshots[i];
49  PropertyInspectorCustomEditorWindow propertyinspector =
50  window.OpenWindow(ref property, i);
51  Bake.CleanInternalValueRewind(ref property, propertyinspector);
52  snapshots[i] = property;
53  propertyinspector.Close();
54  }
55 
56  m_Target.Snapshots = snapshots;
57 
58  window.CloseOverload();
59  EditorRewizeSystemUtility.SaveDirtyObject(m_Target);
60  }
61 
62  if (snapshots.Count > 0)
63  {
64  window = StartWindow(Operationmethod);
65  }
66  }
+ Here is the call graph for this function:

◆ DestroyAndCleanup()

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

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 
)
protectedinherited

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()

override void MarkOostveen.TimeRewizer.Editor.Baking.InternalValueCustomInspector.OnEnable ( )
protectedvirtual

Get's Editor Target

Reimplemented from MarkOostveen.TimeRewizer.Editor.Baking.BaseCustomEditorBaked< PropertySelectionEditorWindow, InternalValueBaker, InternalValueRewizeWindowCache, InternalValueRewizeSettings, InternalValueBaker.PropertyInfo, InternalValueBaker.PropertyInfo >.

25  {
26  base.OnEnable();
27  if (m_Target.Snapshots == null)
28  {
29  m_Target.Snapshots = new List<InternalValueBaker.PropertyInfo>();
30  }
31 
32  Initialize(PropertySelectionEditorWindow.DEFAULTNAME, PropertySelectionEditorWindow.CACHENAME,
33  InternalValueBaker.Convert, InternalValueBaker.Convert, Load);
34  }
+ Here is the call graph for this function:

◆ OnInspectorGUI()

override void MarkOostveen.TimeRewizer.Editor.Baking.InternalValueCustomInspector.OnInspectorGUI ( )

drawing the custom inspector on the game object

72  {
73  if (Application.isPlaying) return;
74 
75  if (GUILayout.Button("Open Editor Window"))
76  {
77  StartWindow();
78  }
79 
80  if (GUILayout.Button("Delete and clean"))
81  {
83  }
84  }

◆ StartWindow()

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

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
protectedinherited

simulating object

◆ m_ScriptableObject

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

scriptable bake linked to this object

◆ m_Target

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

reference to target script