KPS.cs 417 B

12345678910111213141516171819202122232425
  1. using UnityEngine;
  2. using ToneTuneToolkit.Other;
  3. namespace Examples
  4. {
  5. /// <summary>
  6. ///
  7. /// </summary>
  8. public class KPS : MonoBehaviour
  9. {
  10. private void Start()
  11. {
  12. KeyPressSimulator.KeyAction(65, 0);
  13. KeyPressSimulator.KeyAction(65, 2);
  14. }
  15. private void Update()
  16. {
  17. if (Input.GetKeyDown(KeyCode.A))
  18. {
  19. Debug.Log("模拟物理按键A成功");
  20. }
  21. }
  22. }
  23. }