📜  如果触摸精灵 c# 代码示例,如何使角色重生

📅  最后修改于: 2022-03-11 14:48:46.498000             🧑  作者: Mango

代码示例1
//in your character create a new script then put this

 using UnityEngine;
 using System.Collections;
 
 public class respawn : MonoBehaviour {
     public float threshold;
 
     void FixedUpdate () {
         if (transform.position.y < threshold)
             transform.position = new Vector3(0, 0, 0);
     }
 }