Time Rewizer  v.1.1
Created by: Mark Oostveen
MarkOostveen.TimeRewizer.Instalation.TimeRewizerInstalation Class Reference

Associated with managing installation related tasks for Time Rewizer Plug-In More...

+ Collaboration diagram for MarkOostveen.TimeRewizer.Instalation.TimeRewizerInstalation:

Static Public Member Functions

static void CreateSamples ()
 Extract sample scripts from this DLL More...
 
static void CreateSpecialFolders ()
 Creates folders needed for baking functionality More...
 

Static Package Functions

static void Reimport ()
 

Detailed Description

Associated with managing installation related tasks for Time Rewizer Plug-In

Member Function Documentation

◆ CreateSamples()

static void MarkOostveen.TimeRewizer.Instalation.TimeRewizerInstalation.CreateSamples ( )
static

Extract sample scripts from this DLL

31  {
32  string normalPath = Application.dataPath;
33  normalPath += "\\Plugins\\Time Rewizer\\";
34  List<string> files = new List<string>(Directory.GetDirectories(normalPath));
35  if (!files.Contains(normalPath + "\\Samples"))
36  {
37  Debug.Log("Creating Sample Scripts");
38  normalPath += "\\Samples";
39  Directory.CreateDirectory(normalPath).Create();
40  Directory.CreateDirectory(normalPath + "\\Creating a rewindable property");
41  Directory.CreateDirectory(normalPath + "\\Creating a rewindable property\\state classes");
42  Directory.CreateDirectory(normalPath + "\\Using Rewindable properties in your code");
43 
44  File.WriteAllBytes(
45  normalPath + "\\Using Rewindable properties in your code" +
46  "\\HowToUseRewindablePropertiesExample.cs",
47  Encoding.ASCII.GetBytes(FileContainer.HOW_TO_USE_REWINDABLE_PROPERTIES_EXAMPLE));
48  File.WriteAllBytes(
49  normalPath + "\\Using Rewindable properties in your code" +
50  "\\BakingHowToUseRewindablePropertiesExample.cs",
51  Encoding.ASCII.GetBytes(FileContainer.BAKING_HOW_TO_USE_REWINDABLE_PROPERTIES_EXAMPLE));
52  File.WriteAllBytes(normalPath + "\\Creating a rewindable property" + "\\StateRewind.cs",
53  Encoding.ASCII.GetBytes(FileContainer.STATE_REWIND));
54  File.WriteAllBytes(normalPath + "\\Creating a rewindable property\\state classes" + "\\State.cs",
55  Encoding.ASCII.GetBytes(FileContainer.STATE));
56  File.WriteAllBytes(normalPath + "\\Creating a rewindable property\\state classes" + "\\StateMachine.cs",
57  Encoding.ASCII.GetBytes(FileContainer.STATE_MACHINE));
58  }
59 
60  //for editor examples only
61 
62  //string editorPath = normalPath + "\\Editor";
63  //if (!files.Contains(editorPath))
64  //{
65  // Directory.CreateDirectory(editorPath).Create();
66  //}
67 
68  //if (!files.Contains(editorPath + "\\Samples"))
69  //{
70  // Debug.Log("Creating Sample Scripts");
71  // editorPath += "\\Samples";
72  // Directory.CreateDirectory(editorPath).Create();
73  //}
74 
75  AssetDatabase.Refresh();
76  }

◆ CreateSpecialFolders()

static void MarkOostveen.TimeRewizer.Instalation.TimeRewizerInstalation.CreateSpecialFolders ( )
static

Creates folders needed for baking functionality

83  {
84  string assetfolderlocation = Application.dataPath;
85 
86  bool changed = false;
87 
88  if (!Directory.Exists(assetfolderlocation + "\\Plugins\\Time Rewizer\\ProjectData"))
89  {
90  Directory.CreateDirectory(assetfolderlocation + "\\Plugins\\Time Rewizer\\ProjectData").Create();
91  changed = true;
92  }
93 
94  if (!Directory.Exists(assetfolderlocation + "\\Plugins\\Time Rewizer\\ProjectData\\Bakes"))
95  {
96  Directory.CreateDirectory(assetfolderlocation + "\\Plugins\\Time Rewizer\\ProjectData\\Bakes")
97  .Create();
98  changed = true;
99  }
100 
101  if (!Directory.Exists(assetfolderlocation + "\\Plugins\\Time Rewizer\\ProjectData\\EditorSettings"))
102  {
103  Directory.CreateDirectory(assetfolderlocation +
104  "\\Plugins\\Time Rewizer\\ProjectData\\EditorSettings").Create();
105  changed = true;
106  }
107 
108  if (!Directory.Exists(assetfolderlocation + "\\Plugins\\Time Rewizer\\ProjectData\\Cache"))
109  {
110  Directory.CreateDirectory(assetfolderlocation + "\\Plugins\\Time Rewizer\\ProjectData\\Cache")
111  .Create();
112  changed = true;
113  }
114 
115  if (!Directory.Exists(assetfolderlocation +
116  "\\Plugins\\Time Rewizer\\ProjectData\\Cache\\Hierachy"))
117  {
118  Directory.CreateDirectory(assetfolderlocation +
119  "\\Plugins\\Time Rewizer\\ProjectData\\Cache\\Hierachy").Create();
120  changed = true;
121  }
122 
123  if (changed)
124  AssetDatabase.Refresh();
125  }
+ Here is the caller graph for this function:

◆ Reimport()

static void MarkOostveen.TimeRewizer.Instalation.TimeRewizerInstalation.Reimport ( )
staticpackage
129  {
130  string[] assets = AssetDatabase.GetAllAssetPaths();
131 
132  for (int i = 0; i < assets.Length; i++)
133  {
134  if (assets[i].Contains("/TimeRewizer/"))
135  {
136  AssetDatabase.ImportAsset(assets[i], ImportAssetOptions.Default);
137  }
138  }
139 
140  AssetDatabase.Refresh();
141  Debug.Log("Re-imported " + assets.Length + " Assets");
142  }