Ejemplo n.º 1
0
 // Use this for initialization
 void Start()
 {
     anim       = GetComponent <Animator>();
     plControl  = GetComponent <PlayerControl>();
     plStats    = GetComponent <Stats>();
     doDamage   = GetComponentInChildren <DoDamage>();
     kickDamage = GetComponentInChildren <kickAttack>();
 }
Ejemplo n.º 2
0
 void Start()
 {
     rb                 = GetComponent <Rigidbody2D>();
     animator           = GetComponent <Animator>();
     doDamage           = GetComponent <DoDamage>();
     enemyHealthManager = GetComponent <EnemyHealthManager>();
     currentHealth      = enemyHealthManager.currentHP;
     leftX              = transform.position.x - (range / 2);
     rightX             = transform.position.x + (range / 2);
 }
Ejemplo n.º 3
0
    private void OnTriggerEnter2D(Collider2D other)
    {
        CharacterLife character = other.GetComponent <CharacterLife>();

        if (character != null)
        {
            character.TakeDamage(damage);
            if (destroyByContact)
            {
                Destroy(gameObject);
            }
        }

        DoDamage shot = other.GetComponent <DoDamage>();

        if (shot != null && destroyShots)
        {
            Destroy(other.gameObject);
        }
    }
    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);
        }
    }