This commit is contained in:
mob-sakai
2023-08-17 09:43:02 +09:00
parent 35325c8899
commit 3df190382a
33 changed files with 1596 additions and 1752 deletions

View File

@@ -1,30 +1,37 @@
using UnityEngine;
using UnityEngine.Serialization;
namespace Coffee.UIExtensions.Demo
{
public class UIParticle_Demo_UIParticleController : MonoBehaviour
{
public Transform root;
[FormerlySerializedAs("root")]
[SerializeField]
private Transform m_RootTransform;
public void UIParticle_MeshSharing(bool enabled)
public void UIParticle_MeshSharing(bool flag)
{
foreach (var uip in root.GetComponentsInChildren<UIParticle>(true))
foreach (var uip in m_RootTransform.GetComponentsInChildren<UIParticle>(true))
{
uip.meshSharing = enabled ? UIParticle.MeshSharing.Auto : UIParticle.MeshSharing.None;
uip.meshSharing = flag
? UIParticle.MeshSharing.Auto
: UIParticle.MeshSharing.None;
}
}
public void UIParticle_RandomGroup(bool enabled)
public void UIParticle_RandomGroup(bool flag)
{
foreach (var uip in root.GetComponentsInChildren<UIParticle>(true))
foreach (var uip in m_RootTransform.GetComponentsInChildren<UIParticle>(true))
{
uip.groupMaxId = enabled ? 4 : 0;
uip.groupMaxId = flag
? 4
: 0;
}
}
public void UIParticle_Scale(float scale)
{
foreach (var uip in root.GetComponentsInChildren<UIParticle>(true))
foreach (var uip in m_RootTransform.GetComponentsInChildren<UIParticle>(true))
{
uip.scale = scale;
}