12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- using SC.XR.Unity.Module_InputSystem;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.EventSystems;
- using XRTool.Util;
- public class CreateModel : MonoBehaviour, IPointerUpHandler, IPointerDownHandler, IPointerClickHandler
- {
- // Start is called before the first frame update
- void Start()
- {
-
- }
- // Update is called once per frame
- void Update()
- {
-
- }
- private GameObject model;
- public void OnPointerUp(PointerEventData eventData)
- {
- }
- public void OnPointerDown(PointerEventData eventData)
- {
- }
- public void OnPointerClick(PointerEventData eventData)
- {
- model = GameObject.Instantiate(this.gameObject);
- model.GetComponent<CreateModel>().enabled = false;
- model.GetComponent<XBoundingBox>().enabled = false;
- model.GetComponent<XDragComponent>().enabled = false;
- model.GetComponent<CreateModel>().enabled = false;
- Debug.Log("创建物体");
- model.transform.localScale = new Vector3(0, 0, 0);
- model.AddComponent<ModelManager>();
- model.transform.parent = GSXRManager.Instance.head;
- }
- }
|