コード例 #1
0
    public void Setup(LocalBlackboard localBlackboard)
    {
        _localBlackboard = localBlackboard;

        if (TryGetComponent(out TypeInflictor temp))
        {
            _typeInflictor = temp;
        }
        if (TryGetComponent(out Spawn temp2))
        {
            _spawn = temp2;
            _spawn.Setup(_localBlackboard);
        }
        if (TryGetComponent(out PushInflictor temp3))
        {
            _pushInflictor = temp3;
        }
        if (TryGetComponent(out Collection temp4))
        {
            _collection = temp4;
            _collection.Setup(_localBlackboard);
        }
        if (TryGetComponent(out StunInflictor temp5))
        {
            _stunInflictor = temp5;
        }
        if (TryGetComponent(out AttackColliderController temp6))
        {
            _attackCollider = temp6;
            _attackCollider.Setup(_localBlackboard, this);
        }
        if (TryGetComponent(out DestroyAfterTime temp7))
        {
            _destroyAfterTime = temp7;
            _destroyAfterTime.Setup(_spawn);
        }
        if (TryGetComponent(out DoDamage temp8))
        {
            _doDamage = temp8;
        }
        if (TryGetComponent(out Heal temp9))
        {
            _heal = temp9;
        }
        if (TryGetComponent(out Recharge temp10))
        {
            _recharge = temp10;
            _recharge.Setup(this);
        }
        if (TryGetComponent(out IndieAttackPlayer temp11))
        {
            _indieAttackPlayer = temp11;
            _indieAttackPlayer.Setup(this);
        }
        if (TryGetComponent(out AttackFXPlayer temp12))
        {
            _attackFXPlayer = temp12;
        }
        if (TryGetComponent(out DestroyOnHit temp13))
        {
            _destroyOnHit = temp13;
        }
        if (TryGetComponent(out RecievePhysicsPush temp14))
        {
            temp14.Setup(_localBlackboard.currentTarget.transform);
        }
    }