Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using UnityEngine.Events;
- public class PlatformTrigger : MonoBehaviour
- {
- public UnityEventGameObject OnPlayerStayOnPlatform;
- private void OnTriggerStay2D(Collider2D other)
- {
- Debug.Log("OnTriggerStay2D",other);
- bool isPlayer = other.CompareTag("Player");
- Debug.Log($"isPlayer : {isPlayer}");
- if (isPlayer)
- OnPlayerStayOnPlatform.Invoke(gameObject);
- }
- }
- [System.Serializable]
- public class UnityEventGameObject : UnityEvent<GameObject> { }
Add Comment
Please, Sign In to add comment