Removed Collider Check

This commit is contained in:
Syntriax 2022-11-14 12:39:20 +03:00
parent f099d7311b
commit 4e9fe6cbfb
12 changed files with 0 additions and 124 deletions

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 115027fb4693d6247bd07cab06d81091
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,25 +0,0 @@
using UnityEngine;
namespace Syntriax.Modules.Movement.ColliderTrigger
{
public class Box2DColliderTrigger : Trigger, IColliderTrigger
{
private Collider2D[] results = new Collider2D[8];
public LayerMask ColliderMask { get => colliderMask; set => colliderMask = value; }
[SerializeField] private LayerMask colliderMask = 0;
protected void FixedUpdate()
=> IsTrigerred = Physics2D.OverlapBoxNonAlloc(transform.position, transform.localScale, 0, results, ColliderMask) > 0;
#if UNITY_EDITOR
private void OnDrawGizmosSelected()
{
Gizmos.color = IsTrigerred ? Color.green : Color.red;
Gizmos.DrawWireCube(transform.position, transform.lossyScale);
}
#endif
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 20a6baf9a256917448a4d7ad09d0c51a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 8747cc51a59e7a14fae4687c7136d15b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,4 +0,0 @@
namespace Syntriax.Modules.Movement.ColliderTrigger
{
public class Box2DGroundTrigger : Box2DColliderTrigger, IGroundTrigger { }
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 7804f3e8384c7a54482f585b4f43264a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,4 +0,0 @@
namespace Syntriax.Modules.Movement.ColliderTrigger
{
public interface IGroundTrigger : IColliderTrigger { }
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 8dc876763de82b74cb9a05685d57e841
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
namespace Syntriax.Modules.Movement.ColliderTrigger
{
public static class IColliderTriggerExtensions
{
public static bool IsTriggeredNullChecked(this IColliderTrigger colliderCheck)
=> colliderCheck == null ? true : colliderCheck.IsTrigerred;
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: d1b41d4e3ee5ce24eaef42d5c8fc8c3a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,12 +0,0 @@
using System;
using UnityEngine;
namespace Syntriax.Modules.Movement.ColliderTrigger
{
public interface IColliderTrigger
{
LayerMask ColliderMask { get; set; }
bool IsTrigerred { get; }
Action<bool> OnTriggered { get; set; }
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: e199ccade2250b646abfd859e4aa1e7a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: