profile.script 361 B

1234567891011121314
  1. function init(self)
  2. msg.post(".", "acquire_input_focus") -- <1>
  3. end
  4. function on_input(self, action_id, action)
  5. if action_id == hash("touch") and action.pressed then
  6. msg.post("@system:", "toggle_profile") -- <2>
  7. end
  8. end
  9. --[[
  10. 1. Make sure this game object's script component gets input from the engine.
  11. 2. If user clicks, toggle profiling information.
  12. --]]