static public void ReloadTestFromFile() { if (WindowInstance != null) { WindowInstance.ClearAllBoxesAndLinks(); if (CurrentlyOpenTest != null) { MonsterTestManager.SwapActiveMonsterTestManager(CurrentlyOpenTest); } MonsterTestManager.LoadTest(); WindowInstance.PreInit(); List <MonsterTestBase> AllTestStates = MonsterTestManager.EditorGetTestStateList(); foreach (MonsterTestBase CurrentTestState in AllTestStates) { MonsterTestBaseBox NewBox = (MonsterTestBaseBox)TypeUtils.GetEditorBoxForTypeString(CurrentTestState.GetEntityName(), WindowInstance, CurrentTestState); WindowInstance.AddBox(NewBox); } WindowInstance.PostInit(); } }
static public void SaveTestStateList() { MonsterTestManager.GetActiveInstance().SaveEntities(); if (CurrentlyOpenTest != null) { CurrentlyOpenTest.EditorSaveMonsterTest(); } MonsterTestWindow.GetInstance().SerializeBoxMetadata(true); }
public virtual MonsterTestBaseBox SetupNewBox(string EntityTypeName, MonsterTestState NewEntity) { MonsterTestManager.AddTestState(NewEntity); MonsterTestBaseBox NewBox = (MonsterTestBaseBox)TypeUtils.GetEditorBoxForTypeString(EntityTypeName, MonsterTestWindow.WindowInstance, NewEntity); NewBox.InitializeNewBox(); NewBox.MoveBoxTo(InputState.GetLocalMousePosition(this, -GetWindowOffset())); MonsterTestWindow.WindowInstance.AddBox(NewBox); return(NewBox); }
public static MonsterTestManager SwapActiveMonsterTestManager(MonsterTest NewTest) { if (Instance != null) { Instance.UnloadTests(); } Instance = new MonsterTestManager(); EntityListFilename = NewTest.GetTestStateListFilename(); Owner = NewTest; XMLSerializable.SerializeFromXML <MonsterTestManager>(NewTest.GetTestStateListFilename(), ref Instance, false); return(Instance); }
public override void SetModifiedState(ModifiedState NewState, string VariableName) { if (NewState == ModifiedState.PreModify) { } base.SetModifiedState(NewState, VariableName); if (NewState == ModifiedState.Modified) { if (MonsterTestManager.GetActiveInstance() != null) { MonsterTestManager.GetActiveInstance().SaveEntities(); } } }
public static void Log(string Message) { if (MonsterTestCore.MonsterTestCoreInst != null && MonsterTestManager.GetActiveInstance() != null) { if (IgorDebug.Logger != null) { IgorDebug.Logger.Log(MonsterTestCore.MonsterTestCoreInst, " - " + MonsterTestManager.GetActiveInstance().GetOwnerFilename() + Message); } else { Debug.Log("Igor Log: " + MonsterTestCore.MonsterTestCoreInst + " - " + MonsterTestManager.GetActiveInstance().GetOwnerFilename() + " : " + Message); } } else { CoreLog(Message); } }
static public void FullGraphRefreshFromCurrentData() { if (WindowInstance != null) { WindowInstance.ClearAllBoxesAndLinks(); WindowInstance.PreInit(); List <MonsterTestBase> AllTestStates = MonsterTestManager.EditorGetTestStateList(); foreach (MonsterTestBase CurrentTestState in AllTestStates) { MonsterTestBaseBox NewBox = (MonsterTestBaseBox)TypeUtils.GetEditorBoxForTypeString(CurrentTestState.GetEntityName(), WindowInstance, CurrentTestState); WindowInstance.AddBox(NewBox); } WindowInstance.PostInit(); } }
public static void CriticalError(string Message) { if (MonsterTestCore.MonsterTestCoreInst != null && MonsterTestManager.GetActiveInstance() != null) { if (IgorDebug.Logger != null) { IgorDebug.Logger.CriticalError(MonsterTestCore.MonsterTestCoreInst, " - " + MonsterTestManager.GetActiveInstance().GetOwnerFilename() + Message); } else { Debug.LogError("Igor Error: " + MonsterTestCore.MonsterTestCoreInst + " - " + MonsterTestManager.GetActiveInstance().GetOwnerFilename() + " : " + Message); throw new UnityException(MonsterTestCore.MonsterTestCoreInst + " - " + MonsterTestManager.GetActiveInstance().GetOwnerFilename() + " : " + Message); } } else { CoreLog(Message); } }
public override void SaveEntities() { MonsterTestManager.SaveTest(); }
public override void RemoveEntity() { MonsterTestManager.RemoveTestState(MonsterTestBaseInst); }
public static void AddTestState(MonsterTestBase NewTestState) { MonsterTestManager.GetActiveInstance().AddEntity(NewTestState); }
public override string GetUniqueFilename(string OriginalFilename) { return(MonsterTestManager.EditorGetUniqueTestStateFilename(OriginalFilename)); }
public static List <MonsterTestBase> EditorGetTestStateList() { return(MonsterTestManager.GetActiveInstance().Entities); }
public static void RemoveTestState(MonsterTestBase TestStateToRemove) { MonsterTestManager.GetActiveInstance().RemoveEntity(TestStateToRemove); }
/* public virtual void AddLine() * { * Line NewLine = new Line(); * * SetupNewLineBox(NewLine); * } * * public virtual void ConnectLine() * { * Line NewLine = new Line(); * * NewLine.CreateStaticNodesIfNotPresent(); * * LineBox NewBox = SetupNewLineBox(NewLine); * * if(NewBox.GetAllAnchors().Count > 0) * { * Anchor<ConversationBase> NewBoxAnchor = NewBox.GetAllAnchors()[0]; * * ConnectInputToOutput(NewBoxAnchor, StartingAnchorForNewBox); * } * } * * public virtual LineBox SetupNewLineBox(Line NewLine) * { * ConversationManager.AddConversation(NewLine); * * LineBox NewBox = new LineBox(ConversationWindow.WindowInstance, NewLine); * * NewBox.InitializeNewBox(); * * NewBox.MoveBoxTo(InputState.GetLocalMousePosition(this, -GetWindowOffset())); * * ConversationWindow.WindowInstance.AddBox(NewBox); * * return NewBox; * }*/ public override string GetBoxMetadataFile() { return(MonsterTestCore.MonsterLocalDirectoryRoot + "/Config/Editor/MonsterTests/MonsterTestBoxes" + MonsterTestManager.GetActiveInstance().GetOwnerFilename() + ".xml"); }
public override void SaveRequested() { MonsterTestManager.SaveTest(); }
public override void CreateStaticNodesIfNotPresent() { MonsterTestManager.GetActiveInstance().CreateStaticNodesIfNotPresent(); }
public static string EditorGetUniqueTestStateFilename(string OriginalFilename) { return(MonsterTestManager.GetActiveInstance().EditorGetUniqueEntityFilename(OriginalFilename)); }
public static void SaveTest() { MonsterTestManager.GetActiveInstance().SaveEntities(); }
public override LinkedEntityManager <MonsterTestBase> GetManager() { return(MonsterTestManager.GetActiveInstance()); }
public override MonsterTestBase GetLinkedEntityForFilename(string Filename) { return(MonsterTestManager.GetActiveInstance().GetEntityByFileName(Filename)); }
public virtual void UnloadTests() { Instance = null; }
public static void LoadTest() { MonsterTestManager.GetActiveInstance().LoadEntities(); }
public override void OnInspectorGUIClickedSaveButton() { MonsterTestManager.SaveTest(); Owner.SerializeBoxMetadata(true); }
public virtual void LoadTestStates() { TestStates = MonsterTestManager.SwapActiveMonsterTestManager(this); }