Exemplo n.º 1
0
    protected virtual void DamageObject(GameObject obj, RaycastHit?hitInfo)
    {
        // TODO: Expose the rest of this.
        var direction = (obj.transform.position - _owner.transform.position).normalized;

        Damage.ApplyPointDamage(obj, _baseDamage, _owner, direction, _knockbackForce, hitInfo);
    }
Exemplo n.º 2
0
    private void Raycast()
    {
        var        direction = (transform.position - _previousPosition).normalized;
        var        distance  = Vector3.Distance(transform.position, _previousPosition);
        RaycastHit hitInfo;

        if (Physics.Raycast(_previousPosition, direction, out hitInfo, distance, _layerMask, QueryTriggerInteraction.Collide))
        {
            Destroy(this.gameObject);
            Damage.ApplyPointDamage(hitInfo.collider.gameObject, 2, Owner, transform.forward, 15, hitInfo);
        }
    }