12345678910111213141516171819202122232425262728293031 |
- using SC.XR.Unity;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class EditorModelManager : SingletonMono<EditorModelManager>
- {
- public string modelId;
- private GameObject btn;
- public void SetModelEditor( Vector3 pos, Vector3 eul,bool state , string modelId )
- {
- if (state)
- this.modelId = modelId;
- transform.position = pos;
- transform.LookAt(OpenXRCamera.Instance.head);
- transform.eulerAngles = new Vector3(0, transform.eulerAngles.y, 0);
- if (btn == null)
- btn = transform.GetChild(0).gameObject;
- btn.SetActive(state);
- }
- public void DelModelOnClick()
- {
- if (modelId != "")
- UIModelManager.Instance.DesModel(modelId);
- modelId = "";
- btn.SetActive(false);
- }
- }
|