SwitchCameraFollow.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class SwitchCameraFollow : MonoBehaviour {
  5. public ParticlePath particlePath;
  6. // Use this for initialization
  7. void Start () {
  8. }
  9. // Update is called once per frame
  10. void Update () {
  11. }
  12. private void OnGUI()
  13. {
  14. if (GUI.Button(new Rect(0, 0, 180, 30), "View Particle"))
  15. {
  16. particlePath.IsCameraFollow = false;
  17. Camera.main.transform.position = new Vector3(-36.4f, 34.1f, 8.5f);
  18. Camera.main.transform.rotation = Quaternion.Euler(35f, -264f, 0f);
  19. }
  20. if (GUI.Button(new Rect(0,40,180,30),"Follow Particle"))
  21. {
  22. particlePath.IsCameraFollow = true;
  23. }
  24. if (GUI.Button(new Rect(0, 80, 180, 30), "Follow and move to half"))
  25. {
  26. particlePath.IsCameraFollow = true;
  27. particlePath.SetCameraPosition(0.5f);
  28. }
  29. if (GUI.Button(new Rect(Screen.width - 200, 0, 150, 30), "Change To Line"))
  30. {
  31. particlePath.ChangeSegmentToLine();
  32. particlePath.Speed = 5;
  33. particlePath.CameraSpeed = 40;
  34. }
  35. if (GUI.Button(new Rect(Screen.width - 200, 40, 150, 30), "Change To Bezier"))
  36. {
  37. particlePath.ChangeSegmentToBezier();
  38. particlePath.Speed = 0.55f;
  39. particlePath.CameraSpeed = 30;
  40. }
  41. }
  42. }