Пример #1
0
 private void WithMaterial_InChilds(Action <Material> action)
 {
     TargetGameObject?.GetComponentsInChildren <ParticleSystemRenderer>(true).Do(psr =>
     {
         var mat = psr.material;
         if (mat)
         {
             action.Invoke(mat);
         }
     });
 }
Пример #2
0
        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;
            }
        }
Пример #3
0
 public void SetMaterial_InChilds(Material value)
 {
     TargetGameObject?.GetComponentsInChildren <ParticleSystemRenderer>(true).Do(psr => psr.material = value);
 }
Пример #4
0
 private void WithParticles_InChilds(Action <ParticleSystem.MainModule> action)
 {
     TargetGameObject?.GetComponentsInChildren <ParticleSystem>().Do(ps => action.Invoke(ps.main));
 }