/// <summary> /// Updates the AnimatorAccess component of the specified game object. /// </summary> /// <param name="go">Go.</param> public void Update(GameObject go) { string file = GetTargetFile(go); if (string.IsNullOrEmpty(file)) { return; } ClassElementsBuilder a = new ClassElementsBuilder(go); CodeGeneratorResult r = a.PrepareCodeGeneration(true); if (!r.Error) { r = a.GenerateCode(); if (r.Success) { BackupAndSave(a.Code, file); EditorStatusObserver.CheckForAutoRefresh(); } } else { Logger.Warning(r); EditorUtility.DisplayDialog(r.ErrorTitle, r.ErrorText, "OK"); } }
public void TestAnimatorAccessGenerator (GameObject go) { ClassElementsBuilder a = new ClassElementsBuilder (go); CodeGeneratorResult r = a.PrepareCodeGeneration (true); if (!r.Error) { r = a.GenerateCode (); if (r.Success) { WriteToFile (a.Code, "/Users/kay/tmp/TimeMachine.ignore/Trash/New.cs"); } } else { Logger.Warning (r); } }
/// <summary> /// Create a new AnimatorAccess component for the specified game object and saves it to targetCodeFile. The /// caller is responsible for ensuring that there is not yet a component existing with the same name. /// </summary> /// <param name="go">Go.</param> /// <param name="targetCodeFile">Target code file.</param> public void Create(GameObject go, string targetCodeFile) { ClassElementsBuilder gen = new ClassElementsBuilder(go, targetCodeFile); CodeGeneratorResult result = gen.PrepareCodeGeneration(false); if (result.Error) { EditorUtility.DisplayDialog(result.ErrorTitle, result.ErrorText, "OK"); return; } result = gen.GenerateCode(); if (result.Success) { BackupAndSave(gen.Code, targetCodeFile); EditorStatusObserver.RegisterForPostProcessing(gen.FullClassName); } }
public void TestAnimatorAccessGenerator(GameObject go) { ClassElementsBuilder a = new ClassElementsBuilder(go); CodeGeneratorResult r = a.PrepareCodeGeneration(true); if (!r.Error) { r = a.GenerateCode(); if (r.Success) { WriteToFile(a.Code, "/Users/kay/tmp/TimeMachine.ignore/Trash/New.cs"); } } else { Logger.Warning(r); } }
/// <summary> /// Create a new AnimatorAccess component for the specified game object and saves it to targetCodeFile. The /// caller is responsible for ensuring that there is not yet a component existing with the same name. /// </summary> /// <param name="go">Go.</param> /// <param name="targetCodeFile">Target code file.</param> public void Create (GameObject go, string targetCodeFile) { ClassElementsBuilder gen = new ClassElementsBuilder (go, targetCodeFile); CodeGeneratorResult result = gen.PrepareCodeGeneration (false); if (result.Error) { EditorUtility.DisplayDialog (result.ErrorTitle, result.ErrorText, "OK"); return; } result = gen.GenerateCode (); if (result.Success) { BackupAndSave (gen.Code, targetCodeFile); EditorStatusObserver.RegisterForPostProcessing (gen.FullClassName); } }
/// <summary> /// Compares the current version of class with a potential new version. /// </summary> /// <returns>The for updates.</returns> /// <param name="go">GameOject whose attached BaseAnimatorAccess component should be used.</param> public List<ClassMemberCompareElement> CheckForUpdates (GameObject go) { ClassElementsBuilder a = new ClassElementsBuilder (go); return a.Compare (go); }
/// <summary> /// Updates the AnimatorAccess component of the specified game object. /// </summary> /// <param name="go">Go.</param> public void Update (GameObject go) { string file = GetTargetFile (go); if (string.IsNullOrEmpty (file)) { return; } ClassElementsBuilder a = new ClassElementsBuilder (go); CodeGeneratorResult r = a.PrepareCodeGeneration (true); if (!r.Error) { r = a.GenerateCode (); if (r.Success) { BackupAndSave (a.Code, file); EditorStatusObserver.CheckForAutoRefresh (); } } else { Logger.Warning (r); EditorUtility.DisplayDialog (r.ErrorTitle, r.ErrorText, "OK"); } }
/// <summary> /// Compares the current version of class with a potential new version. /// </summary> /// <returns>The for updates.</returns> /// <param name="go">GameOject whose attached BaseAnimatorAccess component should be used.</param> public List <ClassMemberCompareElement> CheckForUpdates(GameObject go) { ClassElementsBuilder a = new ClassElementsBuilder(go); return(a.Compare(go)); }