void Awake()
    {
        instance = this;
        mario    = GameObject.Find("Mario").GetComponent <Mario>();
        EventManager.RegisterEvent <IScore>("AddScoreEvent", AddScore);

        ActivityDictionary.Init();
    }
Ejemplo n.º 2
0
        public WorkflowOptions UnregisterActivityType(Type activityType)
        {
            if (!ActivityDictionary.ContainsKey(activityType))
            {
                throw new InvalidOperationException("The specified activity type is not registered.");
            }

            ActivityDictionary.Remove(activityType);
            return(this);
        }
Ejemplo n.º 3
0
    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));
        }
    }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
 public bool IsActivityRegistered(Type activityType)
 {
     return(ActivityDictionary.ContainsKey(activityType));
 }