오류수정
This commit is contained in:
@@ -72,7 +72,7 @@ public class ChatWindowUI : MonoBehaviour
|
||||
|
||||
void Awake()
|
||||
{
|
||||
EnsureEventSystem();
|
||||
ChatUiBuilder.EnsureEventSystem();
|
||||
Build();
|
||||
panel.gameObject.SetActive(false);
|
||||
}
|
||||
@@ -336,37 +336,6 @@ IEnumerator ScrollToBottomNextFrame()
|
||||
|
||||
// ------------------------------------------------------------------ 계층 만들기
|
||||
|
||||
/// <summary>
|
||||
/// 씬에 EventSystem 이 없으면 만든다.
|
||||
///
|
||||
/// Active Input Handling 이 신규 Input System 전용이므로 모듈은
|
||||
/// InputSystemUIInputModule 이어야 한다. StandaloneInputModule 은 레거시
|
||||
/// UnityEngine.Input 을 쓰기 때문에 이 설정에서 예외를 던진다.
|
||||
/// </summary>
|
||||
static void EnsureEventSystem()
|
||||
{
|
||||
var existing = FindFirstObjectByType<EventSystem>();
|
||||
if (existing == null)
|
||||
{
|
||||
var go = new GameObject("EventSystem");
|
||||
existing = go.AddComponent<EventSystem>();
|
||||
var module = go.AddComponent<InputSystemUIInputModule>();
|
||||
// 런타임에 붙이면 액션 에셋이 비어 있어 아무 입력도 받지 못한다.
|
||||
if (module.actionsAsset == null) module.AssignDefaultActions();
|
||||
}
|
||||
|
||||
// InputField 가 IME 상태를 물을 때 레거시 Input 으로 새지 않게 막는다.
|
||||
// BaseInputModule 은 BaseInput 을 "상속한" 컴포넌트를 기본값으로 고르지 않으므로
|
||||
// inputOverride 에 직접 넣어야 한다.
|
||||
var baseModule = existing.GetComponent<BaseInputModule>();
|
||||
if (baseModule != null && baseModule.inputOverride == null)
|
||||
{
|
||||
var safeInput = existing.GetComponent<SafeBaseInput>();
|
||||
if (safeInput == null) safeInput = existing.gameObject.AddComponent<SafeBaseInput>();
|
||||
baseModule.inputOverride = safeInput;
|
||||
}
|
||||
}
|
||||
|
||||
void Build()
|
||||
{
|
||||
var canvasGo = new GameObject("ChatCanvas", typeof(Canvas), typeof(CanvasScaler), typeof(GraphicRaycaster));
|
||||
|
||||
Reference in New Issue
Block a user