SW 중심대학 OSS GIT 서버 박건태, 이승준, 고기완, 이준호 새로운 배포
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.1 KiB

4 years ago
  1. /*
  2. ------------------- Code Monkey -------------------
  3. Thank you for downloading the Code Monkey Utilities
  4. I hope you find them useful in your projects
  5. If you have any questions use the contact form
  6. Cheers!
  7. unitycodemonkey.com
  8. --------------------------------------------------
  9. */
  10. using System.Collections.Generic;
  11. using UnityEngine;
  12. namespace CodeMonkey.MonoBehaviours {
  13. /*
  14. * Easy set up for CameraFollow, it will follow the transform with zoom
  15. * */
  16. public class CameraFollowSetup : MonoBehaviour {
  17. [SerializeField] private CameraFollow cameraFollow;
  18. [SerializeField] private Transform followTransform;
  19. [SerializeField] private float zoom;
  20. private void Start() {
  21. if (followTransform == null) {
  22. Debug.LogError("followTransform is null! Intended?");
  23. cameraFollow.Setup(() => Vector3.zero, () => zoom);
  24. } else {
  25. cameraFollow.Setup(() => followTransform.position, () => zoom);
  26. }
  27. }
  28. }
  29. }