Exemple #1
0
    public void setup()
    {
        if (this.target != null)
        {
            removalSub = gameObject.AddComponent <IntObserver>();// dequeue index. usually 0.
            removalSub.setupObserver(shiftByIndex);
            target.effectRemoveSubscribe(removalSub);

            additionSub = gameObject.AddComponent <GameObjectObserver>();
            additionSub.setupObserver(effectAddToList);
            target.effectAddSubscribe(additionSub);

            death = gameObject.AddComponent <GameObjectObserver>();
            death.setupObserver(targetDied);
            target.deathSubscribe(death);
        }
    }