// Use this for initialization
    void Start()
    {
        GridUpdateSubscriber   gus = GetComponent <GridUpdateSubscriber>();
        GridMovementSubscriber gms = GetComponent <GridMovementSubscriber>();

        gus.SetSubscriberMethod(new GridUpdateSubscriber.SubscriberDelegate(SubUpdate));
        gms.SetMovementMethod(new GridMovementSubscriber.MovementMethod(SubMovement));
        gms.SetAttackMethod(new GridMovementSubscriber.AttackMethod(SubAttack));
    }
    protected void Init()
    {
        // NOTE(clark, 2/8/2017): Added ec. Calling GetComponent takes a fair bit of time
        ec = GetComponent <EnemyComponent>();
        GridUpdateSubscriber   gus = GetComponent <GridUpdateSubscriber>();
        GridMovementSubscriber gms = GetComponent <GridMovementSubscriber>();

        gus.SetSubscriberMethod(new GridUpdateSubscriber.SubscriberDelegate(SubUpdate));
        gms.SetMovementMethod(new GridMovementSubscriber.MovementMethod(SubMovement));
        gms.SetAttackMethod(new GridMovementSubscriber.AttackMethod(SubAttack));
    }
Пример #3
0
    // Use this for initialization
    void Start()
    {
        GridUpdateSubscriber gus = GetComponent <GridUpdateSubscriber>();

        gus.SetSubscriberMethod(new GridUpdateSubscriber.SubscriberDelegate(SubUpdate));
    }