Пример #1
0
    private void OnTriggerEnter(Collider other)
    {
        if (ProjectileMask == (ProjectileMask | (1 << other.gameObject.layer)))
        {
            if (Hand.Velocity.magnitude > _minimumVelocity)
            {
                Fireball fireBall = other.gameObject.GetComponent <Fireball>();
                if (fireBall.Active)
                {
                    Vector3 force = Hand.Velocity * ForcePercentageCharged * _forcePower;

                    if (fireBall.Armed)
                    {
                        fireBall.ApplyForce(force);
                    }
                    else
                    {
                        fireBall.Launch(force);
                    }
                }
            }
        }
    }