No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

InputModuleComponentFactory.cs 1.0KB

1234567891011121314151617181920212223242526272829
  1. using UnityEngine;
  2. using UnityEngine.EventSystems;
  3. namespace UnityEditor.EventSystems
  4. {
  5. public static class InputModuleComponentFactory
  6. {
  7. public delegate BaseInputModule AddInputModuleComponentDelegate(GameObject gameObject);
  8. public static void SetInputModuleComponentOverride(AddInputModuleComponentDelegate addInputModuleComponentOverride)
  9. {
  10. m_AddInputModuleComponentOverride = addInputModuleComponentOverride;
  11. }
  12. private static AddInputModuleComponentDelegate m_AddInputModuleComponentOverride = null;
  13. public static BaseInputModule AddInputModule(GameObject gameObject)
  14. {
  15. return m_AddInputModuleComponentOverride != null ?
  16. m_AddInputModuleComponentOverride(gameObject) :
  17. AddStandaloneInputModuleComponent(gameObject);
  18. }
  19. private static BaseInputModule AddStandaloneInputModuleComponent(GameObject gameObject)
  20. {
  21. return ObjectFactory.AddComponent<StandaloneInputModule>(gameObject);
  22. }
  23. }
  24. }