private void WithMaterial_InChilds(Action <Material> action) { TargetGameObject?.GetComponentsInChildren <ParticleSystemRenderer>(true).Do(psr => { var mat = psr.material; if (mat) { action.Invoke(mat); } }); }
private void MR_SetMaterial_InChilds(int index, Material material) { foreach (var cmp in TargetGameObject.GetComponentsInChildren <MeshRenderer>(true)) { var materials = cmp.materials; if (index >= materials.Length) { continue; } materials[index] = material; cmp.materials = materials; } }
public void SetMaterial_InChilds(Material value) { TargetGameObject?.GetComponentsInChildren <ParticleSystemRenderer>(true).Do(psr => psr.material = value); }
private void WithParticles_InChilds(Action <ParticleSystem.MainModule> action) { TargetGameObject?.GetComponentsInChildren <ParticleSystem>().Do(ps => action.Invoke(ps.main)); }