using UnityEngine; using UnityEngine.Serialization; public class LgsTest : MonoBehaviour { [FormerlySerializedAs("obj")] //字段重命名之前的名字 [FormerlySerializedAs("obj1")] //字段重命名之前的名字 [SerializeField] GameObject obj3; //字段的新名字 }