You've already forked taptap2024_GJ_chidouren
init
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Coffee.UIExtensions.Demo
|
||||
{
|
||||
public class CopyItemOnStart : MonoBehaviour
|
||||
{
|
||||
public GameObject origin;
|
||||
public int count;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
if (!origin) return;
|
||||
origin.SetActive(false);
|
||||
|
||||
var parent = origin.transform.parent;
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
var go = Instantiate(origin, parent, false);
|
||||
go.name = string.Format("{0} {1}", origin.name, i + 1);
|
||||
go.hideFlags = HideFlags.DontSave;
|
||||
go.SetActive(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user