当前位置: 首页>>代码示例>>C#>>正文


C# ParticleSystem.GetComponentsInChildren方法代码示例

本文整理汇总了C#中UnityEngine.ParticleSystem.GetComponentsInChildren方法的典型用法代码示例。如果您正苦于以下问题:C# ParticleSystem.GetComponentsInChildren方法的具体用法?C# ParticleSystem.GetComponentsInChildren怎么用?C# ParticleSystem.GetComponentsInChildren使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UnityEngine.ParticleSystem的用法示例。


在下文中一共展示了ParticleSystem.GetComponentsInChildren方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Scale

 public static void Scale(ParticleSystem particles, float scale, bool includeChildren = true, ParticleScalerOptions options = null) {
     ScaleSystem(particles, scale, false, options);
     if (includeChildren) {
         var children = particles.GetComponentsInChildren<ParticleSystem>(includeInactive: true);   // my includeInactive addition
         for (var i = children.Length; i-- > 0;) {
             if (children[i] == particles) { continue; }
             ScaleSystem(children[i], scale, true, options);
         }
     }
 }
开发者ID:Maxii,项目名称:CodeEnv.Master,代码行数:10,代码来源:ParticleScaler.cs

示例2: Initialize

        public void Initialize(Diggable diggable)
        {
            this.diggable = diggable;

            if (diggable.DigFX != null) {
                parentFX = Instantiate(diggable.DigFX).GetComponent<ParticleSystem>();
                parentFX.transform.parent = transform;
                parentFX.enableEmission = false;
                FXs = parentFX.GetComponentsInChildren<ParticleSystem>();
                initialized = true;
            }
        }
开发者ID:Dracir,项目名称:Final-bablititi,代码行数:12,代码来源:DiggableFxManager.cs

示例3: ScaleByTransform

        public static void ScaleByTransform(ParticleSystem particles, float scale, bool includeChildren = true) {
            var mainModule = particles.main;  // particles.scalingMode = ParticleSystemScalingMode.Local; Deprecated in Unity 5.5

            mainModule.scalingMode = ParticleSystemScalingMode.Local;
            particles.transform.localScale = particles.transform.localScale * scale;
            mainModule.gravityModifierMultiplier *= scale;    //particles.gravityModifier *= scale; Deprecated in Unity 5.5
            if (includeChildren) {
                var children = particles.GetComponentsInChildren<ParticleSystem>(includeInactive: true);    // my includeInactive addition
                for (var i = children.Length; i-- > 0;) {
                    if (children[i] == particles) {
                        continue;
                    }
                    var childMainModule = children[i].main;
                    childMainModule.scalingMode = ParticleSystemScalingMode.Local;   //children[i].scalingMode = ParticleSystemScalingMode.Local; Deprecated in Unity 5.5
                    children[i].transform.localScale = children[i].transform.localScale * scale;
                    childMainModule.gravityModifierMultiplier *= scale; // children[i].gravityModifier *= scale; Deprecated in Unity 5.5
                }
            }
        }
开发者ID:Maxii,项目名称:CodeEnv.Master,代码行数:19,代码来源:ParticleScaler.cs


注:本文中的UnityEngine.ParticleSystem.GetComponentsInChildren方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。