Beispiel #1
0
    void OnTriggerStay(Collider collider)
    {
        if (collider.GetComponentInChildren <DamageOnTouch>())
        {
            return;
        }

        Targetable targetable = collider.gameObject.GetComponent <Targetable>();

        if (collider.gameObject.tag != "Player")
        {
            if (!isShuriken)
            {
                if (targetable)
                {
                    targetable.DealDamage(Damage, transform.position, ImpactForce);
                }
            }
        }
        else
        {
            if (targetable)
            {
                targetable.DealDamage(Damage, transform.position, ImpactForce);
            }
        }
        Rigidbody rb = collider.gameObject.GetComponent <Rigidbody>();

        if (rb)
        {
            rb.velocity *= SlowAmount;
        }
    }
Beispiel #2
0
    void OnTriggerEnter(Collider collider)
    {
        if ((!_returning && !_throwing) || collider.GetComponent <PlayerController> ())
        {
            return;
        }
        Targetable targetable = collider.GetComponent <Targetable> ();

        if (targetable)
        {
            targetable.DealDamage(Damage, transform.position, Damage * _forceAmplifier);
//			Debug.Log("health: " + targetable.Health);
        }
    }