Files
Hasebe/Library/PackageCache/com.unity.ugui@88d0d51315d3/Editor/UGUI/EventSystem/InputModuleComponentFactory.cs
T
2026-09-25 00:42:08 +03:00

31 lines
1.2 KiB
C#

using UnityEngine;
using UnityEngine.EventSystems;
namespace UnityEditor.EventSystems
{
public static class InputModuleComponentFactory
{
public delegate BaseInputModule AddInputModuleComponentDelegate(GameObject gameObject);
public static void SetInputModuleComponentOverride(AddInputModuleComponentDelegate addInputModuleComponentOverride)
{
m_AddInputModuleComponentOverride = addInputModuleComponentOverride;
}
private static AddInputModuleComponentDelegate m_AddInputModuleComponentOverride = null;
public static AddInputModuleComponentDelegate InputModuleComponentOverride { get { return m_AddInputModuleComponentOverride; } }
public static BaseInputModule AddInputModule(GameObject gameObject)
{
return m_AddInputModuleComponentOverride != null ?
m_AddInputModuleComponentOverride(gameObject) :
AddStandaloneInputModuleComponent(gameObject);
}
private static BaseInputModule AddStandaloneInputModuleComponent(GameObject gameObject)
{
return ObjectFactory.AddComponent<StandaloneInputModule>(gameObject);
}
}
}