Skip to content

Instantly share code, notes, and snippets.

@onmyway133
Last active June 21, 2018 12:58
Show Gist options
  • Save onmyway133/cf217fbf1ba04f460ff4970aafccff2f to your computer and use it in GitHub Desktop.
Save onmyway133/cf217fbf1ba04f460ff4970aafccff2f to your computer and use it in GitHub Desktop.
public class Sugar {
public GameObject makeEventSystem() {
GameObject systemEventObject = new GameObject("EventSystem");
EventSystem system = systemEventObject.AddComponent<EventSystem>();
system.sendNavigationEvents = true;
StandaloneInputModule module = systemEventObject.AddComponent<StandaloneInputModule>();
module.horizontalAxis = "Horizontal";
module.verticalAxis = "Vertical";
module.submitButton = "Submit";
module.cancelButton = "Cancel";
module.inputActionsPerSecond = 10;
module.repeatDelay = 0.5f;
module.forceModuleActive = false;
return systemEventObject;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment