feat: 3D Box Area ColliderTriggerArea & GroundTriggerArea Added
This commit is contained in:
parent
8356f72d6d
commit
cee04f5da3
|
@ -0,0 +1,22 @@
|
|||
using UnityEngine;
|
||||
|
||||
namespace Syntriax.Modules.Trigger
|
||||
{
|
||||
public class BoxColliderTriggerArea : ColliderTriggerAreaBase<Collider>
|
||||
{
|
||||
protected override int TriggerCount
|
||||
=> Physics.OverlapBoxNonAlloc(transform.position, transform.localScale * .5f, nonAllocResults, transform.rotation, ColliderMask);
|
||||
|
||||
#if UNITY_EDITOR
|
||||
private void OnDrawGizmosSelected()
|
||||
{
|
||||
if (UnityEditor.EditorApplication.isPlaying)
|
||||
Gizmos.color = previousTriggerCount > 0 ? Color.green : Color.red;
|
||||
else
|
||||
Gizmos.color = TriggerCount > 0 ? Color.green : Color.red;
|
||||
|
||||
Gizmos.DrawWireCube(transform.position, transform.lossyScale);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 850a555be97ed9b4a86942b21a6a25e4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,4 @@
|
|||
namespace Syntriax.Modules.Trigger
|
||||
{
|
||||
public class BoxGroundTriggerArea : BoxColliderTriggerArea, IGroundTriggerArea { }
|
||||
}
|
Loading…
Reference in New Issue