Пример #1
0
 protected void AddBehaviour(UnityAction behaviour, UnityAction begin, UnityAction end)
 {
     string key = behaviour.Method.Name;
     if (!map.ContainsKey (key)) {
         BehaviourTests bt = new BehaviourTests (behaviour, begin, end);
         map.Add (key, bt);
     } else {
         Debug.LogError ("This behaviour was already added!");
     }
 }
Пример #2
0
    protected void StartBehaviour(UnityAction behaviour)
    {
        if (actual != null)
            actual.End ();

        string key = behaviour.Method.Name;
        if (!map.ContainsKey (key)) {
            Debug.LogError ("This behaviour needs to be Added before Started!");
        } else if (map[key] == null) {
            Debug.LogError ("This behaviour was added, but is null!");
        } else {
            actual = map[key];
        }

        actual.Begin ();
    }