Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.Events;
- using UnityEngine.EventSystems;
- public class MagicCreate :MonoBehaviour
- {
- public UnityEvent OnMagic;
- public static MagicCreate instance;
- private void Awake()
- {
- instance = this;
- }
- public void Update()
- {
- if (OnMagic != null && !EventSystem.current.IsPointerOverGameObject() && Input.GetMouseButton(0))
- {
- OnMagic.Invoke();
- OnMagic.RemoveAllListeners();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement