mirror of
https://github.com/BlackMATov/unity-iso-tools.git
synced 2025-12-16 14:09:00 +07:00
42 lines
977 B
C#
42 lines
977 B
C#
using UnityEngine;
|
|
using HutongGames.PlayMaker;
|
|
|
|
namespace IsoTools.PlayMaker.Internal {
|
|
public class IsoFSMEvents : MonoBehaviour {
|
|
IsoComponentAction<IsoObject> _action = null;
|
|
bool _started = false;
|
|
|
|
public void Init(IsoComponentAction<IsoObject> action) {
|
|
_action = action;
|
|
}
|
|
|
|
void Start() {
|
|
Debug.Assert(_action != null, this);
|
|
_started = true;
|
|
}
|
|
|
|
void OnIsoTriggerEnter(IsoCollider collider) {
|
|
if ( _action != null && _started ) {
|
|
_action.DoIsoTriggerEnter(collider);
|
|
}
|
|
}
|
|
|
|
void OnIsoTriggerExit(IsoCollider collider) {
|
|
if ( _action != null && _started ) {
|
|
_action.DoIsoTriggerExit(collider);
|
|
}
|
|
}
|
|
|
|
void OnIsoCollisionEnter(IsoCollision collision) {
|
|
if ( _action != null && _started ) {
|
|
_action.DoIsoCollisionEnter(collision);
|
|
}
|
|
}
|
|
|
|
void OnIsoCollisionExit(IsoCollision collision) {
|
|
if ( _action != null && _started ) {
|
|
_action.DoIsoCollisionExit(collision);
|
|
}
|
|
}
|
|
}
|
|
} |