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

Class managing transforms before bake in edit mode More...

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

Classes

class  NodeProperties
 Node Properties for Animation Baker More...
 

Public Member Functions

void SaveChanges ()
 save changes for snapshots into cache More...
 
void Load (List< NodeProperties > dataToExtract)
 Called by Time Rewind Editor to load game objects from Save File More...
 
void AddNode (int index)
 will insert a new node into the nodelist More...
 
NodeProperties AddNode (AnimationRewizer.AnimatorParameter[] parameters)
 add snapshot to hierarchy More...
 
void DeleteNode (int index)
 delete snapshot from hierarchy More...
 
int GetIndexOfNode (AnimationRewizer.AnimatorParameter[] input)
 Get index of parameter array More...
 
bool Contains (AnimationRewizer.AnimatorParameter[] input)
 Returns if parameter array is currently contained in parameter array More...
 
NodeProperties GetProperties (AnimationRewizer.AnimatorParameter[] input)
 find properties instance More...
 
void Clear ()
 Clears hierarchy list More...
 

Static Public Member Functions

static NodeProperties Convert (NodeProperties input)
 Default conversion from node to node properties More...
 

Public Attributes

AnimationRewizer.AnimatorParameter [] m_DefaultParameterArray
 Default Parameters from animator More...
 
NodeProperties m_SelectedSnapshot
 Snapshot who's currently selected More...
 

Properties

List< NodePropertiesSnapshots [get, set]
 Saved Snapshots inside Hierarchy More...
 
dynamic BaseBaker [get, set]
 Scriptable Cache Holder More...
 
Action< string > Save [set]
 Save Action More...
 

Detailed Description

Class managing transforms before bake in edit mode

Member Function Documentation

◆ AddNode() [1/2]

void MarkOostveen.TimeRewizer.Editor.Baking.AnimationBaker.AddNode ( int  index)

will insert a new node into the nodelist

Parameters
index
Returns
86  {
87  NodeProperties newproperties = new NodeProperties() { m_TransitionDuration = 60 };
88 
89  if (Snapshots.Count == 0)
90  {
91  newproperties.m_Parameters = new AnimationRewizer.AnimatorParameter[m_DefaultParameterArray.Length];
92  for (int i = 0; i < newproperties.m_Parameters.Length; i++)
93  {
94  newproperties.m_Parameters[i] = m_DefaultParameterArray[i].Clone();
95  }
96 
97  Snapshots.Add(newproperties);
98  }
99  else
100  {
101  newproperties.m_Parameters = new AnimationRewizer.AnimatorParameter[Snapshots[index].m_Parameters.Length];
102  for (int i = 0; i < newproperties.m_Parameters.Length; i++)
103  {
104  newproperties.m_Parameters[i] = Snapshots[index].m_Parameters[i].Clone();
105  }
106 
107  Snapshots.Insert(index + 1, newproperties);
108  }
109 
110  m_SelectedSnapshot = newproperties;
111  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddNode() [2/2]

NodeProperties MarkOostveen.TimeRewizer.Editor.Baking.AnimationBaker.AddNode ( AnimationRewizer.AnimatorParameter []  parameters)

add snapshot to hierarchy

Parameters
parameters
118  {
119  NodeProperties property = new NodeProperties()
120  {
121  m_Parameters = parameters.Clone() as AnimationRewizer.AnimatorParameter[],
122  m_TransitionDuration = 1
123  };
124 
125  Snapshots.Add(property);
126 
127  return property;
128  }
+ Here is the call graph for this function:

◆ Clear()

void MarkOostveen.TimeRewizer.Editor.Baking.AnimationBaker.Clear ( )

Clears hierarchy list

187  {
188  Snapshots.Clear();
189  }
+ Here is the caller graph for this function:

◆ Contains()

bool MarkOostveen.TimeRewizer.Editor.Baking.AnimationBaker.Contains ( AnimationRewizer.AnimatorParameter []  input)

Returns if parameter array is currently contained in parameter array

Parameters
input
Returns
160  {
161  NodeProperties properties = GetProperties(input);
162  return properties != null;
163  }

◆ Convert()

static NodeProperties MarkOostveen.TimeRewizer.Editor.Baking.AnimationBaker.Convert ( NodeProperties  input)
static

Default conversion from node to node properties

Parameters
input
Returns
197  {
198  return input;
199  }
+ Here is the caller graph for this function:

◆ DeleteNode()

void MarkOostveen.TimeRewizer.Editor.Baking.AnimationBaker.DeleteNode ( int  index)

delete snapshot from hierarchy

Parameters
index
135  {
136  Snapshots.RemoveAt(index);
137 
138  if (Snapshots.Count > 0)
139  {
140  m_SelectedSnapshot = Snapshots[index];
141  }
142  }
+ Here is the caller graph for this function:

◆ GetIndexOfNode()

int MarkOostveen.TimeRewizer.Editor.Baking.AnimationBaker.GetIndexOfNode ( AnimationRewizer.AnimatorParameter []  input)

Get index of parameter array

Parameters
input
Returns
150  {
151  return Snapshots.IndexOf(GetProperties(input));
152  }

◆ GetProperties()

NodeProperties MarkOostveen.TimeRewizer.Editor.Baking.AnimationBaker.GetProperties ( AnimationRewizer.AnimatorParameter []  input)

find properties instance

Parameters
input
Returns
171  {
172  for (int i = 0; i < Snapshots.Count; i++)
173  {
174  if (Snapshots[i].m_Parameters == input)
175  {
176  return Snapshots[i];
177  }
178  }
179 
180  return null;
181  }

◆ Load()

void MarkOostveen.TimeRewizer.Editor.Baking.AnimationBaker.Load ( List< NodeProperties dataToExtract)

Called by Time Rewind Editor to load game objects from Save File

Parameters
dataToExtract
67  {
68  Snapshots = new List<NodeProperties>();
69 
70  for (int i = 0; i < dataToExtract.Count; i++)
71  {
72  Snapshots.Add(new NodeProperties()
73  {
74  m_Parameters = dataToExtract[i].m_Parameters,
75  m_TransitionDuration = dataToExtract[i].m_TransitionDuration
76  });
77  }
78  }

◆ SaveChanges()

void MarkOostveen.TimeRewizer.Editor.Baking.AnimationBaker.SaveChanges ( )

save changes for snapshots into cache

45  {
46  Save.Invoke(name);
47  }
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_DefaultParameterArray

AnimationRewizer.AnimatorParameter [] MarkOostveen.TimeRewizer.Editor.Baking.AnimationBaker.m_DefaultParameterArray

Default Parameters from animator

◆ m_SelectedSnapshot

NodeProperties MarkOostveen.TimeRewizer.Editor.Baking.AnimationBaker.m_SelectedSnapshot

Snapshot who's currently selected

Property Documentation

◆ BaseBaker

dynamic MarkOostveen.TimeRewizer.Editor.Baking.AnimationBaker.BaseBaker
getset

Scriptable Cache Holder

34 { get; set; }

◆ Save

Action<string> MarkOostveen.TimeRewizer.Editor.Baking.AnimationBaker.Save
set

Save Action

39 { private get; set; }

◆ Snapshots

List<NodeProperties> MarkOostveen.TimeRewizer.Editor.Baking.AnimationBaker.Snapshots
getset

Saved Snapshots inside Hierarchy

29 { get; set; }