Characters

This commit is contained in:
2025-10-05 18:21:16 +02:00
parent b52b3aa830
commit 174a399ee7
77 changed files with 14406 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
using UnityEngine;
namespace MegaKoop.Game.WeaponSystem
{
public class WeaponView : MonoBehaviour
{
[SerializeField] private Transform[] muzzles;
public Transform[] Muzzles => muzzles;
public Transform GetMuzzle(int index = 0)
{
if (muzzles == null || muzzles.Length == 0)
{
return transform;
}
index = Mathf.Clamp(index, 0, muzzles.Length - 1);
return muzzles[index] == null ? transform : muzzles[index];
}
#if UNITY_EDITOR
private void OnDrawGizmosSelected()
{
if (muzzles == null)
{
return;
}
Gizmos.color = Color.cyan;
foreach (Transform muzzle in muzzles)
{
if (muzzle == null)
{
continue;
}
Gizmos.DrawLine(muzzle.position, muzzle.position + muzzle.forward * 0.5f);
}
}
#endif
}
}