CameraToPose.cs 854 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using DG.Tweening;
  5. using static GameManager;
  6. using UnityEngine.UI;
  7. public class CameraToPose : MonoBehaviour
  8. {
  9. public GameObjectType type;
  10. public TapName tapName;
  11. public Camera cam;
  12. public GameObject go;
  13. public void moveTo()
  14. {
  15. if(go)
  16. {
  17. if(cam.transform.position!=go.transform.position)
  18. cam.transform.DOMove(go.transform.position,1f);
  19. cam.transform.rotation = go.transform.rotation;
  20. }
  21. }
  22. public void toggleWindowclick(bool b)
  23. {
  24. if(b)
  25. {
  26. GameManager.Instance.showW(type,tapName);
  27. moveTo();
  28. }
  29. }
  30. public void init(GameObjectType type,TapName tapName)
  31. {
  32. this.type =type;
  33. this.tapName =tapName;
  34. }
  35. }