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

Editor Extention to scriptabletimerewinding for baking More...

+ Collaboration diagram for MarkOostveen.TimeRewizer.Editor.Baking.ScriptableBakeExtention:

Public Types

enum  FieldActionOption { FieldActionOption.Fill, FieldActionOption.Clear }
 Flag for action More...
 

Static Public Member Functions

static void InitializePreRewindAbleGameObject (GameObject target, FieldActionOption option, ScriptableBake scriptableobject, Type snapshottype, string tag)
 Give all Rewindable components, fields, property's a reference to scriptable object Coation, only use in editor, this uses reflection More...
 

Detailed Description

Editor Extention to scriptabletimerewinding for baking

Member Enumeration Documentation

◆ FieldActionOption

Flag for action

Enumerator
Fill 

fill Irewindable types with baked info

Clear 

clear Irewindable types from baked info

19  {
23  Fill,
24 
28  Clear
29  }

Member Function Documentation

◆ InitializePreRewindAbleGameObject()

static void MarkOostveen.TimeRewizer.Editor.Baking.ScriptableBakeExtention.InitializePreRewindAbleGameObject ( GameObject  target,
FieldActionOption  option,
ScriptableBake  scriptableobject,
Type  snapshottype,
string  tag 
)
static

Give all Rewindable components, fields, property's a reference to scriptable object Coation, only use in editor, this uses reflection

Parameters
target
option
scriptableobject
snapshottype
tag
42  {
43  (IRewizeable instance, (FieldInfo Types, MonoBehaviour mono) types)[] rewindingobjects =
44  GetAllIRewindAblesFromGameObject(target);
45 
46  for (int i = 0; i < rewindingobjects.Length; i++)
47  {
48  if (rewindingobjects[i].instance == null && rewindingobjects[i].types.Types != null)
49  {
50  rewindingobjects[i].instance =
51  (IRewizeable)RewizeUtilityFunctions.CreateInstanceByType(rewindingobjects[i].types.Types
52  .FieldType);
53  }
54 
55  if (rewindingobjects[i].instance.CompatibilityCheck(scriptableobject, tag) &&
56  option == FieldActionOption.Fill)
57  {
58  scriptableobject.DeleteType(snapshottype, tag);
59  rewindingobjects[i].instance.PreLoadInfo = scriptableobject;
60 
61  if (rewindingobjects[i].types.Types == null) continue;
62 
63  EditorRewizerDebug.Log("Installing " + rewindingobjects[i].instance + " into " +
64  rewindingobjects[i].types.mono.name + " in property: " +
65  rewindingobjects[i].types.Types.Name + ".");
66  rewindingobjects[i].types.Types
67  .SetValue(rewindingobjects[i].types.mono, rewindingobjects[i].instance);
68  EditorRewizeSystemUtility.SaveDirtyObject(rewindingobjects[i].types.mono);
69  }
70  else if (rewindingobjects[i].instance.CompatibilityCheck(scriptableobject, tag) &&
71  option == FieldActionOption.Clear)
72  {
73  scriptableobject.DeleteType(snapshottype, tag);
74  rewindingobjects[i].instance.PreLoadInfo = null;
75  }
76  }
77  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function: