Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using UnityEngine.Events;
- public class PhysicButton : MonoBehaviour {
- public bool interactable = true;
- public bool loop = true;
- public UnityEvent OnClick;
- private void OnMouseDown() {
- if (interactable) {
- interactable = loop;
- OnClick.Invoke();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement