_TheStrongestSnail/TheStrongestSnail/Assets/Scripts/Scene_main/scene_main_init.cs
2024-11-27 11:25:42 +08:00

20 lines
503 B
C#

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);
}
}