CameraLocations.cs 570 B

12345678910111213141516171819202122232425262728
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. public class CameraLocations : Singleton<MonoBehaviour>
  6. {
  7. public CameraLocation[] Locations;
  8. public CameraLocation GetLocation()
  9. {
  10. foreach (var item in Locations)
  11. {
  12. if (item.ID == LocationManager.Instance.CurrentLocationID)
  13. return item;
  14. }
  15. return new CameraLocation();
  16. }
  17. }
  18. [Serializable]
  19. public struct CameraLocation
  20. {
  21. public string ID;
  22. public float zoom;
  23. public Vector3 position;
  24. }