Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public class ButtonClick : MonoBehaviour
- {
- public void Start()
- {
- var thisButton = GetComponent<Button>();
- var logic = GetComponent<IMagic>();
- thisButton.onClick.AddListener(() =>
- {
- if (logic != null )
- {
- MagicCreate.instance.OnMagic.RemoveAllListeners();
- MagicCreate.instance.OnMagic.AddListener(logic.MagicInstance); //() => { Debug.Log(name); })
- }
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement