void Awake() { instance = this; mario = GameObject.Find("Mario").GetComponent <Mario>(); EventManager.RegisterEvent <IScore>("AddScoreEvent", AddScore); ActivityDictionary.Init(); }
public WorkflowOptions UnregisterActivityType(Type activityType) { if (!ActivityDictionary.ContainsKey(activityType)) { throw new InvalidOperationException("The specified activity type is not registered."); } ActivityDictionary.Remove(activityType); return(this); }
public ActivityContainer(Actor owner, string name) { actList = new List <Activity>(); this.owner = owner; string fileName = "Activity_" + name + ".txt"; string[] jsons = File.ReadAllLines(Application.streamingAssetsPath + "/" + fileName); foreach (string json in jsons) { Add(ActivityDictionary.CreateFromJson(json)); } }
public WorkflowOptions RegisterActivity(Type activityType, Type driverType = null) { if (ActivityDictionary.ContainsKey(activityType)) { if (driverType != null) { ActivityDictionary[activityType].DriverTypes.Add(driverType); } } else { ActivityDictionary.Add(activityType, new ActivityRegistration(activityType, driverType)); } return(this); }
public bool IsActivityRegistered(Type activityType) { return(ActivityDictionary.ContainsKey(activityType)); }