EditorModelManager.cs 834 B

12345678910111213141516171819202122232425262728293031
  1. using SC.XR.Unity;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. public class EditorModelManager : SingletonMono<EditorModelManager>
  6. {
  7. public string modelId;
  8. private GameObject btn;
  9. public void SetModelEditor( Vector3 pos, Vector3 eul,bool state , string modelId )
  10. {
  11. if (state)
  12. this.modelId = modelId;
  13. transform.position = pos;
  14. transform.LookAt(OpenXRCamera.Instance.head);
  15. transform.eulerAngles = new Vector3(0, transform.eulerAngles.y, 0);
  16. if (btn == null)
  17. btn = transform.GetChild(0).gameObject;
  18. btn.SetActive(state);
  19. }
  20. public void DelModelOnClick()
  21. {
  22. if (modelId != "")
  23. UIModelManager.Instance.DesModel(modelId);
  24. modelId = "";
  25. btn.SetActive(false);
  26. }
  27. }