Cleanup runtime-specific

This commit is contained in:
Sinai
2021-04-07 17:20:09 +10:00
parent c2d9b9b59e
commit 2cc403ad17
29 changed files with 362 additions and 288 deletions

View File

@ -189,4 +189,4 @@ namespace UnityExplorer.Core.Input
}
}
}
}
}

View File

@ -18,4 +18,4 @@ namespace UnityExplorer.Core.Input
void AddUIInputModule();
void ActivateModule();
}
}
}

View File

@ -6,9 +6,6 @@ using UnityEngine.EventSystems;
using UnityExplorer.UI;
using System.Collections.Generic;
using UnityExplorer.UI.Inspectors;
#if CPP
using UnhollowerRuntimeLib;
#endif
namespace UnityExplorer.Core.Input
{
@ -152,13 +149,9 @@ namespace UnityExplorer.Core.Input
}
var assetType = ReflectionUtility.GetTypeByName("UnityEngine.InputSystem.InputActionAsset");
#if CPP
m_newInputModule = UIManager.CanvasRoot.AddComponent(Il2CppType.From(TInputSystemUIInputModule)).TryCast<BaseInputModule>();
var asset = ScriptableObject.CreateInstance(Il2CppType.From(assetType));
#else
m_newInputModule = (BaseInputModule)UIManager.CanvasRoot.AddComponent(TInputSystemUIInputModule);
var asset = ScriptableObject.CreateInstance(assetType);
#endif
m_newInputModule = RuntimeProvider.Instance.AddComponent<BaseInputModule>(UIManager.CanvasRoot, TInputSystemUIInputModule);
var asset = RuntimeProvider.Instance.CreateScriptable(assetType);
inputExtensions = ReflectionUtility.GetTypeByName("UnityEngine.InputSystem.InputActionSetupExtensions");
var addMap = inputExtensions.GetMethod("AddActionMap", new Type[] { assetType, typeof(string) });
@ -205,4 +198,4 @@ namespace UnityExplorer.Core.Input
UI_Enable.Invoke(UI_ActionMap, new object[0]);
}
}
}
}

View File

@ -54,4 +54,4 @@ namespace UnityExplorer.Core.Input
m_inputModule.ActivateModule();
}
}
}
}

View File

@ -19,4 +19,4 @@ namespace UnityExplorer.Core.Input
public void ActivateModule() { }
public void AddUIInputModule() { }
}
}
}