ball 项目提交
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class EngineEventSystem : MonoBehaviour
|
||||
{
|
||||
public static EngineEventSystem 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()
|
||||
{
|
||||
LoadKit.Instance.LoadGameObjectAndClone("Prefab", "EngineEventSystem", eventObj1 =>
|
||||
{
|
||||
eventObj = eventObj1;
|
||||
eventObj.transform.SetParent(transform, false);
|
||||
eventSystem = eventObj.GetComponent<EventSystem>();
|
||||
inputModule = eventObj.GetComponent<StandaloneInputModule>();
|
||||
AppObjConst.EngineEventSystemGo = Instance.eventObj.transform.parent.gameObject;
|
||||
AppObjConst.EngineEventSystemGo.name = AppObjConst.EngineEventSystemGoName;
|
||||
UIManager.Instance.SetEventSystemGo(eventObj);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user