using System.Collections; using System.Collections.Generic; using UnityEngine; public class scene_main_init : MonoBehaviour { [Header("作为父节点的canvas")] public Canvas _canvas; [Header("需要生成的预制体")] public GameObject panelPrefab; // Start is called before the first frame update void Start() { GameObject newPanel= GameObject.Instantiate(panelPrefab,_canvas.transform); //newPanel.transform.localScale = new Vector3(0.5f, 0.5f, 0.5f); } }