You've already forked ParticleEffectForUGUI
mirror of
https://github.com/mob-sakai/ParticleEffectForUGUI.git
synced 2026-05-14 20:20:06 +00:00
demo: update demos
This commit is contained in:
25
Samples~/Demo/Scripts/CopyItemOnStart.cs
Normal file
25
Samples~/Demo/Scripts/CopyItemOnStart.cs
Normal file
@@ -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