MainLogic.cs 655 B

1234567891011121314151617181920212223242526272829303132
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class MainLogic : MonoBehaviour
  5. {
  6. public FlyLogic fl;
  7. public RotateLogic rl;
  8. // Start is called before the first frame update
  9. void Start()
  10. {
  11. Application.targetFrameRate = 60;
  12. }
  13. // Update is called once per frame
  14. void Update()
  15. {
  16. if (Input.GetMouseButtonDown(0))
  17. {
  18. }
  19. if (Input.GetKeyDown(KeyCode.W))
  20. {
  21. fl.Fly();
  22. rl.Turn(1);
  23. } else if (Input.GetKeyDown(KeyCode.S))
  24. {
  25. fl.Land();
  26. rl.Turn(-1);
  27. }
  28. }
  29. }