Exemplo n.º 1
0
    public void UpdateInfo(Zombie model, Vector3 spawnPosition, ZombieAnimationQueue animationQueue, ZombieCollection collection)
    {
        //   Debug.Log(string.Format("{0} UpdateInfo", gameObject.name));

        if (animationQueue != null)
        {
            _animationQueue = animationQueue;
        }

        _collection = collection;
        _animationQueue.UpdateInfo(_view, _instanceId);
        _transform.position = spawnPosition;
        _model = model;
        _model.UpdateInfo(this);
        _zombieCollider.enabled = !_model.IsBoss;
        _bossCollider.enabled   = _model.IsBoss;

        if (_model.IsBoss)
        {
            _collider = _bossCollider;
        }
        else
        {
            _collider = _zombieCollider;
        }

        _view.UpdateInfo(model);
        _stateTimer = 0;
    }
Exemplo n.º 2
0
    public ZombieFactory(ZombieConfig config, MapData mapData, ZombiePool zombiePool,
                         ZombieAnimationQueue.Factory animationQueueFactory, ZombieCollection collection)
    {
        _animationQueueFactory = animationQueueFactory;
        _config     = config;
        _mapData    = mapData;
        _zombiePool = zombiePool;
        _collection = collection;

        _zombiesToSpawn = new Queue <Zombie>();
    }