Init
This commit is contained in:
32
Assets/ThirdParty/DestroyIt/Scripts/Runtime/Extensions/GizmoExtensions.cs
vendored
Normal file
32
Assets/ThirdParty/DestroyIt/Scripts/Runtime/Extensions/GizmoExtensions.cs
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace DestroyIt
|
||||
{
|
||||
public static class GizmoExtensions
|
||||
{
|
||||
/// <summary>Creates an editor-visible Gizmo for each damage effect, showing where they will play.</summary>
|
||||
public static void DrawGizmos(this List<DamageEffect> damageEffects, Transform transform)
|
||||
{
|
||||
if (damageEffects == null) return;
|
||||
|
||||
foreach (DamageEffect effect in damageEffects)
|
||||
{
|
||||
if (effect == null) continue;
|
||||
Gizmos.color = Color.cyan;
|
||||
Gizmos.DrawWireCube(transform.TransformPoint(effect.Offset), new Vector3(0.1f, 0.1f, 0.1f));
|
||||
Quaternion rotatedVector = transform.rotation * Quaternion.Euler(effect.Rotation);
|
||||
Gizmos.DrawRay(transform.TransformPoint(effect.Offset), rotatedVector * Vector3.forward * .5f);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Creates an editor-visible Gizmo for each CenterPointOverride for a Fallback Particle Effect.</summary>
|
||||
public static void DrawGizmos(this Vector3 centerPointOverride, Transform transform)
|
||||
{
|
||||
if (centerPointOverride == Vector3.zero) return;
|
||||
|
||||
Gizmos.color = Color.magenta;
|
||||
Gizmos.DrawWireSphere(transform.TransformPoint(centerPointOverride), 0.1f);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user