In Unity in InputManager I assigned R Button to "Restart" name.
Now that property (Restart) has another property with a key "Positive Button" and string value "R".
In the game I can show notice to user: "click R for Restart!"
But what if user will change that key in the start config window? For example from R to T button.
Now the game should display notice: "click T for Restart!"
Question: How do I get changed Positive Button value by name "Restart" via script in Runtime? Is it possible?
p.s. in Editor I can do this:
SerializedObject inputManager = new SerializedObject(AssetDatabase.LoadAllAssetsAtPath("ProjectSettings/InputManager.asset")[0]);
SerializedProperty axisArray = inputManager.FindProperty("m_Axes");
for (int i = 0; i < axisArray.arraySize; ++i) {
var axis = axisArray.GetArrayElementAtIndex(i);
var axisName = axis.FindPropertyRelative("m_Name").stringValue;
if (axisName == "Restart") {
restartButtonValue = axis.FindPropertyRelative("positiveButton").stringValue;
break;
}
}
But it allows to use it only in the Editor. Because it uses UnityEditor.dll