37 lines
993 B
C#
37 lines
993 B
C#
using System.Collections;
|
|
using UnityEngine;
|
|
|
|
namespace Weapons.Projectiles
|
|
{
|
|
public class RainbowBullet: ProjectileBase
|
|
{
|
|
protected override void OnHitEntity(Collision col)
|
|
{
|
|
HitEffect(col);
|
|
}
|
|
|
|
protected override void OnForce()
|
|
{
|
|
|
|
}
|
|
|
|
public IEnumerator TrailDraw()
|
|
{
|
|
yield return null;
|
|
}
|
|
|
|
private void HitEffect(Collision col)
|
|
{
|
|
if (col.gameObject.layer != LayerMask.NameToLayer("Enemy"))
|
|
{
|
|
Vector3 normal = col.GetContact(0).normal;
|
|
Vector3 contactPosition = col.GetContact(0).point + normal * 0.25f;
|
|
GameObject hitEffect = NetworkPooler.Instance.PooledPlayEffect("FuturisticHitEffect", contactPosition, Quaternion.identity, 4.0f);
|
|
hitEffect.transform.up = normal;
|
|
|
|
HitEffectShadows(hitEffect);
|
|
}
|
|
PooledDestroy();
|
|
}
|
|
}
|
|
} |