Files
BingoGrassland/Assets/BingoSun/Scripts/Ossa/PinPon.cs
T

42 lines
1.3 KiB
C#
Raw Normal View History

2026-04-20 13:49:36 +08:00
using UnityEngine;
using BingoBrain.Asset;
using UnityEngine.EventSystems;
namespace BingoBrain.Core
{
public class PinPon : MonoBehaviour
{
public static PinPon Instance { get; private set; }
[HideInInspector] public GameObject eventObj;
[HideInInspector] public EventSystem eventSystem;
[HideInInspector] public StandaloneInputModule inputModule;
private void Awake()
{
Instance = this;
DontDestroyOnLoad(gameObject);
Init();
}
private void OnDestroy()
{
Instance = null;
}
private void Init()
{
BetKit.Instance.LoadGameObjectAndClone("Prefab", "EngineEventSystem", eventObj1 =>
{
eventObj = eventObj1;
eventObj.transform.SetParent(transform, false);
eventSystem = eventObj.GetComponent<EventSystem>();
inputModule = eventObj.GetComponent<StandaloneInputModule>();
OCConst.EngineEventSystemGo = PinPon.Instance.eventObj.transform.parent.gameObject;
OCConst.EngineEventSystemGo.name = OCConst.EngineEventSystemGoName;
UI.Instance.SetEventSystemGo(eventObj);
});
}
}
}