Exemple #1
0
    public void Awake()
    {
        // Setup coroutine service
        CoroutineService coroutineService = new CoroutineService();

        _coroutineServiceRunner.SetCoroutineService(coroutineService);

        // Setup DOT component
        _damageOverTime.Setup(coroutineService);

        // Start dealing damage
        _damageOverTime.DoDamage(_player, 20, 5);
    }
Exemple #2
0
    public void Setup(LocalBlackboard localBlackboard, AttackRoot attackRoot)
    {
        _localBlackboard = localBlackboard;
        myCollider       = _localBlackboard.healthCollider;
        _attackRoot      = attackRoot;

        if (hitBox.TryGetComponent(out TriggerSensor temp))
        {
            _triggerSensor = temp;
            _triggerSensor.Setup(this);
        }
        else
        {
            Debug.LogError(gameObject.name + " is missing a trigger sensor on it's hitbox. Add one or suffer the consequences O_O! ...x_x");
        }

        if (TryGetComponent(out DamageOverTime temp2))
        {
            _damageOverTime = temp2;
            _damageOverTime.Setup(_attackRoot);
        }
    }