public NodeController() { idHandler = IdHandler.GetInstance(); nodeRelation = new NodeRelation(); context = new NodeContext(idHandler, nodeRelation.OnMakeRelation, nodeRelation.OnClickOnClass, nodeRelation.OnDeleteField, OnDeleteClass); LoadData(); }
public Actor(string actorName, IdHandler idhadler, System.Action <int> OnMakeRelation) { this.actorName = actorName; ID = idhadler.GetActorID(); transform = new Rect(20, 20, 100, 120); img = ResourcesConfig.GetInstance().actor; this.OnMakeRelation = OnMakeRelation; }
public void Save() { var json = JsonUtility.ToJson(this); SaveUtility.SaveInProject(json, NodeConsts.FullResourcesFolder + "/" + NodeConsts.USECASE_DATA_FILE); IdHandler.GetInstance().OnSaveFile(); AssetDatabase.Refresh(); }
public NodeContext(IdHandler idHandler, System.Action <int, ulong> OnMakeRelation, System.Action <int> OnMakeRelationToClass, System.Action <int, ulong> OnDeleteField, System.Action <int> OnDeleteClass) { this.idHandler = idHandler; this.OnMakeRelation = OnMakeRelation; this.OnMakeRelationToClass = OnMakeRelationToClass; this.OnDeleteField = OnDeleteField; this.OnDeleteClass = OnDeleteClass; }
private static void Load() { string json = string.Empty; var o = EditorGUIUtility.Load(NodeConsts.ResourcesFolder + "/" + NodeConsts.ID_HANDLER); if (o != null) { instance = new IdHandler(); json = ((TextAsset)o).text; JsonUtility.FromJsonOverwrite(json, instance); } else { instance = new IdHandler(); } }
private void LoadData() { string json = string.Empty; var o = EditorGUIUtility.Load(NodeConsts.ResourcesFolder + "/" + NodeConsts.SEQUENCE_DATA_FILE); if (o != null) { json = ((TextAsset)o).text; JsonUtility.FromJsonOverwrite(json, this); } else { UseCase c = new UseCase(IdHandler.GetInstance(), useCaseRelation.OnSelectUseCase); listOfUseCase.Add(c); Actor a = new Actor("Actor name", IdHandler.GetInstance(), useCaseRelation.OnMakeStartRelation); actors.Add(a); } }
public UseCase(IdHandler idHander, System.Action <int> OnFinishRelation) { ID = idHander.GetUseCaseID(); transform = new Rect(20, 20, 100, 120); this.OnFinishRelation = OnFinishRelation; }