Files
HOILAI-Galgame-Framework/Assets/HGF/Scripts/Galgame/GalManager_Choice.cs
2023-12-30 23:12:22 +08:00

35 lines
1011 B
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using UnityEngine;
namespace ScenesScripts.GalPlot
{
public class GalManager_Choice : MonoBehaviour
{
private GameObject GameObject_Choice;
private void Start ()
{
GameObject_Choice = Resources.Load<GameObject>("Common/Gameobject/Galgame/Button-Choice");
}
[SerializeField]
public void CreatNewChoice (string JumpID, string Title)
{
var _ = GameObject_Choice;
_.GetComponent<GalComponent_Choice>().Init(JumpID, Title);
Instantiate(_, this.transform);
return;
}
public void Button_Click_Choice ()
{
for (int i = 0; i < this.transform.childCount; i++)
{
//不可用DestroyImmediate
//原因DestroyImmediate是同步的如果使用则会导致每次获取的都是0无法删除
Destroy(this.transform.GetChild(i).gameObject);
}
return;
}
}
}