Global Game Jam 2023
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.

32 lines
557 B

  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class spin : MonoBehaviour
  5. {
  6. public float turnFactor = 1f;
  7. public Transform m_camera;
  8. public float ZoomAmount = 10;
  9. private void Update()
  10. {
  11. transform.rotation = Quaternion.Euler(0f, Time.time * turnFactor, 0f);
  12. }
  13. public void Zoom()
  14. {
  15. m_camera.transform.position += m_camera.forward * ZoomAmount;
  16. }
  17. public void UnZoom()
  18. {
  19. m_camera.transform.position -= m_camera.forward * ZoomAmount;
  20. }
  21. }