ict.xunfei/Assets/ZHYscrip/positionEnter.cs

33 lines
608 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UIElements;
public class positionEnter : MonoBehaviour
{
public GameObject P;
// Start is called before the first frame update
void Start()
{
}
private void OnEnable()
{
this.transform.position = P.transform.position;
this.transform.eulerAngles = P.transform.eulerAngles;
P.SetActive(false);
}
// Update is called once per frame
void Update()
{
}
private void OnDisable()
{
P.SetActive(true);
}
}