diff --git a/Assets/Editor/SourceGenerator/ModuleGenerator.cs b/Assets/Editor/SourceGenerator/ModuleGenerator.cs index d2ef58f..4fc7694 100644 --- a/Assets/Editor/SourceGenerator/ModuleGenerator.cs +++ b/Assets/Editor/SourceGenerator/ModuleGenerator.cs @@ -16,7 +16,7 @@ public static class ModuleGenerator private const string INFO_PATH = "Assets/Editor/SourceGenerator/module-info.json"; #region generate scripts - internal static void WriteExtensionFile(string filePath, string nullableFilePath, PSModuleInfo module) + internal static void WriteExtensionFile(string filePath, PSModuleInfo module) { var builder = new StringBuilder(); var isSameAsPrevious = module.Properties.Any() && module.Properties.First().ReleaseVersion == module.ReleaseVersion; @@ -25,8 +25,13 @@ internal static void WriteExtensionFile(string filePath, string nullableFilePath $@"using System; using System.Runtime.CompilerServices; using UnityEngine; + using static UnityEngine.ParticleSystem; +#if UNITY_2020_2_OR_NEWER +using System.Diagnostics.CodeAnalysis; +#endif + namespace OUCC.FluentParticleSystem {{ public static class {module.Type}Extension @@ -36,7 +41,18 @@ public static class {module.Type}Extension /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem Edit{module.PropertyName.c2p()}(this ParticleSystem particleSystem, Action<{module.Type}> moduleEditor) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem Edit{module.PropertyName.c2p()}( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Action<{module.Type}> moduleEditor) {{ Debug.Assert(particleSystem != null, ""particleSystem cannot be null""); Debug.Assert(moduleEditor != null, ""moduleEditor cannot be null""); @@ -61,7 +77,14 @@ public static class {module.Type}Extension /// Assign a value to /// {obsolete} [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem Set{module.PropertyName.c2p()}{property.PropertyName.c2p()}(this ParticleSystem particleSystem, {property.Type} {property.PropertyName.p2c()}) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem Set{module.PropertyName.c2p()}{property.PropertyName.c2p()}( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, {property.Type} {property.PropertyName.p2c()}) {{ Debug.Assert(particleSystem != null, ""particleSystem cannot be null""); var module = particleSystem.{module.PropertyName}; @@ -73,7 +96,18 @@ public static class {module.Type}Extension /// Edit /// {obsolete} [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem Set{module.PropertyName.c2p()}{property.PropertyName.c2p()}(this ParticleSystem particleSystem, Func<{property.Type}, {property.Type}> {property.PropertyName.p2c()}Changer) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem Set{module.PropertyName.c2p()}{property.PropertyName.c2p()}( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func<{property.Type}, {property.Type}> {property.PropertyName.p2c()}Changer) {{ Debug.Assert(particleSystem != null, ""particleSystem cannot be null""); Debug.Assert({property.PropertyName.p2c()}Changer != null, ""{property.PropertyName.p2c()}Changer cannot be null""); @@ -96,7 +130,11 @@ public static class {module.Type}Extension /// Edit /// {obsolete} [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static {module.Type} Set{property.PropertyName.c2p()}(this {module.Type} module, Func<{property.Type}, {property.Type}> {property.PropertyName.p2c()}Changer) + public static {module.Type} Set{property.PropertyName.c2p()}(this {module.Type} module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func<{property.Type}, {property.Type}> {property.PropertyName.p2c()}Changer) {{ Debug.Assert({property.PropertyName.p2c()}Changer != null, ""{property.PropertyName.p2c()}Changer cannot be null""); module.{property.PropertyName} = {property.PropertyName.p2c()}Changer(module.{property.PropertyName}); @@ -113,8 +151,6 @@ public static class {module.Type}Extension "); File.WriteAllText(filePath, builder.ToString().Replace("\r\n", "\n")); - - File.WriteAllText(nullableFilePath, "#nullable enable\n" + builder.ToString().Replace("\r\n", "\n")); ; } /// @@ -132,9 +168,8 @@ public static void GenerateWithReflection() }); foreach (var module in modules) { - var filePath = $"Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/{module.Type}Extension.cs"; - var nullableFilePath = $"Packages/FluentParticleSystem/Runtime/Nullable/Extensions/{module.Type}Extension.cs"; - WriteExtensionFile(filePath, nullableFilePath, module); + var filePath = $"Packages/FluentParticleSystem/Runtime/Extensions/{module.Type}Extension.cs"; + WriteExtensionFile(filePath, module); } AssetDatabase.Refresh(); } diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Debug.cs b/Packages/FluentParticleSystem/Runtime/Debug.cs similarity index 91% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Debug.cs rename to Packages/FluentParticleSystem/Runtime/Debug.cs index 53d6765..2bcdd33 100644 --- a/Packages/FluentParticleSystem/Runtime/NonNullable/Debug.cs +++ b/Packages/FluentParticleSystem/Runtime/Debug.cs @@ -10,7 +10,7 @@ internal static class Debug [Conditional("UNITY_ASSERTIONS")] internal static void Assert( #if UNITY_2020_2_OR_NEWER - [DoesNotReturnIf(false)] + [DoesNotReturnIf(false)] #endif bool condition, string message) { diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Debug.cs.meta b/Packages/FluentParticleSystem/Runtime/Debug.cs.meta similarity index 100% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Debug.cs.meta rename to Packages/FluentParticleSystem/Runtime/Debug.cs.meta diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions.meta b/Packages/FluentParticleSystem/Runtime/Extensions.meta similarity index 100% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Extensions.meta rename to Packages/FluentParticleSystem/Runtime/Extensions.meta diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/CollisionModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/Extensions/CollisionModuleExtension.cs similarity index 73% rename from Packages/FluentParticleSystem/Runtime/Nullable/Extensions/CollisionModuleExtension.cs rename to Packages/FluentParticleSystem/Runtime/Extensions/CollisionModuleExtension.cs index cccc0a9..15c9504 100644 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/CollisionModuleExtension.cs +++ b/Packages/FluentParticleSystem/Runtime/Extensions/CollisionModuleExtension.cs @@ -1,9 +1,13 @@ -#nullable enable -using System; +using System; using System.Runtime.CompilerServices; using UnityEngine; + using static UnityEngine.ParticleSystem; +#if UNITY_2020_2_OR_NEWER +using System.Diagnostics.CodeAnalysis; +#endif + namespace OUCC.FluentParticleSystem { public static class CollisionModuleExtension @@ -13,7 +17,18 @@ public static class CollisionModuleExtension /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditCollision(this ParticleSystem particleSystem, Action moduleEditor) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem EditCollision( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Action moduleEditor) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); @@ -26,7 +41,14 @@ public static ParticleSystem EditCollision(this ParticleSystem particleSystem, A /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionBounce(this ParticleSystem particleSystem, MinMaxCurve bounce) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionBounce( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve bounce) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.collision; @@ -38,7 +60,18 @@ public static ParticleSystem SetCollisionBounce(this ParticleSystem particleSyst /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionBounce(this ParticleSystem particleSystem, Func bounceChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionBounce( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func bounceChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(bounceChanger != null, "bounceChanger cannot be null"); @@ -61,7 +94,11 @@ public static CollisionModule SetBounce(this CollisionModule module, MinMaxCurve /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetBounce(this CollisionModule module, Func bounceChanger) + public static CollisionModule SetBounce(this CollisionModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func bounceChanger) { Debug.Assert(bounceChanger != null, "bounceChanger cannot be null"); module.bounce = bounceChanger(module.bounce); @@ -74,7 +111,14 @@ public static CollisionModule SetBounce(this CollisionModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionBounceMultiplier(this ParticleSystem particleSystem, float bounceMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionBounceMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float bounceMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.collision; @@ -86,7 +130,18 @@ public static ParticleSystem SetCollisionBounceMultiplier(this ParticleSystem pa /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionBounceMultiplier(this ParticleSystem particleSystem, Func bounceMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionBounceMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func bounceMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(bounceMultiplierChanger != null, "bounceMultiplierChanger cannot be null"); @@ -109,7 +164,11 @@ public static CollisionModule SetBounceMultiplier(this CollisionModule module, f /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetBounceMultiplier(this CollisionModule module, Func bounceMultiplierChanger) + public static CollisionModule SetBounceMultiplier(this CollisionModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func bounceMultiplierChanger) { Debug.Assert(bounceMultiplierChanger != null, "bounceMultiplierChanger cannot be null"); module.bounceMultiplier = bounceMultiplierChanger(module.bounceMultiplier); @@ -122,7 +181,14 @@ public static CollisionModule SetBounceMultiplier(this CollisionModule module, F /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionColliderForce(this ParticleSystem particleSystem, float colliderForce) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionColliderForce( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float colliderForce) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.collision; @@ -134,7 +200,18 @@ public static ParticleSystem SetCollisionColliderForce(this ParticleSystem parti /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionColliderForce(this ParticleSystem particleSystem, Func colliderForceChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionColliderForce( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func colliderForceChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(colliderForceChanger != null, "colliderForceChanger cannot be null"); @@ -157,7 +234,11 @@ public static CollisionModule SetColliderForce(this CollisionModule module, floa /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetColliderForce(this CollisionModule module, Func colliderForceChanger) + public static CollisionModule SetColliderForce(this CollisionModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func colliderForceChanger) { Debug.Assert(colliderForceChanger != null, "colliderForceChanger cannot be null"); module.colliderForce = colliderForceChanger(module.colliderForce); @@ -170,7 +251,14 @@ public static CollisionModule SetColliderForce(this CollisionModule module, Func /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionCollidesWith(this ParticleSystem particleSystem, LayerMask collidesWith) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionCollidesWith( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, LayerMask collidesWith) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.collision; @@ -182,7 +270,18 @@ public static ParticleSystem SetCollisionCollidesWith(this ParticleSystem partic /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionCollidesWith(this ParticleSystem particleSystem, Func collidesWithChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionCollidesWith( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func collidesWithChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(collidesWithChanger != null, "collidesWithChanger cannot be null"); @@ -205,7 +304,11 @@ public static CollisionModule SetCollidesWith(this CollisionModule module, Layer /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetCollidesWith(this CollisionModule module, Func collidesWithChanger) + public static CollisionModule SetCollidesWith(this CollisionModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func collidesWithChanger) { Debug.Assert(collidesWithChanger != null, "collidesWithChanger cannot be null"); module.collidesWith = collidesWithChanger(module.collidesWith); @@ -218,7 +321,14 @@ public static CollisionModule SetCollidesWith(this CollisionModule module, Func< /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionDampen(this ParticleSystem particleSystem, MinMaxCurve dampen) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionDampen( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve dampen) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.collision; @@ -230,7 +340,18 @@ public static ParticleSystem SetCollisionDampen(this ParticleSystem particleSyst /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionDampen(this ParticleSystem particleSystem, Func dampenChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionDampen( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func dampenChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(dampenChanger != null, "dampenChanger cannot be null"); @@ -253,7 +374,11 @@ public static CollisionModule SetDampen(this CollisionModule module, MinMaxCurve /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetDampen(this CollisionModule module, Func dampenChanger) + public static CollisionModule SetDampen(this CollisionModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func dampenChanger) { Debug.Assert(dampenChanger != null, "dampenChanger cannot be null"); module.dampen = dampenChanger(module.dampen); @@ -266,7 +391,14 @@ public static CollisionModule SetDampen(this CollisionModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionDampenMultiplier(this ParticleSystem particleSystem, float dampenMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionDampenMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float dampenMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.collision; @@ -278,7 +410,18 @@ public static ParticleSystem SetCollisionDampenMultiplier(this ParticleSystem pa /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionDampenMultiplier(this ParticleSystem particleSystem, Func dampenMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionDampenMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func dampenMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(dampenMultiplierChanger != null, "dampenMultiplierChanger cannot be null"); @@ -301,7 +444,11 @@ public static CollisionModule SetDampenMultiplier(this CollisionModule module, f /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetDampenMultiplier(this CollisionModule module, Func dampenMultiplierChanger) + public static CollisionModule SetDampenMultiplier(this CollisionModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func dampenMultiplierChanger) { Debug.Assert(dampenMultiplierChanger != null, "dampenMultiplierChanger cannot be null"); module.dampenMultiplier = dampenMultiplierChanger(module.dampenMultiplier); @@ -314,7 +461,14 @@ public static CollisionModule SetDampenMultiplier(this CollisionModule module, F /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionEnabled(this ParticleSystem particleSystem, bool enabled) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool enabled) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.collision; @@ -326,7 +480,18 @@ public static ParticleSystem SetCollisionEnabled(this ParticleSystem particleSys /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionEnabled(this ParticleSystem particleSystem, Func enabledChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); @@ -349,7 +514,11 @@ public static CollisionModule SetEnabled(this CollisionModule module, bool enabl /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetEnabled(this CollisionModule module, Func enabledChanger) + public static CollisionModule SetEnabled(this CollisionModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); module.enabled = enabledChanger(module.enabled); @@ -362,7 +531,14 @@ public static CollisionModule SetEnabled(this CollisionModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionEnableDynamicColliders(this ParticleSystem particleSystem, bool enableDynamicColliders) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionEnableDynamicColliders( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool enableDynamicColliders) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.collision; @@ -374,7 +550,18 @@ public static ParticleSystem SetCollisionEnableDynamicColliders(this ParticleSys /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionEnableDynamicColliders(this ParticleSystem particleSystem, Func enableDynamicCollidersChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionEnableDynamicColliders( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enableDynamicCollidersChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(enableDynamicCollidersChanger != null, "enableDynamicCollidersChanger cannot be null"); @@ -397,7 +584,11 @@ public static CollisionModule SetEnableDynamicColliders(this CollisionModule mod /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetEnableDynamicColliders(this CollisionModule module, Func enableDynamicCollidersChanger) + public static CollisionModule SetEnableDynamicColliders(this CollisionModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enableDynamicCollidersChanger) { Debug.Assert(enableDynamicCollidersChanger != null, "enableDynamicCollidersChanger cannot be null"); module.enableDynamicColliders = enableDynamicCollidersChanger(module.enableDynamicColliders); @@ -413,7 +604,14 @@ public static CollisionModule SetEnableDynamicColliders(this CollisionModule mod [Obsolete("enableInteriorCollisions property is deprecated and is no longer required and has no effect on the particle system.", false)] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionEnableInteriorCollisions(this ParticleSystem particleSystem, bool enableInteriorCollisions) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionEnableInteriorCollisions( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool enableInteriorCollisions) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.collision; @@ -428,7 +626,18 @@ public static ParticleSystem SetCollisionEnableInteriorCollisions(this ParticleS [Obsolete("enableInteriorCollisions property is deprecated and is no longer required and has no effect on the particle system.", false)] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionEnableInteriorCollisions(this ParticleSystem particleSystem, Func enableInteriorCollisionsChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionEnableInteriorCollisions( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enableInteriorCollisionsChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(enableInteriorCollisionsChanger != null, "enableInteriorCollisionsChanger cannot be null"); @@ -457,7 +666,11 @@ public static CollisionModule SetEnableInteriorCollisions(this CollisionModule m [Obsolete("enableInteriorCollisions property is deprecated and is no longer required and has no effect on the particle system.", false)] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetEnableInteriorCollisions(this CollisionModule module, Func enableInteriorCollisionsChanger) + public static CollisionModule SetEnableInteriorCollisions(this CollisionModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enableInteriorCollisionsChanger) { Debug.Assert(enableInteriorCollisionsChanger != null, "enableInteriorCollisionsChanger cannot be null"); module.enableInteriorCollisions = enableInteriorCollisionsChanger(module.enableInteriorCollisions); @@ -470,7 +683,14 @@ public static CollisionModule SetEnableInteriorCollisions(this CollisionModule m /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionLifetimeLoss(this ParticleSystem particleSystem, MinMaxCurve lifetimeLoss) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionLifetimeLoss( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve lifetimeLoss) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.collision; @@ -482,7 +702,18 @@ public static ParticleSystem SetCollisionLifetimeLoss(this ParticleSystem partic /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionLifetimeLoss(this ParticleSystem particleSystem, Func lifetimeLossChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionLifetimeLoss( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func lifetimeLossChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(lifetimeLossChanger != null, "lifetimeLossChanger cannot be null"); @@ -505,7 +736,11 @@ public static CollisionModule SetLifetimeLoss(this CollisionModule module, MinMa /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetLifetimeLoss(this CollisionModule module, Func lifetimeLossChanger) + public static CollisionModule SetLifetimeLoss(this CollisionModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func lifetimeLossChanger) { Debug.Assert(lifetimeLossChanger != null, "lifetimeLossChanger cannot be null"); module.lifetimeLoss = lifetimeLossChanger(module.lifetimeLoss); @@ -518,7 +753,14 @@ public static CollisionModule SetLifetimeLoss(this CollisionModule module, Func< /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionLifetimeLossMultiplier(this ParticleSystem particleSystem, float lifetimeLossMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionLifetimeLossMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float lifetimeLossMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.collision; @@ -530,7 +772,18 @@ public static ParticleSystem SetCollisionLifetimeLossMultiplier(this ParticleSys /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionLifetimeLossMultiplier(this ParticleSystem particleSystem, Func lifetimeLossMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionLifetimeLossMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func lifetimeLossMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(lifetimeLossMultiplierChanger != null, "lifetimeLossMultiplierChanger cannot be null"); @@ -553,7 +806,11 @@ public static CollisionModule SetLifetimeLossMultiplier(this CollisionModule mod /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetLifetimeLossMultiplier(this CollisionModule module, Func lifetimeLossMultiplierChanger) + public static CollisionModule SetLifetimeLossMultiplier(this CollisionModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func lifetimeLossMultiplierChanger) { Debug.Assert(lifetimeLossMultiplierChanger != null, "lifetimeLossMultiplierChanger cannot be null"); module.lifetimeLossMultiplier = lifetimeLossMultiplierChanger(module.lifetimeLossMultiplier); @@ -566,7 +823,14 @@ public static CollisionModule SetLifetimeLossMultiplier(this CollisionModule mod /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionMaxCollisionShapes(this ParticleSystem particleSystem, int maxCollisionShapes) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionMaxCollisionShapes( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, int maxCollisionShapes) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.collision; @@ -578,7 +842,18 @@ public static ParticleSystem SetCollisionMaxCollisionShapes(this ParticleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionMaxCollisionShapes(this ParticleSystem particleSystem, Func maxCollisionShapesChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionMaxCollisionShapes( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func maxCollisionShapesChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(maxCollisionShapesChanger != null, "maxCollisionShapesChanger cannot be null"); @@ -601,7 +876,11 @@ public static CollisionModule SetMaxCollisionShapes(this CollisionModule module, /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetMaxCollisionShapes(this CollisionModule module, Func maxCollisionShapesChanger) + public static CollisionModule SetMaxCollisionShapes(this CollisionModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func maxCollisionShapesChanger) { Debug.Assert(maxCollisionShapesChanger != null, "maxCollisionShapesChanger cannot be null"); module.maxCollisionShapes = maxCollisionShapesChanger(module.maxCollisionShapes); @@ -614,7 +893,14 @@ public static CollisionModule SetMaxCollisionShapes(this CollisionModule module, /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionMaxKillSpeed(this ParticleSystem particleSystem, float maxKillSpeed) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionMaxKillSpeed( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float maxKillSpeed) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.collision; @@ -626,7 +912,18 @@ public static ParticleSystem SetCollisionMaxKillSpeed(this ParticleSystem partic /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionMaxKillSpeed(this ParticleSystem particleSystem, Func maxKillSpeedChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionMaxKillSpeed( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func maxKillSpeedChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(maxKillSpeedChanger != null, "maxKillSpeedChanger cannot be null"); @@ -649,7 +946,11 @@ public static CollisionModule SetMaxKillSpeed(this CollisionModule module, float /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetMaxKillSpeed(this CollisionModule module, Func maxKillSpeedChanger) + public static CollisionModule SetMaxKillSpeed(this CollisionModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func maxKillSpeedChanger) { Debug.Assert(maxKillSpeedChanger != null, "maxKillSpeedChanger cannot be null"); module.maxKillSpeed = maxKillSpeedChanger(module.maxKillSpeed); @@ -662,7 +963,14 @@ public static CollisionModule SetMaxKillSpeed(this CollisionModule module, Func< /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionMinKillSpeed(this ParticleSystem particleSystem, float minKillSpeed) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionMinKillSpeed( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float minKillSpeed) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.collision; @@ -674,7 +982,18 @@ public static ParticleSystem SetCollisionMinKillSpeed(this ParticleSystem partic /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionMinKillSpeed(this ParticleSystem particleSystem, Func minKillSpeedChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionMinKillSpeed( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func minKillSpeedChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(minKillSpeedChanger != null, "minKillSpeedChanger cannot be null"); @@ -697,7 +1016,11 @@ public static CollisionModule SetMinKillSpeed(this CollisionModule module, float /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetMinKillSpeed(this CollisionModule module, Func minKillSpeedChanger) + public static CollisionModule SetMinKillSpeed(this CollisionModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func minKillSpeedChanger) { Debug.Assert(minKillSpeedChanger != null, "minKillSpeedChanger cannot be null"); module.minKillSpeed = minKillSpeedChanger(module.minKillSpeed); @@ -710,7 +1033,14 @@ public static CollisionModule SetMinKillSpeed(this CollisionModule module, Func< /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionMode(this ParticleSystem particleSystem, ParticleSystemCollisionMode mode) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionMode( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, ParticleSystemCollisionMode mode) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.collision; @@ -722,7 +1052,18 @@ public static ParticleSystem SetCollisionMode(this ParticleSystem particleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionMode(this ParticleSystem particleSystem, Func modeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionMode( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func modeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(modeChanger != null, "modeChanger cannot be null"); @@ -745,7 +1086,11 @@ public static CollisionModule SetMode(this CollisionModule module, ParticleSyste /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetMode(this CollisionModule module, Func modeChanger) + public static CollisionModule SetMode(this CollisionModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func modeChanger) { Debug.Assert(modeChanger != null, "modeChanger cannot be null"); module.mode = modeChanger(module.mode); @@ -758,7 +1103,14 @@ public static CollisionModule SetMode(this CollisionModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionMultiplyColliderForceByCollisionAngle(this ParticleSystem particleSystem, bool multiplyColliderForceByCollisionAngle) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionMultiplyColliderForceByCollisionAngle( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool multiplyColliderForceByCollisionAngle) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.collision; @@ -770,7 +1122,18 @@ public static ParticleSystem SetCollisionMultiplyColliderForceByCollisionAngle(t /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionMultiplyColliderForceByCollisionAngle(this ParticleSystem particleSystem, Func multiplyColliderForceByCollisionAngleChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionMultiplyColliderForceByCollisionAngle( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func multiplyColliderForceByCollisionAngleChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(multiplyColliderForceByCollisionAngleChanger != null, "multiplyColliderForceByCollisionAngleChanger cannot be null"); @@ -793,7 +1156,11 @@ public static CollisionModule SetMultiplyColliderForceByCollisionAngle(this Coll /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetMultiplyColliderForceByCollisionAngle(this CollisionModule module, Func multiplyColliderForceByCollisionAngleChanger) + public static CollisionModule SetMultiplyColliderForceByCollisionAngle(this CollisionModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func multiplyColliderForceByCollisionAngleChanger) { Debug.Assert(multiplyColliderForceByCollisionAngleChanger != null, "multiplyColliderForceByCollisionAngleChanger cannot be null"); module.multiplyColliderForceByCollisionAngle = multiplyColliderForceByCollisionAngleChanger(module.multiplyColliderForceByCollisionAngle); @@ -806,7 +1173,14 @@ public static CollisionModule SetMultiplyColliderForceByCollisionAngle(this Coll /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionMultiplyColliderForceByParticleSize(this ParticleSystem particleSystem, bool multiplyColliderForceByParticleSize) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionMultiplyColliderForceByParticleSize( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool multiplyColliderForceByParticleSize) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.collision; @@ -818,7 +1192,18 @@ public static ParticleSystem SetCollisionMultiplyColliderForceByParticleSize(thi /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionMultiplyColliderForceByParticleSize(this ParticleSystem particleSystem, Func multiplyColliderForceByParticleSizeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionMultiplyColliderForceByParticleSize( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func multiplyColliderForceByParticleSizeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(multiplyColliderForceByParticleSizeChanger != null, "multiplyColliderForceByParticleSizeChanger cannot be null"); @@ -841,7 +1226,11 @@ public static CollisionModule SetMultiplyColliderForceByParticleSize(this Collis /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetMultiplyColliderForceByParticleSize(this CollisionModule module, Func multiplyColliderForceByParticleSizeChanger) + public static CollisionModule SetMultiplyColliderForceByParticleSize(this CollisionModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func multiplyColliderForceByParticleSizeChanger) { Debug.Assert(multiplyColliderForceByParticleSizeChanger != null, "multiplyColliderForceByParticleSizeChanger cannot be null"); module.multiplyColliderForceByParticleSize = multiplyColliderForceByParticleSizeChanger(module.multiplyColliderForceByParticleSize); @@ -854,7 +1243,14 @@ public static CollisionModule SetMultiplyColliderForceByParticleSize(this Collis /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionMultiplyColliderForceByParticleSpeed(this ParticleSystem particleSystem, bool multiplyColliderForceByParticleSpeed) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionMultiplyColliderForceByParticleSpeed( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool multiplyColliderForceByParticleSpeed) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.collision; @@ -866,7 +1262,18 @@ public static ParticleSystem SetCollisionMultiplyColliderForceByParticleSpeed(th /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionMultiplyColliderForceByParticleSpeed(this ParticleSystem particleSystem, Func multiplyColliderForceByParticleSpeedChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionMultiplyColliderForceByParticleSpeed( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func multiplyColliderForceByParticleSpeedChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(multiplyColliderForceByParticleSpeedChanger != null, "multiplyColliderForceByParticleSpeedChanger cannot be null"); @@ -889,7 +1296,11 @@ public static CollisionModule SetMultiplyColliderForceByParticleSpeed(this Colli /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetMultiplyColliderForceByParticleSpeed(this CollisionModule module, Func multiplyColliderForceByParticleSpeedChanger) + public static CollisionModule SetMultiplyColliderForceByParticleSpeed(this CollisionModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func multiplyColliderForceByParticleSpeedChanger) { Debug.Assert(multiplyColliderForceByParticleSpeedChanger != null, "multiplyColliderForceByParticleSpeedChanger cannot be null"); module.multiplyColliderForceByParticleSpeed = multiplyColliderForceByParticleSpeedChanger(module.multiplyColliderForceByParticleSpeed); @@ -902,7 +1313,14 @@ public static CollisionModule SetMultiplyColliderForceByParticleSpeed(this Colli /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionQuality(this ParticleSystem particleSystem, ParticleSystemCollisionQuality quality) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionQuality( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, ParticleSystemCollisionQuality quality) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.collision; @@ -914,7 +1332,18 @@ public static ParticleSystem SetCollisionQuality(this ParticleSystem particleSys /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionQuality(this ParticleSystem particleSystem, Func qualityChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionQuality( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func qualityChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(qualityChanger != null, "qualityChanger cannot be null"); @@ -937,7 +1366,11 @@ public static CollisionModule SetQuality(this CollisionModule module, ParticleSy /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetQuality(this CollisionModule module, Func qualityChanger) + public static CollisionModule SetQuality(this CollisionModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func qualityChanger) { Debug.Assert(qualityChanger != null, "qualityChanger cannot be null"); module.quality = qualityChanger(module.quality); @@ -950,7 +1383,14 @@ public static CollisionModule SetQuality(this CollisionModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionRadiusScale(this ParticleSystem particleSystem, float radiusScale) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionRadiusScale( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float radiusScale) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.collision; @@ -962,7 +1402,18 @@ public static ParticleSystem SetCollisionRadiusScale(this ParticleSystem particl /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionRadiusScale(this ParticleSystem particleSystem, Func radiusScaleChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionRadiusScale( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func radiusScaleChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(radiusScaleChanger != null, "radiusScaleChanger cannot be null"); @@ -985,7 +1436,11 @@ public static CollisionModule SetRadiusScale(this CollisionModule module, float /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetRadiusScale(this CollisionModule module, Func radiusScaleChanger) + public static CollisionModule SetRadiusScale(this CollisionModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func radiusScaleChanger) { Debug.Assert(radiusScaleChanger != null, "radiusScaleChanger cannot be null"); module.radiusScale = radiusScaleChanger(module.radiusScale); @@ -998,7 +1453,14 @@ public static CollisionModule SetRadiusScale(this CollisionModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionSendCollisionMessages(this ParticleSystem particleSystem, bool sendCollisionMessages) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionSendCollisionMessages( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool sendCollisionMessages) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.collision; @@ -1010,7 +1472,18 @@ public static ParticleSystem SetCollisionSendCollisionMessages(this ParticleSyst /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionSendCollisionMessages(this ParticleSystem particleSystem, Func sendCollisionMessagesChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionSendCollisionMessages( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func sendCollisionMessagesChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(sendCollisionMessagesChanger != null, "sendCollisionMessagesChanger cannot be null"); @@ -1033,7 +1506,11 @@ public static CollisionModule SetSendCollisionMessages(this CollisionModule modu /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetSendCollisionMessages(this CollisionModule module, Func sendCollisionMessagesChanger) + public static CollisionModule SetSendCollisionMessages(this CollisionModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func sendCollisionMessagesChanger) { Debug.Assert(sendCollisionMessagesChanger != null, "sendCollisionMessagesChanger cannot be null"); module.sendCollisionMessages = sendCollisionMessagesChanger(module.sendCollisionMessages); @@ -1046,7 +1523,14 @@ public static CollisionModule SetSendCollisionMessages(this CollisionModule modu /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionType(this ParticleSystem particleSystem, ParticleSystemCollisionType type) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionType( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, ParticleSystemCollisionType type) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.collision; @@ -1058,7 +1542,18 @@ public static ParticleSystem SetCollisionType(this ParticleSystem particleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionType(this ParticleSystem particleSystem, Func typeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionType( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func typeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(typeChanger != null, "typeChanger cannot be null"); @@ -1081,7 +1576,11 @@ public static CollisionModule SetType(this CollisionModule module, ParticleSyste /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetType(this CollisionModule module, Func typeChanger) + public static CollisionModule SetType(this CollisionModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func typeChanger) { Debug.Assert(typeChanger != null, "typeChanger cannot be null"); module.type = typeChanger(module.type); @@ -1094,7 +1593,14 @@ public static CollisionModule SetType(this CollisionModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionVoxelSize(this ParticleSystem particleSystem, float voxelSize) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionVoxelSize( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float voxelSize) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.collision; @@ -1106,7 +1612,18 @@ public static ParticleSystem SetCollisionVoxelSize(this ParticleSystem particleS /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionVoxelSize(this ParticleSystem particleSystem, Func voxelSizeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCollisionVoxelSize( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func voxelSizeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(voxelSizeChanger != null, "voxelSizeChanger cannot be null"); @@ -1129,7 +1646,11 @@ public static CollisionModule SetVoxelSize(this CollisionModule module, float vo /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetVoxelSize(this CollisionModule module, Func voxelSizeChanger) + public static CollisionModule SetVoxelSize(this CollisionModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func voxelSizeChanger) { Debug.Assert(voxelSizeChanger != null, "voxelSizeChanger cannot be null"); module.voxelSize = voxelSizeChanger(module.voxelSize); diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/CollisionModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Extensions/CollisionModuleExtension.cs.meta similarity index 100% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/CollisionModuleExtension.cs.meta rename to Packages/FluentParticleSystem/Runtime/Extensions/CollisionModuleExtension.cs.meta diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/ColorBySpeedModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/Extensions/ColorBySpeedModuleExtension.cs similarity index 69% rename from Packages/FluentParticleSystem/Runtime/Nullable/Extensions/ColorBySpeedModuleExtension.cs rename to Packages/FluentParticleSystem/Runtime/Extensions/ColorBySpeedModuleExtension.cs index 1007c90..339fdb9 100644 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/ColorBySpeedModuleExtension.cs +++ b/Packages/FluentParticleSystem/Runtime/Extensions/ColorBySpeedModuleExtension.cs @@ -1,9 +1,13 @@ -#nullable enable using System; using System.Runtime.CompilerServices; using UnityEngine; + using static UnityEngine.ParticleSystem; +#if UNITY_2020_2_OR_NEWER +using System.Diagnostics.CodeAnalysis; +#endif + namespace OUCC.FluentParticleSystem { public static class ColorBySpeedModuleExtension @@ -13,7 +17,18 @@ public static class ColorBySpeedModuleExtension /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditColorBySpeed(this ParticleSystem particleSystem, Action moduleEditor) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem EditColorBySpeed( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Action moduleEditor) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); @@ -26,7 +41,14 @@ public static ParticleSystem EditColorBySpeed(this ParticleSystem particleSystem /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetColorBySpeedColor(this ParticleSystem particleSystem, MinMaxGradient color) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetColorBySpeedColor( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxGradient color) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.colorBySpeed; @@ -38,7 +60,18 @@ public static ParticleSystem SetColorBySpeedColor(this ParticleSystem particleSy /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetColorBySpeedColor(this ParticleSystem particleSystem, Func colorChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetColorBySpeedColor( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func colorChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(colorChanger != null, "colorChanger cannot be null"); @@ -61,7 +94,11 @@ public static ColorBySpeedModule SetColor(this ColorBySpeedModule module, MinMax /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ColorBySpeedModule SetColor(this ColorBySpeedModule module, Func colorChanger) + public static ColorBySpeedModule SetColor(this ColorBySpeedModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func colorChanger) { Debug.Assert(colorChanger != null, "colorChanger cannot be null"); module.color = colorChanger(module.color); @@ -74,7 +111,14 @@ public static ColorBySpeedModule SetColor(this ColorBySpeedModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetColorBySpeedEnabled(this ParticleSystem particleSystem, bool enabled) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetColorBySpeedEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool enabled) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.colorBySpeed; @@ -86,7 +130,18 @@ public static ParticleSystem SetColorBySpeedEnabled(this ParticleSystem particle /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetColorBySpeedEnabled(this ParticleSystem particleSystem, Func enabledChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetColorBySpeedEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); @@ -109,7 +164,11 @@ public static ColorBySpeedModule SetEnabled(this ColorBySpeedModule module, bool /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ColorBySpeedModule SetEnabled(this ColorBySpeedModule module, Func enabledChanger) + public static ColorBySpeedModule SetEnabled(this ColorBySpeedModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); module.enabled = enabledChanger(module.enabled); @@ -122,7 +181,14 @@ public static ColorBySpeedModule SetEnabled(this ColorBySpeedModule module, Func /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetColorBySpeedRange(this ParticleSystem particleSystem, Vector2 range) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetColorBySpeedRange( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, Vector2 range) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.colorBySpeed; @@ -134,7 +200,18 @@ public static ParticleSystem SetColorBySpeedRange(this ParticleSystem particleSy /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetColorBySpeedRange(this ParticleSystem particleSystem, Func rangeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetColorBySpeedRange( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func rangeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(rangeChanger != null, "rangeChanger cannot be null"); @@ -157,7 +234,11 @@ public static ColorBySpeedModule SetRange(this ColorBySpeedModule module, Vector /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ColorBySpeedModule SetRange(this ColorBySpeedModule module, Func rangeChanger) + public static ColorBySpeedModule SetRange(this ColorBySpeedModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func rangeChanger) { Debug.Assert(rangeChanger != null, "rangeChanger cannot be null"); module.range = rangeChanger(module.range); diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/ColorBySpeedModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Extensions/ColorBySpeedModuleExtension.cs.meta similarity index 100% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/ColorBySpeedModuleExtension.cs.meta rename to Packages/FluentParticleSystem/Runtime/Extensions/ColorBySpeedModuleExtension.cs.meta diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/ColorOverLifetimeModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/Extensions/ColorOverLifetimeModuleExtension.cs similarity index 70% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/ColorOverLifetimeModuleExtension.cs rename to Packages/FluentParticleSystem/Runtime/Extensions/ColorOverLifetimeModuleExtension.cs index 4202d7a..9a599e3 100644 --- a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/ColorOverLifetimeModuleExtension.cs +++ b/Packages/FluentParticleSystem/Runtime/Extensions/ColorOverLifetimeModuleExtension.cs @@ -1,8 +1,13 @@ using System; using System.Runtime.CompilerServices; using UnityEngine; + using static UnityEngine.ParticleSystem; +#if UNITY_2020_2_OR_NEWER +using System.Diagnostics.CodeAnalysis; +#endif + namespace OUCC.FluentParticleSystem { public static class ColorOverLifetimeModuleExtension @@ -12,7 +17,18 @@ public static class ColorOverLifetimeModuleExtension /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditColorOverLifetime(this ParticleSystem particleSystem, Action moduleEditor) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem EditColorOverLifetime( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Action moduleEditor) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); @@ -25,7 +41,14 @@ public static ParticleSystem EditColorOverLifetime(this ParticleSystem particleS /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetColorOverLifetimeColor(this ParticleSystem particleSystem, MinMaxGradient color) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetColorOverLifetimeColor( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxGradient color) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.colorOverLifetime; @@ -37,7 +60,18 @@ public static ParticleSystem SetColorOverLifetimeColor(this ParticleSystem parti /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetColorOverLifetimeColor(this ParticleSystem particleSystem, Func colorChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetColorOverLifetimeColor( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func colorChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(colorChanger != null, "colorChanger cannot be null"); @@ -60,7 +94,11 @@ public static ColorOverLifetimeModule SetColor(this ColorOverLifetimeModule modu /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ColorOverLifetimeModule SetColor(this ColorOverLifetimeModule module, Func colorChanger) + public static ColorOverLifetimeModule SetColor(this ColorOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func colorChanger) { Debug.Assert(colorChanger != null, "colorChanger cannot be null"); module.color = colorChanger(module.color); @@ -73,7 +111,14 @@ public static ColorOverLifetimeModule SetColor(this ColorOverLifetimeModule modu /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetColorOverLifetimeEnabled(this ParticleSystem particleSystem, bool enabled) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetColorOverLifetimeEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool enabled) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.colorOverLifetime; @@ -85,7 +130,18 @@ public static ParticleSystem SetColorOverLifetimeEnabled(this ParticleSystem par /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetColorOverLifetimeEnabled(this ParticleSystem particleSystem, Func enabledChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetColorOverLifetimeEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); @@ -108,7 +164,11 @@ public static ColorOverLifetimeModule SetEnabled(this ColorOverLifetimeModule mo /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ColorOverLifetimeModule SetEnabled(this ColorOverLifetimeModule module, Func enabledChanger) + public static ColorOverLifetimeModule SetEnabled(this ColorOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); module.enabled = enabledChanger(module.enabled); diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/ColorOverLifetimeModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Extensions/ColorOverLifetimeModuleExtension.cs.meta similarity index 100% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/ColorOverLifetimeModuleExtension.cs.meta rename to Packages/FluentParticleSystem/Runtime/Extensions/ColorOverLifetimeModuleExtension.cs.meta diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/CustomDataModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/Extensions/CustomDataModuleExtension.cs similarity index 68% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/CustomDataModuleExtension.cs rename to Packages/FluentParticleSystem/Runtime/Extensions/CustomDataModuleExtension.cs index c6d7763..5c8eb6f 100644 --- a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/CustomDataModuleExtension.cs +++ b/Packages/FluentParticleSystem/Runtime/Extensions/CustomDataModuleExtension.cs @@ -1,8 +1,13 @@ using System; using System.Runtime.CompilerServices; using UnityEngine; + using static UnityEngine.ParticleSystem; +#if UNITY_2020_2_OR_NEWER +using System.Diagnostics.CodeAnalysis; +#endif + namespace OUCC.FluentParticleSystem { public static class CustomDataModuleExtension @@ -12,7 +17,18 @@ public static class CustomDataModuleExtension /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditCustomData(this ParticleSystem particleSystem, Action moduleEditor) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem EditCustomData( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Action moduleEditor) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); @@ -25,7 +41,14 @@ public static ParticleSystem EditCustomData(this ParticleSystem particleSystem, /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCustomDataEnabled(this ParticleSystem particleSystem, bool enabled) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCustomDataEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool enabled) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.customData; @@ -37,7 +60,18 @@ public static ParticleSystem SetCustomDataEnabled(this ParticleSystem particleSy /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCustomDataEnabled(this ParticleSystem particleSystem, Func enabledChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetCustomDataEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); @@ -60,7 +94,11 @@ public static CustomDataModule SetEnabled(this CustomDataModule module, bool ena /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CustomDataModule SetEnabled(this CustomDataModule module, Func enabledChanger) + public static CustomDataModule SetEnabled(this CustomDataModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); module.enabled = enabledChanger(module.enabled); diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/CustomDataModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Extensions/CustomDataModuleExtension.cs.meta similarity index 100% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/CustomDataModuleExtension.cs.meta rename to Packages/FluentParticleSystem/Runtime/Extensions/CustomDataModuleExtension.cs.meta diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/EmissionModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/Extensions/EmissionModuleExtension.cs similarity index 74% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/EmissionModuleExtension.cs rename to Packages/FluentParticleSystem/Runtime/Extensions/EmissionModuleExtension.cs index c37d6cd..478cb14 100644 --- a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/EmissionModuleExtension.cs +++ b/Packages/FluentParticleSystem/Runtime/Extensions/EmissionModuleExtension.cs @@ -1,8 +1,13 @@ using System; using System.Runtime.CompilerServices; using UnityEngine; + using static UnityEngine.ParticleSystem; +#if UNITY_2020_2_OR_NEWER +using System.Diagnostics.CodeAnalysis; +#endif + namespace OUCC.FluentParticleSystem { public static class EmissionModuleExtension @@ -12,7 +17,18 @@ public static class EmissionModuleExtension /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditEmission(this ParticleSystem particleSystem, Action moduleEditor) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem EditEmission( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Action moduleEditor) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); @@ -25,7 +41,14 @@ public static ParticleSystem EditEmission(this ParticleSystem particleSystem, Ac /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetEmissionBurstCount(this ParticleSystem particleSystem, int burstCount) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetEmissionBurstCount( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, int burstCount) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.emission; @@ -37,7 +60,18 @@ public static ParticleSystem SetEmissionBurstCount(this ParticleSystem particleS /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetEmissionBurstCount(this ParticleSystem particleSystem, Func burstCountChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetEmissionBurstCount( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func burstCountChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(burstCountChanger != null, "burstCountChanger cannot be null"); @@ -60,7 +94,11 @@ public static EmissionModule SetBurstCount(this EmissionModule module, int burst /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EmissionModule SetBurstCount(this EmissionModule module, Func burstCountChanger) + public static EmissionModule SetBurstCount(this EmissionModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func burstCountChanger) { Debug.Assert(burstCountChanger != null, "burstCountChanger cannot be null"); module.burstCount = burstCountChanger(module.burstCount); @@ -73,7 +111,14 @@ public static EmissionModule SetBurstCount(this EmissionModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetEmissionEnabled(this ParticleSystem particleSystem, bool enabled) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetEmissionEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool enabled) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.emission; @@ -85,7 +130,18 @@ public static ParticleSystem SetEmissionEnabled(this ParticleSystem particleSyst /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetEmissionEnabled(this ParticleSystem particleSystem, Func enabledChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetEmissionEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); @@ -108,7 +164,11 @@ public static EmissionModule SetEnabled(this EmissionModule module, bool enabled /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EmissionModule SetEnabled(this EmissionModule module, Func enabledChanger) + public static EmissionModule SetEnabled(this EmissionModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); module.enabled = enabledChanger(module.enabled); @@ -124,7 +184,14 @@ public static EmissionModule SetEnabled(this EmissionModule module, Func rateChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetEmissionRate( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func rateChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(rateChanger != null, "rateChanger cannot be null"); @@ -168,7 +246,11 @@ public static EmissionModule SetRate(this EmissionModule module, MinMaxCurve rat [Obsolete("rate property is deprecated. Use rateOverTime or rateOverDistance instead.", false)] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EmissionModule SetRate(this EmissionModule module, Func rateChanger) + public static EmissionModule SetRate(this EmissionModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func rateChanger) { Debug.Assert(rateChanger != null, "rateChanger cannot be null"); module.rate = rateChanger(module.rate); @@ -184,7 +266,14 @@ public static EmissionModule SetRate(this EmissionModule module, Func rateMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetEmissionRateMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func rateMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(rateMultiplierChanger != null, "rateMultiplierChanger cannot be null"); @@ -228,7 +328,11 @@ public static EmissionModule SetRateMultiplier(this EmissionModule module, float [Obsolete("rateMultiplier property is deprecated. Use rateOverTimeMultiplier or rateOverDistanceMultiplier instead.", false)] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EmissionModule SetRateMultiplier(this EmissionModule module, Func rateMultiplierChanger) + public static EmissionModule SetRateMultiplier(this EmissionModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func rateMultiplierChanger) { Debug.Assert(rateMultiplierChanger != null, "rateMultiplierChanger cannot be null"); module.rateMultiplier = rateMultiplierChanger(module.rateMultiplier); @@ -241,7 +345,14 @@ public static EmissionModule SetRateMultiplier(this EmissionModule module, Func< /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetEmissionRateOverDistance(this ParticleSystem particleSystem, MinMaxCurve rateOverDistance) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetEmissionRateOverDistance( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve rateOverDistance) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.emission; @@ -253,7 +364,18 @@ public static ParticleSystem SetEmissionRateOverDistance(this ParticleSystem par /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetEmissionRateOverDistance(this ParticleSystem particleSystem, Func rateOverDistanceChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetEmissionRateOverDistance( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func rateOverDistanceChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(rateOverDistanceChanger != null, "rateOverDistanceChanger cannot be null"); @@ -276,7 +398,11 @@ public static EmissionModule SetRateOverDistance(this EmissionModule module, Min /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EmissionModule SetRateOverDistance(this EmissionModule module, Func rateOverDistanceChanger) + public static EmissionModule SetRateOverDistance(this EmissionModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func rateOverDistanceChanger) { Debug.Assert(rateOverDistanceChanger != null, "rateOverDistanceChanger cannot be null"); module.rateOverDistance = rateOverDistanceChanger(module.rateOverDistance); @@ -289,7 +415,14 @@ public static EmissionModule SetRateOverDistance(this EmissionModule module, Fun /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetEmissionRateOverDistanceMultiplier(this ParticleSystem particleSystem, float rateOverDistanceMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetEmissionRateOverDistanceMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float rateOverDistanceMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.emission; @@ -301,7 +434,18 @@ public static ParticleSystem SetEmissionRateOverDistanceMultiplier(this Particle /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetEmissionRateOverDistanceMultiplier(this ParticleSystem particleSystem, Func rateOverDistanceMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetEmissionRateOverDistanceMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func rateOverDistanceMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(rateOverDistanceMultiplierChanger != null, "rateOverDistanceMultiplierChanger cannot be null"); @@ -324,7 +468,11 @@ public static EmissionModule SetRateOverDistanceMultiplier(this EmissionModule m /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EmissionModule SetRateOverDistanceMultiplier(this EmissionModule module, Func rateOverDistanceMultiplierChanger) + public static EmissionModule SetRateOverDistanceMultiplier(this EmissionModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func rateOverDistanceMultiplierChanger) { Debug.Assert(rateOverDistanceMultiplierChanger != null, "rateOverDistanceMultiplierChanger cannot be null"); module.rateOverDistanceMultiplier = rateOverDistanceMultiplierChanger(module.rateOverDistanceMultiplier); @@ -337,7 +485,14 @@ public static EmissionModule SetRateOverDistanceMultiplier(this EmissionModule m /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetEmissionRateOverTime(this ParticleSystem particleSystem, MinMaxCurve rateOverTime) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetEmissionRateOverTime( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve rateOverTime) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.emission; @@ -349,7 +504,18 @@ public static ParticleSystem SetEmissionRateOverTime(this ParticleSystem particl /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetEmissionRateOverTime(this ParticleSystem particleSystem, Func rateOverTimeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetEmissionRateOverTime( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func rateOverTimeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(rateOverTimeChanger != null, "rateOverTimeChanger cannot be null"); @@ -372,7 +538,11 @@ public static EmissionModule SetRateOverTime(this EmissionModule module, MinMaxC /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EmissionModule SetRateOverTime(this EmissionModule module, Func rateOverTimeChanger) + public static EmissionModule SetRateOverTime(this EmissionModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func rateOverTimeChanger) { Debug.Assert(rateOverTimeChanger != null, "rateOverTimeChanger cannot be null"); module.rateOverTime = rateOverTimeChanger(module.rateOverTime); @@ -385,7 +555,14 @@ public static EmissionModule SetRateOverTime(this EmissionModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetEmissionRateOverTimeMultiplier(this ParticleSystem particleSystem, float rateOverTimeMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetEmissionRateOverTimeMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float rateOverTimeMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.emission; @@ -397,7 +574,18 @@ public static ParticleSystem SetEmissionRateOverTimeMultiplier(this ParticleSyst /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetEmissionRateOverTimeMultiplier(this ParticleSystem particleSystem, Func rateOverTimeMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetEmissionRateOverTimeMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func rateOverTimeMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(rateOverTimeMultiplierChanger != null, "rateOverTimeMultiplierChanger cannot be null"); @@ -420,7 +608,11 @@ public static EmissionModule SetRateOverTimeMultiplier(this EmissionModule modul /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EmissionModule SetRateOverTimeMultiplier(this EmissionModule module, Func rateOverTimeMultiplierChanger) + public static EmissionModule SetRateOverTimeMultiplier(this EmissionModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func rateOverTimeMultiplierChanger) { Debug.Assert(rateOverTimeMultiplierChanger != null, "rateOverTimeMultiplierChanger cannot be null"); module.rateOverTimeMultiplier = rateOverTimeMultiplierChanger(module.rateOverTimeMultiplier); @@ -436,7 +628,14 @@ public static EmissionModule SetRateOverTimeMultiplier(this EmissionModule modul [Obsolete("ParticleSystemEmissionType no longer does anything. Time and Distance based emission are now both always active.", false)] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetEmissionType(this ParticleSystem particleSystem, ParticleSystemEmissionType type) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetEmissionType( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, ParticleSystemEmissionType type) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.emission; @@ -451,7 +650,18 @@ public static ParticleSystem SetEmissionType(this ParticleSystem particleSystem, [Obsolete("ParticleSystemEmissionType no longer does anything. Time and Distance based emission are now both always active.", false)] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetEmissionType(this ParticleSystem particleSystem, Func typeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetEmissionType( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func typeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(typeChanger != null, "typeChanger cannot be null"); @@ -480,7 +690,11 @@ public static EmissionModule SetType(this EmissionModule module, ParticleSystemE [Obsolete("ParticleSystemEmissionType no longer does anything. Time and Distance based emission are now both always active.", false)] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EmissionModule SetType(this EmissionModule module, Func typeChanger) + public static EmissionModule SetType(this EmissionModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func typeChanger) { Debug.Assert(typeChanger != null, "typeChanger cannot be null"); module.type = typeChanger(module.type); diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/EmissionModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Extensions/EmissionModuleExtension.cs.meta similarity index 100% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/EmissionModuleExtension.cs.meta rename to Packages/FluentParticleSystem/Runtime/Extensions/EmissionModuleExtension.cs.meta diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/ExternalForcesModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/Extensions/ExternalForcesModuleExtension.cs similarity index 73% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/ExternalForcesModuleExtension.cs rename to Packages/FluentParticleSystem/Runtime/Extensions/ExternalForcesModuleExtension.cs index ef06c58..b38af6d 100644 --- a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/ExternalForcesModuleExtension.cs +++ b/Packages/FluentParticleSystem/Runtime/Extensions/ExternalForcesModuleExtension.cs @@ -1,8 +1,13 @@ using System; using System.Runtime.CompilerServices; using UnityEngine; + using static UnityEngine.ParticleSystem; +#if UNITY_2020_2_OR_NEWER +using System.Diagnostics.CodeAnalysis; +#endif + namespace OUCC.FluentParticleSystem { public static class ExternalForcesModuleExtension @@ -12,7 +17,18 @@ public static class ExternalForcesModuleExtension /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditExternalForces(this ParticleSystem particleSystem, Action moduleEditor) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem EditExternalForces( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Action moduleEditor) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); @@ -25,7 +41,14 @@ public static ParticleSystem EditExternalForces(this ParticleSystem particleSyst /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetExternalForcesEnabled(this ParticleSystem particleSystem, bool enabled) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetExternalForcesEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool enabled) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.externalForces; @@ -37,7 +60,18 @@ public static ParticleSystem SetExternalForcesEnabled(this ParticleSystem partic /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetExternalForcesEnabled(this ParticleSystem particleSystem, Func enabledChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetExternalForcesEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); @@ -60,7 +94,11 @@ public static ExternalForcesModule SetEnabled(this ExternalForcesModule module, /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ExternalForcesModule SetEnabled(this ExternalForcesModule module, Func enabledChanger) + public static ExternalForcesModule SetEnabled(this ExternalForcesModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); module.enabled = enabledChanger(module.enabled); @@ -73,7 +111,14 @@ public static ExternalForcesModule SetEnabled(this ExternalForcesModule module, /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetExternalForcesInfluenceFilter(this ParticleSystem particleSystem, ParticleSystemGameObjectFilter influenceFilter) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetExternalForcesInfluenceFilter( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, ParticleSystemGameObjectFilter influenceFilter) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.externalForces; @@ -85,7 +130,18 @@ public static ParticleSystem SetExternalForcesInfluenceFilter(this ParticleSyste /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetExternalForcesInfluenceFilter(this ParticleSystem particleSystem, Func influenceFilterChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetExternalForcesInfluenceFilter( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func influenceFilterChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(influenceFilterChanger != null, "influenceFilterChanger cannot be null"); @@ -108,7 +164,11 @@ public static ExternalForcesModule SetInfluenceFilter(this ExternalForcesModule /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ExternalForcesModule SetInfluenceFilter(this ExternalForcesModule module, Func influenceFilterChanger) + public static ExternalForcesModule SetInfluenceFilter(this ExternalForcesModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func influenceFilterChanger) { Debug.Assert(influenceFilterChanger != null, "influenceFilterChanger cannot be null"); module.influenceFilter = influenceFilterChanger(module.influenceFilter); @@ -123,7 +183,14 @@ public static ExternalForcesModule SetInfluenceFilter(this ExternalForcesModule /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetExternalForcesInfluenceMask(this ParticleSystem particleSystem, LayerMask influenceMask) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetExternalForcesInfluenceMask( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, LayerMask influenceMask) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.externalForces; @@ -135,7 +202,18 @@ public static ParticleSystem SetExternalForcesInfluenceMask(this ParticleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetExternalForcesInfluenceMask(this ParticleSystem particleSystem, Func influenceMaskChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetExternalForcesInfluenceMask( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func influenceMaskChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(influenceMaskChanger != null, "influenceMaskChanger cannot be null"); @@ -158,7 +236,11 @@ public static ExternalForcesModule SetInfluenceMask(this ExternalForcesModule mo /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ExternalForcesModule SetInfluenceMask(this ExternalForcesModule module, Func influenceMaskChanger) + public static ExternalForcesModule SetInfluenceMask(this ExternalForcesModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func influenceMaskChanger) { Debug.Assert(influenceMaskChanger != null, "influenceMaskChanger cannot be null"); module.influenceMask = influenceMaskChanger(module.influenceMask); @@ -173,7 +255,14 @@ public static ExternalForcesModule SetInfluenceMask(this ExternalForcesModule mo /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetExternalForcesMultiplier(this ParticleSystem particleSystem, float multiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetExternalForcesMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float multiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.externalForces; @@ -185,7 +274,18 @@ public static ParticleSystem SetExternalForcesMultiplier(this ParticleSystem par /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetExternalForcesMultiplier(this ParticleSystem particleSystem, Func multiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetExternalForcesMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func multiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(multiplierChanger != null, "multiplierChanger cannot be null"); @@ -208,7 +308,11 @@ public static ExternalForcesModule SetMultiplier(this ExternalForcesModule modul /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ExternalForcesModule SetMultiplier(this ExternalForcesModule module, Func multiplierChanger) + public static ExternalForcesModule SetMultiplier(this ExternalForcesModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func multiplierChanger) { Debug.Assert(multiplierChanger != null, "multiplierChanger cannot be null"); module.multiplier = multiplierChanger(module.multiplier); @@ -223,7 +327,14 @@ public static ExternalForcesModule SetMultiplier(this ExternalForcesModule modul /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetExternalForcesMultiplierCurve(this ParticleSystem particleSystem, MinMaxCurve multiplierCurve) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetExternalForcesMultiplierCurve( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve multiplierCurve) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.externalForces; @@ -235,7 +346,18 @@ public static ParticleSystem SetExternalForcesMultiplierCurve(this ParticleSyste /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetExternalForcesMultiplierCurve(this ParticleSystem particleSystem, Func multiplierCurveChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetExternalForcesMultiplierCurve( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func multiplierCurveChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(multiplierCurveChanger != null, "multiplierCurveChanger cannot be null"); @@ -258,7 +380,11 @@ public static ExternalForcesModule SetMultiplierCurve(this ExternalForcesModule /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ExternalForcesModule SetMultiplierCurve(this ExternalForcesModule module, Func multiplierCurveChanger) + public static ExternalForcesModule SetMultiplierCurve(this ExternalForcesModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func multiplierCurveChanger) { Debug.Assert(multiplierCurveChanger != null, "multiplierCurveChanger cannot be null"); module.multiplierCurve = multiplierCurveChanger(module.multiplierCurve); diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/ExternalForcesModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Extensions/ExternalForcesModuleExtension.cs.meta similarity index 100% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/ExternalForcesModuleExtension.cs.meta rename to Packages/FluentParticleSystem/Runtime/Extensions/ExternalForcesModuleExtension.cs.meta diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/ForceOverLifetimeModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/Extensions/ForceOverLifetimeModuleExtension.cs similarity index 72% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/ForceOverLifetimeModuleExtension.cs rename to Packages/FluentParticleSystem/Runtime/Extensions/ForceOverLifetimeModuleExtension.cs index b964220..6f69fc0 100644 --- a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/ForceOverLifetimeModuleExtension.cs +++ b/Packages/FluentParticleSystem/Runtime/Extensions/ForceOverLifetimeModuleExtension.cs @@ -1,8 +1,13 @@ using System; using System.Runtime.CompilerServices; using UnityEngine; + using static UnityEngine.ParticleSystem; +#if UNITY_2020_2_OR_NEWER +using System.Diagnostics.CodeAnalysis; +#endif + namespace OUCC.FluentParticleSystem { public static class ForceOverLifetimeModuleExtension @@ -12,7 +17,18 @@ public static class ForceOverLifetimeModuleExtension /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditForceOverLifetime(this ParticleSystem particleSystem, Action moduleEditor) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem EditForceOverLifetime( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Action moduleEditor) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); @@ -25,7 +41,14 @@ public static ParticleSystem EditForceOverLifetime(this ParticleSystem particleS /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetForceOverLifetimeEnabled(this ParticleSystem particleSystem, bool enabled) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetForceOverLifetimeEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool enabled) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.forceOverLifetime; @@ -37,7 +60,18 @@ public static ParticleSystem SetForceOverLifetimeEnabled(this ParticleSystem par /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetForceOverLifetimeEnabled(this ParticleSystem particleSystem, Func enabledChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetForceOverLifetimeEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); @@ -60,7 +94,11 @@ public static ForceOverLifetimeModule SetEnabled(this ForceOverLifetimeModule mo /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ForceOverLifetimeModule SetEnabled(this ForceOverLifetimeModule module, Func enabledChanger) + public static ForceOverLifetimeModule SetEnabled(this ForceOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); module.enabled = enabledChanger(module.enabled); @@ -73,7 +111,14 @@ public static ForceOverLifetimeModule SetEnabled(this ForceOverLifetimeModule mo /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetForceOverLifetimeRandomized(this ParticleSystem particleSystem, bool randomized) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetForceOverLifetimeRandomized( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool randomized) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.forceOverLifetime; @@ -85,7 +130,18 @@ public static ParticleSystem SetForceOverLifetimeRandomized(this ParticleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetForceOverLifetimeRandomized(this ParticleSystem particleSystem, Func randomizedChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetForceOverLifetimeRandomized( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func randomizedChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(randomizedChanger != null, "randomizedChanger cannot be null"); @@ -108,7 +164,11 @@ public static ForceOverLifetimeModule SetRandomized(this ForceOverLifetimeModule /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ForceOverLifetimeModule SetRandomized(this ForceOverLifetimeModule module, Func randomizedChanger) + public static ForceOverLifetimeModule SetRandomized(this ForceOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func randomizedChanger) { Debug.Assert(randomizedChanger != null, "randomizedChanger cannot be null"); module.randomized = randomizedChanger(module.randomized); @@ -121,7 +181,14 @@ public static ForceOverLifetimeModule SetRandomized(this ForceOverLifetimeModule /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetForceOverLifetimeSpace(this ParticleSystem particleSystem, ParticleSystemSimulationSpace space) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetForceOverLifetimeSpace( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, ParticleSystemSimulationSpace space) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.forceOverLifetime; @@ -133,7 +200,18 @@ public static ParticleSystem SetForceOverLifetimeSpace(this ParticleSystem parti /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetForceOverLifetimeSpace(this ParticleSystem particleSystem, Func spaceChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetForceOverLifetimeSpace( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func spaceChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(spaceChanger != null, "spaceChanger cannot be null"); @@ -156,7 +234,11 @@ public static ForceOverLifetimeModule SetSpace(this ForceOverLifetimeModule modu /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ForceOverLifetimeModule SetSpace(this ForceOverLifetimeModule module, Func spaceChanger) + public static ForceOverLifetimeModule SetSpace(this ForceOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func spaceChanger) { Debug.Assert(spaceChanger != null, "spaceChanger cannot be null"); module.space = spaceChanger(module.space); @@ -169,7 +251,14 @@ public static ForceOverLifetimeModule SetSpace(this ForceOverLifetimeModule modu /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetForceOverLifetimeX(this ParticleSystem particleSystem, MinMaxCurve x) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetForceOverLifetimeX( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve x) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.forceOverLifetime; @@ -181,7 +270,18 @@ public static ParticleSystem SetForceOverLifetimeX(this ParticleSystem particleS /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetForceOverLifetimeX(this ParticleSystem particleSystem, Func xChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetForceOverLifetimeX( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func xChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(xChanger != null, "xChanger cannot be null"); @@ -204,7 +304,11 @@ public static ForceOverLifetimeModule SetX(this ForceOverLifetimeModule module, /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ForceOverLifetimeModule SetX(this ForceOverLifetimeModule module, Func xChanger) + public static ForceOverLifetimeModule SetX(this ForceOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func xChanger) { Debug.Assert(xChanger != null, "xChanger cannot be null"); module.x = xChanger(module.x); @@ -217,7 +321,14 @@ public static ForceOverLifetimeModule SetX(this ForceOverLifetimeModule module, /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetForceOverLifetimeXMultiplier(this ParticleSystem particleSystem, float xMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetForceOverLifetimeXMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float xMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.forceOverLifetime; @@ -229,7 +340,18 @@ public static ParticleSystem SetForceOverLifetimeXMultiplier(this ParticleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetForceOverLifetimeXMultiplier(this ParticleSystem particleSystem, Func xMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetForceOverLifetimeXMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func xMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(xMultiplierChanger != null, "xMultiplierChanger cannot be null"); @@ -252,7 +374,11 @@ public static ForceOverLifetimeModule SetXMultiplier(this ForceOverLifetimeModul /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ForceOverLifetimeModule SetXMultiplier(this ForceOverLifetimeModule module, Func xMultiplierChanger) + public static ForceOverLifetimeModule SetXMultiplier(this ForceOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func xMultiplierChanger) { Debug.Assert(xMultiplierChanger != null, "xMultiplierChanger cannot be null"); module.xMultiplier = xMultiplierChanger(module.xMultiplier); @@ -265,7 +391,14 @@ public static ForceOverLifetimeModule SetXMultiplier(this ForceOverLifetimeModul /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetForceOverLifetimeY(this ParticleSystem particleSystem, MinMaxCurve y) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetForceOverLifetimeY( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve y) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.forceOverLifetime; @@ -277,7 +410,18 @@ public static ParticleSystem SetForceOverLifetimeY(this ParticleSystem particleS /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetForceOverLifetimeY(this ParticleSystem particleSystem, Func yChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetForceOverLifetimeY( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func yChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(yChanger != null, "yChanger cannot be null"); @@ -300,7 +444,11 @@ public static ForceOverLifetimeModule SetY(this ForceOverLifetimeModule module, /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ForceOverLifetimeModule SetY(this ForceOverLifetimeModule module, Func yChanger) + public static ForceOverLifetimeModule SetY(this ForceOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func yChanger) { Debug.Assert(yChanger != null, "yChanger cannot be null"); module.y = yChanger(module.y); @@ -313,7 +461,14 @@ public static ForceOverLifetimeModule SetY(this ForceOverLifetimeModule module, /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetForceOverLifetimeYMultiplier(this ParticleSystem particleSystem, float yMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetForceOverLifetimeYMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float yMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.forceOverLifetime; @@ -325,7 +480,18 @@ public static ParticleSystem SetForceOverLifetimeYMultiplier(this ParticleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetForceOverLifetimeYMultiplier(this ParticleSystem particleSystem, Func yMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetForceOverLifetimeYMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func yMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(yMultiplierChanger != null, "yMultiplierChanger cannot be null"); @@ -348,7 +514,11 @@ public static ForceOverLifetimeModule SetYMultiplier(this ForceOverLifetimeModul /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ForceOverLifetimeModule SetYMultiplier(this ForceOverLifetimeModule module, Func yMultiplierChanger) + public static ForceOverLifetimeModule SetYMultiplier(this ForceOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func yMultiplierChanger) { Debug.Assert(yMultiplierChanger != null, "yMultiplierChanger cannot be null"); module.yMultiplier = yMultiplierChanger(module.yMultiplier); @@ -361,7 +531,14 @@ public static ForceOverLifetimeModule SetYMultiplier(this ForceOverLifetimeModul /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetForceOverLifetimeZ(this ParticleSystem particleSystem, MinMaxCurve z) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetForceOverLifetimeZ( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve z) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.forceOverLifetime; @@ -373,7 +550,18 @@ public static ParticleSystem SetForceOverLifetimeZ(this ParticleSystem particleS /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetForceOverLifetimeZ(this ParticleSystem particleSystem, Func zChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetForceOverLifetimeZ( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func zChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(zChanger != null, "zChanger cannot be null"); @@ -396,7 +584,11 @@ public static ForceOverLifetimeModule SetZ(this ForceOverLifetimeModule module, /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ForceOverLifetimeModule SetZ(this ForceOverLifetimeModule module, Func zChanger) + public static ForceOverLifetimeModule SetZ(this ForceOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func zChanger) { Debug.Assert(zChanger != null, "zChanger cannot be null"); module.z = zChanger(module.z); @@ -409,7 +601,14 @@ public static ForceOverLifetimeModule SetZ(this ForceOverLifetimeModule module, /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetForceOverLifetimeZMultiplier(this ParticleSystem particleSystem, float zMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetForceOverLifetimeZMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float zMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.forceOverLifetime; @@ -421,7 +620,18 @@ public static ParticleSystem SetForceOverLifetimeZMultiplier(this ParticleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetForceOverLifetimeZMultiplier(this ParticleSystem particleSystem, Func zMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetForceOverLifetimeZMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func zMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(zMultiplierChanger != null, "zMultiplierChanger cannot be null"); @@ -444,7 +654,11 @@ public static ForceOverLifetimeModule SetZMultiplier(this ForceOverLifetimeModul /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ForceOverLifetimeModule SetZMultiplier(this ForceOverLifetimeModule module, Func zMultiplierChanger) + public static ForceOverLifetimeModule SetZMultiplier(this ForceOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func zMultiplierChanger) { Debug.Assert(zMultiplierChanger != null, "zMultiplierChanger cannot be null"); module.zMultiplier = zMultiplierChanger(module.zMultiplier); diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/ForceOverLifetimeModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Extensions/ForceOverLifetimeModuleExtension.cs.meta similarity index 100% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/ForceOverLifetimeModuleExtension.cs.meta rename to Packages/FluentParticleSystem/Runtime/Extensions/ForceOverLifetimeModuleExtension.cs.meta diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/InheritVelocityModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/Extensions/InheritVelocityModuleExtension.cs similarity index 70% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/InheritVelocityModuleExtension.cs rename to Packages/FluentParticleSystem/Runtime/Extensions/InheritVelocityModuleExtension.cs index c363651..9c5e30e 100644 --- a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/InheritVelocityModuleExtension.cs +++ b/Packages/FluentParticleSystem/Runtime/Extensions/InheritVelocityModuleExtension.cs @@ -1,8 +1,13 @@ using System; using System.Runtime.CompilerServices; using UnityEngine; + using static UnityEngine.ParticleSystem; +#if UNITY_2020_2_OR_NEWER +using System.Diagnostics.CodeAnalysis; +#endif + namespace OUCC.FluentParticleSystem { public static class InheritVelocityModuleExtension @@ -12,7 +17,18 @@ public static class InheritVelocityModuleExtension /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditInheritVelocity(this ParticleSystem particleSystem, Action moduleEditor) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem EditInheritVelocity( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Action moduleEditor) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); @@ -25,7 +41,14 @@ public static ParticleSystem EditInheritVelocity(this ParticleSystem particleSys /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetInheritVelocityCurve(this ParticleSystem particleSystem, MinMaxCurve curve) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetInheritVelocityCurve( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve curve) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.inheritVelocity; @@ -37,7 +60,18 @@ public static ParticleSystem SetInheritVelocityCurve(this ParticleSystem particl /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetInheritVelocityCurve(this ParticleSystem particleSystem, Func curveChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetInheritVelocityCurve( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func curveChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(curveChanger != null, "curveChanger cannot be null"); @@ -60,7 +94,11 @@ public static InheritVelocityModule SetCurve(this InheritVelocityModule module, /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static InheritVelocityModule SetCurve(this InheritVelocityModule module, Func curveChanger) + public static InheritVelocityModule SetCurve(this InheritVelocityModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func curveChanger) { Debug.Assert(curveChanger != null, "curveChanger cannot be null"); module.curve = curveChanger(module.curve); @@ -73,7 +111,14 @@ public static InheritVelocityModule SetCurve(this InheritVelocityModule module, /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetInheritVelocityCurveMultiplier(this ParticleSystem particleSystem, float curveMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetInheritVelocityCurveMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float curveMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.inheritVelocity; @@ -85,7 +130,18 @@ public static ParticleSystem SetInheritVelocityCurveMultiplier(this ParticleSyst /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetInheritVelocityCurveMultiplier(this ParticleSystem particleSystem, Func curveMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetInheritVelocityCurveMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func curveMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(curveMultiplierChanger != null, "curveMultiplierChanger cannot be null"); @@ -108,7 +164,11 @@ public static InheritVelocityModule SetCurveMultiplier(this InheritVelocityModul /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static InheritVelocityModule SetCurveMultiplier(this InheritVelocityModule module, Func curveMultiplierChanger) + public static InheritVelocityModule SetCurveMultiplier(this InheritVelocityModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func curveMultiplierChanger) { Debug.Assert(curveMultiplierChanger != null, "curveMultiplierChanger cannot be null"); module.curveMultiplier = curveMultiplierChanger(module.curveMultiplier); @@ -121,7 +181,14 @@ public static InheritVelocityModule SetCurveMultiplier(this InheritVelocityModul /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetInheritVelocityEnabled(this ParticleSystem particleSystem, bool enabled) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetInheritVelocityEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool enabled) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.inheritVelocity; @@ -133,7 +200,18 @@ public static ParticleSystem SetInheritVelocityEnabled(this ParticleSystem parti /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetInheritVelocityEnabled(this ParticleSystem particleSystem, Func enabledChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetInheritVelocityEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); @@ -156,7 +234,11 @@ public static InheritVelocityModule SetEnabled(this InheritVelocityModule module /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static InheritVelocityModule SetEnabled(this InheritVelocityModule module, Func enabledChanger) + public static InheritVelocityModule SetEnabled(this InheritVelocityModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); module.enabled = enabledChanger(module.enabled); @@ -169,7 +251,14 @@ public static InheritVelocityModule SetEnabled(this InheritVelocityModule module /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetInheritVelocityMode(this ParticleSystem particleSystem, ParticleSystemInheritVelocityMode mode) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetInheritVelocityMode( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, ParticleSystemInheritVelocityMode mode) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.inheritVelocity; @@ -181,7 +270,18 @@ public static ParticleSystem SetInheritVelocityMode(this ParticleSystem particle /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetInheritVelocityMode(this ParticleSystem particleSystem, Func modeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetInheritVelocityMode( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func modeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(modeChanger != null, "modeChanger cannot be null"); @@ -204,7 +304,11 @@ public static InheritVelocityModule SetMode(this InheritVelocityModule module, P /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static InheritVelocityModule SetMode(this InheritVelocityModule module, Func modeChanger) + public static InheritVelocityModule SetMode(this InheritVelocityModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func modeChanger) { Debug.Assert(modeChanger != null, "modeChanger cannot be null"); module.mode = modeChanger(module.mode); diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/InheritVelocityModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Extensions/InheritVelocityModuleExtension.cs.meta similarity index 100% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/InheritVelocityModuleExtension.cs.meta rename to Packages/FluentParticleSystem/Runtime/Extensions/InheritVelocityModuleExtension.cs.meta diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/LifetimeByEmitterSpeedModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/Extensions/LifetimeByEmitterSpeedModuleExtension.cs similarity index 74% rename from Packages/FluentParticleSystem/Runtime/Nullable/Extensions/LifetimeByEmitterSpeedModuleExtension.cs rename to Packages/FluentParticleSystem/Runtime/Extensions/LifetimeByEmitterSpeedModuleExtension.cs index abfe4dc..c758a80 100644 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/LifetimeByEmitterSpeedModuleExtension.cs +++ b/Packages/FluentParticleSystem/Runtime/Extensions/LifetimeByEmitterSpeedModuleExtension.cs @@ -1,9 +1,13 @@ -#nullable enable using System; using System.Runtime.CompilerServices; using UnityEngine; + using static UnityEngine.ParticleSystem; +#if UNITY_2020_2_OR_NEWER +using System.Diagnostics.CodeAnalysis; +#endif + namespace OUCC.FluentParticleSystem { public static class LifetimeByEmitterSpeedModuleExtension @@ -13,7 +17,18 @@ public static class LifetimeByEmitterSpeedModuleExtension /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditLifetimeByEmitterSpeed(this ParticleSystem particleSystem, Action moduleEditor) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem EditLifetimeByEmitterSpeed( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Action moduleEditor) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); @@ -26,7 +41,14 @@ public static ParticleSystem EditLifetimeByEmitterSpeed(this ParticleSystem part /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLifetimeByEmitterSpeedCurve(this ParticleSystem particleSystem, MinMaxCurve curve) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLifetimeByEmitterSpeedCurve( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve curve) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.lifetimeByEmitterSpeed; @@ -38,7 +60,18 @@ public static ParticleSystem SetLifetimeByEmitterSpeedCurve(this ParticleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLifetimeByEmitterSpeedCurve(this ParticleSystem particleSystem, Func curveChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLifetimeByEmitterSpeedCurve( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func curveChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(curveChanger != null, "curveChanger cannot be null"); @@ -61,7 +94,11 @@ public static LifetimeByEmitterSpeedModule SetCurve(this LifetimeByEmitterSpeedM /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LifetimeByEmitterSpeedModule SetCurve(this LifetimeByEmitterSpeedModule module, Func curveChanger) + public static LifetimeByEmitterSpeedModule SetCurve(this LifetimeByEmitterSpeedModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func curveChanger) { Debug.Assert(curveChanger != null, "curveChanger cannot be null"); module.curve = curveChanger(module.curve); @@ -74,7 +111,14 @@ public static LifetimeByEmitterSpeedModule SetCurve(this LifetimeByEmitterSpeedM /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLifetimeByEmitterSpeedCurveMultiplier(this ParticleSystem particleSystem, float curveMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLifetimeByEmitterSpeedCurveMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float curveMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.lifetimeByEmitterSpeed; @@ -86,7 +130,18 @@ public static ParticleSystem SetLifetimeByEmitterSpeedCurveMultiplier(this Parti /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLifetimeByEmitterSpeedCurveMultiplier(this ParticleSystem particleSystem, Func curveMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLifetimeByEmitterSpeedCurveMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func curveMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(curveMultiplierChanger != null, "curveMultiplierChanger cannot be null"); @@ -109,7 +164,11 @@ public static LifetimeByEmitterSpeedModule SetCurveMultiplier(this LifetimeByEmi /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LifetimeByEmitterSpeedModule SetCurveMultiplier(this LifetimeByEmitterSpeedModule module, Func curveMultiplierChanger) + public static LifetimeByEmitterSpeedModule SetCurveMultiplier(this LifetimeByEmitterSpeedModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func curveMultiplierChanger) { Debug.Assert(curveMultiplierChanger != null, "curveMultiplierChanger cannot be null"); module.curveMultiplier = curveMultiplierChanger(module.curveMultiplier); @@ -122,7 +181,14 @@ public static LifetimeByEmitterSpeedModule SetCurveMultiplier(this LifetimeByEmi /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLifetimeByEmitterSpeedEnabled(this ParticleSystem particleSystem, bool enabled) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLifetimeByEmitterSpeedEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool enabled) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.lifetimeByEmitterSpeed; @@ -134,7 +200,18 @@ public static ParticleSystem SetLifetimeByEmitterSpeedEnabled(this ParticleSyste /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLifetimeByEmitterSpeedEnabled(this ParticleSystem particleSystem, Func enabledChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLifetimeByEmitterSpeedEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); @@ -157,7 +234,11 @@ public static LifetimeByEmitterSpeedModule SetEnabled(this LifetimeByEmitterSpee /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LifetimeByEmitterSpeedModule SetEnabled(this LifetimeByEmitterSpeedModule module, Func enabledChanger) + public static LifetimeByEmitterSpeedModule SetEnabled(this LifetimeByEmitterSpeedModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); module.enabled = enabledChanger(module.enabled); @@ -170,7 +251,14 @@ public static LifetimeByEmitterSpeedModule SetEnabled(this LifetimeByEmitterSpee /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLifetimeByEmitterSpeedRange(this ParticleSystem particleSystem, Vector2 range) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLifetimeByEmitterSpeedRange( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, Vector2 range) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.lifetimeByEmitterSpeed; @@ -182,7 +270,18 @@ public static ParticleSystem SetLifetimeByEmitterSpeedRange(this ParticleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLifetimeByEmitterSpeedRange(this ParticleSystem particleSystem, Func rangeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLifetimeByEmitterSpeedRange( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func rangeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(rangeChanger != null, "rangeChanger cannot be null"); @@ -205,7 +304,11 @@ public static LifetimeByEmitterSpeedModule SetRange(this LifetimeByEmitterSpeedM /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LifetimeByEmitterSpeedModule SetRange(this LifetimeByEmitterSpeedModule module, Func rangeChanger) + public static LifetimeByEmitterSpeedModule SetRange(this LifetimeByEmitterSpeedModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func rangeChanger) { Debug.Assert(rangeChanger != null, "rangeChanger cannot be null"); module.range = rangeChanger(module.range); diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/LifetimeByEmitterSpeedModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Extensions/LifetimeByEmitterSpeedModuleExtension.cs.meta similarity index 100% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/LifetimeByEmitterSpeedModuleExtension.cs.meta rename to Packages/FluentParticleSystem/Runtime/Extensions/LifetimeByEmitterSpeedModuleExtension.cs.meta diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/LightsModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/Extensions/LightsModuleExtension.cs similarity index 72% rename from Packages/FluentParticleSystem/Runtime/Nullable/Extensions/LightsModuleExtension.cs rename to Packages/FluentParticleSystem/Runtime/Extensions/LightsModuleExtension.cs index bf36af0..bce0693 100644 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/LightsModuleExtension.cs +++ b/Packages/FluentParticleSystem/Runtime/Extensions/LightsModuleExtension.cs @@ -1,9 +1,13 @@ -#nullable enable using System; using System.Runtime.CompilerServices; using UnityEngine; + using static UnityEngine.ParticleSystem; +#if UNITY_2020_2_OR_NEWER +using System.Diagnostics.CodeAnalysis; +#endif + namespace OUCC.FluentParticleSystem { public static class LightsModuleExtension @@ -13,7 +17,18 @@ public static class LightsModuleExtension /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditLights(this ParticleSystem particleSystem, Action moduleEditor) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem EditLights( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Action moduleEditor) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); @@ -26,7 +41,14 @@ public static ParticleSystem EditLights(this ParticleSystem particleSystem, Acti /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsAlphaAffectsIntensity(this ParticleSystem particleSystem, bool alphaAffectsIntensity) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLightsAlphaAffectsIntensity( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool alphaAffectsIntensity) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.lights; @@ -38,7 +60,18 @@ public static ParticleSystem SetLightsAlphaAffectsIntensity(this ParticleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsAlphaAffectsIntensity(this ParticleSystem particleSystem, Func alphaAffectsIntensityChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLightsAlphaAffectsIntensity( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func alphaAffectsIntensityChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(alphaAffectsIntensityChanger != null, "alphaAffectsIntensityChanger cannot be null"); @@ -61,7 +94,11 @@ public static LightsModule SetAlphaAffectsIntensity(this LightsModule module, bo /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LightsModule SetAlphaAffectsIntensity(this LightsModule module, Func alphaAffectsIntensityChanger) + public static LightsModule SetAlphaAffectsIntensity(this LightsModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func alphaAffectsIntensityChanger) { Debug.Assert(alphaAffectsIntensityChanger != null, "alphaAffectsIntensityChanger cannot be null"); module.alphaAffectsIntensity = alphaAffectsIntensityChanger(module.alphaAffectsIntensity); @@ -74,7 +111,14 @@ public static LightsModule SetAlphaAffectsIntensity(this LightsModule module, Fu /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsEnabled(this ParticleSystem particleSystem, bool enabled) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLightsEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool enabled) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.lights; @@ -86,7 +130,18 @@ public static ParticleSystem SetLightsEnabled(this ParticleSystem particleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsEnabled(this ParticleSystem particleSystem, Func enabledChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLightsEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); @@ -109,7 +164,11 @@ public static LightsModule SetEnabled(this LightsModule module, bool enabled) /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LightsModule SetEnabled(this LightsModule module, Func enabledChanger) + public static LightsModule SetEnabled(this LightsModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); module.enabled = enabledChanger(module.enabled); @@ -122,7 +181,14 @@ public static LightsModule SetEnabled(this LightsModule module, Func /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsIntensity(this ParticleSystem particleSystem, MinMaxCurve intensity) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLightsIntensity( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve intensity) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.lights; @@ -134,7 +200,18 @@ public static ParticleSystem SetLightsIntensity(this ParticleSystem particleSyst /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsIntensity(this ParticleSystem particleSystem, Func intensityChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLightsIntensity( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func intensityChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(intensityChanger != null, "intensityChanger cannot be null"); @@ -157,7 +234,11 @@ public static LightsModule SetIntensity(this LightsModule module, MinMaxCurve in /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LightsModule SetIntensity(this LightsModule module, Func intensityChanger) + public static LightsModule SetIntensity(this LightsModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func intensityChanger) { Debug.Assert(intensityChanger != null, "intensityChanger cannot be null"); module.intensity = intensityChanger(module.intensity); @@ -170,7 +251,14 @@ public static LightsModule SetIntensity(this LightsModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsIntensityMultiplier(this ParticleSystem particleSystem, float intensityMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLightsIntensityMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float intensityMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.lights; @@ -182,7 +270,18 @@ public static ParticleSystem SetLightsIntensityMultiplier(this ParticleSystem pa /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsIntensityMultiplier(this ParticleSystem particleSystem, Func intensityMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLightsIntensityMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func intensityMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(intensityMultiplierChanger != null, "intensityMultiplierChanger cannot be null"); @@ -205,7 +304,11 @@ public static LightsModule SetIntensityMultiplier(this LightsModule module, floa /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LightsModule SetIntensityMultiplier(this LightsModule module, Func intensityMultiplierChanger) + public static LightsModule SetIntensityMultiplier(this LightsModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func intensityMultiplierChanger) { Debug.Assert(intensityMultiplierChanger != null, "intensityMultiplierChanger cannot be null"); module.intensityMultiplier = intensityMultiplierChanger(module.intensityMultiplier); @@ -218,7 +321,14 @@ public static LightsModule SetIntensityMultiplier(this LightsModule module, Func /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsLight(this ParticleSystem particleSystem, Light light) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLightsLight( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, Light light) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.lights; @@ -230,7 +340,18 @@ public static ParticleSystem SetLightsLight(this ParticleSystem particleSystem, /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsLight(this ParticleSystem particleSystem, Func lightChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLightsLight( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func lightChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(lightChanger != null, "lightChanger cannot be null"); @@ -253,7 +374,11 @@ public static LightsModule SetLight(this LightsModule module, Light light) /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LightsModule SetLight(this LightsModule module, Func lightChanger) + public static LightsModule SetLight(this LightsModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func lightChanger) { Debug.Assert(lightChanger != null, "lightChanger cannot be null"); module.light = lightChanger(module.light); @@ -266,7 +391,14 @@ public static LightsModule SetLight(this LightsModule module, Func /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsMaxLights(this ParticleSystem particleSystem, int maxLights) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLightsMaxLights( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, int maxLights) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.lights; @@ -278,7 +410,18 @@ public static ParticleSystem SetLightsMaxLights(this ParticleSystem particleSyst /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsMaxLights(this ParticleSystem particleSystem, Func maxLightsChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLightsMaxLights( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func maxLightsChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(maxLightsChanger != null, "maxLightsChanger cannot be null"); @@ -301,7 +444,11 @@ public static LightsModule SetMaxLights(this LightsModule module, int maxLights) /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LightsModule SetMaxLights(this LightsModule module, Func maxLightsChanger) + public static LightsModule SetMaxLights(this LightsModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func maxLightsChanger) { Debug.Assert(maxLightsChanger != null, "maxLightsChanger cannot be null"); module.maxLights = maxLightsChanger(module.maxLights); @@ -314,7 +461,14 @@ public static LightsModule SetMaxLights(this LightsModule module, Func /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsRange(this ParticleSystem particleSystem, MinMaxCurve range) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLightsRange( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve range) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.lights; @@ -326,7 +480,18 @@ public static ParticleSystem SetLightsRange(this ParticleSystem particleSystem, /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsRange(this ParticleSystem particleSystem, Func rangeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLightsRange( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func rangeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(rangeChanger != null, "rangeChanger cannot be null"); @@ -349,7 +514,11 @@ public static LightsModule SetRange(this LightsModule module, MinMaxCurve range) /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LightsModule SetRange(this LightsModule module, Func rangeChanger) + public static LightsModule SetRange(this LightsModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func rangeChanger) { Debug.Assert(rangeChanger != null, "rangeChanger cannot be null"); module.range = rangeChanger(module.range); @@ -362,7 +531,14 @@ public static LightsModule SetRange(this LightsModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsRangeMultiplier(this ParticleSystem particleSystem, float rangeMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLightsRangeMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float rangeMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.lights; @@ -374,7 +550,18 @@ public static ParticleSystem SetLightsRangeMultiplier(this ParticleSystem partic /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsRangeMultiplier(this ParticleSystem particleSystem, Func rangeMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLightsRangeMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func rangeMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(rangeMultiplierChanger != null, "rangeMultiplierChanger cannot be null"); @@ -397,7 +584,11 @@ public static LightsModule SetRangeMultiplier(this LightsModule module, float ra /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LightsModule SetRangeMultiplier(this LightsModule module, Func rangeMultiplierChanger) + public static LightsModule SetRangeMultiplier(this LightsModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func rangeMultiplierChanger) { Debug.Assert(rangeMultiplierChanger != null, "rangeMultiplierChanger cannot be null"); module.rangeMultiplier = rangeMultiplierChanger(module.rangeMultiplier); @@ -410,7 +601,14 @@ public static LightsModule SetRangeMultiplier(this LightsModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsRatio(this ParticleSystem particleSystem, float ratio) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLightsRatio( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float ratio) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.lights; @@ -422,7 +620,18 @@ public static ParticleSystem SetLightsRatio(this ParticleSystem particleSystem, /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsRatio(this ParticleSystem particleSystem, Func ratioChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLightsRatio( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func ratioChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(ratioChanger != null, "ratioChanger cannot be null"); @@ -445,7 +654,11 @@ public static LightsModule SetRatio(this LightsModule module, float ratio) /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LightsModule SetRatio(this LightsModule module, Func ratioChanger) + public static LightsModule SetRatio(this LightsModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func ratioChanger) { Debug.Assert(ratioChanger != null, "ratioChanger cannot be null"); module.ratio = ratioChanger(module.ratio); @@ -458,7 +671,14 @@ public static LightsModule SetRatio(this LightsModule module, Func /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsSizeAffectsRange(this ParticleSystem particleSystem, bool sizeAffectsRange) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLightsSizeAffectsRange( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool sizeAffectsRange) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.lights; @@ -470,7 +690,18 @@ public static ParticleSystem SetLightsSizeAffectsRange(this ParticleSystem parti /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsSizeAffectsRange(this ParticleSystem particleSystem, Func sizeAffectsRangeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLightsSizeAffectsRange( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func sizeAffectsRangeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(sizeAffectsRangeChanger != null, "sizeAffectsRangeChanger cannot be null"); @@ -493,7 +724,11 @@ public static LightsModule SetSizeAffectsRange(this LightsModule module, bool si /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LightsModule SetSizeAffectsRange(this LightsModule module, Func sizeAffectsRangeChanger) + public static LightsModule SetSizeAffectsRange(this LightsModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func sizeAffectsRangeChanger) { Debug.Assert(sizeAffectsRangeChanger != null, "sizeAffectsRangeChanger cannot be null"); module.sizeAffectsRange = sizeAffectsRangeChanger(module.sizeAffectsRange); @@ -506,7 +741,14 @@ public static LightsModule SetSizeAffectsRange(this LightsModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsUseParticleColor(this ParticleSystem particleSystem, bool useParticleColor) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLightsUseParticleColor( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool useParticleColor) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.lights; @@ -518,7 +760,18 @@ public static ParticleSystem SetLightsUseParticleColor(this ParticleSystem parti /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsUseParticleColor(this ParticleSystem particleSystem, Func useParticleColorChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLightsUseParticleColor( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func useParticleColorChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(useParticleColorChanger != null, "useParticleColorChanger cannot be null"); @@ -541,7 +794,11 @@ public static LightsModule SetUseParticleColor(this LightsModule module, bool us /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LightsModule SetUseParticleColor(this LightsModule module, Func useParticleColorChanger) + public static LightsModule SetUseParticleColor(this LightsModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func useParticleColorChanger) { Debug.Assert(useParticleColorChanger != null, "useParticleColorChanger cannot be null"); module.useParticleColor = useParticleColorChanger(module.useParticleColor); @@ -554,7 +811,14 @@ public static LightsModule SetUseParticleColor(this LightsModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsUseRandomDistribution(this ParticleSystem particleSystem, bool useRandomDistribution) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLightsUseRandomDistribution( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool useRandomDistribution) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.lights; @@ -566,7 +830,18 @@ public static ParticleSystem SetLightsUseRandomDistribution(this ParticleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsUseRandomDistribution(this ParticleSystem particleSystem, Func useRandomDistributionChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLightsUseRandomDistribution( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func useRandomDistributionChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(useRandomDistributionChanger != null, "useRandomDistributionChanger cannot be null"); @@ -589,7 +864,11 @@ public static LightsModule SetUseRandomDistribution(this LightsModule module, bo /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LightsModule SetUseRandomDistribution(this LightsModule module, Func useRandomDistributionChanger) + public static LightsModule SetUseRandomDistribution(this LightsModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func useRandomDistributionChanger) { Debug.Assert(useRandomDistributionChanger != null, "useRandomDistributionChanger cannot be null"); module.useRandomDistribution = useRandomDistributionChanger(module.useRandomDistribution); diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/LightsModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Extensions/LightsModuleExtension.cs.meta similarity index 100% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/LightsModuleExtension.cs.meta rename to Packages/FluentParticleSystem/Runtime/Extensions/LightsModuleExtension.cs.meta diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/LimitVelocityOverLifetimeModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/Extensions/LimitVelocityOverLifetimeModuleExtension.cs similarity index 75% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/LimitVelocityOverLifetimeModuleExtension.cs rename to Packages/FluentParticleSystem/Runtime/Extensions/LimitVelocityOverLifetimeModuleExtension.cs index 90abddd..7e4a6a3 100644 --- a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/LimitVelocityOverLifetimeModuleExtension.cs +++ b/Packages/FluentParticleSystem/Runtime/Extensions/LimitVelocityOverLifetimeModuleExtension.cs @@ -1,8 +1,13 @@ using System; using System.Runtime.CompilerServices; using UnityEngine; + using static UnityEngine.ParticleSystem; +#if UNITY_2020_2_OR_NEWER +using System.Diagnostics.CodeAnalysis; +#endif + namespace OUCC.FluentParticleSystem { public static class LimitVelocityOverLifetimeModuleExtension @@ -12,7 +17,18 @@ public static class LimitVelocityOverLifetimeModuleExtension /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditLimitVelocityOverLifetime(this ParticleSystem particleSystem, Action moduleEditor) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem EditLimitVelocityOverLifetime( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Action moduleEditor) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); @@ -25,7 +41,14 @@ public static ParticleSystem EditLimitVelocityOverLifetime(this ParticleSystem p /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeDampen(this ParticleSystem particleSystem, float dampen) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLimitVelocityOverLifetimeDampen( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float dampen) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.limitVelocityOverLifetime; @@ -37,7 +60,18 @@ public static ParticleSystem SetLimitVelocityOverLifetimeDampen(this ParticleSys /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeDampen(this ParticleSystem particleSystem, Func dampenChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLimitVelocityOverLifetimeDampen( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func dampenChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(dampenChanger != null, "dampenChanger cannot be null"); @@ -60,7 +94,11 @@ public static LimitVelocityOverLifetimeModule SetDampen(this LimitVelocityOverLi /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetDampen(this LimitVelocityOverLifetimeModule module, Func dampenChanger) + public static LimitVelocityOverLifetimeModule SetDampen(this LimitVelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func dampenChanger) { Debug.Assert(dampenChanger != null, "dampenChanger cannot be null"); module.dampen = dampenChanger(module.dampen); @@ -73,7 +111,14 @@ public static LimitVelocityOverLifetimeModule SetDampen(this LimitVelocityOverLi /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeDrag(this ParticleSystem particleSystem, MinMaxCurve drag) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLimitVelocityOverLifetimeDrag( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve drag) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.limitVelocityOverLifetime; @@ -85,7 +130,18 @@ public static ParticleSystem SetLimitVelocityOverLifetimeDrag(this ParticleSyste /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeDrag(this ParticleSystem particleSystem, Func dragChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLimitVelocityOverLifetimeDrag( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func dragChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(dragChanger != null, "dragChanger cannot be null"); @@ -108,7 +164,11 @@ public static LimitVelocityOverLifetimeModule SetDrag(this LimitVelocityOverLife /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetDrag(this LimitVelocityOverLifetimeModule module, Func dragChanger) + public static LimitVelocityOverLifetimeModule SetDrag(this LimitVelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func dragChanger) { Debug.Assert(dragChanger != null, "dragChanger cannot be null"); module.drag = dragChanger(module.drag); @@ -121,7 +181,14 @@ public static LimitVelocityOverLifetimeModule SetDrag(this LimitVelocityOverLife /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeDragMultiplier(this ParticleSystem particleSystem, float dragMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLimitVelocityOverLifetimeDragMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float dragMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.limitVelocityOverLifetime; @@ -133,7 +200,18 @@ public static ParticleSystem SetLimitVelocityOverLifetimeDragMultiplier(this Par /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeDragMultiplier(this ParticleSystem particleSystem, Func dragMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLimitVelocityOverLifetimeDragMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func dragMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(dragMultiplierChanger != null, "dragMultiplierChanger cannot be null"); @@ -156,7 +234,11 @@ public static LimitVelocityOverLifetimeModule SetDragMultiplier(this LimitVeloci /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetDragMultiplier(this LimitVelocityOverLifetimeModule module, Func dragMultiplierChanger) + public static LimitVelocityOverLifetimeModule SetDragMultiplier(this LimitVelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func dragMultiplierChanger) { Debug.Assert(dragMultiplierChanger != null, "dragMultiplierChanger cannot be null"); module.dragMultiplier = dragMultiplierChanger(module.dragMultiplier); @@ -169,7 +251,14 @@ public static LimitVelocityOverLifetimeModule SetDragMultiplier(this LimitVeloci /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeEnabled(this ParticleSystem particleSystem, bool enabled) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLimitVelocityOverLifetimeEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool enabled) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.limitVelocityOverLifetime; @@ -181,7 +270,18 @@ public static ParticleSystem SetLimitVelocityOverLifetimeEnabled(this ParticleSy /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeEnabled(this ParticleSystem particleSystem, Func enabledChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLimitVelocityOverLifetimeEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); @@ -204,7 +304,11 @@ public static LimitVelocityOverLifetimeModule SetEnabled(this LimitVelocityOverL /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetEnabled(this LimitVelocityOverLifetimeModule module, Func enabledChanger) + public static LimitVelocityOverLifetimeModule SetEnabled(this LimitVelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); module.enabled = enabledChanger(module.enabled); @@ -217,7 +321,14 @@ public static LimitVelocityOverLifetimeModule SetEnabled(this LimitVelocityOverL /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeLimit(this ParticleSystem particleSystem, MinMaxCurve limit) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLimitVelocityOverLifetimeLimit( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve limit) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.limitVelocityOverLifetime; @@ -229,7 +340,18 @@ public static ParticleSystem SetLimitVelocityOverLifetimeLimit(this ParticleSyst /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeLimit(this ParticleSystem particleSystem, Func limitChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLimitVelocityOverLifetimeLimit( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func limitChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(limitChanger != null, "limitChanger cannot be null"); @@ -252,7 +374,11 @@ public static LimitVelocityOverLifetimeModule SetLimit(this LimitVelocityOverLif /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetLimit(this LimitVelocityOverLifetimeModule module, Func limitChanger) + public static LimitVelocityOverLifetimeModule SetLimit(this LimitVelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func limitChanger) { Debug.Assert(limitChanger != null, "limitChanger cannot be null"); module.limit = limitChanger(module.limit); @@ -265,7 +391,14 @@ public static LimitVelocityOverLifetimeModule SetLimit(this LimitVelocityOverLif /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeLimitMultiplier(this ParticleSystem particleSystem, float limitMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLimitVelocityOverLifetimeLimitMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float limitMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.limitVelocityOverLifetime; @@ -277,7 +410,18 @@ public static ParticleSystem SetLimitVelocityOverLifetimeLimitMultiplier(this Pa /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeLimitMultiplier(this ParticleSystem particleSystem, Func limitMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLimitVelocityOverLifetimeLimitMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func limitMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(limitMultiplierChanger != null, "limitMultiplierChanger cannot be null"); @@ -300,7 +444,11 @@ public static LimitVelocityOverLifetimeModule SetLimitMultiplier(this LimitVeloc /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetLimitMultiplier(this LimitVelocityOverLifetimeModule module, Func limitMultiplierChanger) + public static LimitVelocityOverLifetimeModule SetLimitMultiplier(this LimitVelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func limitMultiplierChanger) { Debug.Assert(limitMultiplierChanger != null, "limitMultiplierChanger cannot be null"); module.limitMultiplier = limitMultiplierChanger(module.limitMultiplier); @@ -313,7 +461,14 @@ public static LimitVelocityOverLifetimeModule SetLimitMultiplier(this LimitVeloc /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeLimitX(this ParticleSystem particleSystem, MinMaxCurve limitX) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLimitVelocityOverLifetimeLimitX( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve limitX) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.limitVelocityOverLifetime; @@ -325,7 +480,18 @@ public static ParticleSystem SetLimitVelocityOverLifetimeLimitX(this ParticleSys /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeLimitX(this ParticleSystem particleSystem, Func limitXChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLimitVelocityOverLifetimeLimitX( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func limitXChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(limitXChanger != null, "limitXChanger cannot be null"); @@ -348,7 +514,11 @@ public static LimitVelocityOverLifetimeModule SetLimitX(this LimitVelocityOverLi /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetLimitX(this LimitVelocityOverLifetimeModule module, Func limitXChanger) + public static LimitVelocityOverLifetimeModule SetLimitX(this LimitVelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func limitXChanger) { Debug.Assert(limitXChanger != null, "limitXChanger cannot be null"); module.limitX = limitXChanger(module.limitX); @@ -361,7 +531,14 @@ public static LimitVelocityOverLifetimeModule SetLimitX(this LimitVelocityOverLi /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeLimitXMultiplier(this ParticleSystem particleSystem, float limitXMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLimitVelocityOverLifetimeLimitXMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float limitXMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.limitVelocityOverLifetime; @@ -373,7 +550,18 @@ public static ParticleSystem SetLimitVelocityOverLifetimeLimitXMultiplier(this P /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeLimitXMultiplier(this ParticleSystem particleSystem, Func limitXMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLimitVelocityOverLifetimeLimitXMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func limitXMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(limitXMultiplierChanger != null, "limitXMultiplierChanger cannot be null"); @@ -396,7 +584,11 @@ public static LimitVelocityOverLifetimeModule SetLimitXMultiplier(this LimitVelo /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetLimitXMultiplier(this LimitVelocityOverLifetimeModule module, Func limitXMultiplierChanger) + public static LimitVelocityOverLifetimeModule SetLimitXMultiplier(this LimitVelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func limitXMultiplierChanger) { Debug.Assert(limitXMultiplierChanger != null, "limitXMultiplierChanger cannot be null"); module.limitXMultiplier = limitXMultiplierChanger(module.limitXMultiplier); @@ -409,7 +601,14 @@ public static LimitVelocityOverLifetimeModule SetLimitXMultiplier(this LimitVelo /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeLimitY(this ParticleSystem particleSystem, MinMaxCurve limitY) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLimitVelocityOverLifetimeLimitY( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve limitY) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.limitVelocityOverLifetime; @@ -421,7 +620,18 @@ public static ParticleSystem SetLimitVelocityOverLifetimeLimitY(this ParticleSys /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeLimitY(this ParticleSystem particleSystem, Func limitYChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLimitVelocityOverLifetimeLimitY( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func limitYChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(limitYChanger != null, "limitYChanger cannot be null"); @@ -444,7 +654,11 @@ public static LimitVelocityOverLifetimeModule SetLimitY(this LimitVelocityOverLi /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetLimitY(this LimitVelocityOverLifetimeModule module, Func limitYChanger) + public static LimitVelocityOverLifetimeModule SetLimitY(this LimitVelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func limitYChanger) { Debug.Assert(limitYChanger != null, "limitYChanger cannot be null"); module.limitY = limitYChanger(module.limitY); @@ -457,7 +671,14 @@ public static LimitVelocityOverLifetimeModule SetLimitY(this LimitVelocityOverLi /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeLimitYMultiplier(this ParticleSystem particleSystem, float limitYMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLimitVelocityOverLifetimeLimitYMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float limitYMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.limitVelocityOverLifetime; @@ -469,7 +690,18 @@ public static ParticleSystem SetLimitVelocityOverLifetimeLimitYMultiplier(this P /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeLimitYMultiplier(this ParticleSystem particleSystem, Func limitYMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLimitVelocityOverLifetimeLimitYMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func limitYMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(limitYMultiplierChanger != null, "limitYMultiplierChanger cannot be null"); @@ -492,7 +724,11 @@ public static LimitVelocityOverLifetimeModule SetLimitYMultiplier(this LimitVelo /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetLimitYMultiplier(this LimitVelocityOverLifetimeModule module, Func limitYMultiplierChanger) + public static LimitVelocityOverLifetimeModule SetLimitYMultiplier(this LimitVelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func limitYMultiplierChanger) { Debug.Assert(limitYMultiplierChanger != null, "limitYMultiplierChanger cannot be null"); module.limitYMultiplier = limitYMultiplierChanger(module.limitYMultiplier); @@ -505,7 +741,14 @@ public static LimitVelocityOverLifetimeModule SetLimitYMultiplier(this LimitVelo /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeLimitZ(this ParticleSystem particleSystem, MinMaxCurve limitZ) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLimitVelocityOverLifetimeLimitZ( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve limitZ) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.limitVelocityOverLifetime; @@ -517,7 +760,18 @@ public static ParticleSystem SetLimitVelocityOverLifetimeLimitZ(this ParticleSys /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeLimitZ(this ParticleSystem particleSystem, Func limitZChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLimitVelocityOverLifetimeLimitZ( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func limitZChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(limitZChanger != null, "limitZChanger cannot be null"); @@ -540,7 +794,11 @@ public static LimitVelocityOverLifetimeModule SetLimitZ(this LimitVelocityOverLi /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetLimitZ(this LimitVelocityOverLifetimeModule module, Func limitZChanger) + public static LimitVelocityOverLifetimeModule SetLimitZ(this LimitVelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func limitZChanger) { Debug.Assert(limitZChanger != null, "limitZChanger cannot be null"); module.limitZ = limitZChanger(module.limitZ); @@ -553,7 +811,14 @@ public static LimitVelocityOverLifetimeModule SetLimitZ(this LimitVelocityOverLi /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeLimitZMultiplier(this ParticleSystem particleSystem, float limitZMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLimitVelocityOverLifetimeLimitZMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float limitZMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.limitVelocityOverLifetime; @@ -565,7 +830,18 @@ public static ParticleSystem SetLimitVelocityOverLifetimeLimitZMultiplier(this P /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeLimitZMultiplier(this ParticleSystem particleSystem, Func limitZMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLimitVelocityOverLifetimeLimitZMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func limitZMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(limitZMultiplierChanger != null, "limitZMultiplierChanger cannot be null"); @@ -588,7 +864,11 @@ public static LimitVelocityOverLifetimeModule SetLimitZMultiplier(this LimitVelo /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetLimitZMultiplier(this LimitVelocityOverLifetimeModule module, Func limitZMultiplierChanger) + public static LimitVelocityOverLifetimeModule SetLimitZMultiplier(this LimitVelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func limitZMultiplierChanger) { Debug.Assert(limitZMultiplierChanger != null, "limitZMultiplierChanger cannot be null"); module.limitZMultiplier = limitZMultiplierChanger(module.limitZMultiplier); @@ -601,7 +881,14 @@ public static LimitVelocityOverLifetimeModule SetLimitZMultiplier(this LimitVelo /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeMultiplyDragByParticleSize(this ParticleSystem particleSystem, bool multiplyDragByParticleSize) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLimitVelocityOverLifetimeMultiplyDragByParticleSize( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool multiplyDragByParticleSize) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.limitVelocityOverLifetime; @@ -613,7 +900,18 @@ public static ParticleSystem SetLimitVelocityOverLifetimeMultiplyDragByParticleS /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeMultiplyDragByParticleSize(this ParticleSystem particleSystem, Func multiplyDragByParticleSizeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLimitVelocityOverLifetimeMultiplyDragByParticleSize( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func multiplyDragByParticleSizeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(multiplyDragByParticleSizeChanger != null, "multiplyDragByParticleSizeChanger cannot be null"); @@ -636,7 +934,11 @@ public static LimitVelocityOverLifetimeModule SetMultiplyDragByParticleSize(this /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetMultiplyDragByParticleSize(this LimitVelocityOverLifetimeModule module, Func multiplyDragByParticleSizeChanger) + public static LimitVelocityOverLifetimeModule SetMultiplyDragByParticleSize(this LimitVelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func multiplyDragByParticleSizeChanger) { Debug.Assert(multiplyDragByParticleSizeChanger != null, "multiplyDragByParticleSizeChanger cannot be null"); module.multiplyDragByParticleSize = multiplyDragByParticleSizeChanger(module.multiplyDragByParticleSize); @@ -649,7 +951,14 @@ public static LimitVelocityOverLifetimeModule SetMultiplyDragByParticleSize(this /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeMultiplyDragByParticleVelocity(this ParticleSystem particleSystem, bool multiplyDragByParticleVelocity) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLimitVelocityOverLifetimeMultiplyDragByParticleVelocity( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool multiplyDragByParticleVelocity) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.limitVelocityOverLifetime; @@ -661,7 +970,18 @@ public static ParticleSystem SetLimitVelocityOverLifetimeMultiplyDragByParticleV /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeMultiplyDragByParticleVelocity(this ParticleSystem particleSystem, Func multiplyDragByParticleVelocityChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLimitVelocityOverLifetimeMultiplyDragByParticleVelocity( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func multiplyDragByParticleVelocityChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(multiplyDragByParticleVelocityChanger != null, "multiplyDragByParticleVelocityChanger cannot be null"); @@ -684,7 +1004,11 @@ public static LimitVelocityOverLifetimeModule SetMultiplyDragByParticleVelocity( /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetMultiplyDragByParticleVelocity(this LimitVelocityOverLifetimeModule module, Func multiplyDragByParticleVelocityChanger) + public static LimitVelocityOverLifetimeModule SetMultiplyDragByParticleVelocity(this LimitVelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func multiplyDragByParticleVelocityChanger) { Debug.Assert(multiplyDragByParticleVelocityChanger != null, "multiplyDragByParticleVelocityChanger cannot be null"); module.multiplyDragByParticleVelocity = multiplyDragByParticleVelocityChanger(module.multiplyDragByParticleVelocity); @@ -697,7 +1021,14 @@ public static LimitVelocityOverLifetimeModule SetMultiplyDragByParticleVelocity( /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeSeparateAxes(this ParticleSystem particleSystem, bool separateAxes) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLimitVelocityOverLifetimeSeparateAxes( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool separateAxes) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.limitVelocityOverLifetime; @@ -709,7 +1040,18 @@ public static ParticleSystem SetLimitVelocityOverLifetimeSeparateAxes(this Parti /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeSeparateAxes(this ParticleSystem particleSystem, Func separateAxesChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLimitVelocityOverLifetimeSeparateAxes( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func separateAxesChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(separateAxesChanger != null, "separateAxesChanger cannot be null"); @@ -732,7 +1074,11 @@ public static LimitVelocityOverLifetimeModule SetSeparateAxes(this LimitVelocity /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetSeparateAxes(this LimitVelocityOverLifetimeModule module, Func separateAxesChanger) + public static LimitVelocityOverLifetimeModule SetSeparateAxes(this LimitVelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func separateAxesChanger) { Debug.Assert(separateAxesChanger != null, "separateAxesChanger cannot be null"); module.separateAxes = separateAxesChanger(module.separateAxes); @@ -745,7 +1091,14 @@ public static LimitVelocityOverLifetimeModule SetSeparateAxes(this LimitVelocity /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeSpace(this ParticleSystem particleSystem, ParticleSystemSimulationSpace space) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLimitVelocityOverLifetimeSpace( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, ParticleSystemSimulationSpace space) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.limitVelocityOverLifetime; @@ -757,7 +1110,18 @@ public static ParticleSystem SetLimitVelocityOverLifetimeSpace(this ParticleSyst /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeSpace(this ParticleSystem particleSystem, Func spaceChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetLimitVelocityOverLifetimeSpace( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func spaceChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(spaceChanger != null, "spaceChanger cannot be null"); @@ -780,7 +1144,11 @@ public static LimitVelocityOverLifetimeModule SetSpace(this LimitVelocityOverLif /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetSpace(this LimitVelocityOverLifetimeModule module, Func spaceChanger) + public static LimitVelocityOverLifetimeModule SetSpace(this LimitVelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func spaceChanger) { Debug.Assert(spaceChanger != null, "spaceChanger cannot be null"); module.space = spaceChanger(module.space); diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/LimitVelocityOverLifetimeModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Extensions/LimitVelocityOverLifetimeModuleExtension.cs.meta similarity index 100% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/LimitVelocityOverLifetimeModuleExtension.cs.meta rename to Packages/FluentParticleSystem/Runtime/Extensions/LimitVelocityOverLifetimeModuleExtension.cs.meta diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/MainModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/Extensions/MainModuleExtension.cs similarity index 72% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/MainModuleExtension.cs rename to Packages/FluentParticleSystem/Runtime/Extensions/MainModuleExtension.cs index 01b2b43..b66c68f 100644 --- a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/MainModuleExtension.cs +++ b/Packages/FluentParticleSystem/Runtime/Extensions/MainModuleExtension.cs @@ -1,8 +1,13 @@ using System; using System.Runtime.CompilerServices; using UnityEngine; + using static UnityEngine.ParticleSystem; +#if UNITY_2020_2_OR_NEWER +using System.Diagnostics.CodeAnalysis; +#endif + namespace OUCC.FluentParticleSystem { public static class MainModuleExtension @@ -12,7 +17,18 @@ public static class MainModuleExtension /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditMain(this ParticleSystem particleSystem, Action moduleEditor) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem EditMain( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Action moduleEditor) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); @@ -25,7 +41,14 @@ public static ParticleSystem EditMain(this ParticleSystem particleSystem, Action /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainCullingMode(this ParticleSystem particleSystem, ParticleSystemCullingMode cullingMode) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainCullingMode( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, ParticleSystemCullingMode cullingMode) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -37,7 +60,18 @@ public static ParticleSystem SetMainCullingMode(this ParticleSystem particleSyst /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainCullingMode(this ParticleSystem particleSystem, Func cullingModeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainCullingMode( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func cullingModeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(cullingModeChanger != null, "cullingModeChanger cannot be null"); @@ -60,7 +94,11 @@ public static MainModule SetCullingMode(this MainModule module, ParticleSystemCu /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetCullingMode(this MainModule module, Func cullingModeChanger) + public static MainModule SetCullingMode(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func cullingModeChanger) { Debug.Assert(cullingModeChanger != null, "cullingModeChanger cannot be null"); module.cullingMode = cullingModeChanger(module.cullingMode); @@ -73,7 +111,14 @@ public static MainModule SetCullingMode(this MainModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainCustomSimulationSpace(this ParticleSystem particleSystem, Transform customSimulationSpace) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainCustomSimulationSpace( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, Transform customSimulationSpace) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -85,7 +130,18 @@ public static ParticleSystem SetMainCustomSimulationSpace(this ParticleSystem pa /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainCustomSimulationSpace(this ParticleSystem particleSystem, Func customSimulationSpaceChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainCustomSimulationSpace( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func customSimulationSpaceChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(customSimulationSpaceChanger != null, "customSimulationSpaceChanger cannot be null"); @@ -108,7 +164,11 @@ public static MainModule SetCustomSimulationSpace(this MainModule module, Transf /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetCustomSimulationSpace(this MainModule module, Func customSimulationSpaceChanger) + public static MainModule SetCustomSimulationSpace(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func customSimulationSpaceChanger) { Debug.Assert(customSimulationSpaceChanger != null, "customSimulationSpaceChanger cannot be null"); module.customSimulationSpace = customSimulationSpaceChanger(module.customSimulationSpace); @@ -121,7 +181,14 @@ public static MainModule SetCustomSimulationSpace(this MainModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainDuration(this ParticleSystem particleSystem, float duration) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainDuration( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float duration) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -133,7 +200,18 @@ public static ParticleSystem SetMainDuration(this ParticleSystem particleSystem, /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainDuration(this ParticleSystem particleSystem, Func durationChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainDuration( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func durationChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(durationChanger != null, "durationChanger cannot be null"); @@ -156,7 +234,11 @@ public static MainModule SetDuration(this MainModule module, float duration) /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetDuration(this MainModule module, Func durationChanger) + public static MainModule SetDuration(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func durationChanger) { Debug.Assert(durationChanger != null, "durationChanger cannot be null"); module.duration = durationChanger(module.duration); @@ -171,7 +253,14 @@ public static MainModule SetDuration(this MainModule module, Func /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainEmitterVelocity(this ParticleSystem particleSystem, Vector3 emitterVelocity) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainEmitterVelocity( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, Vector3 emitterVelocity) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -183,7 +272,18 @@ public static ParticleSystem SetMainEmitterVelocity(this ParticleSystem particle /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainEmitterVelocity(this ParticleSystem particleSystem, Func emitterVelocityChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainEmitterVelocity( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func emitterVelocityChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(emitterVelocityChanger != null, "emitterVelocityChanger cannot be null"); @@ -206,7 +306,11 @@ public static MainModule SetEmitterVelocity(this MainModule module, Vector3 emit /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetEmitterVelocity(this MainModule module, Func emitterVelocityChanger) + public static MainModule SetEmitterVelocity(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func emitterVelocityChanger) { Debug.Assert(emitterVelocityChanger != null, "emitterVelocityChanger cannot be null"); module.emitterVelocity = emitterVelocityChanger(module.emitterVelocity); @@ -221,7 +325,14 @@ public static MainModule SetEmitterVelocity(this MainModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainEmitterVelocityMode(this ParticleSystem particleSystem, ParticleSystemEmitterVelocityMode emitterVelocityMode) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainEmitterVelocityMode( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, ParticleSystemEmitterVelocityMode emitterVelocityMode) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -233,7 +344,18 @@ public static ParticleSystem SetMainEmitterVelocityMode(this ParticleSystem part /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainEmitterVelocityMode(this ParticleSystem particleSystem, Func emitterVelocityModeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainEmitterVelocityMode( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func emitterVelocityModeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(emitterVelocityModeChanger != null, "emitterVelocityModeChanger cannot be null"); @@ -256,7 +378,11 @@ public static MainModule SetEmitterVelocityMode(this MainModule module, Particle /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetEmitterVelocityMode(this MainModule module, Func emitterVelocityModeChanger) + public static MainModule SetEmitterVelocityMode(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func emitterVelocityModeChanger) { Debug.Assert(emitterVelocityModeChanger != null, "emitterVelocityModeChanger cannot be null"); module.emitterVelocityMode = emitterVelocityModeChanger(module.emitterVelocityMode); @@ -269,7 +395,14 @@ public static MainModule SetEmitterVelocityMode(this MainModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainFlipRotation(this ParticleSystem particleSystem, float flipRotation) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainFlipRotation( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float flipRotation) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -281,7 +414,18 @@ public static ParticleSystem SetMainFlipRotation(this ParticleSystem particleSys /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainFlipRotation(this ParticleSystem particleSystem, Func flipRotationChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainFlipRotation( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func flipRotationChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(flipRotationChanger != null, "flipRotationChanger cannot be null"); @@ -304,7 +448,11 @@ public static MainModule SetFlipRotation(this MainModule module, float flipRotat /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetFlipRotation(this MainModule module, Func flipRotationChanger) + public static MainModule SetFlipRotation(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func flipRotationChanger) { Debug.Assert(flipRotationChanger != null, "flipRotationChanger cannot be null"); module.flipRotation = flipRotationChanger(module.flipRotation); @@ -317,7 +465,14 @@ public static MainModule SetFlipRotation(this MainModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainGravityModifier(this ParticleSystem particleSystem, MinMaxCurve gravityModifier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainGravityModifier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve gravityModifier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -329,7 +484,18 @@ public static ParticleSystem SetMainGravityModifier(this ParticleSystem particle /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainGravityModifier(this ParticleSystem particleSystem, Func gravityModifierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainGravityModifier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func gravityModifierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(gravityModifierChanger != null, "gravityModifierChanger cannot be null"); @@ -352,7 +518,11 @@ public static MainModule SetGravityModifier(this MainModule module, MinMaxCurve /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetGravityModifier(this MainModule module, Func gravityModifierChanger) + public static MainModule SetGravityModifier(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func gravityModifierChanger) { Debug.Assert(gravityModifierChanger != null, "gravityModifierChanger cannot be null"); module.gravityModifier = gravityModifierChanger(module.gravityModifier); @@ -365,7 +535,14 @@ public static MainModule SetGravityModifier(this MainModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainGravityModifierMultiplier(this ParticleSystem particleSystem, float gravityModifierMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainGravityModifierMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float gravityModifierMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -377,7 +554,18 @@ public static ParticleSystem SetMainGravityModifierMultiplier(this ParticleSyste /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainGravityModifierMultiplier(this ParticleSystem particleSystem, Func gravityModifierMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainGravityModifierMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func gravityModifierMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(gravityModifierMultiplierChanger != null, "gravityModifierMultiplierChanger cannot be null"); @@ -400,7 +588,11 @@ public static MainModule SetGravityModifierMultiplier(this MainModule module, fl /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetGravityModifierMultiplier(this MainModule module, Func gravityModifierMultiplierChanger) + public static MainModule SetGravityModifierMultiplier(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func gravityModifierMultiplierChanger) { Debug.Assert(gravityModifierMultiplierChanger != null, "gravityModifierMultiplierChanger cannot be null"); module.gravityModifierMultiplier = gravityModifierMultiplierChanger(module.gravityModifierMultiplier); @@ -415,7 +607,14 @@ public static MainModule SetGravityModifierMultiplier(this MainModule module, Fu /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainGravitySource(this ParticleSystem particleSystem, ParticleSystemGravitySource gravitySource) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainGravitySource( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, ParticleSystemGravitySource gravitySource) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -427,7 +626,18 @@ public static ParticleSystem SetMainGravitySource(this ParticleSystem particleSy /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainGravitySource(this ParticleSystem particleSystem, Func gravitySourceChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainGravitySource( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func gravitySourceChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(gravitySourceChanger != null, "gravitySourceChanger cannot be null"); @@ -450,7 +660,11 @@ public static MainModule SetGravitySource(this MainModule module, ParticleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetGravitySource(this MainModule module, Func gravitySourceChanger) + public static MainModule SetGravitySource(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func gravitySourceChanger) { Debug.Assert(gravitySourceChanger != null, "gravitySourceChanger cannot be null"); module.gravitySource = gravitySourceChanger(module.gravitySource); @@ -465,7 +679,14 @@ public static MainModule SetGravitySource(this MainModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainLoop(this ParticleSystem particleSystem, bool loop) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainLoop( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool loop) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -477,7 +698,18 @@ public static ParticleSystem SetMainLoop(this ParticleSystem particleSystem, boo /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainLoop(this ParticleSystem particleSystem, Func loopChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainLoop( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func loopChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(loopChanger != null, "loopChanger cannot be null"); @@ -500,7 +732,11 @@ public static MainModule SetLoop(this MainModule module, bool loop) /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetLoop(this MainModule module, Func loopChanger) + public static MainModule SetLoop(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func loopChanger) { Debug.Assert(loopChanger != null, "loopChanger cannot be null"); module.loop = loopChanger(module.loop); @@ -513,7 +749,14 @@ public static MainModule SetLoop(this MainModule module, Func loopCh /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainMaxParticles(this ParticleSystem particleSystem, int maxParticles) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainMaxParticles( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, int maxParticles) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -525,7 +768,18 @@ public static ParticleSystem SetMainMaxParticles(this ParticleSystem particleSys /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainMaxParticles(this ParticleSystem particleSystem, Func maxParticlesChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainMaxParticles( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func maxParticlesChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(maxParticlesChanger != null, "maxParticlesChanger cannot be null"); @@ -548,7 +802,11 @@ public static MainModule SetMaxParticles(this MainModule module, int maxParticle /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetMaxParticles(this MainModule module, Func maxParticlesChanger) + public static MainModule SetMaxParticles(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func maxParticlesChanger) { Debug.Assert(maxParticlesChanger != null, "maxParticlesChanger cannot be null"); module.maxParticles = maxParticlesChanger(module.maxParticles); @@ -561,7 +819,14 @@ public static MainModule SetMaxParticles(this MainModule module, Func /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainPlayOnAwake(this ParticleSystem particleSystem, bool playOnAwake) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainPlayOnAwake( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool playOnAwake) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -573,7 +838,18 @@ public static ParticleSystem SetMainPlayOnAwake(this ParticleSystem particleSyst /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainPlayOnAwake(this ParticleSystem particleSystem, Func playOnAwakeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainPlayOnAwake( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func playOnAwakeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(playOnAwakeChanger != null, "playOnAwakeChanger cannot be null"); @@ -596,7 +872,11 @@ public static MainModule SetPlayOnAwake(this MainModule module, bool playOnAwake /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetPlayOnAwake(this MainModule module, Func playOnAwakeChanger) + public static MainModule SetPlayOnAwake(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func playOnAwakeChanger) { Debug.Assert(playOnAwakeChanger != null, "playOnAwakeChanger cannot be null"); module.playOnAwake = playOnAwakeChanger(module.playOnAwake); @@ -609,7 +889,14 @@ public static MainModule SetPlayOnAwake(this MainModule module, Func /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainPrewarm(this ParticleSystem particleSystem, bool prewarm) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainPrewarm( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool prewarm) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -621,7 +908,18 @@ public static ParticleSystem SetMainPrewarm(this ParticleSystem particleSystem, /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainPrewarm(this ParticleSystem particleSystem, Func prewarmChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainPrewarm( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func prewarmChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(prewarmChanger != null, "prewarmChanger cannot be null"); @@ -644,7 +942,11 @@ public static MainModule SetPrewarm(this MainModule module, bool prewarm) /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetPrewarm(this MainModule module, Func prewarmChanger) + public static MainModule SetPrewarm(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func prewarmChanger) { Debug.Assert(prewarmChanger != null, "prewarmChanger cannot be null"); module.prewarm = prewarmChanger(module.prewarm); @@ -660,7 +962,14 @@ public static MainModule SetPrewarm(this MainModule module, Func pre [Obsolete("Please use flipRotation instead. (UnityUpgradable) -> UnityEngine.ParticleSystem/MainModule.flipRotation", false)] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainRandomizeRotationDirection(this ParticleSystem particleSystem, float randomizeRotationDirection) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainRandomizeRotationDirection( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float randomizeRotationDirection) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -675,7 +984,18 @@ public static ParticleSystem SetMainRandomizeRotationDirection(this ParticleSyst [Obsolete("Please use flipRotation instead. (UnityUpgradable) -> UnityEngine.ParticleSystem/MainModule.flipRotation", false)] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainRandomizeRotationDirection(this ParticleSystem particleSystem, Func randomizeRotationDirectionChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainRandomizeRotationDirection( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func randomizeRotationDirectionChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(randomizeRotationDirectionChanger != null, "randomizeRotationDirectionChanger cannot be null"); @@ -704,7 +1024,11 @@ public static MainModule SetRandomizeRotationDirection(this MainModule module, f [Obsolete("Please use flipRotation instead. (UnityUpgradable) -> UnityEngine.ParticleSystem/MainModule.flipRotation", false)] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetRandomizeRotationDirection(this MainModule module, Func randomizeRotationDirectionChanger) + public static MainModule SetRandomizeRotationDirection(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func randomizeRotationDirectionChanger) { Debug.Assert(randomizeRotationDirectionChanger != null, "randomizeRotationDirectionChanger cannot be null"); module.randomizeRotationDirection = randomizeRotationDirectionChanger(module.randomizeRotationDirection); @@ -717,7 +1041,14 @@ public static MainModule SetRandomizeRotationDirection(this MainModule module, F /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainRingBufferLoopRange(this ParticleSystem particleSystem, Vector2 ringBufferLoopRange) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainRingBufferLoopRange( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, Vector2 ringBufferLoopRange) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -729,7 +1060,18 @@ public static ParticleSystem SetMainRingBufferLoopRange(this ParticleSystem part /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainRingBufferLoopRange(this ParticleSystem particleSystem, Func ringBufferLoopRangeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainRingBufferLoopRange( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func ringBufferLoopRangeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(ringBufferLoopRangeChanger != null, "ringBufferLoopRangeChanger cannot be null"); @@ -752,7 +1094,11 @@ public static MainModule SetRingBufferLoopRange(this MainModule module, Vector2 /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetRingBufferLoopRange(this MainModule module, Func ringBufferLoopRangeChanger) + public static MainModule SetRingBufferLoopRange(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func ringBufferLoopRangeChanger) { Debug.Assert(ringBufferLoopRangeChanger != null, "ringBufferLoopRangeChanger cannot be null"); module.ringBufferLoopRange = ringBufferLoopRangeChanger(module.ringBufferLoopRange); @@ -765,7 +1111,14 @@ public static MainModule SetRingBufferLoopRange(this MainModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainRingBufferMode(this ParticleSystem particleSystem, ParticleSystemRingBufferMode ringBufferMode) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainRingBufferMode( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, ParticleSystemRingBufferMode ringBufferMode) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -777,7 +1130,18 @@ public static ParticleSystem SetMainRingBufferMode(this ParticleSystem particleS /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainRingBufferMode(this ParticleSystem particleSystem, Func ringBufferModeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainRingBufferMode( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func ringBufferModeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(ringBufferModeChanger != null, "ringBufferModeChanger cannot be null"); @@ -800,7 +1164,11 @@ public static MainModule SetRingBufferMode(this MainModule module, ParticleSyste /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetRingBufferMode(this MainModule module, Func ringBufferModeChanger) + public static MainModule SetRingBufferMode(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func ringBufferModeChanger) { Debug.Assert(ringBufferModeChanger != null, "ringBufferModeChanger cannot be null"); module.ringBufferMode = ringBufferModeChanger(module.ringBufferMode); @@ -813,7 +1181,14 @@ public static MainModule SetRingBufferMode(this MainModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainScalingMode(this ParticleSystem particleSystem, ParticleSystemScalingMode scalingMode) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainScalingMode( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, ParticleSystemScalingMode scalingMode) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -825,7 +1200,18 @@ public static ParticleSystem SetMainScalingMode(this ParticleSystem particleSyst /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainScalingMode(this ParticleSystem particleSystem, Func scalingModeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainScalingMode( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func scalingModeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(scalingModeChanger != null, "scalingModeChanger cannot be null"); @@ -848,7 +1234,11 @@ public static MainModule SetScalingMode(this MainModule module, ParticleSystemSc /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetScalingMode(this MainModule module, Func scalingModeChanger) + public static MainModule SetScalingMode(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func scalingModeChanger) { Debug.Assert(scalingModeChanger != null, "scalingModeChanger cannot be null"); module.scalingMode = scalingModeChanger(module.scalingMode); @@ -861,7 +1251,14 @@ public static MainModule SetScalingMode(this MainModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainSimulationSpace(this ParticleSystem particleSystem, ParticleSystemSimulationSpace simulationSpace) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainSimulationSpace( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, ParticleSystemSimulationSpace simulationSpace) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -873,7 +1270,18 @@ public static ParticleSystem SetMainSimulationSpace(this ParticleSystem particle /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainSimulationSpace(this ParticleSystem particleSystem, Func simulationSpaceChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainSimulationSpace( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func simulationSpaceChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(simulationSpaceChanger != null, "simulationSpaceChanger cannot be null"); @@ -896,7 +1304,11 @@ public static MainModule SetSimulationSpace(this MainModule module, ParticleSyst /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetSimulationSpace(this MainModule module, Func simulationSpaceChanger) + public static MainModule SetSimulationSpace(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func simulationSpaceChanger) { Debug.Assert(simulationSpaceChanger != null, "simulationSpaceChanger cannot be null"); module.simulationSpace = simulationSpaceChanger(module.simulationSpace); @@ -909,7 +1321,14 @@ public static MainModule SetSimulationSpace(this MainModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainSimulationSpeed(this ParticleSystem particleSystem, float simulationSpeed) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainSimulationSpeed( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float simulationSpeed) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -921,7 +1340,18 @@ public static ParticleSystem SetMainSimulationSpeed(this ParticleSystem particle /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainSimulationSpeed(this ParticleSystem particleSystem, Func simulationSpeedChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainSimulationSpeed( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func simulationSpeedChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(simulationSpeedChanger != null, "simulationSpeedChanger cannot be null"); @@ -944,7 +1374,11 @@ public static MainModule SetSimulationSpeed(this MainModule module, float simula /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetSimulationSpeed(this MainModule module, Func simulationSpeedChanger) + public static MainModule SetSimulationSpeed(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func simulationSpeedChanger) { Debug.Assert(simulationSpeedChanger != null, "simulationSpeedChanger cannot be null"); module.simulationSpeed = simulationSpeedChanger(module.simulationSpeed); @@ -957,7 +1391,14 @@ public static MainModule SetSimulationSpeed(this MainModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartColor(this ParticleSystem particleSystem, MinMaxGradient startColor) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartColor( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxGradient startColor) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -969,7 +1410,18 @@ public static ParticleSystem SetMainStartColor(this ParticleSystem particleSyste /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartColor(this ParticleSystem particleSystem, Func startColorChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartColor( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startColorChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(startColorChanger != null, "startColorChanger cannot be null"); @@ -992,7 +1444,11 @@ public static MainModule SetStartColor(this MainModule module, MinMaxGradient st /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartColor(this MainModule module, Func startColorChanger) + public static MainModule SetStartColor(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startColorChanger) { Debug.Assert(startColorChanger != null, "startColorChanger cannot be null"); module.startColor = startColorChanger(module.startColor); @@ -1005,7 +1461,14 @@ public static MainModule SetStartColor(this MainModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartDelay(this ParticleSystem particleSystem, MinMaxCurve startDelay) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartDelay( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve startDelay) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -1017,7 +1480,18 @@ public static ParticleSystem SetMainStartDelay(this ParticleSystem particleSyste /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartDelay(this ParticleSystem particleSystem, Func startDelayChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartDelay( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startDelayChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(startDelayChanger != null, "startDelayChanger cannot be null"); @@ -1040,7 +1514,11 @@ public static MainModule SetStartDelay(this MainModule module, MinMaxCurve start /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartDelay(this MainModule module, Func startDelayChanger) + public static MainModule SetStartDelay(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startDelayChanger) { Debug.Assert(startDelayChanger != null, "startDelayChanger cannot be null"); module.startDelay = startDelayChanger(module.startDelay); @@ -1053,7 +1531,14 @@ public static MainModule SetStartDelay(this MainModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartDelayMultiplier(this ParticleSystem particleSystem, float startDelayMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartDelayMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float startDelayMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -1065,7 +1550,18 @@ public static ParticleSystem SetMainStartDelayMultiplier(this ParticleSystem par /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartDelayMultiplier(this ParticleSystem particleSystem, Func startDelayMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartDelayMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startDelayMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(startDelayMultiplierChanger != null, "startDelayMultiplierChanger cannot be null"); @@ -1088,7 +1584,11 @@ public static MainModule SetStartDelayMultiplier(this MainModule module, float s /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartDelayMultiplier(this MainModule module, Func startDelayMultiplierChanger) + public static MainModule SetStartDelayMultiplier(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startDelayMultiplierChanger) { Debug.Assert(startDelayMultiplierChanger != null, "startDelayMultiplierChanger cannot be null"); module.startDelayMultiplier = startDelayMultiplierChanger(module.startDelayMultiplier); @@ -1101,7 +1601,14 @@ public static MainModule SetStartDelayMultiplier(this MainModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartLifetime(this ParticleSystem particleSystem, MinMaxCurve startLifetime) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartLifetime( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve startLifetime) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -1113,7 +1620,18 @@ public static ParticleSystem SetMainStartLifetime(this ParticleSystem particleSy /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartLifetime(this ParticleSystem particleSystem, Func startLifetimeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartLifetime( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startLifetimeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(startLifetimeChanger != null, "startLifetimeChanger cannot be null"); @@ -1136,7 +1654,11 @@ public static MainModule SetStartLifetime(this MainModule module, MinMaxCurve st /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartLifetime(this MainModule module, Func startLifetimeChanger) + public static MainModule SetStartLifetime(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startLifetimeChanger) { Debug.Assert(startLifetimeChanger != null, "startLifetimeChanger cannot be null"); module.startLifetime = startLifetimeChanger(module.startLifetime); @@ -1149,7 +1671,14 @@ public static MainModule SetStartLifetime(this MainModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartLifetimeMultiplier(this ParticleSystem particleSystem, float startLifetimeMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartLifetimeMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float startLifetimeMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -1161,7 +1690,18 @@ public static ParticleSystem SetMainStartLifetimeMultiplier(this ParticleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartLifetimeMultiplier(this ParticleSystem particleSystem, Func startLifetimeMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartLifetimeMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startLifetimeMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(startLifetimeMultiplierChanger != null, "startLifetimeMultiplierChanger cannot be null"); @@ -1184,7 +1724,11 @@ public static MainModule SetStartLifetimeMultiplier(this MainModule module, floa /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartLifetimeMultiplier(this MainModule module, Func startLifetimeMultiplierChanger) + public static MainModule SetStartLifetimeMultiplier(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startLifetimeMultiplierChanger) { Debug.Assert(startLifetimeMultiplierChanger != null, "startLifetimeMultiplierChanger cannot be null"); module.startLifetimeMultiplier = startLifetimeMultiplierChanger(module.startLifetimeMultiplier); @@ -1197,7 +1741,14 @@ public static MainModule SetStartLifetimeMultiplier(this MainModule module, Func /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartRotation(this ParticleSystem particleSystem, MinMaxCurve startRotation) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartRotation( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve startRotation) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -1209,7 +1760,18 @@ public static ParticleSystem SetMainStartRotation(this ParticleSystem particleSy /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartRotation(this ParticleSystem particleSystem, Func startRotationChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartRotation( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startRotationChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(startRotationChanger != null, "startRotationChanger cannot be null"); @@ -1232,7 +1794,11 @@ public static MainModule SetStartRotation(this MainModule module, MinMaxCurve st /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartRotation(this MainModule module, Func startRotationChanger) + public static MainModule SetStartRotation(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startRotationChanger) { Debug.Assert(startRotationChanger != null, "startRotationChanger cannot be null"); module.startRotation = startRotationChanger(module.startRotation); @@ -1245,7 +1811,14 @@ public static MainModule SetStartRotation(this MainModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartRotation3D(this ParticleSystem particleSystem, bool startRotation3D) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartRotation3D( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool startRotation3D) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -1257,7 +1830,18 @@ public static ParticleSystem SetMainStartRotation3D(this ParticleSystem particle /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartRotation3D(this ParticleSystem particleSystem, Func startRotation3DChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartRotation3D( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startRotation3DChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(startRotation3DChanger != null, "startRotation3DChanger cannot be null"); @@ -1280,7 +1864,11 @@ public static MainModule SetStartRotation3D(this MainModule module, bool startRo /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartRotation3D(this MainModule module, Func startRotation3DChanger) + public static MainModule SetStartRotation3D(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startRotation3DChanger) { Debug.Assert(startRotation3DChanger != null, "startRotation3DChanger cannot be null"); module.startRotation3D = startRotation3DChanger(module.startRotation3D); @@ -1293,7 +1881,14 @@ public static MainModule SetStartRotation3D(this MainModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartRotationMultiplier(this ParticleSystem particleSystem, float startRotationMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartRotationMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float startRotationMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -1305,7 +1900,18 @@ public static ParticleSystem SetMainStartRotationMultiplier(this ParticleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartRotationMultiplier(this ParticleSystem particleSystem, Func startRotationMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartRotationMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startRotationMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(startRotationMultiplierChanger != null, "startRotationMultiplierChanger cannot be null"); @@ -1328,7 +1934,11 @@ public static MainModule SetStartRotationMultiplier(this MainModule module, floa /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartRotationMultiplier(this MainModule module, Func startRotationMultiplierChanger) + public static MainModule SetStartRotationMultiplier(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startRotationMultiplierChanger) { Debug.Assert(startRotationMultiplierChanger != null, "startRotationMultiplierChanger cannot be null"); module.startRotationMultiplier = startRotationMultiplierChanger(module.startRotationMultiplier); @@ -1341,7 +1951,14 @@ public static MainModule SetStartRotationMultiplier(this MainModule module, Func /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartRotationX(this ParticleSystem particleSystem, MinMaxCurve startRotationX) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartRotationX( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve startRotationX) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -1353,7 +1970,18 @@ public static ParticleSystem SetMainStartRotationX(this ParticleSystem particleS /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartRotationX(this ParticleSystem particleSystem, Func startRotationXChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartRotationX( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startRotationXChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(startRotationXChanger != null, "startRotationXChanger cannot be null"); @@ -1376,7 +2004,11 @@ public static MainModule SetStartRotationX(this MainModule module, MinMaxCurve s /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartRotationX(this MainModule module, Func startRotationXChanger) + public static MainModule SetStartRotationX(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startRotationXChanger) { Debug.Assert(startRotationXChanger != null, "startRotationXChanger cannot be null"); module.startRotationX = startRotationXChanger(module.startRotationX); @@ -1389,7 +2021,14 @@ public static MainModule SetStartRotationX(this MainModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartRotationXMultiplier(this ParticleSystem particleSystem, float startRotationXMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartRotationXMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float startRotationXMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -1401,7 +2040,18 @@ public static ParticleSystem SetMainStartRotationXMultiplier(this ParticleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartRotationXMultiplier(this ParticleSystem particleSystem, Func startRotationXMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartRotationXMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startRotationXMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(startRotationXMultiplierChanger != null, "startRotationXMultiplierChanger cannot be null"); @@ -1424,7 +2074,11 @@ public static MainModule SetStartRotationXMultiplier(this MainModule module, flo /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartRotationXMultiplier(this MainModule module, Func startRotationXMultiplierChanger) + public static MainModule SetStartRotationXMultiplier(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startRotationXMultiplierChanger) { Debug.Assert(startRotationXMultiplierChanger != null, "startRotationXMultiplierChanger cannot be null"); module.startRotationXMultiplier = startRotationXMultiplierChanger(module.startRotationXMultiplier); @@ -1437,7 +2091,14 @@ public static MainModule SetStartRotationXMultiplier(this MainModule module, Fun /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartRotationY(this ParticleSystem particleSystem, MinMaxCurve startRotationY) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartRotationY( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve startRotationY) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -1449,7 +2110,18 @@ public static ParticleSystem SetMainStartRotationY(this ParticleSystem particleS /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartRotationY(this ParticleSystem particleSystem, Func startRotationYChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartRotationY( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startRotationYChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(startRotationYChanger != null, "startRotationYChanger cannot be null"); @@ -1472,7 +2144,11 @@ public static MainModule SetStartRotationY(this MainModule module, MinMaxCurve s /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartRotationY(this MainModule module, Func startRotationYChanger) + public static MainModule SetStartRotationY(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startRotationYChanger) { Debug.Assert(startRotationYChanger != null, "startRotationYChanger cannot be null"); module.startRotationY = startRotationYChanger(module.startRotationY); @@ -1485,7 +2161,14 @@ public static MainModule SetStartRotationY(this MainModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartRotationYMultiplier(this ParticleSystem particleSystem, float startRotationYMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartRotationYMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float startRotationYMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -1497,7 +2180,18 @@ public static ParticleSystem SetMainStartRotationYMultiplier(this ParticleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartRotationYMultiplier(this ParticleSystem particleSystem, Func startRotationYMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartRotationYMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startRotationYMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(startRotationYMultiplierChanger != null, "startRotationYMultiplierChanger cannot be null"); @@ -1520,7 +2214,11 @@ public static MainModule SetStartRotationYMultiplier(this MainModule module, flo /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartRotationYMultiplier(this MainModule module, Func startRotationYMultiplierChanger) + public static MainModule SetStartRotationYMultiplier(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startRotationYMultiplierChanger) { Debug.Assert(startRotationYMultiplierChanger != null, "startRotationYMultiplierChanger cannot be null"); module.startRotationYMultiplier = startRotationYMultiplierChanger(module.startRotationYMultiplier); @@ -1533,7 +2231,14 @@ public static MainModule SetStartRotationYMultiplier(this MainModule module, Fun /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartRotationZ(this ParticleSystem particleSystem, MinMaxCurve startRotationZ) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartRotationZ( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve startRotationZ) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -1545,7 +2250,18 @@ public static ParticleSystem SetMainStartRotationZ(this ParticleSystem particleS /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartRotationZ(this ParticleSystem particleSystem, Func startRotationZChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartRotationZ( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startRotationZChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(startRotationZChanger != null, "startRotationZChanger cannot be null"); @@ -1568,7 +2284,11 @@ public static MainModule SetStartRotationZ(this MainModule module, MinMaxCurve s /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartRotationZ(this MainModule module, Func startRotationZChanger) + public static MainModule SetStartRotationZ(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startRotationZChanger) { Debug.Assert(startRotationZChanger != null, "startRotationZChanger cannot be null"); module.startRotationZ = startRotationZChanger(module.startRotationZ); @@ -1581,7 +2301,14 @@ public static MainModule SetStartRotationZ(this MainModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartRotationZMultiplier(this ParticleSystem particleSystem, float startRotationZMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartRotationZMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float startRotationZMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -1593,7 +2320,18 @@ public static ParticleSystem SetMainStartRotationZMultiplier(this ParticleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartRotationZMultiplier(this ParticleSystem particleSystem, Func startRotationZMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartRotationZMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startRotationZMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(startRotationZMultiplierChanger != null, "startRotationZMultiplierChanger cannot be null"); @@ -1616,7 +2354,11 @@ public static MainModule SetStartRotationZMultiplier(this MainModule module, flo /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartRotationZMultiplier(this MainModule module, Func startRotationZMultiplierChanger) + public static MainModule SetStartRotationZMultiplier(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startRotationZMultiplierChanger) { Debug.Assert(startRotationZMultiplierChanger != null, "startRotationZMultiplierChanger cannot be null"); module.startRotationZMultiplier = startRotationZMultiplierChanger(module.startRotationZMultiplier); @@ -1629,7 +2371,14 @@ public static MainModule SetStartRotationZMultiplier(this MainModule module, Fun /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSize(this ParticleSystem particleSystem, MinMaxCurve startSize) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartSize( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve startSize) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -1641,7 +2390,18 @@ public static ParticleSystem SetMainStartSize(this ParticleSystem particleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSize(this ParticleSystem particleSystem, Func startSizeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartSize( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startSizeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(startSizeChanger != null, "startSizeChanger cannot be null"); @@ -1664,7 +2424,11 @@ public static MainModule SetStartSize(this MainModule module, MinMaxCurve startS /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartSize(this MainModule module, Func startSizeChanger) + public static MainModule SetStartSize(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startSizeChanger) { Debug.Assert(startSizeChanger != null, "startSizeChanger cannot be null"); module.startSize = startSizeChanger(module.startSize); @@ -1677,7 +2441,14 @@ public static MainModule SetStartSize(this MainModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSize3D(this ParticleSystem particleSystem, bool startSize3D) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartSize3D( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool startSize3D) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -1689,7 +2460,18 @@ public static ParticleSystem SetMainStartSize3D(this ParticleSystem particleSyst /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSize3D(this ParticleSystem particleSystem, Func startSize3DChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartSize3D( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startSize3DChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(startSize3DChanger != null, "startSize3DChanger cannot be null"); @@ -1712,7 +2494,11 @@ public static MainModule SetStartSize3D(this MainModule module, bool startSize3D /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartSize3D(this MainModule module, Func startSize3DChanger) + public static MainModule SetStartSize3D(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startSize3DChanger) { Debug.Assert(startSize3DChanger != null, "startSize3DChanger cannot be null"); module.startSize3D = startSize3DChanger(module.startSize3D); @@ -1725,7 +2511,14 @@ public static MainModule SetStartSize3D(this MainModule module, Func /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSizeMultiplier(this ParticleSystem particleSystem, float startSizeMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartSizeMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float startSizeMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -1737,7 +2530,18 @@ public static ParticleSystem SetMainStartSizeMultiplier(this ParticleSystem part /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSizeMultiplier(this ParticleSystem particleSystem, Func startSizeMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartSizeMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startSizeMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(startSizeMultiplierChanger != null, "startSizeMultiplierChanger cannot be null"); @@ -1760,7 +2564,11 @@ public static MainModule SetStartSizeMultiplier(this MainModule module, float st /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartSizeMultiplier(this MainModule module, Func startSizeMultiplierChanger) + public static MainModule SetStartSizeMultiplier(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startSizeMultiplierChanger) { Debug.Assert(startSizeMultiplierChanger != null, "startSizeMultiplierChanger cannot be null"); module.startSizeMultiplier = startSizeMultiplierChanger(module.startSizeMultiplier); @@ -1773,7 +2581,14 @@ public static MainModule SetStartSizeMultiplier(this MainModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSizeX(this ParticleSystem particleSystem, MinMaxCurve startSizeX) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartSizeX( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve startSizeX) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -1785,7 +2600,18 @@ public static ParticleSystem SetMainStartSizeX(this ParticleSystem particleSyste /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSizeX(this ParticleSystem particleSystem, Func startSizeXChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartSizeX( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startSizeXChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(startSizeXChanger != null, "startSizeXChanger cannot be null"); @@ -1808,7 +2634,11 @@ public static MainModule SetStartSizeX(this MainModule module, MinMaxCurve start /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartSizeX(this MainModule module, Func startSizeXChanger) + public static MainModule SetStartSizeX(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startSizeXChanger) { Debug.Assert(startSizeXChanger != null, "startSizeXChanger cannot be null"); module.startSizeX = startSizeXChanger(module.startSizeX); @@ -1821,7 +2651,14 @@ public static MainModule SetStartSizeX(this MainModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSizeXMultiplier(this ParticleSystem particleSystem, float startSizeXMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartSizeXMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float startSizeXMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -1833,7 +2670,18 @@ public static ParticleSystem SetMainStartSizeXMultiplier(this ParticleSystem par /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSizeXMultiplier(this ParticleSystem particleSystem, Func startSizeXMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartSizeXMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startSizeXMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(startSizeXMultiplierChanger != null, "startSizeXMultiplierChanger cannot be null"); @@ -1856,7 +2704,11 @@ public static MainModule SetStartSizeXMultiplier(this MainModule module, float s /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartSizeXMultiplier(this MainModule module, Func startSizeXMultiplierChanger) + public static MainModule SetStartSizeXMultiplier(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startSizeXMultiplierChanger) { Debug.Assert(startSizeXMultiplierChanger != null, "startSizeXMultiplierChanger cannot be null"); module.startSizeXMultiplier = startSizeXMultiplierChanger(module.startSizeXMultiplier); @@ -1869,7 +2721,14 @@ public static MainModule SetStartSizeXMultiplier(this MainModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSizeY(this ParticleSystem particleSystem, MinMaxCurve startSizeY) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartSizeY( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve startSizeY) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -1881,7 +2740,18 @@ public static ParticleSystem SetMainStartSizeY(this ParticleSystem particleSyste /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSizeY(this ParticleSystem particleSystem, Func startSizeYChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartSizeY( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startSizeYChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(startSizeYChanger != null, "startSizeYChanger cannot be null"); @@ -1904,7 +2774,11 @@ public static MainModule SetStartSizeY(this MainModule module, MinMaxCurve start /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartSizeY(this MainModule module, Func startSizeYChanger) + public static MainModule SetStartSizeY(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startSizeYChanger) { Debug.Assert(startSizeYChanger != null, "startSizeYChanger cannot be null"); module.startSizeY = startSizeYChanger(module.startSizeY); @@ -1917,7 +2791,14 @@ public static MainModule SetStartSizeY(this MainModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSizeYMultiplier(this ParticleSystem particleSystem, float startSizeYMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartSizeYMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float startSizeYMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -1929,7 +2810,18 @@ public static ParticleSystem SetMainStartSizeYMultiplier(this ParticleSystem par /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSizeYMultiplier(this ParticleSystem particleSystem, Func startSizeYMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartSizeYMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startSizeYMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(startSizeYMultiplierChanger != null, "startSizeYMultiplierChanger cannot be null"); @@ -1952,7 +2844,11 @@ public static MainModule SetStartSizeYMultiplier(this MainModule module, float s /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartSizeYMultiplier(this MainModule module, Func startSizeYMultiplierChanger) + public static MainModule SetStartSizeYMultiplier(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startSizeYMultiplierChanger) { Debug.Assert(startSizeYMultiplierChanger != null, "startSizeYMultiplierChanger cannot be null"); module.startSizeYMultiplier = startSizeYMultiplierChanger(module.startSizeYMultiplier); @@ -1965,7 +2861,14 @@ public static MainModule SetStartSizeYMultiplier(this MainModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSizeZ(this ParticleSystem particleSystem, MinMaxCurve startSizeZ) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartSizeZ( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve startSizeZ) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -1977,7 +2880,18 @@ public static ParticleSystem SetMainStartSizeZ(this ParticleSystem particleSyste /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSizeZ(this ParticleSystem particleSystem, Func startSizeZChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartSizeZ( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startSizeZChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(startSizeZChanger != null, "startSizeZChanger cannot be null"); @@ -2000,7 +2914,11 @@ public static MainModule SetStartSizeZ(this MainModule module, MinMaxCurve start /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartSizeZ(this MainModule module, Func startSizeZChanger) + public static MainModule SetStartSizeZ(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startSizeZChanger) { Debug.Assert(startSizeZChanger != null, "startSizeZChanger cannot be null"); module.startSizeZ = startSizeZChanger(module.startSizeZ); @@ -2013,7 +2931,14 @@ public static MainModule SetStartSizeZ(this MainModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSizeZMultiplier(this ParticleSystem particleSystem, float startSizeZMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartSizeZMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float startSizeZMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -2025,7 +2950,18 @@ public static ParticleSystem SetMainStartSizeZMultiplier(this ParticleSystem par /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSizeZMultiplier(this ParticleSystem particleSystem, Func startSizeZMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartSizeZMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startSizeZMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(startSizeZMultiplierChanger != null, "startSizeZMultiplierChanger cannot be null"); @@ -2048,7 +2984,11 @@ public static MainModule SetStartSizeZMultiplier(this MainModule module, float s /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartSizeZMultiplier(this MainModule module, Func startSizeZMultiplierChanger) + public static MainModule SetStartSizeZMultiplier(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startSizeZMultiplierChanger) { Debug.Assert(startSizeZMultiplierChanger != null, "startSizeZMultiplierChanger cannot be null"); module.startSizeZMultiplier = startSizeZMultiplierChanger(module.startSizeZMultiplier); @@ -2061,7 +3001,14 @@ public static MainModule SetStartSizeZMultiplier(this MainModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSpeed(this ParticleSystem particleSystem, MinMaxCurve startSpeed) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartSpeed( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve startSpeed) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -2073,7 +3020,18 @@ public static ParticleSystem SetMainStartSpeed(this ParticleSystem particleSyste /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSpeed(this ParticleSystem particleSystem, Func startSpeedChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartSpeed( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startSpeedChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(startSpeedChanger != null, "startSpeedChanger cannot be null"); @@ -2096,7 +3054,11 @@ public static MainModule SetStartSpeed(this MainModule module, MinMaxCurve start /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartSpeed(this MainModule module, Func startSpeedChanger) + public static MainModule SetStartSpeed(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startSpeedChanger) { Debug.Assert(startSpeedChanger != null, "startSpeedChanger cannot be null"); module.startSpeed = startSpeedChanger(module.startSpeed); @@ -2109,7 +3071,14 @@ public static MainModule SetStartSpeed(this MainModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSpeedMultiplier(this ParticleSystem particleSystem, float startSpeedMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartSpeedMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float startSpeedMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -2121,7 +3090,18 @@ public static ParticleSystem SetMainStartSpeedMultiplier(this ParticleSystem par /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSpeedMultiplier(this ParticleSystem particleSystem, Func startSpeedMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStartSpeedMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startSpeedMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(startSpeedMultiplierChanger != null, "startSpeedMultiplierChanger cannot be null"); @@ -2144,7 +3124,11 @@ public static MainModule SetStartSpeedMultiplier(this MainModule module, float s /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartSpeedMultiplier(this MainModule module, Func startSpeedMultiplierChanger) + public static MainModule SetStartSpeedMultiplier(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startSpeedMultiplierChanger) { Debug.Assert(startSpeedMultiplierChanger != null, "startSpeedMultiplierChanger cannot be null"); module.startSpeedMultiplier = startSpeedMultiplierChanger(module.startSpeedMultiplier); @@ -2157,7 +3141,14 @@ public static MainModule SetStartSpeedMultiplier(this MainModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStopAction(this ParticleSystem particleSystem, ParticleSystemStopAction stopAction) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStopAction( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, ParticleSystemStopAction stopAction) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -2169,7 +3160,18 @@ public static ParticleSystem SetMainStopAction(this ParticleSystem particleSyste /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStopAction(this ParticleSystem particleSystem, Func stopActionChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainStopAction( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func stopActionChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(stopActionChanger != null, "stopActionChanger cannot be null"); @@ -2192,7 +3194,11 @@ public static MainModule SetStopAction(this MainModule module, ParticleSystemSto /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStopAction(this MainModule module, Func stopActionChanger) + public static MainModule SetStopAction(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func stopActionChanger) { Debug.Assert(stopActionChanger != null, "stopActionChanger cannot be null"); module.stopAction = stopActionChanger(module.stopAction); @@ -2205,7 +3211,14 @@ public static MainModule SetStopAction(this MainModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainUseUnscaledTime(this ParticleSystem particleSystem, bool useUnscaledTime) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainUseUnscaledTime( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool useUnscaledTime) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.main; @@ -2217,7 +3230,18 @@ public static ParticleSystem SetMainUseUnscaledTime(this ParticleSystem particle /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainUseUnscaledTime(this ParticleSystem particleSystem, Func useUnscaledTimeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetMainUseUnscaledTime( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func useUnscaledTimeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(useUnscaledTimeChanger != null, "useUnscaledTimeChanger cannot be null"); @@ -2240,7 +3264,11 @@ public static MainModule SetUseUnscaledTime(this MainModule module, bool useUnsc /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetUseUnscaledTime(this MainModule module, Func useUnscaledTimeChanger) + public static MainModule SetUseUnscaledTime(this MainModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func useUnscaledTimeChanger) { Debug.Assert(useUnscaledTimeChanger != null, "useUnscaledTimeChanger cannot be null"); module.useUnscaledTime = useUnscaledTimeChanger(module.useUnscaledTime); diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/MainModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Extensions/MainModuleExtension.cs.meta similarity index 100% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/MainModuleExtension.cs.meta rename to Packages/FluentParticleSystem/Runtime/Extensions/MainModuleExtension.cs.meta diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/NoiseModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/Extensions/NoiseModuleExtension.cs similarity index 71% rename from Packages/FluentParticleSystem/Runtime/Nullable/Extensions/NoiseModuleExtension.cs rename to Packages/FluentParticleSystem/Runtime/Extensions/NoiseModuleExtension.cs index 86ea028..0e9ca81 100644 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/NoiseModuleExtension.cs +++ b/Packages/FluentParticleSystem/Runtime/Extensions/NoiseModuleExtension.cs @@ -1,9 +1,13 @@ -#nullable enable using System; using System.Runtime.CompilerServices; using UnityEngine; + using static UnityEngine.ParticleSystem; +#if UNITY_2020_2_OR_NEWER +using System.Diagnostics.CodeAnalysis; +#endif + namespace OUCC.FluentParticleSystem { public static class NoiseModuleExtension @@ -13,7 +17,18 @@ public static class NoiseModuleExtension /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditNoise(this ParticleSystem particleSystem, Action moduleEditor) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem EditNoise( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Action moduleEditor) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); @@ -26,7 +41,14 @@ public static ParticleSystem EditNoise(this ParticleSystem particleSystem, Actio /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseDamping(this ParticleSystem particleSystem, bool damping) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseDamping( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool damping) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.noise; @@ -38,7 +60,18 @@ public static ParticleSystem SetNoiseDamping(this ParticleSystem particleSystem, /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseDamping(this ParticleSystem particleSystem, Func dampingChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseDamping( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func dampingChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(dampingChanger != null, "dampingChanger cannot be null"); @@ -61,7 +94,11 @@ public static NoiseModule SetDamping(this NoiseModule module, bool damping) /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetDamping(this NoiseModule module, Func dampingChanger) + public static NoiseModule SetDamping(this NoiseModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func dampingChanger) { Debug.Assert(dampingChanger != null, "dampingChanger cannot be null"); module.damping = dampingChanger(module.damping); @@ -74,7 +111,14 @@ public static NoiseModule SetDamping(this NoiseModule module, Func d /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseEnabled(this ParticleSystem particleSystem, bool enabled) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool enabled) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.noise; @@ -86,7 +130,18 @@ public static ParticleSystem SetNoiseEnabled(this ParticleSystem particleSystem, /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseEnabled(this ParticleSystem particleSystem, Func enabledChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); @@ -109,7 +164,11 @@ public static NoiseModule SetEnabled(this NoiseModule module, bool enabled) /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetEnabled(this NoiseModule module, Func enabledChanger) + public static NoiseModule SetEnabled(this NoiseModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); module.enabled = enabledChanger(module.enabled); @@ -122,7 +181,14 @@ public static NoiseModule SetEnabled(this NoiseModule module, Func e /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseFrequency(this ParticleSystem particleSystem, float frequency) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseFrequency( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float frequency) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.noise; @@ -134,7 +200,18 @@ public static ParticleSystem SetNoiseFrequency(this ParticleSystem particleSyste /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseFrequency(this ParticleSystem particleSystem, Func frequencyChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseFrequency( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func frequencyChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(frequencyChanger != null, "frequencyChanger cannot be null"); @@ -157,7 +234,11 @@ public static NoiseModule SetFrequency(this NoiseModule module, float frequency) /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetFrequency(this NoiseModule module, Func frequencyChanger) + public static NoiseModule SetFrequency(this NoiseModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func frequencyChanger) { Debug.Assert(frequencyChanger != null, "frequencyChanger cannot be null"); module.frequency = frequencyChanger(module.frequency); @@ -170,7 +251,14 @@ public static NoiseModule SetFrequency(this NoiseModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseOctaveCount(this ParticleSystem particleSystem, int octaveCount) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseOctaveCount( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, int octaveCount) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.noise; @@ -182,7 +270,18 @@ public static ParticleSystem SetNoiseOctaveCount(this ParticleSystem particleSys /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseOctaveCount(this ParticleSystem particleSystem, Func octaveCountChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseOctaveCount( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func octaveCountChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(octaveCountChanger != null, "octaveCountChanger cannot be null"); @@ -205,7 +304,11 @@ public static NoiseModule SetOctaveCount(this NoiseModule module, int octaveCoun /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetOctaveCount(this NoiseModule module, Func octaveCountChanger) + public static NoiseModule SetOctaveCount(this NoiseModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func octaveCountChanger) { Debug.Assert(octaveCountChanger != null, "octaveCountChanger cannot be null"); module.octaveCount = octaveCountChanger(module.octaveCount); @@ -218,7 +321,14 @@ public static NoiseModule SetOctaveCount(this NoiseModule module, Func /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseOctaveMultiplier(this ParticleSystem particleSystem, float octaveMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseOctaveMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float octaveMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.noise; @@ -230,7 +340,18 @@ public static ParticleSystem SetNoiseOctaveMultiplier(this ParticleSystem partic /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseOctaveMultiplier(this ParticleSystem particleSystem, Func octaveMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseOctaveMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func octaveMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(octaveMultiplierChanger != null, "octaveMultiplierChanger cannot be null"); @@ -253,7 +374,11 @@ public static NoiseModule SetOctaveMultiplier(this NoiseModule module, float oct /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetOctaveMultiplier(this NoiseModule module, Func octaveMultiplierChanger) + public static NoiseModule SetOctaveMultiplier(this NoiseModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func octaveMultiplierChanger) { Debug.Assert(octaveMultiplierChanger != null, "octaveMultiplierChanger cannot be null"); module.octaveMultiplier = octaveMultiplierChanger(module.octaveMultiplier); @@ -266,7 +391,14 @@ public static NoiseModule SetOctaveMultiplier(this NoiseModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseOctaveScale(this ParticleSystem particleSystem, float octaveScale) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseOctaveScale( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float octaveScale) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.noise; @@ -278,7 +410,18 @@ public static ParticleSystem SetNoiseOctaveScale(this ParticleSystem particleSys /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseOctaveScale(this ParticleSystem particleSystem, Func octaveScaleChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseOctaveScale( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func octaveScaleChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(octaveScaleChanger != null, "octaveScaleChanger cannot be null"); @@ -301,7 +444,11 @@ public static NoiseModule SetOctaveScale(this NoiseModule module, float octaveSc /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetOctaveScale(this NoiseModule module, Func octaveScaleChanger) + public static NoiseModule SetOctaveScale(this NoiseModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func octaveScaleChanger) { Debug.Assert(octaveScaleChanger != null, "octaveScaleChanger cannot be null"); module.octaveScale = octaveScaleChanger(module.octaveScale); @@ -314,7 +461,14 @@ public static NoiseModule SetOctaveScale(this NoiseModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoisePositionAmount(this ParticleSystem particleSystem, MinMaxCurve positionAmount) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoisePositionAmount( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve positionAmount) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.noise; @@ -326,7 +480,18 @@ public static ParticleSystem SetNoisePositionAmount(this ParticleSystem particle /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoisePositionAmount(this ParticleSystem particleSystem, Func positionAmountChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoisePositionAmount( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func positionAmountChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(positionAmountChanger != null, "positionAmountChanger cannot be null"); @@ -349,7 +514,11 @@ public static NoiseModule SetPositionAmount(this NoiseModule module, MinMaxCurve /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetPositionAmount(this NoiseModule module, Func positionAmountChanger) + public static NoiseModule SetPositionAmount(this NoiseModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func positionAmountChanger) { Debug.Assert(positionAmountChanger != null, "positionAmountChanger cannot be null"); module.positionAmount = positionAmountChanger(module.positionAmount); @@ -362,7 +531,14 @@ public static NoiseModule SetPositionAmount(this NoiseModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseQuality(this ParticleSystem particleSystem, ParticleSystemNoiseQuality quality) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseQuality( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, ParticleSystemNoiseQuality quality) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.noise; @@ -374,7 +550,18 @@ public static ParticleSystem SetNoiseQuality(this ParticleSystem particleSystem, /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseQuality(this ParticleSystem particleSystem, Func qualityChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseQuality( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func qualityChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(qualityChanger != null, "qualityChanger cannot be null"); @@ -397,7 +584,11 @@ public static NoiseModule SetQuality(this NoiseModule module, ParticleSystemNois /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetQuality(this NoiseModule module, Func qualityChanger) + public static NoiseModule SetQuality(this NoiseModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func qualityChanger) { Debug.Assert(qualityChanger != null, "qualityChanger cannot be null"); module.quality = qualityChanger(module.quality); @@ -410,7 +601,14 @@ public static NoiseModule SetQuality(this NoiseModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRemap(this ParticleSystem particleSystem, MinMaxCurve remap) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseRemap( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve remap) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.noise; @@ -422,7 +620,18 @@ public static ParticleSystem SetNoiseRemap(this ParticleSystem particleSystem, M /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRemap(this ParticleSystem particleSystem, Func remapChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseRemap( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func remapChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(remapChanger != null, "remapChanger cannot be null"); @@ -445,7 +654,11 @@ public static NoiseModule SetRemap(this NoiseModule module, MinMaxCurve remap) /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetRemap(this NoiseModule module, Func remapChanger) + public static NoiseModule SetRemap(this NoiseModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func remapChanger) { Debug.Assert(remapChanger != null, "remapChanger cannot be null"); module.remap = remapChanger(module.remap); @@ -458,7 +671,14 @@ public static NoiseModule SetRemap(this NoiseModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRemapEnabled(this ParticleSystem particleSystem, bool remapEnabled) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseRemapEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool remapEnabled) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.noise; @@ -470,7 +690,18 @@ public static ParticleSystem SetNoiseRemapEnabled(this ParticleSystem particleSy /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRemapEnabled(this ParticleSystem particleSystem, Func remapEnabledChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseRemapEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func remapEnabledChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(remapEnabledChanger != null, "remapEnabledChanger cannot be null"); @@ -493,7 +724,11 @@ public static NoiseModule SetRemapEnabled(this NoiseModule module, bool remapEna /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetRemapEnabled(this NoiseModule module, Func remapEnabledChanger) + public static NoiseModule SetRemapEnabled(this NoiseModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func remapEnabledChanger) { Debug.Assert(remapEnabledChanger != null, "remapEnabledChanger cannot be null"); module.remapEnabled = remapEnabledChanger(module.remapEnabled); @@ -506,7 +741,14 @@ public static NoiseModule SetRemapEnabled(this NoiseModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRemapMultiplier(this ParticleSystem particleSystem, float remapMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseRemapMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float remapMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.noise; @@ -518,7 +760,18 @@ public static ParticleSystem SetNoiseRemapMultiplier(this ParticleSystem particl /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRemapMultiplier(this ParticleSystem particleSystem, Func remapMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseRemapMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func remapMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(remapMultiplierChanger != null, "remapMultiplierChanger cannot be null"); @@ -541,7 +794,11 @@ public static NoiseModule SetRemapMultiplier(this NoiseModule module, float rema /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetRemapMultiplier(this NoiseModule module, Func remapMultiplierChanger) + public static NoiseModule SetRemapMultiplier(this NoiseModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func remapMultiplierChanger) { Debug.Assert(remapMultiplierChanger != null, "remapMultiplierChanger cannot be null"); module.remapMultiplier = remapMultiplierChanger(module.remapMultiplier); @@ -554,7 +811,14 @@ public static NoiseModule SetRemapMultiplier(this NoiseModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRemapX(this ParticleSystem particleSystem, MinMaxCurve remapX) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseRemapX( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve remapX) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.noise; @@ -566,7 +830,18 @@ public static ParticleSystem SetNoiseRemapX(this ParticleSystem particleSystem, /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRemapX(this ParticleSystem particleSystem, Func remapXChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseRemapX( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func remapXChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(remapXChanger != null, "remapXChanger cannot be null"); @@ -589,7 +864,11 @@ public static NoiseModule SetRemapX(this NoiseModule module, MinMaxCurve remapX) /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetRemapX(this NoiseModule module, Func remapXChanger) + public static NoiseModule SetRemapX(this NoiseModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func remapXChanger) { Debug.Assert(remapXChanger != null, "remapXChanger cannot be null"); module.remapX = remapXChanger(module.remapX); @@ -602,7 +881,14 @@ public static NoiseModule SetRemapX(this NoiseModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRemapXMultiplier(this ParticleSystem particleSystem, float remapXMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseRemapXMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float remapXMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.noise; @@ -614,7 +900,18 @@ public static ParticleSystem SetNoiseRemapXMultiplier(this ParticleSystem partic /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRemapXMultiplier(this ParticleSystem particleSystem, Func remapXMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseRemapXMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func remapXMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(remapXMultiplierChanger != null, "remapXMultiplierChanger cannot be null"); @@ -637,7 +934,11 @@ public static NoiseModule SetRemapXMultiplier(this NoiseModule module, float rem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetRemapXMultiplier(this NoiseModule module, Func remapXMultiplierChanger) + public static NoiseModule SetRemapXMultiplier(this NoiseModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func remapXMultiplierChanger) { Debug.Assert(remapXMultiplierChanger != null, "remapXMultiplierChanger cannot be null"); module.remapXMultiplier = remapXMultiplierChanger(module.remapXMultiplier); @@ -650,7 +951,14 @@ public static NoiseModule SetRemapXMultiplier(this NoiseModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRemapY(this ParticleSystem particleSystem, MinMaxCurve remapY) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseRemapY( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve remapY) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.noise; @@ -662,7 +970,18 @@ public static ParticleSystem SetNoiseRemapY(this ParticleSystem particleSystem, /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRemapY(this ParticleSystem particleSystem, Func remapYChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseRemapY( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func remapYChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(remapYChanger != null, "remapYChanger cannot be null"); @@ -685,7 +1004,11 @@ public static NoiseModule SetRemapY(this NoiseModule module, MinMaxCurve remapY) /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetRemapY(this NoiseModule module, Func remapYChanger) + public static NoiseModule SetRemapY(this NoiseModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func remapYChanger) { Debug.Assert(remapYChanger != null, "remapYChanger cannot be null"); module.remapY = remapYChanger(module.remapY); @@ -698,7 +1021,14 @@ public static NoiseModule SetRemapY(this NoiseModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRemapYMultiplier(this ParticleSystem particleSystem, float remapYMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseRemapYMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float remapYMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.noise; @@ -710,7 +1040,18 @@ public static ParticleSystem SetNoiseRemapYMultiplier(this ParticleSystem partic /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRemapYMultiplier(this ParticleSystem particleSystem, Func remapYMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseRemapYMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func remapYMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(remapYMultiplierChanger != null, "remapYMultiplierChanger cannot be null"); @@ -733,7 +1074,11 @@ public static NoiseModule SetRemapYMultiplier(this NoiseModule module, float rem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetRemapYMultiplier(this NoiseModule module, Func remapYMultiplierChanger) + public static NoiseModule SetRemapYMultiplier(this NoiseModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func remapYMultiplierChanger) { Debug.Assert(remapYMultiplierChanger != null, "remapYMultiplierChanger cannot be null"); module.remapYMultiplier = remapYMultiplierChanger(module.remapYMultiplier); @@ -746,7 +1091,14 @@ public static NoiseModule SetRemapYMultiplier(this NoiseModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRemapZ(this ParticleSystem particleSystem, MinMaxCurve remapZ) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseRemapZ( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve remapZ) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.noise; @@ -758,7 +1110,18 @@ public static ParticleSystem SetNoiseRemapZ(this ParticleSystem particleSystem, /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRemapZ(this ParticleSystem particleSystem, Func remapZChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseRemapZ( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func remapZChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(remapZChanger != null, "remapZChanger cannot be null"); @@ -781,7 +1144,11 @@ public static NoiseModule SetRemapZ(this NoiseModule module, MinMaxCurve remapZ) /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetRemapZ(this NoiseModule module, Func remapZChanger) + public static NoiseModule SetRemapZ(this NoiseModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func remapZChanger) { Debug.Assert(remapZChanger != null, "remapZChanger cannot be null"); module.remapZ = remapZChanger(module.remapZ); @@ -794,7 +1161,14 @@ public static NoiseModule SetRemapZ(this NoiseModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRemapZMultiplier(this ParticleSystem particleSystem, float remapZMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseRemapZMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float remapZMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.noise; @@ -806,7 +1180,18 @@ public static ParticleSystem SetNoiseRemapZMultiplier(this ParticleSystem partic /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRemapZMultiplier(this ParticleSystem particleSystem, Func remapZMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseRemapZMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func remapZMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(remapZMultiplierChanger != null, "remapZMultiplierChanger cannot be null"); @@ -829,7 +1214,11 @@ public static NoiseModule SetRemapZMultiplier(this NoiseModule module, float rem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetRemapZMultiplier(this NoiseModule module, Func remapZMultiplierChanger) + public static NoiseModule SetRemapZMultiplier(this NoiseModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func remapZMultiplierChanger) { Debug.Assert(remapZMultiplierChanger != null, "remapZMultiplierChanger cannot be null"); module.remapZMultiplier = remapZMultiplierChanger(module.remapZMultiplier); @@ -842,7 +1231,14 @@ public static NoiseModule SetRemapZMultiplier(this NoiseModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRotationAmount(this ParticleSystem particleSystem, MinMaxCurve rotationAmount) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseRotationAmount( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve rotationAmount) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.noise; @@ -854,7 +1250,18 @@ public static ParticleSystem SetNoiseRotationAmount(this ParticleSystem particle /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRotationAmount(this ParticleSystem particleSystem, Func rotationAmountChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseRotationAmount( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func rotationAmountChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(rotationAmountChanger != null, "rotationAmountChanger cannot be null"); @@ -877,7 +1284,11 @@ public static NoiseModule SetRotationAmount(this NoiseModule module, MinMaxCurve /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetRotationAmount(this NoiseModule module, Func rotationAmountChanger) + public static NoiseModule SetRotationAmount(this NoiseModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func rotationAmountChanger) { Debug.Assert(rotationAmountChanger != null, "rotationAmountChanger cannot be null"); module.rotationAmount = rotationAmountChanger(module.rotationAmount); @@ -890,7 +1301,14 @@ public static NoiseModule SetRotationAmount(this NoiseModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseScrollSpeed(this ParticleSystem particleSystem, MinMaxCurve scrollSpeed) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseScrollSpeed( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve scrollSpeed) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.noise; @@ -902,7 +1320,18 @@ public static ParticleSystem SetNoiseScrollSpeed(this ParticleSystem particleSys /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseScrollSpeed(this ParticleSystem particleSystem, Func scrollSpeedChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseScrollSpeed( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func scrollSpeedChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(scrollSpeedChanger != null, "scrollSpeedChanger cannot be null"); @@ -925,7 +1354,11 @@ public static NoiseModule SetScrollSpeed(this NoiseModule module, MinMaxCurve sc /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetScrollSpeed(this NoiseModule module, Func scrollSpeedChanger) + public static NoiseModule SetScrollSpeed(this NoiseModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func scrollSpeedChanger) { Debug.Assert(scrollSpeedChanger != null, "scrollSpeedChanger cannot be null"); module.scrollSpeed = scrollSpeedChanger(module.scrollSpeed); @@ -938,7 +1371,14 @@ public static NoiseModule SetScrollSpeed(this NoiseModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseScrollSpeedMultiplier(this ParticleSystem particleSystem, float scrollSpeedMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseScrollSpeedMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float scrollSpeedMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.noise; @@ -950,7 +1390,18 @@ public static ParticleSystem SetNoiseScrollSpeedMultiplier(this ParticleSystem p /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseScrollSpeedMultiplier(this ParticleSystem particleSystem, Func scrollSpeedMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseScrollSpeedMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func scrollSpeedMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(scrollSpeedMultiplierChanger != null, "scrollSpeedMultiplierChanger cannot be null"); @@ -973,7 +1424,11 @@ public static NoiseModule SetScrollSpeedMultiplier(this NoiseModule module, floa /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetScrollSpeedMultiplier(this NoiseModule module, Func scrollSpeedMultiplierChanger) + public static NoiseModule SetScrollSpeedMultiplier(this NoiseModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func scrollSpeedMultiplierChanger) { Debug.Assert(scrollSpeedMultiplierChanger != null, "scrollSpeedMultiplierChanger cannot be null"); module.scrollSpeedMultiplier = scrollSpeedMultiplierChanger(module.scrollSpeedMultiplier); @@ -986,7 +1441,14 @@ public static NoiseModule SetScrollSpeedMultiplier(this NoiseModule module, Func /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseSeparateAxes(this ParticleSystem particleSystem, bool separateAxes) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseSeparateAxes( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool separateAxes) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.noise; @@ -998,7 +1460,18 @@ public static ParticleSystem SetNoiseSeparateAxes(this ParticleSystem particleSy /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseSeparateAxes(this ParticleSystem particleSystem, Func separateAxesChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseSeparateAxes( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func separateAxesChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(separateAxesChanger != null, "separateAxesChanger cannot be null"); @@ -1021,7 +1494,11 @@ public static NoiseModule SetSeparateAxes(this NoiseModule module, bool separate /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetSeparateAxes(this NoiseModule module, Func separateAxesChanger) + public static NoiseModule SetSeparateAxes(this NoiseModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func separateAxesChanger) { Debug.Assert(separateAxesChanger != null, "separateAxesChanger cannot be null"); module.separateAxes = separateAxesChanger(module.separateAxes); @@ -1034,7 +1511,14 @@ public static NoiseModule SetSeparateAxes(this NoiseModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseSizeAmount(this ParticleSystem particleSystem, MinMaxCurve sizeAmount) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseSizeAmount( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve sizeAmount) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.noise; @@ -1046,7 +1530,18 @@ public static ParticleSystem SetNoiseSizeAmount(this ParticleSystem particleSyst /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseSizeAmount(this ParticleSystem particleSystem, Func sizeAmountChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseSizeAmount( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func sizeAmountChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(sizeAmountChanger != null, "sizeAmountChanger cannot be null"); @@ -1069,7 +1564,11 @@ public static NoiseModule SetSizeAmount(this NoiseModule module, MinMaxCurve siz /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetSizeAmount(this NoiseModule module, Func sizeAmountChanger) + public static NoiseModule SetSizeAmount(this NoiseModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func sizeAmountChanger) { Debug.Assert(sizeAmountChanger != null, "sizeAmountChanger cannot be null"); module.sizeAmount = sizeAmountChanger(module.sizeAmount); @@ -1082,7 +1581,14 @@ public static NoiseModule SetSizeAmount(this NoiseModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseStrength(this ParticleSystem particleSystem, MinMaxCurve strength) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseStrength( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve strength) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.noise; @@ -1094,7 +1600,18 @@ public static ParticleSystem SetNoiseStrength(this ParticleSystem particleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseStrength(this ParticleSystem particleSystem, Func strengthChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseStrength( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func strengthChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(strengthChanger != null, "strengthChanger cannot be null"); @@ -1117,7 +1634,11 @@ public static NoiseModule SetStrength(this NoiseModule module, MinMaxCurve stren /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetStrength(this NoiseModule module, Func strengthChanger) + public static NoiseModule SetStrength(this NoiseModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func strengthChanger) { Debug.Assert(strengthChanger != null, "strengthChanger cannot be null"); module.strength = strengthChanger(module.strength); @@ -1130,7 +1651,14 @@ public static NoiseModule SetStrength(this NoiseModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseStrengthMultiplier(this ParticleSystem particleSystem, float strengthMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseStrengthMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float strengthMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.noise; @@ -1142,7 +1670,18 @@ public static ParticleSystem SetNoiseStrengthMultiplier(this ParticleSystem part /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseStrengthMultiplier(this ParticleSystem particleSystem, Func strengthMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseStrengthMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func strengthMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(strengthMultiplierChanger != null, "strengthMultiplierChanger cannot be null"); @@ -1165,7 +1704,11 @@ public static NoiseModule SetStrengthMultiplier(this NoiseModule module, float s /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetStrengthMultiplier(this NoiseModule module, Func strengthMultiplierChanger) + public static NoiseModule SetStrengthMultiplier(this NoiseModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func strengthMultiplierChanger) { Debug.Assert(strengthMultiplierChanger != null, "strengthMultiplierChanger cannot be null"); module.strengthMultiplier = strengthMultiplierChanger(module.strengthMultiplier); @@ -1178,7 +1721,14 @@ public static NoiseModule SetStrengthMultiplier(this NoiseModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseStrengthX(this ParticleSystem particleSystem, MinMaxCurve strengthX) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseStrengthX( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve strengthX) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.noise; @@ -1190,7 +1740,18 @@ public static ParticleSystem SetNoiseStrengthX(this ParticleSystem particleSyste /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseStrengthX(this ParticleSystem particleSystem, Func strengthXChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseStrengthX( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func strengthXChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(strengthXChanger != null, "strengthXChanger cannot be null"); @@ -1213,7 +1774,11 @@ public static NoiseModule SetStrengthX(this NoiseModule module, MinMaxCurve stre /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetStrengthX(this NoiseModule module, Func strengthXChanger) + public static NoiseModule SetStrengthX(this NoiseModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func strengthXChanger) { Debug.Assert(strengthXChanger != null, "strengthXChanger cannot be null"); module.strengthX = strengthXChanger(module.strengthX); @@ -1226,7 +1791,14 @@ public static NoiseModule SetStrengthX(this NoiseModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseStrengthXMultiplier(this ParticleSystem particleSystem, float strengthXMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseStrengthXMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float strengthXMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.noise; @@ -1238,7 +1810,18 @@ public static ParticleSystem SetNoiseStrengthXMultiplier(this ParticleSystem par /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseStrengthXMultiplier(this ParticleSystem particleSystem, Func strengthXMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseStrengthXMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func strengthXMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(strengthXMultiplierChanger != null, "strengthXMultiplierChanger cannot be null"); @@ -1261,7 +1844,11 @@ public static NoiseModule SetStrengthXMultiplier(this NoiseModule module, float /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetStrengthXMultiplier(this NoiseModule module, Func strengthXMultiplierChanger) + public static NoiseModule SetStrengthXMultiplier(this NoiseModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func strengthXMultiplierChanger) { Debug.Assert(strengthXMultiplierChanger != null, "strengthXMultiplierChanger cannot be null"); module.strengthXMultiplier = strengthXMultiplierChanger(module.strengthXMultiplier); @@ -1274,7 +1861,14 @@ public static NoiseModule SetStrengthXMultiplier(this NoiseModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseStrengthY(this ParticleSystem particleSystem, MinMaxCurve strengthY) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseStrengthY( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve strengthY) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.noise; @@ -1286,7 +1880,18 @@ public static ParticleSystem SetNoiseStrengthY(this ParticleSystem particleSyste /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseStrengthY(this ParticleSystem particleSystem, Func strengthYChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseStrengthY( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func strengthYChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(strengthYChanger != null, "strengthYChanger cannot be null"); @@ -1309,7 +1914,11 @@ public static NoiseModule SetStrengthY(this NoiseModule module, MinMaxCurve stre /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetStrengthY(this NoiseModule module, Func strengthYChanger) + public static NoiseModule SetStrengthY(this NoiseModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func strengthYChanger) { Debug.Assert(strengthYChanger != null, "strengthYChanger cannot be null"); module.strengthY = strengthYChanger(module.strengthY); @@ -1322,7 +1931,14 @@ public static NoiseModule SetStrengthY(this NoiseModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseStrengthYMultiplier(this ParticleSystem particleSystem, float strengthYMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseStrengthYMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float strengthYMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.noise; @@ -1334,7 +1950,18 @@ public static ParticleSystem SetNoiseStrengthYMultiplier(this ParticleSystem par /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseStrengthYMultiplier(this ParticleSystem particleSystem, Func strengthYMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseStrengthYMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func strengthYMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(strengthYMultiplierChanger != null, "strengthYMultiplierChanger cannot be null"); @@ -1357,7 +1984,11 @@ public static NoiseModule SetStrengthYMultiplier(this NoiseModule module, float /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetStrengthYMultiplier(this NoiseModule module, Func strengthYMultiplierChanger) + public static NoiseModule SetStrengthYMultiplier(this NoiseModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func strengthYMultiplierChanger) { Debug.Assert(strengthYMultiplierChanger != null, "strengthYMultiplierChanger cannot be null"); module.strengthYMultiplier = strengthYMultiplierChanger(module.strengthYMultiplier); @@ -1370,7 +2001,14 @@ public static NoiseModule SetStrengthYMultiplier(this NoiseModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseStrengthZ(this ParticleSystem particleSystem, MinMaxCurve strengthZ) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseStrengthZ( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve strengthZ) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.noise; @@ -1382,7 +2020,18 @@ public static ParticleSystem SetNoiseStrengthZ(this ParticleSystem particleSyste /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseStrengthZ(this ParticleSystem particleSystem, Func strengthZChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseStrengthZ( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func strengthZChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(strengthZChanger != null, "strengthZChanger cannot be null"); @@ -1405,7 +2054,11 @@ public static NoiseModule SetStrengthZ(this NoiseModule module, MinMaxCurve stre /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetStrengthZ(this NoiseModule module, Func strengthZChanger) + public static NoiseModule SetStrengthZ(this NoiseModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func strengthZChanger) { Debug.Assert(strengthZChanger != null, "strengthZChanger cannot be null"); module.strengthZ = strengthZChanger(module.strengthZ); @@ -1418,7 +2071,14 @@ public static NoiseModule SetStrengthZ(this NoiseModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseStrengthZMultiplier(this ParticleSystem particleSystem, float strengthZMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseStrengthZMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float strengthZMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.noise; @@ -1430,7 +2090,18 @@ public static ParticleSystem SetNoiseStrengthZMultiplier(this ParticleSystem par /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseStrengthZMultiplier(this ParticleSystem particleSystem, Func strengthZMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetNoiseStrengthZMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func strengthZMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(strengthZMultiplierChanger != null, "strengthZMultiplierChanger cannot be null"); @@ -1453,7 +2124,11 @@ public static NoiseModule SetStrengthZMultiplier(this NoiseModule module, float /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetStrengthZMultiplier(this NoiseModule module, Func strengthZMultiplierChanger) + public static NoiseModule SetStrengthZMultiplier(this NoiseModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func strengthZMultiplierChanger) { Debug.Assert(strengthZMultiplierChanger != null, "strengthZMultiplierChanger cannot be null"); module.strengthZMultiplier = strengthZMultiplierChanger(module.strengthZMultiplier); diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/NoiseModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Extensions/NoiseModuleExtension.cs.meta similarity index 100% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/NoiseModuleExtension.cs.meta rename to Packages/FluentParticleSystem/Runtime/Extensions/NoiseModuleExtension.cs.meta diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/RotationBySpeedModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/Extensions/RotationBySpeedModuleExtension.cs similarity index 72% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/RotationBySpeedModuleExtension.cs rename to Packages/FluentParticleSystem/Runtime/Extensions/RotationBySpeedModuleExtension.cs index dcf3363..ebd9b72 100644 --- a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/RotationBySpeedModuleExtension.cs +++ b/Packages/FluentParticleSystem/Runtime/Extensions/RotationBySpeedModuleExtension.cs @@ -1,8 +1,13 @@ using System; using System.Runtime.CompilerServices; using UnityEngine; + using static UnityEngine.ParticleSystem; +#if UNITY_2020_2_OR_NEWER +using System.Diagnostics.CodeAnalysis; +#endif + namespace OUCC.FluentParticleSystem { public static class RotationBySpeedModuleExtension @@ -12,7 +17,18 @@ public static class RotationBySpeedModuleExtension /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditRotationBySpeed(this ParticleSystem particleSystem, Action moduleEditor) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem EditRotationBySpeed( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Action moduleEditor) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); @@ -25,7 +41,14 @@ public static ParticleSystem EditRotationBySpeed(this ParticleSystem particleSys /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationBySpeedEnabled(this ParticleSystem particleSystem, bool enabled) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetRotationBySpeedEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool enabled) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.rotationBySpeed; @@ -37,7 +60,18 @@ public static ParticleSystem SetRotationBySpeedEnabled(this ParticleSystem parti /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationBySpeedEnabled(this ParticleSystem particleSystem, Func enabledChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetRotationBySpeedEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); @@ -60,7 +94,11 @@ public static RotationBySpeedModule SetEnabled(this RotationBySpeedModule module /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationBySpeedModule SetEnabled(this RotationBySpeedModule module, Func enabledChanger) + public static RotationBySpeedModule SetEnabled(this RotationBySpeedModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); module.enabled = enabledChanger(module.enabled); @@ -73,7 +111,14 @@ public static RotationBySpeedModule SetEnabled(this RotationBySpeedModule module /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationBySpeedRange(this ParticleSystem particleSystem, Vector2 range) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetRotationBySpeedRange( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, Vector2 range) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.rotationBySpeed; @@ -85,7 +130,18 @@ public static ParticleSystem SetRotationBySpeedRange(this ParticleSystem particl /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationBySpeedRange(this ParticleSystem particleSystem, Func rangeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetRotationBySpeedRange( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func rangeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(rangeChanger != null, "rangeChanger cannot be null"); @@ -108,7 +164,11 @@ public static RotationBySpeedModule SetRange(this RotationBySpeedModule module, /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationBySpeedModule SetRange(this RotationBySpeedModule module, Func rangeChanger) + public static RotationBySpeedModule SetRange(this RotationBySpeedModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func rangeChanger) { Debug.Assert(rangeChanger != null, "rangeChanger cannot be null"); module.range = rangeChanger(module.range); @@ -121,7 +181,14 @@ public static RotationBySpeedModule SetRange(this RotationBySpeedModule module, /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationBySpeedSeparateAxes(this ParticleSystem particleSystem, bool separateAxes) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetRotationBySpeedSeparateAxes( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool separateAxes) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.rotationBySpeed; @@ -133,7 +200,18 @@ public static ParticleSystem SetRotationBySpeedSeparateAxes(this ParticleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationBySpeedSeparateAxes(this ParticleSystem particleSystem, Func separateAxesChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetRotationBySpeedSeparateAxes( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func separateAxesChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(separateAxesChanger != null, "separateAxesChanger cannot be null"); @@ -156,7 +234,11 @@ public static RotationBySpeedModule SetSeparateAxes(this RotationBySpeedModule m /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationBySpeedModule SetSeparateAxes(this RotationBySpeedModule module, Func separateAxesChanger) + public static RotationBySpeedModule SetSeparateAxes(this RotationBySpeedModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func separateAxesChanger) { Debug.Assert(separateAxesChanger != null, "separateAxesChanger cannot be null"); module.separateAxes = separateAxesChanger(module.separateAxes); @@ -169,7 +251,14 @@ public static RotationBySpeedModule SetSeparateAxes(this RotationBySpeedModule m /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationBySpeedX(this ParticleSystem particleSystem, MinMaxCurve x) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetRotationBySpeedX( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve x) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.rotationBySpeed; @@ -181,7 +270,18 @@ public static ParticleSystem SetRotationBySpeedX(this ParticleSystem particleSys /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationBySpeedX(this ParticleSystem particleSystem, Func xChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetRotationBySpeedX( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func xChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(xChanger != null, "xChanger cannot be null"); @@ -204,7 +304,11 @@ public static RotationBySpeedModule SetX(this RotationBySpeedModule module, MinM /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationBySpeedModule SetX(this RotationBySpeedModule module, Func xChanger) + public static RotationBySpeedModule SetX(this RotationBySpeedModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func xChanger) { Debug.Assert(xChanger != null, "xChanger cannot be null"); module.x = xChanger(module.x); @@ -217,7 +321,14 @@ public static RotationBySpeedModule SetX(this RotationBySpeedModule module, Func /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationBySpeedXMultiplier(this ParticleSystem particleSystem, float xMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetRotationBySpeedXMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float xMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.rotationBySpeed; @@ -229,7 +340,18 @@ public static ParticleSystem SetRotationBySpeedXMultiplier(this ParticleSystem p /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationBySpeedXMultiplier(this ParticleSystem particleSystem, Func xMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetRotationBySpeedXMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func xMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(xMultiplierChanger != null, "xMultiplierChanger cannot be null"); @@ -252,7 +374,11 @@ public static RotationBySpeedModule SetXMultiplier(this RotationBySpeedModule mo /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationBySpeedModule SetXMultiplier(this RotationBySpeedModule module, Func xMultiplierChanger) + public static RotationBySpeedModule SetXMultiplier(this RotationBySpeedModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func xMultiplierChanger) { Debug.Assert(xMultiplierChanger != null, "xMultiplierChanger cannot be null"); module.xMultiplier = xMultiplierChanger(module.xMultiplier); @@ -265,7 +391,14 @@ public static RotationBySpeedModule SetXMultiplier(this RotationBySpeedModule mo /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationBySpeedY(this ParticleSystem particleSystem, MinMaxCurve y) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetRotationBySpeedY( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve y) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.rotationBySpeed; @@ -277,7 +410,18 @@ public static ParticleSystem SetRotationBySpeedY(this ParticleSystem particleSys /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationBySpeedY(this ParticleSystem particleSystem, Func yChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetRotationBySpeedY( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func yChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(yChanger != null, "yChanger cannot be null"); @@ -300,7 +444,11 @@ public static RotationBySpeedModule SetY(this RotationBySpeedModule module, MinM /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationBySpeedModule SetY(this RotationBySpeedModule module, Func yChanger) + public static RotationBySpeedModule SetY(this RotationBySpeedModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func yChanger) { Debug.Assert(yChanger != null, "yChanger cannot be null"); module.y = yChanger(module.y); @@ -313,7 +461,14 @@ public static RotationBySpeedModule SetY(this RotationBySpeedModule module, Func /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationBySpeedYMultiplier(this ParticleSystem particleSystem, float yMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetRotationBySpeedYMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float yMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.rotationBySpeed; @@ -325,7 +480,18 @@ public static ParticleSystem SetRotationBySpeedYMultiplier(this ParticleSystem p /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationBySpeedYMultiplier(this ParticleSystem particleSystem, Func yMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetRotationBySpeedYMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func yMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(yMultiplierChanger != null, "yMultiplierChanger cannot be null"); @@ -348,7 +514,11 @@ public static RotationBySpeedModule SetYMultiplier(this RotationBySpeedModule mo /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationBySpeedModule SetYMultiplier(this RotationBySpeedModule module, Func yMultiplierChanger) + public static RotationBySpeedModule SetYMultiplier(this RotationBySpeedModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func yMultiplierChanger) { Debug.Assert(yMultiplierChanger != null, "yMultiplierChanger cannot be null"); module.yMultiplier = yMultiplierChanger(module.yMultiplier); @@ -361,7 +531,14 @@ public static RotationBySpeedModule SetYMultiplier(this RotationBySpeedModule mo /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationBySpeedZ(this ParticleSystem particleSystem, MinMaxCurve z) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetRotationBySpeedZ( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve z) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.rotationBySpeed; @@ -373,7 +550,18 @@ public static ParticleSystem SetRotationBySpeedZ(this ParticleSystem particleSys /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationBySpeedZ(this ParticleSystem particleSystem, Func zChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetRotationBySpeedZ( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func zChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(zChanger != null, "zChanger cannot be null"); @@ -396,7 +584,11 @@ public static RotationBySpeedModule SetZ(this RotationBySpeedModule module, MinM /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationBySpeedModule SetZ(this RotationBySpeedModule module, Func zChanger) + public static RotationBySpeedModule SetZ(this RotationBySpeedModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func zChanger) { Debug.Assert(zChanger != null, "zChanger cannot be null"); module.z = zChanger(module.z); @@ -409,7 +601,14 @@ public static RotationBySpeedModule SetZ(this RotationBySpeedModule module, Func /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationBySpeedZMultiplier(this ParticleSystem particleSystem, float zMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetRotationBySpeedZMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float zMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.rotationBySpeed; @@ -421,7 +620,18 @@ public static ParticleSystem SetRotationBySpeedZMultiplier(this ParticleSystem p /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationBySpeedZMultiplier(this ParticleSystem particleSystem, Func zMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetRotationBySpeedZMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func zMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(zMultiplierChanger != null, "zMultiplierChanger cannot be null"); @@ -444,7 +654,11 @@ public static RotationBySpeedModule SetZMultiplier(this RotationBySpeedModule mo /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationBySpeedModule SetZMultiplier(this RotationBySpeedModule module, Func zMultiplierChanger) + public static RotationBySpeedModule SetZMultiplier(this RotationBySpeedModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func zMultiplierChanger) { Debug.Assert(zMultiplierChanger != null, "zMultiplierChanger cannot be null"); module.zMultiplier = zMultiplierChanger(module.zMultiplier); diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/RotationBySpeedModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Extensions/RotationBySpeedModuleExtension.cs.meta similarity index 100% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/RotationBySpeedModuleExtension.cs.meta rename to Packages/FluentParticleSystem/Runtime/Extensions/RotationBySpeedModuleExtension.cs.meta diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/RotationOverLifetimeModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/Extensions/RotationOverLifetimeModuleExtension.cs similarity index 73% rename from Packages/FluentParticleSystem/Runtime/Nullable/Extensions/RotationOverLifetimeModuleExtension.cs rename to Packages/FluentParticleSystem/Runtime/Extensions/RotationOverLifetimeModuleExtension.cs index 4ae717c..8ff0f3a 100644 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/RotationOverLifetimeModuleExtension.cs +++ b/Packages/FluentParticleSystem/Runtime/Extensions/RotationOverLifetimeModuleExtension.cs @@ -1,9 +1,13 @@ -#nullable enable using System; using System.Runtime.CompilerServices; using UnityEngine; + using static UnityEngine.ParticleSystem; +#if UNITY_2020_2_OR_NEWER +using System.Diagnostics.CodeAnalysis; +#endif + namespace OUCC.FluentParticleSystem { public static class RotationOverLifetimeModuleExtension @@ -13,7 +17,18 @@ public static class RotationOverLifetimeModuleExtension /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditRotationOverLifetime(this ParticleSystem particleSystem, Action moduleEditor) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem EditRotationOverLifetime( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Action moduleEditor) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); @@ -26,7 +41,14 @@ public static ParticleSystem EditRotationOverLifetime(this ParticleSystem partic /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationOverLifetimeEnabled(this ParticleSystem particleSystem, bool enabled) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetRotationOverLifetimeEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool enabled) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.rotationOverLifetime; @@ -38,7 +60,18 @@ public static ParticleSystem SetRotationOverLifetimeEnabled(this ParticleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationOverLifetimeEnabled(this ParticleSystem particleSystem, Func enabledChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetRotationOverLifetimeEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); @@ -61,7 +94,11 @@ public static RotationOverLifetimeModule SetEnabled(this RotationOverLifetimeMod /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationOverLifetimeModule SetEnabled(this RotationOverLifetimeModule module, Func enabledChanger) + public static RotationOverLifetimeModule SetEnabled(this RotationOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); module.enabled = enabledChanger(module.enabled); @@ -74,7 +111,14 @@ public static RotationOverLifetimeModule SetEnabled(this RotationOverLifetimeMod /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationOverLifetimeSeparateAxes(this ParticleSystem particleSystem, bool separateAxes) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetRotationOverLifetimeSeparateAxes( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool separateAxes) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.rotationOverLifetime; @@ -86,7 +130,18 @@ public static ParticleSystem SetRotationOverLifetimeSeparateAxes(this ParticleSy /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationOverLifetimeSeparateAxes(this ParticleSystem particleSystem, Func separateAxesChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetRotationOverLifetimeSeparateAxes( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func separateAxesChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(separateAxesChanger != null, "separateAxesChanger cannot be null"); @@ -109,7 +164,11 @@ public static RotationOverLifetimeModule SetSeparateAxes(this RotationOverLifeti /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationOverLifetimeModule SetSeparateAxes(this RotationOverLifetimeModule module, Func separateAxesChanger) + public static RotationOverLifetimeModule SetSeparateAxes(this RotationOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func separateAxesChanger) { Debug.Assert(separateAxesChanger != null, "separateAxesChanger cannot be null"); module.separateAxes = separateAxesChanger(module.separateAxes); @@ -122,7 +181,14 @@ public static RotationOverLifetimeModule SetSeparateAxes(this RotationOverLifeti /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationOverLifetimeX(this ParticleSystem particleSystem, MinMaxCurve x) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetRotationOverLifetimeX( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve x) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.rotationOverLifetime; @@ -134,7 +200,18 @@ public static ParticleSystem SetRotationOverLifetimeX(this ParticleSystem partic /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationOverLifetimeX(this ParticleSystem particleSystem, Func xChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetRotationOverLifetimeX( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func xChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(xChanger != null, "xChanger cannot be null"); @@ -157,7 +234,11 @@ public static RotationOverLifetimeModule SetX(this RotationOverLifetimeModule mo /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationOverLifetimeModule SetX(this RotationOverLifetimeModule module, Func xChanger) + public static RotationOverLifetimeModule SetX(this RotationOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func xChanger) { Debug.Assert(xChanger != null, "xChanger cannot be null"); module.x = xChanger(module.x); @@ -170,7 +251,14 @@ public static RotationOverLifetimeModule SetX(this RotationOverLifetimeModule mo /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationOverLifetimeXMultiplier(this ParticleSystem particleSystem, float xMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetRotationOverLifetimeXMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float xMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.rotationOverLifetime; @@ -182,7 +270,18 @@ public static ParticleSystem SetRotationOverLifetimeXMultiplier(this ParticleSys /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationOverLifetimeXMultiplier(this ParticleSystem particleSystem, Func xMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetRotationOverLifetimeXMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func xMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(xMultiplierChanger != null, "xMultiplierChanger cannot be null"); @@ -205,7 +304,11 @@ public static RotationOverLifetimeModule SetXMultiplier(this RotationOverLifetim /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationOverLifetimeModule SetXMultiplier(this RotationOverLifetimeModule module, Func xMultiplierChanger) + public static RotationOverLifetimeModule SetXMultiplier(this RotationOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func xMultiplierChanger) { Debug.Assert(xMultiplierChanger != null, "xMultiplierChanger cannot be null"); module.xMultiplier = xMultiplierChanger(module.xMultiplier); @@ -218,7 +321,14 @@ public static RotationOverLifetimeModule SetXMultiplier(this RotationOverLifetim /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationOverLifetimeY(this ParticleSystem particleSystem, MinMaxCurve y) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetRotationOverLifetimeY( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve y) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.rotationOverLifetime; @@ -230,7 +340,18 @@ public static ParticleSystem SetRotationOverLifetimeY(this ParticleSystem partic /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationOverLifetimeY(this ParticleSystem particleSystem, Func yChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetRotationOverLifetimeY( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func yChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(yChanger != null, "yChanger cannot be null"); @@ -253,7 +374,11 @@ public static RotationOverLifetimeModule SetY(this RotationOverLifetimeModule mo /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationOverLifetimeModule SetY(this RotationOverLifetimeModule module, Func yChanger) + public static RotationOverLifetimeModule SetY(this RotationOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func yChanger) { Debug.Assert(yChanger != null, "yChanger cannot be null"); module.y = yChanger(module.y); @@ -266,7 +391,14 @@ public static RotationOverLifetimeModule SetY(this RotationOverLifetimeModule mo /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationOverLifetimeYMultiplier(this ParticleSystem particleSystem, float yMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetRotationOverLifetimeYMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float yMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.rotationOverLifetime; @@ -278,7 +410,18 @@ public static ParticleSystem SetRotationOverLifetimeYMultiplier(this ParticleSys /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationOverLifetimeYMultiplier(this ParticleSystem particleSystem, Func yMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetRotationOverLifetimeYMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func yMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(yMultiplierChanger != null, "yMultiplierChanger cannot be null"); @@ -301,7 +444,11 @@ public static RotationOverLifetimeModule SetYMultiplier(this RotationOverLifetim /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationOverLifetimeModule SetYMultiplier(this RotationOverLifetimeModule module, Func yMultiplierChanger) + public static RotationOverLifetimeModule SetYMultiplier(this RotationOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func yMultiplierChanger) { Debug.Assert(yMultiplierChanger != null, "yMultiplierChanger cannot be null"); module.yMultiplier = yMultiplierChanger(module.yMultiplier); @@ -314,7 +461,14 @@ public static RotationOverLifetimeModule SetYMultiplier(this RotationOverLifetim /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationOverLifetimeZ(this ParticleSystem particleSystem, MinMaxCurve z) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetRotationOverLifetimeZ( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve z) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.rotationOverLifetime; @@ -326,7 +480,18 @@ public static ParticleSystem SetRotationOverLifetimeZ(this ParticleSystem partic /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationOverLifetimeZ(this ParticleSystem particleSystem, Func zChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetRotationOverLifetimeZ( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func zChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(zChanger != null, "zChanger cannot be null"); @@ -349,7 +514,11 @@ public static RotationOverLifetimeModule SetZ(this RotationOverLifetimeModule mo /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationOverLifetimeModule SetZ(this RotationOverLifetimeModule module, Func zChanger) + public static RotationOverLifetimeModule SetZ(this RotationOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func zChanger) { Debug.Assert(zChanger != null, "zChanger cannot be null"); module.z = zChanger(module.z); @@ -362,7 +531,14 @@ public static RotationOverLifetimeModule SetZ(this RotationOverLifetimeModule mo /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationOverLifetimeZMultiplier(this ParticleSystem particleSystem, float zMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetRotationOverLifetimeZMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float zMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.rotationOverLifetime; @@ -374,7 +550,18 @@ public static ParticleSystem SetRotationOverLifetimeZMultiplier(this ParticleSys /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationOverLifetimeZMultiplier(this ParticleSystem particleSystem, Func zMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetRotationOverLifetimeZMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func zMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(zMultiplierChanger != null, "zMultiplierChanger cannot be null"); @@ -397,7 +584,11 @@ public static RotationOverLifetimeModule SetZMultiplier(this RotationOverLifetim /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationOverLifetimeModule SetZMultiplier(this RotationOverLifetimeModule module, Func zMultiplierChanger) + public static RotationOverLifetimeModule SetZMultiplier(this RotationOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func zMultiplierChanger) { Debug.Assert(zMultiplierChanger != null, "zMultiplierChanger cannot be null"); module.zMultiplier = zMultiplierChanger(module.zMultiplier); diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/RotationOverLifetimeModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Extensions/RotationOverLifetimeModuleExtension.cs.meta similarity index 100% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/RotationOverLifetimeModuleExtension.cs.meta rename to Packages/FluentParticleSystem/Runtime/Extensions/RotationOverLifetimeModuleExtension.cs.meta diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/ShapeModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/Extensions/ShapeModuleExtension.cs similarity index 72% rename from Packages/FluentParticleSystem/Runtime/Nullable/Extensions/ShapeModuleExtension.cs rename to Packages/FluentParticleSystem/Runtime/Extensions/ShapeModuleExtension.cs index 2417dfa..97bb2c4 100644 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/ShapeModuleExtension.cs +++ b/Packages/FluentParticleSystem/Runtime/Extensions/ShapeModuleExtension.cs @@ -1,9 +1,13 @@ -#nullable enable using System; using System.Runtime.CompilerServices; using UnityEngine; + using static UnityEngine.ParticleSystem; +#if UNITY_2020_2_OR_NEWER +using System.Diagnostics.CodeAnalysis; +#endif + namespace OUCC.FluentParticleSystem { public static class ShapeModuleExtension @@ -13,7 +17,18 @@ public static class ShapeModuleExtension /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditShape(this ParticleSystem particleSystem, Action moduleEditor) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem EditShape( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Action moduleEditor) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); @@ -26,7 +41,14 @@ public static ParticleSystem EditShape(this ParticleSystem particleSystem, Actio /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeAlignToDirection(this ParticleSystem particleSystem, bool alignToDirection) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeAlignToDirection( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool alignToDirection) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -38,7 +60,18 @@ public static ParticleSystem SetShapeAlignToDirection(this ParticleSystem partic /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeAlignToDirection(this ParticleSystem particleSystem, Func alignToDirectionChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeAlignToDirection( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func alignToDirectionChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(alignToDirectionChanger != null, "alignToDirectionChanger cannot be null"); @@ -61,7 +94,11 @@ public static ShapeModule SetAlignToDirection(this ShapeModule module, bool alig /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetAlignToDirection(this ShapeModule module, Func alignToDirectionChanger) + public static ShapeModule SetAlignToDirection(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func alignToDirectionChanger) { Debug.Assert(alignToDirectionChanger != null, "alignToDirectionChanger cannot be null"); module.alignToDirection = alignToDirectionChanger(module.alignToDirection); @@ -74,7 +111,14 @@ public static ShapeModule SetAlignToDirection(this ShapeModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeAngle(this ParticleSystem particleSystem, float angle) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeAngle( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float angle) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -86,7 +130,18 @@ public static ParticleSystem SetShapeAngle(this ParticleSystem particleSystem, f /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeAngle(this ParticleSystem particleSystem, Func angleChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeAngle( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func angleChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(angleChanger != null, "angleChanger cannot be null"); @@ -109,7 +164,11 @@ public static ShapeModule SetAngle(this ShapeModule module, float angle) /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetAngle(this ShapeModule module, Func angleChanger) + public static ShapeModule SetAngle(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func angleChanger) { Debug.Assert(angleChanger != null, "angleChanger cannot be null"); module.angle = angleChanger(module.angle); @@ -122,7 +181,14 @@ public static ShapeModule SetAngle(this ShapeModule module, Func a /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeArc(this ParticleSystem particleSystem, float arc) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeArc( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float arc) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -134,7 +200,18 @@ public static ParticleSystem SetShapeArc(this ParticleSystem particleSystem, flo /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeArc(this ParticleSystem particleSystem, Func arcChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeArc( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func arcChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(arcChanger != null, "arcChanger cannot be null"); @@ -157,7 +234,11 @@ public static ShapeModule SetArc(this ShapeModule module, float arc) /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetArc(this ShapeModule module, Func arcChanger) + public static ShapeModule SetArc(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func arcChanger) { Debug.Assert(arcChanger != null, "arcChanger cannot be null"); module.arc = arcChanger(module.arc); @@ -170,7 +251,14 @@ public static ShapeModule SetArc(this ShapeModule module, Func arc /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeArcMode(this ParticleSystem particleSystem, ParticleSystemShapeMultiModeValue arcMode) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeArcMode( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, ParticleSystemShapeMultiModeValue arcMode) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -182,7 +270,18 @@ public static ParticleSystem SetShapeArcMode(this ParticleSystem particleSystem, /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeArcMode(this ParticleSystem particleSystem, Func arcModeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeArcMode( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func arcModeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(arcModeChanger != null, "arcModeChanger cannot be null"); @@ -205,7 +304,11 @@ public static ShapeModule SetArcMode(this ShapeModule module, ParticleSystemShap /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetArcMode(this ShapeModule module, Func arcModeChanger) + public static ShapeModule SetArcMode(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func arcModeChanger) { Debug.Assert(arcModeChanger != null, "arcModeChanger cannot be null"); module.arcMode = arcModeChanger(module.arcMode); @@ -218,7 +321,14 @@ public static ShapeModule SetArcMode(this ShapeModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeArcSpeed(this ParticleSystem particleSystem, MinMaxCurve arcSpeed) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeArcSpeed( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve arcSpeed) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -230,7 +340,18 @@ public static ParticleSystem SetShapeArcSpeed(this ParticleSystem particleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeArcSpeed(this ParticleSystem particleSystem, Func arcSpeedChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeArcSpeed( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func arcSpeedChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(arcSpeedChanger != null, "arcSpeedChanger cannot be null"); @@ -253,7 +374,11 @@ public static ShapeModule SetArcSpeed(this ShapeModule module, MinMaxCurve arcSp /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetArcSpeed(this ShapeModule module, Func arcSpeedChanger) + public static ShapeModule SetArcSpeed(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func arcSpeedChanger) { Debug.Assert(arcSpeedChanger != null, "arcSpeedChanger cannot be null"); module.arcSpeed = arcSpeedChanger(module.arcSpeed); @@ -266,7 +391,14 @@ public static ShapeModule SetArcSpeed(this ShapeModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeArcSpeedMultiplier(this ParticleSystem particleSystem, float arcSpeedMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeArcSpeedMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float arcSpeedMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -278,7 +410,18 @@ public static ParticleSystem SetShapeArcSpeedMultiplier(this ParticleSystem part /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeArcSpeedMultiplier(this ParticleSystem particleSystem, Func arcSpeedMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeArcSpeedMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func arcSpeedMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(arcSpeedMultiplierChanger != null, "arcSpeedMultiplierChanger cannot be null"); @@ -301,7 +444,11 @@ public static ShapeModule SetArcSpeedMultiplier(this ShapeModule module, float a /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetArcSpeedMultiplier(this ShapeModule module, Func arcSpeedMultiplierChanger) + public static ShapeModule SetArcSpeedMultiplier(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func arcSpeedMultiplierChanger) { Debug.Assert(arcSpeedMultiplierChanger != null, "arcSpeedMultiplierChanger cannot be null"); module.arcSpeedMultiplier = arcSpeedMultiplierChanger(module.arcSpeedMultiplier); @@ -314,7 +461,14 @@ public static ShapeModule SetArcSpeedMultiplier(this ShapeModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeArcSpread(this ParticleSystem particleSystem, float arcSpread) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeArcSpread( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float arcSpread) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -326,7 +480,18 @@ public static ParticleSystem SetShapeArcSpread(this ParticleSystem particleSyste /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeArcSpread(this ParticleSystem particleSystem, Func arcSpreadChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeArcSpread( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func arcSpreadChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(arcSpreadChanger != null, "arcSpreadChanger cannot be null"); @@ -349,7 +514,11 @@ public static ShapeModule SetArcSpread(this ShapeModule module, float arcSpread) /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetArcSpread(this ShapeModule module, Func arcSpreadChanger) + public static ShapeModule SetArcSpread(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func arcSpreadChanger) { Debug.Assert(arcSpreadChanger != null, "arcSpreadChanger cannot be null"); module.arcSpread = arcSpreadChanger(module.arcSpread); @@ -365,7 +534,14 @@ public static ShapeModule SetArcSpread(this ShapeModule module, Func UnityEngine.ParticleSystem/ShapeModule.scale", false)] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeBox(this ParticleSystem particleSystem, Vector3 box) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeBox( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, Vector3 box) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -380,7 +556,18 @@ public static ParticleSystem SetShapeBox(this ParticleSystem particleSystem, Vec [Obsolete("Please use scale instead. (UnityUpgradable) -> UnityEngine.ParticleSystem/ShapeModule.scale", false)] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeBox(this ParticleSystem particleSystem, Func boxChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeBox( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func boxChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(boxChanger != null, "boxChanger cannot be null"); @@ -409,7 +596,11 @@ public static ShapeModule SetBox(this ShapeModule module, Vector3 box) [Obsolete("Please use scale instead. (UnityUpgradable) -> UnityEngine.ParticleSystem/ShapeModule.scale", false)] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetBox(this ShapeModule module, Func boxChanger) + public static ShapeModule SetBox(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func boxChanger) { Debug.Assert(boxChanger != null, "boxChanger cannot be null"); module.box = boxChanger(module.box); @@ -422,7 +613,14 @@ public static ShapeModule SetBox(this ShapeModule module, Func /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeBoxThickness(this ParticleSystem particleSystem, Vector3 boxThickness) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeBoxThickness( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, Vector3 boxThickness) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -434,7 +632,18 @@ public static ParticleSystem SetShapeBoxThickness(this ParticleSystem particleSy /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeBoxThickness(this ParticleSystem particleSystem, Func boxThicknessChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeBoxThickness( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func boxThicknessChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(boxThicknessChanger != null, "boxThicknessChanger cannot be null"); @@ -457,7 +666,11 @@ public static ShapeModule SetBoxThickness(this ShapeModule module, Vector3 boxTh /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetBoxThickness(this ShapeModule module, Func boxThicknessChanger) + public static ShapeModule SetBoxThickness(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func boxThicknessChanger) { Debug.Assert(boxThicknessChanger != null, "boxThicknessChanger cannot be null"); module.boxThickness = boxThicknessChanger(module.boxThickness); @@ -470,7 +683,14 @@ public static ShapeModule SetBoxThickness(this ShapeModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeDonutRadius(this ParticleSystem particleSystem, float donutRadius) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeDonutRadius( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float donutRadius) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -482,7 +702,18 @@ public static ParticleSystem SetShapeDonutRadius(this ParticleSystem particleSys /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeDonutRadius(this ParticleSystem particleSystem, Func donutRadiusChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeDonutRadius( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func donutRadiusChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(donutRadiusChanger != null, "donutRadiusChanger cannot be null"); @@ -505,7 +736,11 @@ public static ShapeModule SetDonutRadius(this ShapeModule module, float donutRad /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetDonutRadius(this ShapeModule module, Func donutRadiusChanger) + public static ShapeModule SetDonutRadius(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func donutRadiusChanger) { Debug.Assert(donutRadiusChanger != null, "donutRadiusChanger cannot be null"); module.donutRadius = donutRadiusChanger(module.donutRadius); @@ -518,7 +753,14 @@ public static ShapeModule SetDonutRadius(this ShapeModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeEnabled(this ParticleSystem particleSystem, bool enabled) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool enabled) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -530,7 +772,18 @@ public static ParticleSystem SetShapeEnabled(this ParticleSystem particleSystem, /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeEnabled(this ParticleSystem particleSystem, Func enabledChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); @@ -553,7 +806,11 @@ public static ShapeModule SetEnabled(this ShapeModule module, bool enabled) /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetEnabled(this ShapeModule module, Func enabledChanger) + public static ShapeModule SetEnabled(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); module.enabled = enabledChanger(module.enabled); @@ -566,7 +823,14 @@ public static ShapeModule SetEnabled(this ShapeModule module, Func e /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeLength(this ParticleSystem particleSystem, float length) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeLength( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float length) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -578,7 +842,18 @@ public static ParticleSystem SetShapeLength(this ParticleSystem particleSystem, /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeLength(this ParticleSystem particleSystem, Func lengthChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeLength( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func lengthChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(lengthChanger != null, "lengthChanger cannot be null"); @@ -601,7 +876,11 @@ public static ShapeModule SetLength(this ShapeModule module, float length) /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetLength(this ShapeModule module, Func lengthChanger) + public static ShapeModule SetLength(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func lengthChanger) { Debug.Assert(lengthChanger != null, "lengthChanger cannot be null"); module.length = lengthChanger(module.length); @@ -614,7 +893,14 @@ public static ShapeModule SetLength(this ShapeModule module, Func /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeMesh(this ParticleSystem particleSystem, Mesh mesh) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeMesh( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, Mesh mesh) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -626,7 +912,18 @@ public static ParticleSystem SetShapeMesh(this ParticleSystem particleSystem, Me /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeMesh(this ParticleSystem particleSystem, Func meshChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeMesh( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func meshChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(meshChanger != null, "meshChanger cannot be null"); @@ -649,7 +946,11 @@ public static ShapeModule SetMesh(this ShapeModule module, Mesh mesh) /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetMesh(this ShapeModule module, Func meshChanger) + public static ShapeModule SetMesh(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func meshChanger) { Debug.Assert(meshChanger != null, "meshChanger cannot be null"); module.mesh = meshChanger(module.mesh); @@ -662,7 +963,14 @@ public static ShapeModule SetMesh(this ShapeModule module, Func mesh /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeMeshMaterialIndex(this ParticleSystem particleSystem, int meshMaterialIndex) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeMeshMaterialIndex( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, int meshMaterialIndex) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -674,7 +982,18 @@ public static ParticleSystem SetShapeMeshMaterialIndex(this ParticleSystem parti /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeMeshMaterialIndex(this ParticleSystem particleSystem, Func meshMaterialIndexChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeMeshMaterialIndex( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func meshMaterialIndexChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(meshMaterialIndexChanger != null, "meshMaterialIndexChanger cannot be null"); @@ -697,7 +1016,11 @@ public static ShapeModule SetMeshMaterialIndex(this ShapeModule module, int mesh /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetMeshMaterialIndex(this ShapeModule module, Func meshMaterialIndexChanger) + public static ShapeModule SetMeshMaterialIndex(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func meshMaterialIndexChanger) { Debug.Assert(meshMaterialIndexChanger != null, "meshMaterialIndexChanger cannot be null"); module.meshMaterialIndex = meshMaterialIndexChanger(module.meshMaterialIndex); @@ -710,7 +1033,14 @@ public static ShapeModule SetMeshMaterialIndex(this ShapeModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeMeshRenderer(this ParticleSystem particleSystem, MeshRenderer meshRenderer) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeMeshRenderer( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MeshRenderer meshRenderer) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -722,7 +1052,18 @@ public static ParticleSystem SetShapeMeshRenderer(this ParticleSystem particleSy /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeMeshRenderer(this ParticleSystem particleSystem, Func meshRendererChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeMeshRenderer( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func meshRendererChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(meshRendererChanger != null, "meshRendererChanger cannot be null"); @@ -745,7 +1086,11 @@ public static ShapeModule SetMeshRenderer(this ShapeModule module, MeshRenderer /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetMeshRenderer(this ShapeModule module, Func meshRendererChanger) + public static ShapeModule SetMeshRenderer(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func meshRendererChanger) { Debug.Assert(meshRendererChanger != null, "meshRendererChanger cannot be null"); module.meshRenderer = meshRendererChanger(module.meshRenderer); @@ -761,7 +1106,14 @@ public static ShapeModule SetMeshRenderer(this ShapeModule module, Func meshScaleChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeMeshScale( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func meshScaleChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(meshScaleChanger != null, "meshScaleChanger cannot be null"); @@ -805,7 +1168,11 @@ public static ShapeModule SetMeshScale(this ShapeModule module, float meshScale) [Obsolete("meshScale property is deprecated.Please use scale instead.", false)] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetMeshScale(this ShapeModule module, Func meshScaleChanger) + public static ShapeModule SetMeshScale(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func meshScaleChanger) { Debug.Assert(meshScaleChanger != null, "meshScaleChanger cannot be null"); module.meshScale = meshScaleChanger(module.meshScale); @@ -818,7 +1185,14 @@ public static ShapeModule SetMeshScale(this ShapeModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeMeshShapeType(this ParticleSystem particleSystem, ParticleSystemMeshShapeType meshShapeType) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeMeshShapeType( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, ParticleSystemMeshShapeType meshShapeType) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -830,7 +1204,18 @@ public static ParticleSystem SetShapeMeshShapeType(this ParticleSystem particleS /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeMeshShapeType(this ParticleSystem particleSystem, Func meshShapeTypeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeMeshShapeType( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func meshShapeTypeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(meshShapeTypeChanger != null, "meshShapeTypeChanger cannot be null"); @@ -853,7 +1238,11 @@ public static ShapeModule SetMeshShapeType(this ShapeModule module, ParticleSyst /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetMeshShapeType(this ShapeModule module, Func meshShapeTypeChanger) + public static ShapeModule SetMeshShapeType(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func meshShapeTypeChanger) { Debug.Assert(meshShapeTypeChanger != null, "meshShapeTypeChanger cannot be null"); module.meshShapeType = meshShapeTypeChanger(module.meshShapeType); @@ -866,7 +1255,14 @@ public static ShapeModule SetMeshShapeType(this ShapeModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeMeshSpawnMode(this ParticleSystem particleSystem, ParticleSystemShapeMultiModeValue meshSpawnMode) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeMeshSpawnMode( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, ParticleSystemShapeMultiModeValue meshSpawnMode) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -878,7 +1274,18 @@ public static ParticleSystem SetShapeMeshSpawnMode(this ParticleSystem particleS /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeMeshSpawnMode(this ParticleSystem particleSystem, Func meshSpawnModeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeMeshSpawnMode( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func meshSpawnModeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(meshSpawnModeChanger != null, "meshSpawnModeChanger cannot be null"); @@ -901,7 +1308,11 @@ public static ShapeModule SetMeshSpawnMode(this ShapeModule module, ParticleSyst /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetMeshSpawnMode(this ShapeModule module, Func meshSpawnModeChanger) + public static ShapeModule SetMeshSpawnMode(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func meshSpawnModeChanger) { Debug.Assert(meshSpawnModeChanger != null, "meshSpawnModeChanger cannot be null"); module.meshSpawnMode = meshSpawnModeChanger(module.meshSpawnMode); @@ -914,7 +1325,14 @@ public static ShapeModule SetMeshSpawnMode(this ShapeModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeMeshSpawnSpeed(this ParticleSystem particleSystem, MinMaxCurve meshSpawnSpeed) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeMeshSpawnSpeed( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve meshSpawnSpeed) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -926,7 +1344,18 @@ public static ParticleSystem SetShapeMeshSpawnSpeed(this ParticleSystem particle /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeMeshSpawnSpeed(this ParticleSystem particleSystem, Func meshSpawnSpeedChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeMeshSpawnSpeed( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func meshSpawnSpeedChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(meshSpawnSpeedChanger != null, "meshSpawnSpeedChanger cannot be null"); @@ -949,7 +1378,11 @@ public static ShapeModule SetMeshSpawnSpeed(this ShapeModule module, MinMaxCurve /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetMeshSpawnSpeed(this ShapeModule module, Func meshSpawnSpeedChanger) + public static ShapeModule SetMeshSpawnSpeed(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func meshSpawnSpeedChanger) { Debug.Assert(meshSpawnSpeedChanger != null, "meshSpawnSpeedChanger cannot be null"); module.meshSpawnSpeed = meshSpawnSpeedChanger(module.meshSpawnSpeed); @@ -962,7 +1395,14 @@ public static ShapeModule SetMeshSpawnSpeed(this ShapeModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeMeshSpawnSpeedMultiplier(this ParticleSystem particleSystem, float meshSpawnSpeedMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeMeshSpawnSpeedMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float meshSpawnSpeedMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -974,7 +1414,18 @@ public static ParticleSystem SetShapeMeshSpawnSpeedMultiplier(this ParticleSyste /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeMeshSpawnSpeedMultiplier(this ParticleSystem particleSystem, Func meshSpawnSpeedMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeMeshSpawnSpeedMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func meshSpawnSpeedMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(meshSpawnSpeedMultiplierChanger != null, "meshSpawnSpeedMultiplierChanger cannot be null"); @@ -997,7 +1448,11 @@ public static ShapeModule SetMeshSpawnSpeedMultiplier(this ShapeModule module, f /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetMeshSpawnSpeedMultiplier(this ShapeModule module, Func meshSpawnSpeedMultiplierChanger) + public static ShapeModule SetMeshSpawnSpeedMultiplier(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func meshSpawnSpeedMultiplierChanger) { Debug.Assert(meshSpawnSpeedMultiplierChanger != null, "meshSpawnSpeedMultiplierChanger cannot be null"); module.meshSpawnSpeedMultiplier = meshSpawnSpeedMultiplierChanger(module.meshSpawnSpeedMultiplier); @@ -1010,7 +1465,14 @@ public static ShapeModule SetMeshSpawnSpeedMultiplier(this ShapeModule module, F /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeMeshSpawnSpread(this ParticleSystem particleSystem, float meshSpawnSpread) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeMeshSpawnSpread( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float meshSpawnSpread) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -1022,7 +1484,18 @@ public static ParticleSystem SetShapeMeshSpawnSpread(this ParticleSystem particl /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeMeshSpawnSpread(this ParticleSystem particleSystem, Func meshSpawnSpreadChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeMeshSpawnSpread( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func meshSpawnSpreadChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(meshSpawnSpreadChanger != null, "meshSpawnSpreadChanger cannot be null"); @@ -1045,7 +1518,11 @@ public static ShapeModule SetMeshSpawnSpread(this ShapeModule module, float mesh /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetMeshSpawnSpread(this ShapeModule module, Func meshSpawnSpreadChanger) + public static ShapeModule SetMeshSpawnSpread(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func meshSpawnSpreadChanger) { Debug.Assert(meshSpawnSpreadChanger != null, "meshSpawnSpreadChanger cannot be null"); module.meshSpawnSpread = meshSpawnSpreadChanger(module.meshSpawnSpread); @@ -1058,7 +1535,14 @@ public static ShapeModule SetMeshSpawnSpread(this ShapeModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeNormalOffset(this ParticleSystem particleSystem, float normalOffset) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeNormalOffset( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float normalOffset) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -1070,7 +1554,18 @@ public static ParticleSystem SetShapeNormalOffset(this ParticleSystem particleSy /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeNormalOffset(this ParticleSystem particleSystem, Func normalOffsetChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeNormalOffset( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func normalOffsetChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(normalOffsetChanger != null, "normalOffsetChanger cannot be null"); @@ -1093,7 +1588,11 @@ public static ShapeModule SetNormalOffset(this ShapeModule module, float normalO /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetNormalOffset(this ShapeModule module, Func normalOffsetChanger) + public static ShapeModule SetNormalOffset(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func normalOffsetChanger) { Debug.Assert(normalOffsetChanger != null, "normalOffsetChanger cannot be null"); module.normalOffset = normalOffsetChanger(module.normalOffset); @@ -1106,7 +1605,14 @@ public static ShapeModule SetNormalOffset(this ShapeModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapePosition(this ParticleSystem particleSystem, Vector3 position) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapePosition( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, Vector3 position) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -1118,7 +1624,18 @@ public static ParticleSystem SetShapePosition(this ParticleSystem particleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapePosition(this ParticleSystem particleSystem, Func positionChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapePosition( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func positionChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(positionChanger != null, "positionChanger cannot be null"); @@ -1141,7 +1658,11 @@ public static ShapeModule SetPosition(this ShapeModule module, Vector3 position) /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetPosition(this ShapeModule module, Func positionChanger) + public static ShapeModule SetPosition(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func positionChanger) { Debug.Assert(positionChanger != null, "positionChanger cannot be null"); module.position = positionChanger(module.position); @@ -1154,7 +1675,14 @@ public static ShapeModule SetPosition(this ShapeModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeRadius(this ParticleSystem particleSystem, float radius) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeRadius( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float radius) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -1166,7 +1694,18 @@ public static ParticleSystem SetShapeRadius(this ParticleSystem particleSystem, /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeRadius(this ParticleSystem particleSystem, Func radiusChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeRadius( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func radiusChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(radiusChanger != null, "radiusChanger cannot be null"); @@ -1189,7 +1728,11 @@ public static ShapeModule SetRadius(this ShapeModule module, float radius) /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetRadius(this ShapeModule module, Func radiusChanger) + public static ShapeModule SetRadius(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func radiusChanger) { Debug.Assert(radiusChanger != null, "radiusChanger cannot be null"); module.radius = radiusChanger(module.radius); @@ -1202,7 +1745,14 @@ public static ShapeModule SetRadius(this ShapeModule module, Func /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeRadiusMode(this ParticleSystem particleSystem, ParticleSystemShapeMultiModeValue radiusMode) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeRadiusMode( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, ParticleSystemShapeMultiModeValue radiusMode) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -1214,7 +1764,18 @@ public static ParticleSystem SetShapeRadiusMode(this ParticleSystem particleSyst /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeRadiusMode(this ParticleSystem particleSystem, Func radiusModeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeRadiusMode( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func radiusModeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(radiusModeChanger != null, "radiusModeChanger cannot be null"); @@ -1237,7 +1798,11 @@ public static ShapeModule SetRadiusMode(this ShapeModule module, ParticleSystemS /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetRadiusMode(this ShapeModule module, Func radiusModeChanger) + public static ShapeModule SetRadiusMode(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func radiusModeChanger) { Debug.Assert(radiusModeChanger != null, "radiusModeChanger cannot be null"); module.radiusMode = radiusModeChanger(module.radiusMode); @@ -1250,7 +1815,14 @@ public static ShapeModule SetRadiusMode(this ShapeModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeRadiusSpeed(this ParticleSystem particleSystem, MinMaxCurve radiusSpeed) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeRadiusSpeed( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve radiusSpeed) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -1262,7 +1834,18 @@ public static ParticleSystem SetShapeRadiusSpeed(this ParticleSystem particleSys /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeRadiusSpeed(this ParticleSystem particleSystem, Func radiusSpeedChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeRadiusSpeed( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func radiusSpeedChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(radiusSpeedChanger != null, "radiusSpeedChanger cannot be null"); @@ -1285,7 +1868,11 @@ public static ShapeModule SetRadiusSpeed(this ShapeModule module, MinMaxCurve ra /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetRadiusSpeed(this ShapeModule module, Func radiusSpeedChanger) + public static ShapeModule SetRadiusSpeed(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func radiusSpeedChanger) { Debug.Assert(radiusSpeedChanger != null, "radiusSpeedChanger cannot be null"); module.radiusSpeed = radiusSpeedChanger(module.radiusSpeed); @@ -1298,7 +1885,14 @@ public static ShapeModule SetRadiusSpeed(this ShapeModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeRadiusSpeedMultiplier(this ParticleSystem particleSystem, float radiusSpeedMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeRadiusSpeedMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float radiusSpeedMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -1310,7 +1904,18 @@ public static ParticleSystem SetShapeRadiusSpeedMultiplier(this ParticleSystem p /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeRadiusSpeedMultiplier(this ParticleSystem particleSystem, Func radiusSpeedMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeRadiusSpeedMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func radiusSpeedMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(radiusSpeedMultiplierChanger != null, "radiusSpeedMultiplierChanger cannot be null"); @@ -1333,7 +1938,11 @@ public static ShapeModule SetRadiusSpeedMultiplier(this ShapeModule module, floa /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetRadiusSpeedMultiplier(this ShapeModule module, Func radiusSpeedMultiplierChanger) + public static ShapeModule SetRadiusSpeedMultiplier(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func radiusSpeedMultiplierChanger) { Debug.Assert(radiusSpeedMultiplierChanger != null, "radiusSpeedMultiplierChanger cannot be null"); module.radiusSpeedMultiplier = radiusSpeedMultiplierChanger(module.radiusSpeedMultiplier); @@ -1346,7 +1955,14 @@ public static ShapeModule SetRadiusSpeedMultiplier(this ShapeModule module, Func /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeRadiusSpread(this ParticleSystem particleSystem, float radiusSpread) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeRadiusSpread( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float radiusSpread) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -1358,7 +1974,18 @@ public static ParticleSystem SetShapeRadiusSpread(this ParticleSystem particleSy /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeRadiusSpread(this ParticleSystem particleSystem, Func radiusSpreadChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeRadiusSpread( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func radiusSpreadChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(radiusSpreadChanger != null, "radiusSpreadChanger cannot be null"); @@ -1381,7 +2008,11 @@ public static ShapeModule SetRadiusSpread(this ShapeModule module, float radiusS /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetRadiusSpread(this ShapeModule module, Func radiusSpreadChanger) + public static ShapeModule SetRadiusSpread(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func radiusSpreadChanger) { Debug.Assert(radiusSpreadChanger != null, "radiusSpreadChanger cannot be null"); module.radiusSpread = radiusSpreadChanger(module.radiusSpread); @@ -1394,7 +2025,14 @@ public static ShapeModule SetRadiusSpread(this ShapeModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeRadiusThickness(this ParticleSystem particleSystem, float radiusThickness) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeRadiusThickness( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float radiusThickness) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -1406,7 +2044,18 @@ public static ParticleSystem SetShapeRadiusThickness(this ParticleSystem particl /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeRadiusThickness(this ParticleSystem particleSystem, Func radiusThicknessChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeRadiusThickness( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func radiusThicknessChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(radiusThicknessChanger != null, "radiusThicknessChanger cannot be null"); @@ -1429,7 +2078,11 @@ public static ShapeModule SetRadiusThickness(this ShapeModule module, float radi /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetRadiusThickness(this ShapeModule module, Func radiusThicknessChanger) + public static ShapeModule SetRadiusThickness(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func radiusThicknessChanger) { Debug.Assert(radiusThicknessChanger != null, "radiusThicknessChanger cannot be null"); module.radiusThickness = radiusThicknessChanger(module.radiusThickness); @@ -1445,7 +2098,14 @@ public static ShapeModule SetRadiusThickness(this ShapeModule module, Func randomDirectionChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeRandomDirection( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func randomDirectionChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(randomDirectionChanger != null, "randomDirectionChanger cannot be null"); @@ -1489,7 +2160,11 @@ public static ShapeModule SetRandomDirection(this ShapeModule module, bool rando [Obsolete("randomDirection property is deprecated. Use randomDirectionAmount instead.", false)] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetRandomDirection(this ShapeModule module, Func randomDirectionChanger) + public static ShapeModule SetRandomDirection(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func randomDirectionChanger) { Debug.Assert(randomDirectionChanger != null, "randomDirectionChanger cannot be null"); module.randomDirection = randomDirectionChanger(module.randomDirection); @@ -1502,7 +2177,14 @@ public static ShapeModule SetRandomDirection(this ShapeModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeRandomDirectionAmount(this ParticleSystem particleSystem, float randomDirectionAmount) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeRandomDirectionAmount( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float randomDirectionAmount) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -1514,7 +2196,18 @@ public static ParticleSystem SetShapeRandomDirectionAmount(this ParticleSystem p /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeRandomDirectionAmount(this ParticleSystem particleSystem, Func randomDirectionAmountChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeRandomDirectionAmount( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func randomDirectionAmountChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(randomDirectionAmountChanger != null, "randomDirectionAmountChanger cannot be null"); @@ -1537,7 +2230,11 @@ public static ShapeModule SetRandomDirectionAmount(this ShapeModule module, floa /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetRandomDirectionAmount(this ShapeModule module, Func randomDirectionAmountChanger) + public static ShapeModule SetRandomDirectionAmount(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func randomDirectionAmountChanger) { Debug.Assert(randomDirectionAmountChanger != null, "randomDirectionAmountChanger cannot be null"); module.randomDirectionAmount = randomDirectionAmountChanger(module.randomDirectionAmount); @@ -1550,7 +2247,14 @@ public static ShapeModule SetRandomDirectionAmount(this ShapeModule module, Func /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeRandomPositionAmount(this ParticleSystem particleSystem, float randomPositionAmount) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeRandomPositionAmount( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float randomPositionAmount) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -1562,7 +2266,18 @@ public static ParticleSystem SetShapeRandomPositionAmount(this ParticleSystem pa /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeRandomPositionAmount(this ParticleSystem particleSystem, Func randomPositionAmountChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeRandomPositionAmount( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func randomPositionAmountChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(randomPositionAmountChanger != null, "randomPositionAmountChanger cannot be null"); @@ -1585,7 +2300,11 @@ public static ShapeModule SetRandomPositionAmount(this ShapeModule module, float /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetRandomPositionAmount(this ShapeModule module, Func randomPositionAmountChanger) + public static ShapeModule SetRandomPositionAmount(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func randomPositionAmountChanger) { Debug.Assert(randomPositionAmountChanger != null, "randomPositionAmountChanger cannot be null"); module.randomPositionAmount = randomPositionAmountChanger(module.randomPositionAmount); @@ -1598,7 +2317,14 @@ public static ShapeModule SetRandomPositionAmount(this ShapeModule module, Func< /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeRotation(this ParticleSystem particleSystem, Vector3 rotation) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeRotation( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, Vector3 rotation) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -1610,7 +2336,18 @@ public static ParticleSystem SetShapeRotation(this ParticleSystem particleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeRotation(this ParticleSystem particleSystem, Func rotationChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeRotation( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func rotationChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(rotationChanger != null, "rotationChanger cannot be null"); @@ -1633,7 +2370,11 @@ public static ShapeModule SetRotation(this ShapeModule module, Vector3 rotation) /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetRotation(this ShapeModule module, Func rotationChanger) + public static ShapeModule SetRotation(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func rotationChanger) { Debug.Assert(rotationChanger != null, "rotationChanger cannot be null"); module.rotation = rotationChanger(module.rotation); @@ -1646,7 +2387,14 @@ public static ShapeModule SetRotation(this ShapeModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeScale(this ParticleSystem particleSystem, Vector3 scale) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeScale( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, Vector3 scale) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -1658,7 +2406,18 @@ public static ParticleSystem SetShapeScale(this ParticleSystem particleSystem, V /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeScale(this ParticleSystem particleSystem, Func scaleChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeScale( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func scaleChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(scaleChanger != null, "scaleChanger cannot be null"); @@ -1681,7 +2440,11 @@ public static ShapeModule SetScale(this ShapeModule module, Vector3 scale) /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetScale(this ShapeModule module, Func scaleChanger) + public static ShapeModule SetScale(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func scaleChanger) { Debug.Assert(scaleChanger != null, "scaleChanger cannot be null"); module.scale = scaleChanger(module.scale); @@ -1694,7 +2457,14 @@ public static ShapeModule SetScale(this ShapeModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeShapeType(this ParticleSystem particleSystem, ParticleSystemShapeType shapeType) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeShapeType( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, ParticleSystemShapeType shapeType) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -1706,7 +2476,18 @@ public static ParticleSystem SetShapeShapeType(this ParticleSystem particleSyste /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeShapeType(this ParticleSystem particleSystem, Func shapeTypeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeShapeType( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func shapeTypeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(shapeTypeChanger != null, "shapeTypeChanger cannot be null"); @@ -1729,7 +2510,11 @@ public static ShapeModule SetShapeType(this ShapeModule module, ParticleSystemSh /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetShapeType(this ShapeModule module, Func shapeTypeChanger) + public static ShapeModule SetShapeType(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func shapeTypeChanger) { Debug.Assert(shapeTypeChanger != null, "shapeTypeChanger cannot be null"); module.shapeType = shapeTypeChanger(module.shapeType); @@ -1742,7 +2527,14 @@ public static ShapeModule SetShapeType(this ShapeModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeSkinnedMeshRenderer(this ParticleSystem particleSystem, SkinnedMeshRenderer skinnedMeshRenderer) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeSkinnedMeshRenderer( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, SkinnedMeshRenderer skinnedMeshRenderer) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -1754,7 +2546,18 @@ public static ParticleSystem SetShapeSkinnedMeshRenderer(this ParticleSystem par /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeSkinnedMeshRenderer(this ParticleSystem particleSystem, Func skinnedMeshRendererChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeSkinnedMeshRenderer( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func skinnedMeshRendererChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(skinnedMeshRendererChanger != null, "skinnedMeshRendererChanger cannot be null"); @@ -1777,7 +2580,11 @@ public static ShapeModule SetSkinnedMeshRenderer(this ShapeModule module, Skinne /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetSkinnedMeshRenderer(this ShapeModule module, Func skinnedMeshRendererChanger) + public static ShapeModule SetSkinnedMeshRenderer(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func skinnedMeshRendererChanger) { Debug.Assert(skinnedMeshRendererChanger != null, "skinnedMeshRendererChanger cannot be null"); module.skinnedMeshRenderer = skinnedMeshRendererChanger(module.skinnedMeshRenderer); @@ -1790,7 +2597,14 @@ public static ShapeModule SetSkinnedMeshRenderer(this ShapeModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeSphericalDirectionAmount(this ParticleSystem particleSystem, float sphericalDirectionAmount) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeSphericalDirectionAmount( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float sphericalDirectionAmount) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -1802,7 +2616,18 @@ public static ParticleSystem SetShapeSphericalDirectionAmount(this ParticleSyste /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeSphericalDirectionAmount(this ParticleSystem particleSystem, Func sphericalDirectionAmountChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeSphericalDirectionAmount( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func sphericalDirectionAmountChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(sphericalDirectionAmountChanger != null, "sphericalDirectionAmountChanger cannot be null"); @@ -1825,7 +2650,11 @@ public static ShapeModule SetSphericalDirectionAmount(this ShapeModule module, f /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetSphericalDirectionAmount(this ShapeModule module, Func sphericalDirectionAmountChanger) + public static ShapeModule SetSphericalDirectionAmount(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func sphericalDirectionAmountChanger) { Debug.Assert(sphericalDirectionAmountChanger != null, "sphericalDirectionAmountChanger cannot be null"); module.sphericalDirectionAmount = sphericalDirectionAmountChanger(module.sphericalDirectionAmount); @@ -1838,7 +2667,14 @@ public static ShapeModule SetSphericalDirectionAmount(this ShapeModule module, F /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeSprite(this ParticleSystem particleSystem, Sprite sprite) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeSprite( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, Sprite sprite) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -1850,7 +2686,18 @@ public static ParticleSystem SetShapeSprite(this ParticleSystem particleSystem, /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeSprite(this ParticleSystem particleSystem, Func spriteChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeSprite( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func spriteChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(spriteChanger != null, "spriteChanger cannot be null"); @@ -1873,7 +2720,11 @@ public static ShapeModule SetSprite(this ShapeModule module, Sprite sprite) /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetSprite(this ShapeModule module, Func spriteChanger) + public static ShapeModule SetSprite(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func spriteChanger) { Debug.Assert(spriteChanger != null, "spriteChanger cannot be null"); module.sprite = spriteChanger(module.sprite); @@ -1886,7 +2737,14 @@ public static ShapeModule SetSprite(this ShapeModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeSpriteRenderer(this ParticleSystem particleSystem, SpriteRenderer spriteRenderer) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeSpriteRenderer( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, SpriteRenderer spriteRenderer) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -1898,7 +2756,18 @@ public static ParticleSystem SetShapeSpriteRenderer(this ParticleSystem particle /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeSpriteRenderer(this ParticleSystem particleSystem, Func spriteRendererChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeSpriteRenderer( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func spriteRendererChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(spriteRendererChanger != null, "spriteRendererChanger cannot be null"); @@ -1921,7 +2790,11 @@ public static ShapeModule SetSpriteRenderer(this ShapeModule module, SpriteRende /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetSpriteRenderer(this ShapeModule module, Func spriteRendererChanger) + public static ShapeModule SetSpriteRenderer(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func spriteRendererChanger) { Debug.Assert(spriteRendererChanger != null, "spriteRendererChanger cannot be null"); module.spriteRenderer = spriteRendererChanger(module.spriteRenderer); @@ -1934,7 +2807,14 @@ public static ShapeModule SetSpriteRenderer(this ShapeModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeTexture(this ParticleSystem particleSystem, Texture2D texture) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeTexture( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, Texture2D texture) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -1946,7 +2826,18 @@ public static ParticleSystem SetShapeTexture(this ParticleSystem particleSystem, /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeTexture(this ParticleSystem particleSystem, Func textureChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeTexture( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func textureChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(textureChanger != null, "textureChanger cannot be null"); @@ -1969,7 +2860,11 @@ public static ShapeModule SetTexture(this ShapeModule module, Texture2D texture) /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetTexture(this ShapeModule module, Func textureChanger) + public static ShapeModule SetTexture(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func textureChanger) { Debug.Assert(textureChanger != null, "textureChanger cannot be null"); module.texture = textureChanger(module.texture); @@ -1982,7 +2877,14 @@ public static ShapeModule SetTexture(this ShapeModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeTextureAlphaAffectsParticles(this ParticleSystem particleSystem, bool textureAlphaAffectsParticles) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeTextureAlphaAffectsParticles( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool textureAlphaAffectsParticles) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -1994,7 +2896,18 @@ public static ParticleSystem SetShapeTextureAlphaAffectsParticles(this ParticleS /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeTextureAlphaAffectsParticles(this ParticleSystem particleSystem, Func textureAlphaAffectsParticlesChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeTextureAlphaAffectsParticles( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func textureAlphaAffectsParticlesChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(textureAlphaAffectsParticlesChanger != null, "textureAlphaAffectsParticlesChanger cannot be null"); @@ -2017,7 +2930,11 @@ public static ShapeModule SetTextureAlphaAffectsParticles(this ShapeModule modul /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetTextureAlphaAffectsParticles(this ShapeModule module, Func textureAlphaAffectsParticlesChanger) + public static ShapeModule SetTextureAlphaAffectsParticles(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func textureAlphaAffectsParticlesChanger) { Debug.Assert(textureAlphaAffectsParticlesChanger != null, "textureAlphaAffectsParticlesChanger cannot be null"); module.textureAlphaAffectsParticles = textureAlphaAffectsParticlesChanger(module.textureAlphaAffectsParticles); @@ -2030,7 +2947,14 @@ public static ShapeModule SetTextureAlphaAffectsParticles(this ShapeModule modul /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeTextureBilinearFiltering(this ParticleSystem particleSystem, bool textureBilinearFiltering) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeTextureBilinearFiltering( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool textureBilinearFiltering) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -2042,7 +2966,18 @@ public static ParticleSystem SetShapeTextureBilinearFiltering(this ParticleSyste /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeTextureBilinearFiltering(this ParticleSystem particleSystem, Func textureBilinearFilteringChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeTextureBilinearFiltering( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func textureBilinearFilteringChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(textureBilinearFilteringChanger != null, "textureBilinearFilteringChanger cannot be null"); @@ -2065,7 +3000,11 @@ public static ShapeModule SetTextureBilinearFiltering(this ShapeModule module, b /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetTextureBilinearFiltering(this ShapeModule module, Func textureBilinearFilteringChanger) + public static ShapeModule SetTextureBilinearFiltering(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func textureBilinearFilteringChanger) { Debug.Assert(textureBilinearFilteringChanger != null, "textureBilinearFilteringChanger cannot be null"); module.textureBilinearFiltering = textureBilinearFilteringChanger(module.textureBilinearFiltering); @@ -2078,7 +3017,14 @@ public static ShapeModule SetTextureBilinearFiltering(this ShapeModule module, F /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeTextureClipChannel(this ParticleSystem particleSystem, ParticleSystemShapeTextureChannel textureClipChannel) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeTextureClipChannel( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, ParticleSystemShapeTextureChannel textureClipChannel) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -2090,7 +3036,18 @@ public static ParticleSystem SetShapeTextureClipChannel(this ParticleSystem part /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeTextureClipChannel(this ParticleSystem particleSystem, Func textureClipChannelChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeTextureClipChannel( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func textureClipChannelChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(textureClipChannelChanger != null, "textureClipChannelChanger cannot be null"); @@ -2113,7 +3070,11 @@ public static ShapeModule SetTextureClipChannel(this ShapeModule module, Particl /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetTextureClipChannel(this ShapeModule module, Func textureClipChannelChanger) + public static ShapeModule SetTextureClipChannel(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func textureClipChannelChanger) { Debug.Assert(textureClipChannelChanger != null, "textureClipChannelChanger cannot be null"); module.textureClipChannel = textureClipChannelChanger(module.textureClipChannel); @@ -2126,7 +3087,14 @@ public static ShapeModule SetTextureClipChannel(this ShapeModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeTextureClipThreshold(this ParticleSystem particleSystem, float textureClipThreshold) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeTextureClipThreshold( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float textureClipThreshold) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -2138,7 +3106,18 @@ public static ParticleSystem SetShapeTextureClipThreshold(this ParticleSystem pa /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeTextureClipThreshold(this ParticleSystem particleSystem, Func textureClipThresholdChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeTextureClipThreshold( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func textureClipThresholdChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(textureClipThresholdChanger != null, "textureClipThresholdChanger cannot be null"); @@ -2161,7 +3140,11 @@ public static ShapeModule SetTextureClipThreshold(this ShapeModule module, float /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetTextureClipThreshold(this ShapeModule module, Func textureClipThresholdChanger) + public static ShapeModule SetTextureClipThreshold(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func textureClipThresholdChanger) { Debug.Assert(textureClipThresholdChanger != null, "textureClipThresholdChanger cannot be null"); module.textureClipThreshold = textureClipThresholdChanger(module.textureClipThreshold); @@ -2174,7 +3157,14 @@ public static ShapeModule SetTextureClipThreshold(this ShapeModule module, Func< /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeTextureColorAffectsParticles(this ParticleSystem particleSystem, bool textureColorAffectsParticles) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeTextureColorAffectsParticles( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool textureColorAffectsParticles) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -2186,7 +3176,18 @@ public static ParticleSystem SetShapeTextureColorAffectsParticles(this ParticleS /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeTextureColorAffectsParticles(this ParticleSystem particleSystem, Func textureColorAffectsParticlesChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeTextureColorAffectsParticles( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func textureColorAffectsParticlesChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(textureColorAffectsParticlesChanger != null, "textureColorAffectsParticlesChanger cannot be null"); @@ -2209,7 +3210,11 @@ public static ShapeModule SetTextureColorAffectsParticles(this ShapeModule modul /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetTextureColorAffectsParticles(this ShapeModule module, Func textureColorAffectsParticlesChanger) + public static ShapeModule SetTextureColorAffectsParticles(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func textureColorAffectsParticlesChanger) { Debug.Assert(textureColorAffectsParticlesChanger != null, "textureColorAffectsParticlesChanger cannot be null"); module.textureColorAffectsParticles = textureColorAffectsParticlesChanger(module.textureColorAffectsParticles); @@ -2222,7 +3227,14 @@ public static ShapeModule SetTextureColorAffectsParticles(this ShapeModule modul /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeTextureUVChannel(this ParticleSystem particleSystem, int textureUVChannel) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeTextureUVChannel( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, int textureUVChannel) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -2234,7 +3246,18 @@ public static ParticleSystem SetShapeTextureUVChannel(this ParticleSystem partic /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeTextureUVChannel(this ParticleSystem particleSystem, Func textureUVChannelChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeTextureUVChannel( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func textureUVChannelChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(textureUVChannelChanger != null, "textureUVChannelChanger cannot be null"); @@ -2257,7 +3280,11 @@ public static ShapeModule SetTextureUVChannel(this ShapeModule module, int textu /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetTextureUVChannel(this ShapeModule module, Func textureUVChannelChanger) + public static ShapeModule SetTextureUVChannel(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func textureUVChannelChanger) { Debug.Assert(textureUVChannelChanger != null, "textureUVChannelChanger cannot be null"); module.textureUVChannel = textureUVChannelChanger(module.textureUVChannel); @@ -2270,7 +3297,14 @@ public static ShapeModule SetTextureUVChannel(this ShapeModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeUseMeshColors(this ParticleSystem particleSystem, bool useMeshColors) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeUseMeshColors( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool useMeshColors) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -2282,7 +3316,18 @@ public static ParticleSystem SetShapeUseMeshColors(this ParticleSystem particleS /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeUseMeshColors(this ParticleSystem particleSystem, Func useMeshColorsChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeUseMeshColors( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func useMeshColorsChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(useMeshColorsChanger != null, "useMeshColorsChanger cannot be null"); @@ -2305,7 +3350,11 @@ public static ShapeModule SetUseMeshColors(this ShapeModule module, bool useMesh /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetUseMeshColors(this ShapeModule module, Func useMeshColorsChanger) + public static ShapeModule SetUseMeshColors(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func useMeshColorsChanger) { Debug.Assert(useMeshColorsChanger != null, "useMeshColorsChanger cannot be null"); module.useMeshColors = useMeshColorsChanger(module.useMeshColors); @@ -2318,7 +3367,14 @@ public static ShapeModule SetUseMeshColors(this ShapeModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeUseMeshMaterialIndex(this ParticleSystem particleSystem, bool useMeshMaterialIndex) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeUseMeshMaterialIndex( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool useMeshMaterialIndex) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.shape; @@ -2330,7 +3386,18 @@ public static ParticleSystem SetShapeUseMeshMaterialIndex(this ParticleSystem pa /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeUseMeshMaterialIndex(this ParticleSystem particleSystem, Func useMeshMaterialIndexChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetShapeUseMeshMaterialIndex( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func useMeshMaterialIndexChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(useMeshMaterialIndexChanger != null, "useMeshMaterialIndexChanger cannot be null"); @@ -2353,7 +3420,11 @@ public static ShapeModule SetUseMeshMaterialIndex(this ShapeModule module, bool /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetUseMeshMaterialIndex(this ShapeModule module, Func useMeshMaterialIndexChanger) + public static ShapeModule SetUseMeshMaterialIndex(this ShapeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func useMeshMaterialIndexChanger) { Debug.Assert(useMeshMaterialIndexChanger != null, "useMeshMaterialIndexChanger cannot be null"); module.useMeshMaterialIndex = useMeshMaterialIndexChanger(module.useMeshMaterialIndex); diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/ShapeModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Extensions/ShapeModuleExtension.cs.meta similarity index 100% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/ShapeModuleExtension.cs.meta rename to Packages/FluentParticleSystem/Runtime/Extensions/ShapeModuleExtension.cs.meta diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/SizeBySpeedModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/Extensions/SizeBySpeedModuleExtension.cs similarity index 71% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/SizeBySpeedModuleExtension.cs rename to Packages/FluentParticleSystem/Runtime/Extensions/SizeBySpeedModuleExtension.cs index ab2ab82..5073219 100644 --- a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/SizeBySpeedModuleExtension.cs +++ b/Packages/FluentParticleSystem/Runtime/Extensions/SizeBySpeedModuleExtension.cs @@ -1,8 +1,13 @@ using System; using System.Runtime.CompilerServices; using UnityEngine; + using static UnityEngine.ParticleSystem; +#if UNITY_2020_2_OR_NEWER +using System.Diagnostics.CodeAnalysis; +#endif + namespace OUCC.FluentParticleSystem { public static class SizeBySpeedModuleExtension @@ -12,7 +17,18 @@ public static class SizeBySpeedModuleExtension /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditSizeBySpeed(this ParticleSystem particleSystem, Action moduleEditor) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem EditSizeBySpeed( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Action moduleEditor) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); @@ -25,7 +41,14 @@ public static ParticleSystem EditSizeBySpeed(this ParticleSystem particleSystem, /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedEnabled(this ParticleSystem particleSystem, bool enabled) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeBySpeedEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool enabled) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.sizeBySpeed; @@ -37,7 +60,18 @@ public static ParticleSystem SetSizeBySpeedEnabled(this ParticleSystem particleS /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedEnabled(this ParticleSystem particleSystem, Func enabledChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeBySpeedEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); @@ -60,7 +94,11 @@ public static SizeBySpeedModule SetEnabled(this SizeBySpeedModule module, bool e /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeBySpeedModule SetEnabled(this SizeBySpeedModule module, Func enabledChanger) + public static SizeBySpeedModule SetEnabled(this SizeBySpeedModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); module.enabled = enabledChanger(module.enabled); @@ -73,7 +111,14 @@ public static SizeBySpeedModule SetEnabled(this SizeBySpeedModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedRange(this ParticleSystem particleSystem, Vector2 range) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeBySpeedRange( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, Vector2 range) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.sizeBySpeed; @@ -85,7 +130,18 @@ public static ParticleSystem SetSizeBySpeedRange(this ParticleSystem particleSys /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedRange(this ParticleSystem particleSystem, Func rangeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeBySpeedRange( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func rangeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(rangeChanger != null, "rangeChanger cannot be null"); @@ -108,7 +164,11 @@ public static SizeBySpeedModule SetRange(this SizeBySpeedModule module, Vector2 /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeBySpeedModule SetRange(this SizeBySpeedModule module, Func rangeChanger) + public static SizeBySpeedModule SetRange(this SizeBySpeedModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func rangeChanger) { Debug.Assert(rangeChanger != null, "rangeChanger cannot be null"); module.range = rangeChanger(module.range); @@ -121,7 +181,14 @@ public static SizeBySpeedModule SetRange(this SizeBySpeedModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedSeparateAxes(this ParticleSystem particleSystem, bool separateAxes) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeBySpeedSeparateAxes( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool separateAxes) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.sizeBySpeed; @@ -133,7 +200,18 @@ public static ParticleSystem SetSizeBySpeedSeparateAxes(this ParticleSystem part /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedSeparateAxes(this ParticleSystem particleSystem, Func separateAxesChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeBySpeedSeparateAxes( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func separateAxesChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(separateAxesChanger != null, "separateAxesChanger cannot be null"); @@ -156,7 +234,11 @@ public static SizeBySpeedModule SetSeparateAxes(this SizeBySpeedModule module, b /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeBySpeedModule SetSeparateAxes(this SizeBySpeedModule module, Func separateAxesChanger) + public static SizeBySpeedModule SetSeparateAxes(this SizeBySpeedModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func separateAxesChanger) { Debug.Assert(separateAxesChanger != null, "separateAxesChanger cannot be null"); module.separateAxes = separateAxesChanger(module.separateAxes); @@ -169,7 +251,14 @@ public static SizeBySpeedModule SetSeparateAxes(this SizeBySpeedModule module, F /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedSize(this ParticleSystem particleSystem, MinMaxCurve size) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeBySpeedSize( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve size) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.sizeBySpeed; @@ -181,7 +270,18 @@ public static ParticleSystem SetSizeBySpeedSize(this ParticleSystem particleSyst /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedSize(this ParticleSystem particleSystem, Func sizeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeBySpeedSize( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func sizeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(sizeChanger != null, "sizeChanger cannot be null"); @@ -204,7 +304,11 @@ public static SizeBySpeedModule SetSize(this SizeBySpeedModule module, MinMaxCur /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeBySpeedModule SetSize(this SizeBySpeedModule module, Func sizeChanger) + public static SizeBySpeedModule SetSize(this SizeBySpeedModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func sizeChanger) { Debug.Assert(sizeChanger != null, "sizeChanger cannot be null"); module.size = sizeChanger(module.size); @@ -217,7 +321,14 @@ public static SizeBySpeedModule SetSize(this SizeBySpeedModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedSizeMultiplier(this ParticleSystem particleSystem, float sizeMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeBySpeedSizeMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float sizeMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.sizeBySpeed; @@ -229,7 +340,18 @@ public static ParticleSystem SetSizeBySpeedSizeMultiplier(this ParticleSystem pa /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedSizeMultiplier(this ParticleSystem particleSystem, Func sizeMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeBySpeedSizeMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func sizeMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(sizeMultiplierChanger != null, "sizeMultiplierChanger cannot be null"); @@ -252,7 +374,11 @@ public static SizeBySpeedModule SetSizeMultiplier(this SizeBySpeedModule module, /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeBySpeedModule SetSizeMultiplier(this SizeBySpeedModule module, Func sizeMultiplierChanger) + public static SizeBySpeedModule SetSizeMultiplier(this SizeBySpeedModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func sizeMultiplierChanger) { Debug.Assert(sizeMultiplierChanger != null, "sizeMultiplierChanger cannot be null"); module.sizeMultiplier = sizeMultiplierChanger(module.sizeMultiplier); @@ -265,7 +391,14 @@ public static SizeBySpeedModule SetSizeMultiplier(this SizeBySpeedModule module, /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedX(this ParticleSystem particleSystem, MinMaxCurve x) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeBySpeedX( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve x) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.sizeBySpeed; @@ -277,7 +410,18 @@ public static ParticleSystem SetSizeBySpeedX(this ParticleSystem particleSystem, /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedX(this ParticleSystem particleSystem, Func xChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeBySpeedX( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func xChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(xChanger != null, "xChanger cannot be null"); @@ -300,7 +444,11 @@ public static SizeBySpeedModule SetX(this SizeBySpeedModule module, MinMaxCurve /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeBySpeedModule SetX(this SizeBySpeedModule module, Func xChanger) + public static SizeBySpeedModule SetX(this SizeBySpeedModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func xChanger) { Debug.Assert(xChanger != null, "xChanger cannot be null"); module.x = xChanger(module.x); @@ -313,7 +461,14 @@ public static SizeBySpeedModule SetX(this SizeBySpeedModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedXMultiplier(this ParticleSystem particleSystem, float xMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeBySpeedXMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float xMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.sizeBySpeed; @@ -325,7 +480,18 @@ public static ParticleSystem SetSizeBySpeedXMultiplier(this ParticleSystem parti /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedXMultiplier(this ParticleSystem particleSystem, Func xMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeBySpeedXMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func xMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(xMultiplierChanger != null, "xMultiplierChanger cannot be null"); @@ -348,7 +514,11 @@ public static SizeBySpeedModule SetXMultiplier(this SizeBySpeedModule module, fl /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeBySpeedModule SetXMultiplier(this SizeBySpeedModule module, Func xMultiplierChanger) + public static SizeBySpeedModule SetXMultiplier(this SizeBySpeedModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func xMultiplierChanger) { Debug.Assert(xMultiplierChanger != null, "xMultiplierChanger cannot be null"); module.xMultiplier = xMultiplierChanger(module.xMultiplier); @@ -361,7 +531,14 @@ public static SizeBySpeedModule SetXMultiplier(this SizeBySpeedModule module, Fu /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedY(this ParticleSystem particleSystem, MinMaxCurve y) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeBySpeedY( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve y) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.sizeBySpeed; @@ -373,7 +550,18 @@ public static ParticleSystem SetSizeBySpeedY(this ParticleSystem particleSystem, /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedY(this ParticleSystem particleSystem, Func yChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeBySpeedY( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func yChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(yChanger != null, "yChanger cannot be null"); @@ -396,7 +584,11 @@ public static SizeBySpeedModule SetY(this SizeBySpeedModule module, MinMaxCurve /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeBySpeedModule SetY(this SizeBySpeedModule module, Func yChanger) + public static SizeBySpeedModule SetY(this SizeBySpeedModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func yChanger) { Debug.Assert(yChanger != null, "yChanger cannot be null"); module.y = yChanger(module.y); @@ -409,7 +601,14 @@ public static SizeBySpeedModule SetY(this SizeBySpeedModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedYMultiplier(this ParticleSystem particleSystem, float yMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeBySpeedYMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float yMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.sizeBySpeed; @@ -421,7 +620,18 @@ public static ParticleSystem SetSizeBySpeedYMultiplier(this ParticleSystem parti /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedYMultiplier(this ParticleSystem particleSystem, Func yMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeBySpeedYMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func yMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(yMultiplierChanger != null, "yMultiplierChanger cannot be null"); @@ -444,7 +654,11 @@ public static SizeBySpeedModule SetYMultiplier(this SizeBySpeedModule module, fl /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeBySpeedModule SetYMultiplier(this SizeBySpeedModule module, Func yMultiplierChanger) + public static SizeBySpeedModule SetYMultiplier(this SizeBySpeedModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func yMultiplierChanger) { Debug.Assert(yMultiplierChanger != null, "yMultiplierChanger cannot be null"); module.yMultiplier = yMultiplierChanger(module.yMultiplier); @@ -457,7 +671,14 @@ public static SizeBySpeedModule SetYMultiplier(this SizeBySpeedModule module, Fu /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedZ(this ParticleSystem particleSystem, MinMaxCurve z) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeBySpeedZ( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve z) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.sizeBySpeed; @@ -469,7 +690,18 @@ public static ParticleSystem SetSizeBySpeedZ(this ParticleSystem particleSystem, /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedZ(this ParticleSystem particleSystem, Func zChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeBySpeedZ( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func zChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(zChanger != null, "zChanger cannot be null"); @@ -492,7 +724,11 @@ public static SizeBySpeedModule SetZ(this SizeBySpeedModule module, MinMaxCurve /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeBySpeedModule SetZ(this SizeBySpeedModule module, Func zChanger) + public static SizeBySpeedModule SetZ(this SizeBySpeedModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func zChanger) { Debug.Assert(zChanger != null, "zChanger cannot be null"); module.z = zChanger(module.z); @@ -505,7 +741,14 @@ public static SizeBySpeedModule SetZ(this SizeBySpeedModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedZMultiplier(this ParticleSystem particleSystem, float zMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeBySpeedZMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float zMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.sizeBySpeed; @@ -517,7 +760,18 @@ public static ParticleSystem SetSizeBySpeedZMultiplier(this ParticleSystem parti /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedZMultiplier(this ParticleSystem particleSystem, Func zMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeBySpeedZMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func zMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(zMultiplierChanger != null, "zMultiplierChanger cannot be null"); @@ -540,7 +794,11 @@ public static SizeBySpeedModule SetZMultiplier(this SizeBySpeedModule module, fl /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeBySpeedModule SetZMultiplier(this SizeBySpeedModule module, Func zMultiplierChanger) + public static SizeBySpeedModule SetZMultiplier(this SizeBySpeedModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func zMultiplierChanger) { Debug.Assert(zMultiplierChanger != null, "zMultiplierChanger cannot be null"); module.zMultiplier = zMultiplierChanger(module.zMultiplier); diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/SizeBySpeedModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Extensions/SizeBySpeedModuleExtension.cs.meta similarity index 100% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/SizeBySpeedModuleExtension.cs.meta rename to Packages/FluentParticleSystem/Runtime/Extensions/SizeBySpeedModuleExtension.cs.meta diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/SizeOverLifetimeModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/Extensions/SizeOverLifetimeModuleExtension.cs similarity index 73% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/SizeOverLifetimeModuleExtension.cs rename to Packages/FluentParticleSystem/Runtime/Extensions/SizeOverLifetimeModuleExtension.cs index 2e91776..4aa1074 100644 --- a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/SizeOverLifetimeModuleExtension.cs +++ b/Packages/FluentParticleSystem/Runtime/Extensions/SizeOverLifetimeModuleExtension.cs @@ -1,8 +1,13 @@ using System; using System.Runtime.CompilerServices; using UnityEngine; + using static UnityEngine.ParticleSystem; +#if UNITY_2020_2_OR_NEWER +using System.Diagnostics.CodeAnalysis; +#endif + namespace OUCC.FluentParticleSystem { public static class SizeOverLifetimeModuleExtension @@ -12,7 +17,18 @@ public static class SizeOverLifetimeModuleExtension /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditSizeOverLifetime(this ParticleSystem particleSystem, Action moduleEditor) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem EditSizeOverLifetime( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Action moduleEditor) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); @@ -25,7 +41,14 @@ public static ParticleSystem EditSizeOverLifetime(this ParticleSystem particleSy /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeEnabled(this ParticleSystem particleSystem, bool enabled) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeOverLifetimeEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool enabled) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.sizeOverLifetime; @@ -37,7 +60,18 @@ public static ParticleSystem SetSizeOverLifetimeEnabled(this ParticleSystem part /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeEnabled(this ParticleSystem particleSystem, Func enabledChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeOverLifetimeEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); @@ -60,7 +94,11 @@ public static SizeOverLifetimeModule SetEnabled(this SizeOverLifetimeModule modu /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeOverLifetimeModule SetEnabled(this SizeOverLifetimeModule module, Func enabledChanger) + public static SizeOverLifetimeModule SetEnabled(this SizeOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); module.enabled = enabledChanger(module.enabled); @@ -73,7 +111,14 @@ public static SizeOverLifetimeModule SetEnabled(this SizeOverLifetimeModule modu /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeSeparateAxes(this ParticleSystem particleSystem, bool separateAxes) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeOverLifetimeSeparateAxes( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool separateAxes) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.sizeOverLifetime; @@ -85,7 +130,18 @@ public static ParticleSystem SetSizeOverLifetimeSeparateAxes(this ParticleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeSeparateAxes(this ParticleSystem particleSystem, Func separateAxesChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeOverLifetimeSeparateAxes( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func separateAxesChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(separateAxesChanger != null, "separateAxesChanger cannot be null"); @@ -108,7 +164,11 @@ public static SizeOverLifetimeModule SetSeparateAxes(this SizeOverLifetimeModule /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeOverLifetimeModule SetSeparateAxes(this SizeOverLifetimeModule module, Func separateAxesChanger) + public static SizeOverLifetimeModule SetSeparateAxes(this SizeOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func separateAxesChanger) { Debug.Assert(separateAxesChanger != null, "separateAxesChanger cannot be null"); module.separateAxes = separateAxesChanger(module.separateAxes); @@ -121,7 +181,14 @@ public static SizeOverLifetimeModule SetSeparateAxes(this SizeOverLifetimeModule /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeSize(this ParticleSystem particleSystem, MinMaxCurve size) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeOverLifetimeSize( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve size) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.sizeOverLifetime; @@ -133,7 +200,18 @@ public static ParticleSystem SetSizeOverLifetimeSize(this ParticleSystem particl /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeSize(this ParticleSystem particleSystem, Func sizeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeOverLifetimeSize( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func sizeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(sizeChanger != null, "sizeChanger cannot be null"); @@ -156,7 +234,11 @@ public static SizeOverLifetimeModule SetSize(this SizeOverLifetimeModule module, /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeOverLifetimeModule SetSize(this SizeOverLifetimeModule module, Func sizeChanger) + public static SizeOverLifetimeModule SetSize(this SizeOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func sizeChanger) { Debug.Assert(sizeChanger != null, "sizeChanger cannot be null"); module.size = sizeChanger(module.size); @@ -169,7 +251,14 @@ public static SizeOverLifetimeModule SetSize(this SizeOverLifetimeModule module, /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeSizeMultiplier(this ParticleSystem particleSystem, float sizeMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeOverLifetimeSizeMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float sizeMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.sizeOverLifetime; @@ -181,7 +270,18 @@ public static ParticleSystem SetSizeOverLifetimeSizeMultiplier(this ParticleSyst /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeSizeMultiplier(this ParticleSystem particleSystem, Func sizeMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeOverLifetimeSizeMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func sizeMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(sizeMultiplierChanger != null, "sizeMultiplierChanger cannot be null"); @@ -204,7 +304,11 @@ public static SizeOverLifetimeModule SetSizeMultiplier(this SizeOverLifetimeModu /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeOverLifetimeModule SetSizeMultiplier(this SizeOverLifetimeModule module, Func sizeMultiplierChanger) + public static SizeOverLifetimeModule SetSizeMultiplier(this SizeOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func sizeMultiplierChanger) { Debug.Assert(sizeMultiplierChanger != null, "sizeMultiplierChanger cannot be null"); module.sizeMultiplier = sizeMultiplierChanger(module.sizeMultiplier); @@ -217,7 +321,14 @@ public static SizeOverLifetimeModule SetSizeMultiplier(this SizeOverLifetimeModu /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeX(this ParticleSystem particleSystem, MinMaxCurve x) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeOverLifetimeX( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve x) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.sizeOverLifetime; @@ -229,7 +340,18 @@ public static ParticleSystem SetSizeOverLifetimeX(this ParticleSystem particleSy /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeX(this ParticleSystem particleSystem, Func xChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeOverLifetimeX( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func xChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(xChanger != null, "xChanger cannot be null"); @@ -252,7 +374,11 @@ public static SizeOverLifetimeModule SetX(this SizeOverLifetimeModule module, Mi /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeOverLifetimeModule SetX(this SizeOverLifetimeModule module, Func xChanger) + public static SizeOverLifetimeModule SetX(this SizeOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func xChanger) { Debug.Assert(xChanger != null, "xChanger cannot be null"); module.x = xChanger(module.x); @@ -265,7 +391,14 @@ public static SizeOverLifetimeModule SetX(this SizeOverLifetimeModule module, Fu /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeXMultiplier(this ParticleSystem particleSystem, float xMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeOverLifetimeXMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float xMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.sizeOverLifetime; @@ -277,7 +410,18 @@ public static ParticleSystem SetSizeOverLifetimeXMultiplier(this ParticleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeXMultiplier(this ParticleSystem particleSystem, Func xMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeOverLifetimeXMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func xMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(xMultiplierChanger != null, "xMultiplierChanger cannot be null"); @@ -300,7 +444,11 @@ public static SizeOverLifetimeModule SetXMultiplier(this SizeOverLifetimeModule /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeOverLifetimeModule SetXMultiplier(this SizeOverLifetimeModule module, Func xMultiplierChanger) + public static SizeOverLifetimeModule SetXMultiplier(this SizeOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func xMultiplierChanger) { Debug.Assert(xMultiplierChanger != null, "xMultiplierChanger cannot be null"); module.xMultiplier = xMultiplierChanger(module.xMultiplier); @@ -313,7 +461,14 @@ public static SizeOverLifetimeModule SetXMultiplier(this SizeOverLifetimeModule /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeY(this ParticleSystem particleSystem, MinMaxCurve y) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeOverLifetimeY( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve y) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.sizeOverLifetime; @@ -325,7 +480,18 @@ public static ParticleSystem SetSizeOverLifetimeY(this ParticleSystem particleSy /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeY(this ParticleSystem particleSystem, Func yChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeOverLifetimeY( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func yChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(yChanger != null, "yChanger cannot be null"); @@ -348,7 +514,11 @@ public static SizeOverLifetimeModule SetY(this SizeOverLifetimeModule module, Mi /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeOverLifetimeModule SetY(this SizeOverLifetimeModule module, Func yChanger) + public static SizeOverLifetimeModule SetY(this SizeOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func yChanger) { Debug.Assert(yChanger != null, "yChanger cannot be null"); module.y = yChanger(module.y); @@ -361,7 +531,14 @@ public static SizeOverLifetimeModule SetY(this SizeOverLifetimeModule module, Fu /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeYMultiplier(this ParticleSystem particleSystem, float yMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeOverLifetimeYMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float yMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.sizeOverLifetime; @@ -373,7 +550,18 @@ public static ParticleSystem SetSizeOverLifetimeYMultiplier(this ParticleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeYMultiplier(this ParticleSystem particleSystem, Func yMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeOverLifetimeYMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func yMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(yMultiplierChanger != null, "yMultiplierChanger cannot be null"); @@ -396,7 +584,11 @@ public static SizeOverLifetimeModule SetYMultiplier(this SizeOverLifetimeModule /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeOverLifetimeModule SetYMultiplier(this SizeOverLifetimeModule module, Func yMultiplierChanger) + public static SizeOverLifetimeModule SetYMultiplier(this SizeOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func yMultiplierChanger) { Debug.Assert(yMultiplierChanger != null, "yMultiplierChanger cannot be null"); module.yMultiplier = yMultiplierChanger(module.yMultiplier); @@ -409,7 +601,14 @@ public static SizeOverLifetimeModule SetYMultiplier(this SizeOverLifetimeModule /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeZ(this ParticleSystem particleSystem, MinMaxCurve z) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeOverLifetimeZ( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve z) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.sizeOverLifetime; @@ -421,7 +620,18 @@ public static ParticleSystem SetSizeOverLifetimeZ(this ParticleSystem particleSy /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeZ(this ParticleSystem particleSystem, Func zChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeOverLifetimeZ( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func zChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(zChanger != null, "zChanger cannot be null"); @@ -444,7 +654,11 @@ public static SizeOverLifetimeModule SetZ(this SizeOverLifetimeModule module, Mi /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeOverLifetimeModule SetZ(this SizeOverLifetimeModule module, Func zChanger) + public static SizeOverLifetimeModule SetZ(this SizeOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func zChanger) { Debug.Assert(zChanger != null, "zChanger cannot be null"); module.z = zChanger(module.z); @@ -457,7 +671,14 @@ public static SizeOverLifetimeModule SetZ(this SizeOverLifetimeModule module, Fu /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeZMultiplier(this ParticleSystem particleSystem, float zMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeOverLifetimeZMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float zMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.sizeOverLifetime; @@ -469,7 +690,18 @@ public static ParticleSystem SetSizeOverLifetimeZMultiplier(this ParticleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeZMultiplier(this ParticleSystem particleSystem, Func zMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSizeOverLifetimeZMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func zMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(zMultiplierChanger != null, "zMultiplierChanger cannot be null"); @@ -492,7 +724,11 @@ public static SizeOverLifetimeModule SetZMultiplier(this SizeOverLifetimeModule /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeOverLifetimeModule SetZMultiplier(this SizeOverLifetimeModule module, Func zMultiplierChanger) + public static SizeOverLifetimeModule SetZMultiplier(this SizeOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func zMultiplierChanger) { Debug.Assert(zMultiplierChanger != null, "zMultiplierChanger cannot be null"); module.zMultiplier = zMultiplierChanger(module.zMultiplier); diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/SizeOverLifetimeModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Extensions/SizeOverLifetimeModuleExtension.cs.meta similarity index 100% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/SizeOverLifetimeModuleExtension.cs.meta rename to Packages/FluentParticleSystem/Runtime/Extensions/SizeOverLifetimeModuleExtension.cs.meta diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/SubEmittersModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/Extensions/SubEmittersModuleExtension.cs similarity index 75% rename from Packages/FluentParticleSystem/Runtime/Nullable/Extensions/SubEmittersModuleExtension.cs rename to Packages/FluentParticleSystem/Runtime/Extensions/SubEmittersModuleExtension.cs index c385799..9872cc2 100644 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/SubEmittersModuleExtension.cs +++ b/Packages/FluentParticleSystem/Runtime/Extensions/SubEmittersModuleExtension.cs @@ -1,9 +1,13 @@ -#nullable enable using System; using System.Runtime.CompilerServices; using UnityEngine; + using static UnityEngine.ParticleSystem; +#if UNITY_2020_2_OR_NEWER +using System.Diagnostics.CodeAnalysis; +#endif + namespace OUCC.FluentParticleSystem { public static class SubEmittersModuleExtension @@ -13,7 +17,18 @@ public static class SubEmittersModuleExtension /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditSubEmitters(this ParticleSystem particleSystem, Action moduleEditor) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem EditSubEmitters( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Action moduleEditor) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); @@ -29,7 +44,14 @@ public static ParticleSystem EditSubEmitters(this ParticleSystem particleSystem, [Obsolete("birth0 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSubEmittersBirth0(this ParticleSystem particleSystem, ParticleSystem birth0) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSubEmittersBirth0( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, ParticleSystem birth0) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.subEmitters; @@ -44,7 +66,18 @@ public static ParticleSystem SetSubEmittersBirth0(this ParticleSystem particleSy [Obsolete("birth0 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSubEmittersBirth0(this ParticleSystem particleSystem, Func birth0Changer) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSubEmittersBirth0( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func birth0Changer) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(birth0Changer != null, "birth0Changer cannot be null"); @@ -73,7 +106,11 @@ public static SubEmittersModule SetBirth0(this SubEmittersModule module, Particl [Obsolete("birth0 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SubEmittersModule SetBirth0(this SubEmittersModule module, Func birth0Changer) + public static SubEmittersModule SetBirth0(this SubEmittersModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func birth0Changer) { Debug.Assert(birth0Changer != null, "birth0Changer cannot be null"); module.birth0 = birth0Changer(module.birth0); @@ -89,7 +126,14 @@ public static SubEmittersModule SetBirth0(this SubEmittersModule module, Func birth1Changer) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSubEmittersBirth1( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func birth1Changer) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(birth1Changer != null, "birth1Changer cannot be null"); @@ -133,7 +188,11 @@ public static SubEmittersModule SetBirth1(this SubEmittersModule module, Particl [Obsolete("birth1 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SubEmittersModule SetBirth1(this SubEmittersModule module, Func birth1Changer) + public static SubEmittersModule SetBirth1(this SubEmittersModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func birth1Changer) { Debug.Assert(birth1Changer != null, "birth1Changer cannot be null"); module.birth1 = birth1Changer(module.birth1); @@ -149,7 +208,14 @@ public static SubEmittersModule SetBirth1(this SubEmittersModule module, Func collision0Changer) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSubEmittersCollision0( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func collision0Changer) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(collision0Changer != null, "collision0Changer cannot be null"); @@ -193,7 +270,11 @@ public static SubEmittersModule SetCollision0(this SubEmittersModule module, Par [Obsolete("collision0 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SubEmittersModule SetCollision0(this SubEmittersModule module, Func collision0Changer) + public static SubEmittersModule SetCollision0(this SubEmittersModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func collision0Changer) { Debug.Assert(collision0Changer != null, "collision0Changer cannot be null"); module.collision0 = collision0Changer(module.collision0); @@ -209,7 +290,14 @@ public static SubEmittersModule SetCollision0(this SubEmittersModule module, Fun [Obsolete("collision1 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSubEmittersCollision1(this ParticleSystem particleSystem, ParticleSystem collision1) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSubEmittersCollision1( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, ParticleSystem collision1) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.subEmitters; @@ -224,7 +312,18 @@ public static ParticleSystem SetSubEmittersCollision1(this ParticleSystem partic [Obsolete("collision1 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSubEmittersCollision1(this ParticleSystem particleSystem, Func collision1Changer) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSubEmittersCollision1( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func collision1Changer) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(collision1Changer != null, "collision1Changer cannot be null"); @@ -253,7 +352,11 @@ public static SubEmittersModule SetCollision1(this SubEmittersModule module, Par [Obsolete("collision1 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SubEmittersModule SetCollision1(this SubEmittersModule module, Func collision1Changer) + public static SubEmittersModule SetCollision1(this SubEmittersModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func collision1Changer) { Debug.Assert(collision1Changer != null, "collision1Changer cannot be null"); module.collision1 = collision1Changer(module.collision1); @@ -269,7 +372,14 @@ public static SubEmittersModule SetCollision1(this SubEmittersModule module, Fun [Obsolete("death0 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSubEmittersDeath0(this ParticleSystem particleSystem, ParticleSystem death0) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSubEmittersDeath0( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, ParticleSystem death0) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.subEmitters; @@ -284,7 +394,18 @@ public static ParticleSystem SetSubEmittersDeath0(this ParticleSystem particleSy [Obsolete("death0 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSubEmittersDeath0(this ParticleSystem particleSystem, Func death0Changer) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSubEmittersDeath0( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func death0Changer) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(death0Changer != null, "death0Changer cannot be null"); @@ -313,7 +434,11 @@ public static SubEmittersModule SetDeath0(this SubEmittersModule module, Particl [Obsolete("death0 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SubEmittersModule SetDeath0(this SubEmittersModule module, Func death0Changer) + public static SubEmittersModule SetDeath0(this SubEmittersModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func death0Changer) { Debug.Assert(death0Changer != null, "death0Changer cannot be null"); module.death0 = death0Changer(module.death0); @@ -329,7 +454,14 @@ public static SubEmittersModule SetDeath0(this SubEmittersModule module, Func death1Changer) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSubEmittersDeath1( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func death1Changer) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(death1Changer != null, "death1Changer cannot be null"); @@ -373,7 +516,11 @@ public static SubEmittersModule SetDeath1(this SubEmittersModule module, Particl [Obsolete("death1 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SubEmittersModule SetDeath1(this SubEmittersModule module, Func death1Changer) + public static SubEmittersModule SetDeath1(this SubEmittersModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func death1Changer) { Debug.Assert(death1Changer != null, "death1Changer cannot be null"); module.death1 = death1Changer(module.death1); @@ -386,7 +533,14 @@ public static SubEmittersModule SetDeath1(this SubEmittersModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSubEmittersEnabled(this ParticleSystem particleSystem, bool enabled) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSubEmittersEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool enabled) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.subEmitters; @@ -398,7 +552,18 @@ public static ParticleSystem SetSubEmittersEnabled(this ParticleSystem particleS /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSubEmittersEnabled(this ParticleSystem particleSystem, Func enabledChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetSubEmittersEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); @@ -421,7 +586,11 @@ public static SubEmittersModule SetEnabled(this SubEmittersModule module, bool e /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SubEmittersModule SetEnabled(this SubEmittersModule module, Func enabledChanger) + public static SubEmittersModule SetEnabled(this SubEmittersModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); module.enabled = enabledChanger(module.enabled); diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/SubEmittersModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Extensions/SubEmittersModuleExtension.cs.meta similarity index 100% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/SubEmittersModuleExtension.cs.meta rename to Packages/FluentParticleSystem/Runtime/Extensions/SubEmittersModuleExtension.cs.meta diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/TextureSheetAnimationModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/Extensions/TextureSheetAnimationModuleExtension.cs similarity index 75% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/TextureSheetAnimationModuleExtension.cs rename to Packages/FluentParticleSystem/Runtime/Extensions/TextureSheetAnimationModuleExtension.cs index 2f17451..4e3d7ca 100644 --- a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/TextureSheetAnimationModuleExtension.cs +++ b/Packages/FluentParticleSystem/Runtime/Extensions/TextureSheetAnimationModuleExtension.cs @@ -1,8 +1,13 @@ using System; using System.Runtime.CompilerServices; using UnityEngine; + using static UnityEngine.ParticleSystem; +#if UNITY_2020_2_OR_NEWER +using System.Diagnostics.CodeAnalysis; +#endif + namespace OUCC.FluentParticleSystem { public static class TextureSheetAnimationModuleExtension @@ -12,7 +17,18 @@ public static class TextureSheetAnimationModuleExtension /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditTextureSheetAnimation(this ParticleSystem particleSystem, Action moduleEditor) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem EditTextureSheetAnimation( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Action moduleEditor) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); @@ -25,7 +41,14 @@ public static ParticleSystem EditTextureSheetAnimation(this ParticleSystem parti /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationAnimation(this ParticleSystem particleSystem, ParticleSystemAnimationType animation) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTextureSheetAnimationAnimation( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, ParticleSystemAnimationType animation) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.textureSheetAnimation; @@ -37,7 +60,18 @@ public static ParticleSystem SetTextureSheetAnimationAnimation(this ParticleSyst /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationAnimation(this ParticleSystem particleSystem, Func animationChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTextureSheetAnimationAnimation( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func animationChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(animationChanger != null, "animationChanger cannot be null"); @@ -60,7 +94,11 @@ public static TextureSheetAnimationModule SetAnimation(this TextureSheetAnimatio /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetAnimation(this TextureSheetAnimationModule module, Func animationChanger) + public static TextureSheetAnimationModule SetAnimation(this TextureSheetAnimationModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func animationChanger) { Debug.Assert(animationChanger != null, "animationChanger cannot be null"); module.animation = animationChanger(module.animation); @@ -73,7 +111,14 @@ public static TextureSheetAnimationModule SetAnimation(this TextureSheetAnimatio /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationCycleCount(this ParticleSystem particleSystem, int cycleCount) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTextureSheetAnimationCycleCount( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, int cycleCount) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.textureSheetAnimation; @@ -85,7 +130,18 @@ public static ParticleSystem SetTextureSheetAnimationCycleCount(this ParticleSys /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationCycleCount(this ParticleSystem particleSystem, Func cycleCountChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTextureSheetAnimationCycleCount( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func cycleCountChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(cycleCountChanger != null, "cycleCountChanger cannot be null"); @@ -108,7 +164,11 @@ public static TextureSheetAnimationModule SetCycleCount(this TextureSheetAnimati /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetCycleCount(this TextureSheetAnimationModule module, Func cycleCountChanger) + public static TextureSheetAnimationModule SetCycleCount(this TextureSheetAnimationModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func cycleCountChanger) { Debug.Assert(cycleCountChanger != null, "cycleCountChanger cannot be null"); module.cycleCount = cycleCountChanger(module.cycleCount); @@ -121,7 +181,14 @@ public static TextureSheetAnimationModule SetCycleCount(this TextureSheetAnimati /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationEnabled(this ParticleSystem particleSystem, bool enabled) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTextureSheetAnimationEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool enabled) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.textureSheetAnimation; @@ -133,7 +200,18 @@ public static ParticleSystem SetTextureSheetAnimationEnabled(this ParticleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationEnabled(this ParticleSystem particleSystem, Func enabledChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTextureSheetAnimationEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); @@ -156,7 +234,11 @@ public static TextureSheetAnimationModule SetEnabled(this TextureSheetAnimationM /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetEnabled(this TextureSheetAnimationModule module, Func enabledChanger) + public static TextureSheetAnimationModule SetEnabled(this TextureSheetAnimationModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); module.enabled = enabledChanger(module.enabled); @@ -172,7 +254,14 @@ public static TextureSheetAnimationModule SetEnabled(this TextureSheetAnimationM [Obsolete("flipU property is deprecated. Use ParticleSystemRenderer.flip.x instead.", false)] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationFlipU(this ParticleSystem particleSystem, float flipU) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTextureSheetAnimationFlipU( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float flipU) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.textureSheetAnimation; @@ -187,7 +276,18 @@ public static ParticleSystem SetTextureSheetAnimationFlipU(this ParticleSystem p [Obsolete("flipU property is deprecated. Use ParticleSystemRenderer.flip.x instead.", false)] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationFlipU(this ParticleSystem particleSystem, Func flipUChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTextureSheetAnimationFlipU( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func flipUChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(flipUChanger != null, "flipUChanger cannot be null"); @@ -216,7 +316,11 @@ public static TextureSheetAnimationModule SetFlipU(this TextureSheetAnimationMod [Obsolete("flipU property is deprecated. Use ParticleSystemRenderer.flip.x instead.", false)] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetFlipU(this TextureSheetAnimationModule module, Func flipUChanger) + public static TextureSheetAnimationModule SetFlipU(this TextureSheetAnimationModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func flipUChanger) { Debug.Assert(flipUChanger != null, "flipUChanger cannot be null"); module.flipU = flipUChanger(module.flipU); @@ -232,7 +336,14 @@ public static TextureSheetAnimationModule SetFlipU(this TextureSheetAnimationMod [Obsolete("flipV property is deprecated. Use ParticleSystemRenderer.flip.y instead.", false)] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationFlipV(this ParticleSystem particleSystem, float flipV) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTextureSheetAnimationFlipV( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float flipV) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.textureSheetAnimation; @@ -247,7 +358,18 @@ public static ParticleSystem SetTextureSheetAnimationFlipV(this ParticleSystem p [Obsolete("flipV property is deprecated. Use ParticleSystemRenderer.flip.y instead.", false)] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationFlipV(this ParticleSystem particleSystem, Func flipVChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTextureSheetAnimationFlipV( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func flipVChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(flipVChanger != null, "flipVChanger cannot be null"); @@ -276,7 +398,11 @@ public static TextureSheetAnimationModule SetFlipV(this TextureSheetAnimationMod [Obsolete("flipV property is deprecated. Use ParticleSystemRenderer.flip.y instead.", false)] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetFlipV(this TextureSheetAnimationModule module, Func flipVChanger) + public static TextureSheetAnimationModule SetFlipV(this TextureSheetAnimationModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func flipVChanger) { Debug.Assert(flipVChanger != null, "flipVChanger cannot be null"); module.flipV = flipVChanger(module.flipV); @@ -289,7 +415,14 @@ public static TextureSheetAnimationModule SetFlipV(this TextureSheetAnimationMod /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationFps(this ParticleSystem particleSystem, float fps) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTextureSheetAnimationFps( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float fps) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.textureSheetAnimation; @@ -301,7 +434,18 @@ public static ParticleSystem SetTextureSheetAnimationFps(this ParticleSystem par /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationFps(this ParticleSystem particleSystem, Func fpsChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTextureSheetAnimationFps( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func fpsChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(fpsChanger != null, "fpsChanger cannot be null"); @@ -324,7 +468,11 @@ public static TextureSheetAnimationModule SetFps(this TextureSheetAnimationModul /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetFps(this TextureSheetAnimationModule module, Func fpsChanger) + public static TextureSheetAnimationModule SetFps(this TextureSheetAnimationModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func fpsChanger) { Debug.Assert(fpsChanger != null, "fpsChanger cannot be null"); module.fps = fpsChanger(module.fps); @@ -337,7 +485,14 @@ public static TextureSheetAnimationModule SetFps(this TextureSheetAnimationModul /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationFrameOverTime(this ParticleSystem particleSystem, MinMaxCurve frameOverTime) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTextureSheetAnimationFrameOverTime( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve frameOverTime) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.textureSheetAnimation; @@ -349,7 +504,18 @@ public static ParticleSystem SetTextureSheetAnimationFrameOverTime(this Particle /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationFrameOverTime(this ParticleSystem particleSystem, Func frameOverTimeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTextureSheetAnimationFrameOverTime( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func frameOverTimeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(frameOverTimeChanger != null, "frameOverTimeChanger cannot be null"); @@ -372,7 +538,11 @@ public static TextureSheetAnimationModule SetFrameOverTime(this TextureSheetAnim /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetFrameOverTime(this TextureSheetAnimationModule module, Func frameOverTimeChanger) + public static TextureSheetAnimationModule SetFrameOverTime(this TextureSheetAnimationModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func frameOverTimeChanger) { Debug.Assert(frameOverTimeChanger != null, "frameOverTimeChanger cannot be null"); module.frameOverTime = frameOverTimeChanger(module.frameOverTime); @@ -385,7 +555,14 @@ public static TextureSheetAnimationModule SetFrameOverTime(this TextureSheetAnim /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationFrameOverTimeMultiplier(this ParticleSystem particleSystem, float frameOverTimeMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTextureSheetAnimationFrameOverTimeMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float frameOverTimeMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.textureSheetAnimation; @@ -397,7 +574,18 @@ public static ParticleSystem SetTextureSheetAnimationFrameOverTimeMultiplier(thi /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationFrameOverTimeMultiplier(this ParticleSystem particleSystem, Func frameOverTimeMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTextureSheetAnimationFrameOverTimeMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func frameOverTimeMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(frameOverTimeMultiplierChanger != null, "frameOverTimeMultiplierChanger cannot be null"); @@ -420,7 +608,11 @@ public static TextureSheetAnimationModule SetFrameOverTimeMultiplier(this Textur /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetFrameOverTimeMultiplier(this TextureSheetAnimationModule module, Func frameOverTimeMultiplierChanger) + public static TextureSheetAnimationModule SetFrameOverTimeMultiplier(this TextureSheetAnimationModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func frameOverTimeMultiplierChanger) { Debug.Assert(frameOverTimeMultiplierChanger != null, "frameOverTimeMultiplierChanger cannot be null"); module.frameOverTimeMultiplier = frameOverTimeMultiplierChanger(module.frameOverTimeMultiplier); @@ -433,7 +625,14 @@ public static TextureSheetAnimationModule SetFrameOverTimeMultiplier(this Textur /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationMode(this ParticleSystem particleSystem, ParticleSystemAnimationMode mode) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTextureSheetAnimationMode( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, ParticleSystemAnimationMode mode) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.textureSheetAnimation; @@ -445,7 +644,18 @@ public static ParticleSystem SetTextureSheetAnimationMode(this ParticleSystem pa /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationMode(this ParticleSystem particleSystem, Func modeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTextureSheetAnimationMode( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func modeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(modeChanger != null, "modeChanger cannot be null"); @@ -468,7 +678,11 @@ public static TextureSheetAnimationModule SetMode(this TextureSheetAnimationModu /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetMode(this TextureSheetAnimationModule module, Func modeChanger) + public static TextureSheetAnimationModule SetMode(this TextureSheetAnimationModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func modeChanger) { Debug.Assert(modeChanger != null, "modeChanger cannot be null"); module.mode = modeChanger(module.mode); @@ -481,7 +695,14 @@ public static TextureSheetAnimationModule SetMode(this TextureSheetAnimationModu /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationNumTilesX(this ParticleSystem particleSystem, int numTilesX) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTextureSheetAnimationNumTilesX( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, int numTilesX) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.textureSheetAnimation; @@ -493,7 +714,18 @@ public static ParticleSystem SetTextureSheetAnimationNumTilesX(this ParticleSyst /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationNumTilesX(this ParticleSystem particleSystem, Func numTilesXChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTextureSheetAnimationNumTilesX( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func numTilesXChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(numTilesXChanger != null, "numTilesXChanger cannot be null"); @@ -516,7 +748,11 @@ public static TextureSheetAnimationModule SetNumTilesX(this TextureSheetAnimatio /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetNumTilesX(this TextureSheetAnimationModule module, Func numTilesXChanger) + public static TextureSheetAnimationModule SetNumTilesX(this TextureSheetAnimationModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func numTilesXChanger) { Debug.Assert(numTilesXChanger != null, "numTilesXChanger cannot be null"); module.numTilesX = numTilesXChanger(module.numTilesX); @@ -529,7 +765,14 @@ public static TextureSheetAnimationModule SetNumTilesX(this TextureSheetAnimatio /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationNumTilesY(this ParticleSystem particleSystem, int numTilesY) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTextureSheetAnimationNumTilesY( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, int numTilesY) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.textureSheetAnimation; @@ -541,7 +784,18 @@ public static ParticleSystem SetTextureSheetAnimationNumTilesY(this ParticleSyst /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationNumTilesY(this ParticleSystem particleSystem, Func numTilesYChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTextureSheetAnimationNumTilesY( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func numTilesYChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(numTilesYChanger != null, "numTilesYChanger cannot be null"); @@ -564,7 +818,11 @@ public static TextureSheetAnimationModule SetNumTilesY(this TextureSheetAnimatio /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetNumTilesY(this TextureSheetAnimationModule module, Func numTilesYChanger) + public static TextureSheetAnimationModule SetNumTilesY(this TextureSheetAnimationModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func numTilesYChanger) { Debug.Assert(numTilesYChanger != null, "numTilesYChanger cannot be null"); module.numTilesY = numTilesYChanger(module.numTilesY); @@ -577,7 +835,14 @@ public static TextureSheetAnimationModule SetNumTilesY(this TextureSheetAnimatio /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationRowIndex(this ParticleSystem particleSystem, int rowIndex) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTextureSheetAnimationRowIndex( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, int rowIndex) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.textureSheetAnimation; @@ -589,7 +854,18 @@ public static ParticleSystem SetTextureSheetAnimationRowIndex(this ParticleSyste /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationRowIndex(this ParticleSystem particleSystem, Func rowIndexChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTextureSheetAnimationRowIndex( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func rowIndexChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(rowIndexChanger != null, "rowIndexChanger cannot be null"); @@ -612,7 +888,11 @@ public static TextureSheetAnimationModule SetRowIndex(this TextureSheetAnimation /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetRowIndex(this TextureSheetAnimationModule module, Func rowIndexChanger) + public static TextureSheetAnimationModule SetRowIndex(this TextureSheetAnimationModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func rowIndexChanger) { Debug.Assert(rowIndexChanger != null, "rowIndexChanger cannot be null"); module.rowIndex = rowIndexChanger(module.rowIndex); @@ -627,7 +907,14 @@ public static TextureSheetAnimationModule SetRowIndex(this TextureSheetAnimation /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationRowMode(this ParticleSystem particleSystem, ParticleSystemAnimationRowMode rowMode) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTextureSheetAnimationRowMode( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, ParticleSystemAnimationRowMode rowMode) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.textureSheetAnimation; @@ -639,7 +926,18 @@ public static ParticleSystem SetTextureSheetAnimationRowMode(this ParticleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationRowMode(this ParticleSystem particleSystem, Func rowModeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTextureSheetAnimationRowMode( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func rowModeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(rowModeChanger != null, "rowModeChanger cannot be null"); @@ -662,7 +960,11 @@ public static TextureSheetAnimationModule SetRowMode(this TextureSheetAnimationM /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetRowMode(this TextureSheetAnimationModule module, Func rowModeChanger) + public static TextureSheetAnimationModule SetRowMode(this TextureSheetAnimationModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func rowModeChanger) { Debug.Assert(rowModeChanger != null, "rowModeChanger cannot be null"); module.rowMode = rowModeChanger(module.rowMode); @@ -677,7 +979,14 @@ public static TextureSheetAnimationModule SetRowMode(this TextureSheetAnimationM /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationSpeedRange(this ParticleSystem particleSystem, Vector2 speedRange) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTextureSheetAnimationSpeedRange( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, Vector2 speedRange) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.textureSheetAnimation; @@ -689,7 +998,18 @@ public static ParticleSystem SetTextureSheetAnimationSpeedRange(this ParticleSys /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationSpeedRange(this ParticleSystem particleSystem, Func speedRangeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTextureSheetAnimationSpeedRange( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func speedRangeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(speedRangeChanger != null, "speedRangeChanger cannot be null"); @@ -712,7 +1032,11 @@ public static TextureSheetAnimationModule SetSpeedRange(this TextureSheetAnimati /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetSpeedRange(this TextureSheetAnimationModule module, Func speedRangeChanger) + public static TextureSheetAnimationModule SetSpeedRange(this TextureSheetAnimationModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func speedRangeChanger) { Debug.Assert(speedRangeChanger != null, "speedRangeChanger cannot be null"); module.speedRange = speedRangeChanger(module.speedRange); @@ -725,7 +1049,14 @@ public static TextureSheetAnimationModule SetSpeedRange(this TextureSheetAnimati /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationStartFrame(this ParticleSystem particleSystem, MinMaxCurve startFrame) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTextureSheetAnimationStartFrame( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve startFrame) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.textureSheetAnimation; @@ -737,7 +1068,18 @@ public static ParticleSystem SetTextureSheetAnimationStartFrame(this ParticleSys /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationStartFrame(this ParticleSystem particleSystem, Func startFrameChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTextureSheetAnimationStartFrame( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startFrameChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(startFrameChanger != null, "startFrameChanger cannot be null"); @@ -760,7 +1102,11 @@ public static TextureSheetAnimationModule SetStartFrame(this TextureSheetAnimati /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetStartFrame(this TextureSheetAnimationModule module, Func startFrameChanger) + public static TextureSheetAnimationModule SetStartFrame(this TextureSheetAnimationModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startFrameChanger) { Debug.Assert(startFrameChanger != null, "startFrameChanger cannot be null"); module.startFrame = startFrameChanger(module.startFrame); @@ -773,7 +1119,14 @@ public static TextureSheetAnimationModule SetStartFrame(this TextureSheetAnimati /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationStartFrameMultiplier(this ParticleSystem particleSystem, float startFrameMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTextureSheetAnimationStartFrameMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float startFrameMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.textureSheetAnimation; @@ -785,7 +1138,18 @@ public static ParticleSystem SetTextureSheetAnimationStartFrameMultiplier(this P /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationStartFrameMultiplier(this ParticleSystem particleSystem, Func startFrameMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTextureSheetAnimationStartFrameMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startFrameMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(startFrameMultiplierChanger != null, "startFrameMultiplierChanger cannot be null"); @@ -808,7 +1172,11 @@ public static TextureSheetAnimationModule SetStartFrameMultiplier(this TextureSh /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetStartFrameMultiplier(this TextureSheetAnimationModule module, Func startFrameMultiplierChanger) + public static TextureSheetAnimationModule SetStartFrameMultiplier(this TextureSheetAnimationModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func startFrameMultiplierChanger) { Debug.Assert(startFrameMultiplierChanger != null, "startFrameMultiplierChanger cannot be null"); module.startFrameMultiplier = startFrameMultiplierChanger(module.startFrameMultiplier); @@ -821,7 +1189,14 @@ public static TextureSheetAnimationModule SetStartFrameMultiplier(this TextureSh /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationTimeMode(this ParticleSystem particleSystem, ParticleSystemAnimationTimeMode timeMode) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTextureSheetAnimationTimeMode( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, ParticleSystemAnimationTimeMode timeMode) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.textureSheetAnimation; @@ -833,7 +1208,18 @@ public static ParticleSystem SetTextureSheetAnimationTimeMode(this ParticleSyste /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationTimeMode(this ParticleSystem particleSystem, Func timeModeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTextureSheetAnimationTimeMode( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func timeModeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(timeModeChanger != null, "timeModeChanger cannot be null"); @@ -856,7 +1242,11 @@ public static TextureSheetAnimationModule SetTimeMode(this TextureSheetAnimation /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetTimeMode(this TextureSheetAnimationModule module, Func timeModeChanger) + public static TextureSheetAnimationModule SetTimeMode(this TextureSheetAnimationModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func timeModeChanger) { Debug.Assert(timeModeChanger != null, "timeModeChanger cannot be null"); module.timeMode = timeModeChanger(module.timeMode); @@ -872,7 +1262,14 @@ public static TextureSheetAnimationModule SetTimeMode(this TextureSheetAnimation [Obsolete("useRandomRow property is deprecated. Use rowMode instead.", false)] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationUseRandomRow(this ParticleSystem particleSystem, bool useRandomRow) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTextureSheetAnimationUseRandomRow( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool useRandomRow) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.textureSheetAnimation; @@ -887,7 +1284,18 @@ public static ParticleSystem SetTextureSheetAnimationUseRandomRow(this ParticleS [Obsolete("useRandomRow property is deprecated. Use rowMode instead.", false)] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationUseRandomRow(this ParticleSystem particleSystem, Func useRandomRowChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTextureSheetAnimationUseRandomRow( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func useRandomRowChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(useRandomRowChanger != null, "useRandomRowChanger cannot be null"); @@ -916,7 +1324,11 @@ public static TextureSheetAnimationModule SetUseRandomRow(this TextureSheetAnima [Obsolete("useRandomRow property is deprecated. Use rowMode instead.", false)] #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetUseRandomRow(this TextureSheetAnimationModule module, Func useRandomRowChanger) + public static TextureSheetAnimationModule SetUseRandomRow(this TextureSheetAnimationModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func useRandomRowChanger) { Debug.Assert(useRandomRowChanger != null, "useRandomRowChanger cannot be null"); module.useRandomRow = useRandomRowChanger(module.useRandomRow); @@ -929,7 +1341,14 @@ public static TextureSheetAnimationModule SetUseRandomRow(this TextureSheetAnima /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationUvChannelMask(this ParticleSystem particleSystem, UnityEngine.Rendering.UVChannelFlags uvChannelMask) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTextureSheetAnimationUvChannelMask( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, UnityEngine.Rendering.UVChannelFlags uvChannelMask) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.textureSheetAnimation; @@ -941,7 +1360,18 @@ public static ParticleSystem SetTextureSheetAnimationUvChannelMask(this Particle /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationUvChannelMask(this ParticleSystem particleSystem, Func uvChannelMaskChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTextureSheetAnimationUvChannelMask( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func uvChannelMaskChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(uvChannelMaskChanger != null, "uvChannelMaskChanger cannot be null"); @@ -964,7 +1394,11 @@ public static TextureSheetAnimationModule SetUvChannelMask(this TextureSheetAnim /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetUvChannelMask(this TextureSheetAnimationModule module, Func uvChannelMaskChanger) + public static TextureSheetAnimationModule SetUvChannelMask(this TextureSheetAnimationModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func uvChannelMaskChanger) { Debug.Assert(uvChannelMaskChanger != null, "uvChannelMaskChanger cannot be null"); module.uvChannelMask = uvChannelMaskChanger(module.uvChannelMask); diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/TextureSheetAnimationModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Extensions/TextureSheetAnimationModuleExtension.cs.meta similarity index 100% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/TextureSheetAnimationModuleExtension.cs.meta rename to Packages/FluentParticleSystem/Runtime/Extensions/TextureSheetAnimationModuleExtension.cs.meta diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/TrailModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/Extensions/TrailModuleExtension.cs similarity index 73% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/TrailModuleExtension.cs rename to Packages/FluentParticleSystem/Runtime/Extensions/TrailModuleExtension.cs index 49803df..0e6dbc2 100644 --- a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/TrailModuleExtension.cs +++ b/Packages/FluentParticleSystem/Runtime/Extensions/TrailModuleExtension.cs @@ -1,8 +1,13 @@ using System; using System.Runtime.CompilerServices; using UnityEngine; + using static UnityEngine.ParticleSystem; +#if UNITY_2020_2_OR_NEWER +using System.Diagnostics.CodeAnalysis; +#endif + namespace OUCC.FluentParticleSystem { public static class TrailModuleExtension @@ -12,7 +17,18 @@ public static class TrailModuleExtension /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditTrails(this ParticleSystem particleSystem, Action moduleEditor) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem EditTrails( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Action moduleEditor) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); @@ -25,7 +41,14 @@ public static ParticleSystem EditTrails(this ParticleSystem particleSystem, Acti /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsAttachRibbonsToTransform(this ParticleSystem particleSystem, bool attachRibbonsToTransform) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsAttachRibbonsToTransform( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool attachRibbonsToTransform) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.trails; @@ -37,7 +60,18 @@ public static ParticleSystem SetTrailsAttachRibbonsToTransform(this ParticleSyst /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsAttachRibbonsToTransform(this ParticleSystem particleSystem, Func attachRibbonsToTransformChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsAttachRibbonsToTransform( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func attachRibbonsToTransformChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(attachRibbonsToTransformChanger != null, "attachRibbonsToTransformChanger cannot be null"); @@ -60,7 +94,11 @@ public static TrailModule SetAttachRibbonsToTransform(this TrailModule module, b /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetAttachRibbonsToTransform(this TrailModule module, Func attachRibbonsToTransformChanger) + public static TrailModule SetAttachRibbonsToTransform(this TrailModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func attachRibbonsToTransformChanger) { Debug.Assert(attachRibbonsToTransformChanger != null, "attachRibbonsToTransformChanger cannot be null"); module.attachRibbonsToTransform = attachRibbonsToTransformChanger(module.attachRibbonsToTransform); @@ -73,7 +111,14 @@ public static TrailModule SetAttachRibbonsToTransform(this TrailModule module, F /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsColorOverLifetime(this ParticleSystem particleSystem, MinMaxGradient colorOverLifetime) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsColorOverLifetime( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxGradient colorOverLifetime) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.trails; @@ -85,7 +130,18 @@ public static ParticleSystem SetTrailsColorOverLifetime(this ParticleSystem part /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsColorOverLifetime(this ParticleSystem particleSystem, Func colorOverLifetimeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsColorOverLifetime( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func colorOverLifetimeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(colorOverLifetimeChanger != null, "colorOverLifetimeChanger cannot be null"); @@ -108,7 +164,11 @@ public static TrailModule SetColorOverLifetime(this TrailModule module, MinMaxGr /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetColorOverLifetime(this TrailModule module, Func colorOverLifetimeChanger) + public static TrailModule SetColorOverLifetime(this TrailModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func colorOverLifetimeChanger) { Debug.Assert(colorOverLifetimeChanger != null, "colorOverLifetimeChanger cannot be null"); module.colorOverLifetime = colorOverLifetimeChanger(module.colorOverLifetime); @@ -121,7 +181,14 @@ public static TrailModule SetColorOverLifetime(this TrailModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsColorOverTrail(this ParticleSystem particleSystem, MinMaxGradient colorOverTrail) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsColorOverTrail( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxGradient colorOverTrail) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.trails; @@ -133,7 +200,18 @@ public static ParticleSystem SetTrailsColorOverTrail(this ParticleSystem particl /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsColorOverTrail(this ParticleSystem particleSystem, Func colorOverTrailChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsColorOverTrail( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func colorOverTrailChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(colorOverTrailChanger != null, "colorOverTrailChanger cannot be null"); @@ -156,7 +234,11 @@ public static TrailModule SetColorOverTrail(this TrailModule module, MinMaxGradi /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetColorOverTrail(this TrailModule module, Func colorOverTrailChanger) + public static TrailModule SetColorOverTrail(this TrailModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func colorOverTrailChanger) { Debug.Assert(colorOverTrailChanger != null, "colorOverTrailChanger cannot be null"); module.colorOverTrail = colorOverTrailChanger(module.colorOverTrail); @@ -169,7 +251,14 @@ public static TrailModule SetColorOverTrail(this TrailModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsDieWithParticles(this ParticleSystem particleSystem, bool dieWithParticles) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsDieWithParticles( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool dieWithParticles) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.trails; @@ -181,7 +270,18 @@ public static ParticleSystem SetTrailsDieWithParticles(this ParticleSystem parti /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsDieWithParticles(this ParticleSystem particleSystem, Func dieWithParticlesChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsDieWithParticles( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func dieWithParticlesChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(dieWithParticlesChanger != null, "dieWithParticlesChanger cannot be null"); @@ -204,7 +304,11 @@ public static TrailModule SetDieWithParticles(this TrailModule module, bool dieW /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetDieWithParticles(this TrailModule module, Func dieWithParticlesChanger) + public static TrailModule SetDieWithParticles(this TrailModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func dieWithParticlesChanger) { Debug.Assert(dieWithParticlesChanger != null, "dieWithParticlesChanger cannot be null"); module.dieWithParticles = dieWithParticlesChanger(module.dieWithParticles); @@ -217,7 +321,14 @@ public static TrailModule SetDieWithParticles(this TrailModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsEnabled(this ParticleSystem particleSystem, bool enabled) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool enabled) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.trails; @@ -229,7 +340,18 @@ public static ParticleSystem SetTrailsEnabled(this ParticleSystem particleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsEnabled(this ParticleSystem particleSystem, Func enabledChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); @@ -252,7 +374,11 @@ public static TrailModule SetEnabled(this TrailModule module, bool enabled) /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetEnabled(this TrailModule module, Func enabledChanger) + public static TrailModule SetEnabled(this TrailModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); module.enabled = enabledChanger(module.enabled); @@ -265,7 +391,14 @@ public static TrailModule SetEnabled(this TrailModule module, Func e /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsGenerateLightingData(this ParticleSystem particleSystem, bool generateLightingData) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsGenerateLightingData( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool generateLightingData) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.trails; @@ -277,7 +410,18 @@ public static ParticleSystem SetTrailsGenerateLightingData(this ParticleSystem p /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsGenerateLightingData(this ParticleSystem particleSystem, Func generateLightingDataChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsGenerateLightingData( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func generateLightingDataChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(generateLightingDataChanger != null, "generateLightingDataChanger cannot be null"); @@ -300,7 +444,11 @@ public static TrailModule SetGenerateLightingData(this TrailModule module, bool /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetGenerateLightingData(this TrailModule module, Func generateLightingDataChanger) + public static TrailModule SetGenerateLightingData(this TrailModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func generateLightingDataChanger) { Debug.Assert(generateLightingDataChanger != null, "generateLightingDataChanger cannot be null"); module.generateLightingData = generateLightingDataChanger(module.generateLightingData); @@ -313,7 +461,14 @@ public static TrailModule SetGenerateLightingData(this TrailModule module, Func< /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsInheritParticleColor(this ParticleSystem particleSystem, bool inheritParticleColor) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsInheritParticleColor( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool inheritParticleColor) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.trails; @@ -325,7 +480,18 @@ public static ParticleSystem SetTrailsInheritParticleColor(this ParticleSystem p /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsInheritParticleColor(this ParticleSystem particleSystem, Func inheritParticleColorChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsInheritParticleColor( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func inheritParticleColorChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(inheritParticleColorChanger != null, "inheritParticleColorChanger cannot be null"); @@ -348,7 +514,11 @@ public static TrailModule SetInheritParticleColor(this TrailModule module, bool /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetInheritParticleColor(this TrailModule module, Func inheritParticleColorChanger) + public static TrailModule SetInheritParticleColor(this TrailModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func inheritParticleColorChanger) { Debug.Assert(inheritParticleColorChanger != null, "inheritParticleColorChanger cannot be null"); module.inheritParticleColor = inheritParticleColorChanger(module.inheritParticleColor); @@ -361,7 +531,14 @@ public static TrailModule SetInheritParticleColor(this TrailModule module, Func< /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsLifetime(this ParticleSystem particleSystem, MinMaxCurve lifetime) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsLifetime( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve lifetime) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.trails; @@ -373,7 +550,18 @@ public static ParticleSystem SetTrailsLifetime(this ParticleSystem particleSyste /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsLifetime(this ParticleSystem particleSystem, Func lifetimeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsLifetime( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func lifetimeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(lifetimeChanger != null, "lifetimeChanger cannot be null"); @@ -396,7 +584,11 @@ public static TrailModule SetLifetime(this TrailModule module, MinMaxCurve lifet /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetLifetime(this TrailModule module, Func lifetimeChanger) + public static TrailModule SetLifetime(this TrailModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func lifetimeChanger) { Debug.Assert(lifetimeChanger != null, "lifetimeChanger cannot be null"); module.lifetime = lifetimeChanger(module.lifetime); @@ -409,7 +601,14 @@ public static TrailModule SetLifetime(this TrailModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsLifetimeMultiplier(this ParticleSystem particleSystem, float lifetimeMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsLifetimeMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float lifetimeMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.trails; @@ -421,7 +620,18 @@ public static ParticleSystem SetTrailsLifetimeMultiplier(this ParticleSystem par /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsLifetimeMultiplier(this ParticleSystem particleSystem, Func lifetimeMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsLifetimeMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func lifetimeMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(lifetimeMultiplierChanger != null, "lifetimeMultiplierChanger cannot be null"); @@ -444,7 +654,11 @@ public static TrailModule SetLifetimeMultiplier(this TrailModule module, float l /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetLifetimeMultiplier(this TrailModule module, Func lifetimeMultiplierChanger) + public static TrailModule SetLifetimeMultiplier(this TrailModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func lifetimeMultiplierChanger) { Debug.Assert(lifetimeMultiplierChanger != null, "lifetimeMultiplierChanger cannot be null"); module.lifetimeMultiplier = lifetimeMultiplierChanger(module.lifetimeMultiplier); @@ -457,7 +671,14 @@ public static TrailModule SetLifetimeMultiplier(this TrailModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsMinVertexDistance(this ParticleSystem particleSystem, float minVertexDistance) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsMinVertexDistance( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float minVertexDistance) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.trails; @@ -469,7 +690,18 @@ public static ParticleSystem SetTrailsMinVertexDistance(this ParticleSystem part /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsMinVertexDistance(this ParticleSystem particleSystem, Func minVertexDistanceChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsMinVertexDistance( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func minVertexDistanceChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(minVertexDistanceChanger != null, "minVertexDistanceChanger cannot be null"); @@ -492,7 +724,11 @@ public static TrailModule SetMinVertexDistance(this TrailModule module, float mi /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetMinVertexDistance(this TrailModule module, Func minVertexDistanceChanger) + public static TrailModule SetMinVertexDistance(this TrailModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func minVertexDistanceChanger) { Debug.Assert(minVertexDistanceChanger != null, "minVertexDistanceChanger cannot be null"); module.minVertexDistance = minVertexDistanceChanger(module.minVertexDistance); @@ -505,7 +741,14 @@ public static TrailModule SetMinVertexDistance(this TrailModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsMode(this ParticleSystem particleSystem, ParticleSystemTrailMode mode) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsMode( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, ParticleSystemTrailMode mode) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.trails; @@ -517,7 +760,18 @@ public static ParticleSystem SetTrailsMode(this ParticleSystem particleSystem, P /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsMode(this ParticleSystem particleSystem, Func modeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsMode( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func modeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(modeChanger != null, "modeChanger cannot be null"); @@ -540,7 +794,11 @@ public static TrailModule SetMode(this TrailModule module, ParticleSystemTrailMo /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetMode(this TrailModule module, Func modeChanger) + public static TrailModule SetMode(this TrailModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func modeChanger) { Debug.Assert(modeChanger != null, "modeChanger cannot be null"); module.mode = modeChanger(module.mode); @@ -553,7 +811,14 @@ public static TrailModule SetMode(this TrailModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsRatio(this ParticleSystem particleSystem, float ratio) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsRatio( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float ratio) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.trails; @@ -565,7 +830,18 @@ public static ParticleSystem SetTrailsRatio(this ParticleSystem particleSystem, /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsRatio(this ParticleSystem particleSystem, Func ratioChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsRatio( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func ratioChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(ratioChanger != null, "ratioChanger cannot be null"); @@ -588,7 +864,11 @@ public static TrailModule SetRatio(this TrailModule module, float ratio) /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetRatio(this TrailModule module, Func ratioChanger) + public static TrailModule SetRatio(this TrailModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func ratioChanger) { Debug.Assert(ratioChanger != null, "ratioChanger cannot be null"); module.ratio = ratioChanger(module.ratio); @@ -601,7 +881,14 @@ public static TrailModule SetRatio(this TrailModule module, Func r /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsRibbonCount(this ParticleSystem particleSystem, int ribbonCount) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsRibbonCount( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, int ribbonCount) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.trails; @@ -613,7 +900,18 @@ public static ParticleSystem SetTrailsRibbonCount(this ParticleSystem particleSy /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsRibbonCount(this ParticleSystem particleSystem, Func ribbonCountChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsRibbonCount( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func ribbonCountChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(ribbonCountChanger != null, "ribbonCountChanger cannot be null"); @@ -636,7 +934,11 @@ public static TrailModule SetRibbonCount(this TrailModule module, int ribbonCoun /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetRibbonCount(this TrailModule module, Func ribbonCountChanger) + public static TrailModule SetRibbonCount(this TrailModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func ribbonCountChanger) { Debug.Assert(ribbonCountChanger != null, "ribbonCountChanger cannot be null"); module.ribbonCount = ribbonCountChanger(module.ribbonCount); @@ -649,7 +951,14 @@ public static TrailModule SetRibbonCount(this TrailModule module, Func /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsShadowBias(this ParticleSystem particleSystem, float shadowBias) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsShadowBias( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float shadowBias) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.trails; @@ -661,7 +970,18 @@ public static ParticleSystem SetTrailsShadowBias(this ParticleSystem particleSys /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsShadowBias(this ParticleSystem particleSystem, Func shadowBiasChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsShadowBias( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func shadowBiasChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(shadowBiasChanger != null, "shadowBiasChanger cannot be null"); @@ -684,7 +1004,11 @@ public static TrailModule SetShadowBias(this TrailModule module, float shadowBia /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetShadowBias(this TrailModule module, Func shadowBiasChanger) + public static TrailModule SetShadowBias(this TrailModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func shadowBiasChanger) { Debug.Assert(shadowBiasChanger != null, "shadowBiasChanger cannot be null"); module.shadowBias = shadowBiasChanger(module.shadowBias); @@ -697,7 +1021,14 @@ public static TrailModule SetShadowBias(this TrailModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsSizeAffectsLifetime(this ParticleSystem particleSystem, bool sizeAffectsLifetime) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsSizeAffectsLifetime( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool sizeAffectsLifetime) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.trails; @@ -709,7 +1040,18 @@ public static ParticleSystem SetTrailsSizeAffectsLifetime(this ParticleSystem pa /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsSizeAffectsLifetime(this ParticleSystem particleSystem, Func sizeAffectsLifetimeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsSizeAffectsLifetime( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func sizeAffectsLifetimeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(sizeAffectsLifetimeChanger != null, "sizeAffectsLifetimeChanger cannot be null"); @@ -732,7 +1074,11 @@ public static TrailModule SetSizeAffectsLifetime(this TrailModule module, bool s /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetSizeAffectsLifetime(this TrailModule module, Func sizeAffectsLifetimeChanger) + public static TrailModule SetSizeAffectsLifetime(this TrailModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func sizeAffectsLifetimeChanger) { Debug.Assert(sizeAffectsLifetimeChanger != null, "sizeAffectsLifetimeChanger cannot be null"); module.sizeAffectsLifetime = sizeAffectsLifetimeChanger(module.sizeAffectsLifetime); @@ -745,7 +1091,14 @@ public static TrailModule SetSizeAffectsLifetime(this TrailModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsSizeAffectsWidth(this ParticleSystem particleSystem, bool sizeAffectsWidth) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsSizeAffectsWidth( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool sizeAffectsWidth) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.trails; @@ -757,7 +1110,18 @@ public static ParticleSystem SetTrailsSizeAffectsWidth(this ParticleSystem parti /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsSizeAffectsWidth(this ParticleSystem particleSystem, Func sizeAffectsWidthChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsSizeAffectsWidth( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func sizeAffectsWidthChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(sizeAffectsWidthChanger != null, "sizeAffectsWidthChanger cannot be null"); @@ -780,7 +1144,11 @@ public static TrailModule SetSizeAffectsWidth(this TrailModule module, bool size /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetSizeAffectsWidth(this TrailModule module, Func sizeAffectsWidthChanger) + public static TrailModule SetSizeAffectsWidth(this TrailModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func sizeAffectsWidthChanger) { Debug.Assert(sizeAffectsWidthChanger != null, "sizeAffectsWidthChanger cannot be null"); module.sizeAffectsWidth = sizeAffectsWidthChanger(module.sizeAffectsWidth); @@ -793,7 +1161,14 @@ public static TrailModule SetSizeAffectsWidth(this TrailModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsSplitSubEmitterRibbons(this ParticleSystem particleSystem, bool splitSubEmitterRibbons) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsSplitSubEmitterRibbons( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool splitSubEmitterRibbons) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.trails; @@ -805,7 +1180,18 @@ public static ParticleSystem SetTrailsSplitSubEmitterRibbons(this ParticleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsSplitSubEmitterRibbons(this ParticleSystem particleSystem, Func splitSubEmitterRibbonsChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsSplitSubEmitterRibbons( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func splitSubEmitterRibbonsChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(splitSubEmitterRibbonsChanger != null, "splitSubEmitterRibbonsChanger cannot be null"); @@ -828,7 +1214,11 @@ public static TrailModule SetSplitSubEmitterRibbons(this TrailModule module, boo /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetSplitSubEmitterRibbons(this TrailModule module, Func splitSubEmitterRibbonsChanger) + public static TrailModule SetSplitSubEmitterRibbons(this TrailModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func splitSubEmitterRibbonsChanger) { Debug.Assert(splitSubEmitterRibbonsChanger != null, "splitSubEmitterRibbonsChanger cannot be null"); module.splitSubEmitterRibbons = splitSubEmitterRibbonsChanger(module.splitSubEmitterRibbons); @@ -841,7 +1231,14 @@ public static TrailModule SetSplitSubEmitterRibbons(this TrailModule module, Fun /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsTextureMode(this ParticleSystem particleSystem, ParticleSystemTrailTextureMode textureMode) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsTextureMode( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, ParticleSystemTrailTextureMode textureMode) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.trails; @@ -853,7 +1250,18 @@ public static ParticleSystem SetTrailsTextureMode(this ParticleSystem particleSy /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsTextureMode(this ParticleSystem particleSystem, Func textureModeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsTextureMode( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func textureModeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(textureModeChanger != null, "textureModeChanger cannot be null"); @@ -876,7 +1284,11 @@ public static TrailModule SetTextureMode(this TrailModule module, ParticleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetTextureMode(this TrailModule module, Func textureModeChanger) + public static TrailModule SetTextureMode(this TrailModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func textureModeChanger) { Debug.Assert(textureModeChanger != null, "textureModeChanger cannot be null"); module.textureMode = textureModeChanger(module.textureMode); @@ -891,7 +1303,14 @@ public static TrailModule SetTextureMode(this TrailModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsTextureScale(this ParticleSystem particleSystem, Vector2 textureScale) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsTextureScale( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, Vector2 textureScale) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.trails; @@ -903,7 +1322,18 @@ public static ParticleSystem SetTrailsTextureScale(this ParticleSystem particleS /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsTextureScale(this ParticleSystem particleSystem, Func textureScaleChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsTextureScale( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func textureScaleChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(textureScaleChanger != null, "textureScaleChanger cannot be null"); @@ -926,7 +1356,11 @@ public static TrailModule SetTextureScale(this TrailModule module, Vector2 textu /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetTextureScale(this TrailModule module, Func textureScaleChanger) + public static TrailModule SetTextureScale(this TrailModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func textureScaleChanger) { Debug.Assert(textureScaleChanger != null, "textureScaleChanger cannot be null"); module.textureScale = textureScaleChanger(module.textureScale); @@ -941,7 +1375,14 @@ public static TrailModule SetTextureScale(this TrailModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsWidthOverTrail(this ParticleSystem particleSystem, MinMaxCurve widthOverTrail) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsWidthOverTrail( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve widthOverTrail) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.trails; @@ -953,7 +1394,18 @@ public static ParticleSystem SetTrailsWidthOverTrail(this ParticleSystem particl /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsWidthOverTrail(this ParticleSystem particleSystem, Func widthOverTrailChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsWidthOverTrail( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func widthOverTrailChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(widthOverTrailChanger != null, "widthOverTrailChanger cannot be null"); @@ -976,7 +1428,11 @@ public static TrailModule SetWidthOverTrail(this TrailModule module, MinMaxCurve /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetWidthOverTrail(this TrailModule module, Func widthOverTrailChanger) + public static TrailModule SetWidthOverTrail(this TrailModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func widthOverTrailChanger) { Debug.Assert(widthOverTrailChanger != null, "widthOverTrailChanger cannot be null"); module.widthOverTrail = widthOverTrailChanger(module.widthOverTrail); @@ -989,7 +1445,14 @@ public static TrailModule SetWidthOverTrail(this TrailModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsWidthOverTrailMultiplier(this ParticleSystem particleSystem, float widthOverTrailMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsWidthOverTrailMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float widthOverTrailMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.trails; @@ -1001,7 +1464,18 @@ public static ParticleSystem SetTrailsWidthOverTrailMultiplier(this ParticleSyst /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsWidthOverTrailMultiplier(this ParticleSystem particleSystem, Func widthOverTrailMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsWidthOverTrailMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func widthOverTrailMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(widthOverTrailMultiplierChanger != null, "widthOverTrailMultiplierChanger cannot be null"); @@ -1024,7 +1498,11 @@ public static TrailModule SetWidthOverTrailMultiplier(this TrailModule module, f /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetWidthOverTrailMultiplier(this TrailModule module, Func widthOverTrailMultiplierChanger) + public static TrailModule SetWidthOverTrailMultiplier(this TrailModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func widthOverTrailMultiplierChanger) { Debug.Assert(widthOverTrailMultiplierChanger != null, "widthOverTrailMultiplierChanger cannot be null"); module.widthOverTrailMultiplier = widthOverTrailMultiplierChanger(module.widthOverTrailMultiplier); @@ -1037,7 +1515,14 @@ public static TrailModule SetWidthOverTrailMultiplier(this TrailModule module, F /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsWorldSpace(this ParticleSystem particleSystem, bool worldSpace) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsWorldSpace( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool worldSpace) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.trails; @@ -1049,7 +1534,18 @@ public static ParticleSystem SetTrailsWorldSpace(this ParticleSystem particleSys /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsWorldSpace(this ParticleSystem particleSystem, Func worldSpaceChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTrailsWorldSpace( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func worldSpaceChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(worldSpaceChanger != null, "worldSpaceChanger cannot be null"); @@ -1072,7 +1568,11 @@ public static TrailModule SetWorldSpace(this TrailModule module, bool worldSpace /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetWorldSpace(this TrailModule module, Func worldSpaceChanger) + public static TrailModule SetWorldSpace(this TrailModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func worldSpaceChanger) { Debug.Assert(worldSpaceChanger != null, "worldSpaceChanger cannot be null"); module.worldSpace = worldSpaceChanger(module.worldSpace); diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/TrailModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Extensions/TrailModuleExtension.cs.meta similarity index 100% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/TrailModuleExtension.cs.meta rename to Packages/FluentParticleSystem/Runtime/Extensions/TrailModuleExtension.cs.meta diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/TriggerModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/Extensions/TriggerModuleExtension.cs similarity index 69% rename from Packages/FluentParticleSystem/Runtime/Nullable/Extensions/TriggerModuleExtension.cs rename to Packages/FluentParticleSystem/Runtime/Extensions/TriggerModuleExtension.cs index 51c127b..a65916e 100644 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/TriggerModuleExtension.cs +++ b/Packages/FluentParticleSystem/Runtime/Extensions/TriggerModuleExtension.cs @@ -1,9 +1,13 @@ -#nullable enable using System; using System.Runtime.CompilerServices; using UnityEngine; + using static UnityEngine.ParticleSystem; +#if UNITY_2020_2_OR_NEWER +using System.Diagnostics.CodeAnalysis; +#endif + namespace OUCC.FluentParticleSystem { public static class TriggerModuleExtension @@ -13,7 +17,18 @@ public static class TriggerModuleExtension /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditTrigger(this ParticleSystem particleSystem, Action moduleEditor) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem EditTrigger( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Action moduleEditor) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); @@ -28,7 +43,14 @@ public static ParticleSystem EditTrigger(this ParticleSystem particleSystem, Act /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTriggerColliderQueryMode(this ParticleSystem particleSystem, ParticleSystemColliderQueryMode colliderQueryMode) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTriggerColliderQueryMode( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, ParticleSystemColliderQueryMode colliderQueryMode) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.trigger; @@ -40,7 +62,18 @@ public static ParticleSystem SetTriggerColliderQueryMode(this ParticleSystem par /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTriggerColliderQueryMode(this ParticleSystem particleSystem, Func colliderQueryModeChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTriggerColliderQueryMode( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func colliderQueryModeChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(colliderQueryModeChanger != null, "colliderQueryModeChanger cannot be null"); @@ -63,7 +96,11 @@ public static TriggerModule SetColliderQueryMode(this TriggerModule module, Part /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TriggerModule SetColliderQueryMode(this TriggerModule module, Func colliderQueryModeChanger) + public static TriggerModule SetColliderQueryMode(this TriggerModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func colliderQueryModeChanger) { Debug.Assert(colliderQueryModeChanger != null, "colliderQueryModeChanger cannot be null"); module.colliderQueryMode = colliderQueryModeChanger(module.colliderQueryMode); @@ -78,7 +115,14 @@ public static TriggerModule SetColliderQueryMode(this TriggerModule module, Func /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTriggerEnabled(this ParticleSystem particleSystem, bool enabled) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTriggerEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool enabled) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.trigger; @@ -90,7 +134,18 @@ public static ParticleSystem SetTriggerEnabled(this ParticleSystem particleSyste /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTriggerEnabled(this ParticleSystem particleSystem, Func enabledChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTriggerEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); @@ -113,7 +168,11 @@ public static TriggerModule SetEnabled(this TriggerModule module, bool enabled) /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TriggerModule SetEnabled(this TriggerModule module, Func enabledChanger) + public static TriggerModule SetEnabled(this TriggerModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); module.enabled = enabledChanger(module.enabled); @@ -126,7 +185,14 @@ public static TriggerModule SetEnabled(this TriggerModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTriggerEnter(this ParticleSystem particleSystem, ParticleSystemOverlapAction enter) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTriggerEnter( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, ParticleSystemOverlapAction enter) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.trigger; @@ -138,7 +204,18 @@ public static ParticleSystem SetTriggerEnter(this ParticleSystem particleSystem, /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTriggerEnter(this ParticleSystem particleSystem, Func enterChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTriggerEnter( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enterChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(enterChanger != null, "enterChanger cannot be null"); @@ -161,7 +238,11 @@ public static TriggerModule SetEnter(this TriggerModule module, ParticleSystemOv /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TriggerModule SetEnter(this TriggerModule module, Func enterChanger) + public static TriggerModule SetEnter(this TriggerModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enterChanger) { Debug.Assert(enterChanger != null, "enterChanger cannot be null"); module.enter = enterChanger(module.enter); @@ -174,7 +255,14 @@ public static TriggerModule SetEnter(this TriggerModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTriggerExit(this ParticleSystem particleSystem, ParticleSystemOverlapAction exit) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTriggerExit( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, ParticleSystemOverlapAction exit) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.trigger; @@ -186,7 +274,18 @@ public static ParticleSystem SetTriggerExit(this ParticleSystem particleSystem, /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTriggerExit(this ParticleSystem particleSystem, Func exitChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTriggerExit( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func exitChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(exitChanger != null, "exitChanger cannot be null"); @@ -209,7 +308,11 @@ public static TriggerModule SetExit(this TriggerModule module, ParticleSystemOve /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TriggerModule SetExit(this TriggerModule module, Func exitChanger) + public static TriggerModule SetExit(this TriggerModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func exitChanger) { Debug.Assert(exitChanger != null, "exitChanger cannot be null"); module.exit = exitChanger(module.exit); @@ -222,7 +325,14 @@ public static TriggerModule SetExit(this TriggerModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTriggerInside(this ParticleSystem particleSystem, ParticleSystemOverlapAction inside) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTriggerInside( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, ParticleSystemOverlapAction inside) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.trigger; @@ -234,7 +344,18 @@ public static ParticleSystem SetTriggerInside(this ParticleSystem particleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTriggerInside(this ParticleSystem particleSystem, Func insideChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTriggerInside( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func insideChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(insideChanger != null, "insideChanger cannot be null"); @@ -257,7 +378,11 @@ public static TriggerModule SetInside(this TriggerModule module, ParticleSystemO /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TriggerModule SetInside(this TriggerModule module, Func insideChanger) + public static TriggerModule SetInside(this TriggerModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func insideChanger) { Debug.Assert(insideChanger != null, "insideChanger cannot be null"); module.inside = insideChanger(module.inside); @@ -270,7 +395,14 @@ public static TriggerModule SetInside(this TriggerModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTriggerOutside(this ParticleSystem particleSystem, ParticleSystemOverlapAction outside) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTriggerOutside( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, ParticleSystemOverlapAction outside) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.trigger; @@ -282,7 +414,18 @@ public static ParticleSystem SetTriggerOutside(this ParticleSystem particleSyste /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTriggerOutside(this ParticleSystem particleSystem, Func outsideChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTriggerOutside( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func outsideChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(outsideChanger != null, "outsideChanger cannot be null"); @@ -305,7 +448,11 @@ public static TriggerModule SetOutside(this TriggerModule module, ParticleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TriggerModule SetOutside(this TriggerModule module, Func outsideChanger) + public static TriggerModule SetOutside(this TriggerModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func outsideChanger) { Debug.Assert(outsideChanger != null, "outsideChanger cannot be null"); module.outside = outsideChanger(module.outside); @@ -318,7 +465,14 @@ public static TriggerModule SetOutside(this TriggerModule module, Func /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTriggerRadiusScale(this ParticleSystem particleSystem, float radiusScale) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTriggerRadiusScale( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float radiusScale) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.trigger; @@ -330,7 +484,18 @@ public static ParticleSystem SetTriggerRadiusScale(this ParticleSystem particleS /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTriggerRadiusScale(this ParticleSystem particleSystem, Func radiusScaleChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetTriggerRadiusScale( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func radiusScaleChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(radiusScaleChanger != null, "radiusScaleChanger cannot be null"); @@ -353,7 +518,11 @@ public static TriggerModule SetRadiusScale(this TriggerModule module, float radi /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TriggerModule SetRadiusScale(this TriggerModule module, Func radiusScaleChanger) + public static TriggerModule SetRadiusScale(this TriggerModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func radiusScaleChanger) { Debug.Assert(radiusScaleChanger != null, "radiusScaleChanger cannot be null"); module.radiusScale = radiusScaleChanger(module.radiusScale); diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/TriggerModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Extensions/TriggerModuleExtension.cs.meta similarity index 100% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/TriggerModuleExtension.cs.meta rename to Packages/FluentParticleSystem/Runtime/Extensions/TriggerModuleExtension.cs.meta diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/VelocityOverLifetimeModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/Extensions/VelocityOverLifetimeModuleExtension.cs similarity index 74% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/VelocityOverLifetimeModuleExtension.cs rename to Packages/FluentParticleSystem/Runtime/Extensions/VelocityOverLifetimeModuleExtension.cs index d5a171f..ffbf288 100644 --- a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/VelocityOverLifetimeModuleExtension.cs +++ b/Packages/FluentParticleSystem/Runtime/Extensions/VelocityOverLifetimeModuleExtension.cs @@ -1,8 +1,13 @@ using System; using System.Runtime.CompilerServices; using UnityEngine; + using static UnityEngine.ParticleSystem; +#if UNITY_2020_2_OR_NEWER +using System.Diagnostics.CodeAnalysis; +#endif + namespace OUCC.FluentParticleSystem { public static class VelocityOverLifetimeModuleExtension @@ -12,7 +17,18 @@ public static class VelocityOverLifetimeModuleExtension /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditVelocityOverLifetime(this ParticleSystem particleSystem, Action moduleEditor) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem EditVelocityOverLifetime( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Action moduleEditor) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); @@ -25,7 +41,14 @@ public static ParticleSystem EditVelocityOverLifetime(this ParticleSystem partic /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeEnabled(this ParticleSystem particleSystem, bool enabled) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, bool enabled) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.velocityOverLifetime; @@ -37,7 +60,18 @@ public static ParticleSystem SetVelocityOverLifetimeEnabled(this ParticleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeEnabled(this ParticleSystem particleSystem, Func enabledChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeEnabled( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); @@ -60,7 +94,11 @@ public static VelocityOverLifetimeModule SetEnabled(this VelocityOverLifetimeMod /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetEnabled(this VelocityOverLifetimeModule module, Func enabledChanger) + public static VelocityOverLifetimeModule SetEnabled(this VelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func enabledChanger) { Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); module.enabled = enabledChanger(module.enabled); @@ -73,7 +111,14 @@ public static VelocityOverLifetimeModule SetEnabled(this VelocityOverLifetimeMod /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetX(this ParticleSystem particleSystem, MinMaxCurve orbitalOffsetX) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetX( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve orbitalOffsetX) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.velocityOverLifetime; @@ -85,7 +130,18 @@ public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetX(this Particle /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetX(this ParticleSystem particleSystem, Func orbitalOffsetXChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetX( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func orbitalOffsetXChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(orbitalOffsetXChanger != null, "orbitalOffsetXChanger cannot be null"); @@ -108,7 +164,11 @@ public static VelocityOverLifetimeModule SetOrbitalOffsetX(this VelocityOverLife /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetOrbitalOffsetX(this VelocityOverLifetimeModule module, Func orbitalOffsetXChanger) + public static VelocityOverLifetimeModule SetOrbitalOffsetX(this VelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func orbitalOffsetXChanger) { Debug.Assert(orbitalOffsetXChanger != null, "orbitalOffsetXChanger cannot be null"); module.orbitalOffsetX = orbitalOffsetXChanger(module.orbitalOffsetX); @@ -121,7 +181,14 @@ public static VelocityOverLifetimeModule SetOrbitalOffsetX(this VelocityOverLife /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetXMultiplier(this ParticleSystem particleSystem, float orbitalOffsetXMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetXMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float orbitalOffsetXMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.velocityOverLifetime; @@ -133,7 +200,18 @@ public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetXMultiplier(thi /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetXMultiplier(this ParticleSystem particleSystem, Func orbitalOffsetXMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetXMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func orbitalOffsetXMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(orbitalOffsetXMultiplierChanger != null, "orbitalOffsetXMultiplierChanger cannot be null"); @@ -156,7 +234,11 @@ public static VelocityOverLifetimeModule SetOrbitalOffsetXMultiplier(this Veloci /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetOrbitalOffsetXMultiplier(this VelocityOverLifetimeModule module, Func orbitalOffsetXMultiplierChanger) + public static VelocityOverLifetimeModule SetOrbitalOffsetXMultiplier(this VelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func orbitalOffsetXMultiplierChanger) { Debug.Assert(orbitalOffsetXMultiplierChanger != null, "orbitalOffsetXMultiplierChanger cannot be null"); module.orbitalOffsetXMultiplier = orbitalOffsetXMultiplierChanger(module.orbitalOffsetXMultiplier); @@ -169,7 +251,14 @@ public static VelocityOverLifetimeModule SetOrbitalOffsetXMultiplier(this Veloci /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetY(this ParticleSystem particleSystem, MinMaxCurve orbitalOffsetY) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetY( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve orbitalOffsetY) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.velocityOverLifetime; @@ -181,7 +270,18 @@ public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetY(this Particle /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetY(this ParticleSystem particleSystem, Func orbitalOffsetYChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetY( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func orbitalOffsetYChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(orbitalOffsetYChanger != null, "orbitalOffsetYChanger cannot be null"); @@ -204,7 +304,11 @@ public static VelocityOverLifetimeModule SetOrbitalOffsetY(this VelocityOverLife /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetOrbitalOffsetY(this VelocityOverLifetimeModule module, Func orbitalOffsetYChanger) + public static VelocityOverLifetimeModule SetOrbitalOffsetY(this VelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func orbitalOffsetYChanger) { Debug.Assert(orbitalOffsetYChanger != null, "orbitalOffsetYChanger cannot be null"); module.orbitalOffsetY = orbitalOffsetYChanger(module.orbitalOffsetY); @@ -217,7 +321,14 @@ public static VelocityOverLifetimeModule SetOrbitalOffsetY(this VelocityOverLife /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetYMultiplier(this ParticleSystem particleSystem, float orbitalOffsetYMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetYMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float orbitalOffsetYMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.velocityOverLifetime; @@ -229,7 +340,18 @@ public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetYMultiplier(thi /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetYMultiplier(this ParticleSystem particleSystem, Func orbitalOffsetYMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetYMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func orbitalOffsetYMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(orbitalOffsetYMultiplierChanger != null, "orbitalOffsetYMultiplierChanger cannot be null"); @@ -252,7 +374,11 @@ public static VelocityOverLifetimeModule SetOrbitalOffsetYMultiplier(this Veloci /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetOrbitalOffsetYMultiplier(this VelocityOverLifetimeModule module, Func orbitalOffsetYMultiplierChanger) + public static VelocityOverLifetimeModule SetOrbitalOffsetYMultiplier(this VelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func orbitalOffsetYMultiplierChanger) { Debug.Assert(orbitalOffsetYMultiplierChanger != null, "orbitalOffsetYMultiplierChanger cannot be null"); module.orbitalOffsetYMultiplier = orbitalOffsetYMultiplierChanger(module.orbitalOffsetYMultiplier); @@ -265,7 +391,14 @@ public static VelocityOverLifetimeModule SetOrbitalOffsetYMultiplier(this Veloci /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetZ(this ParticleSystem particleSystem, MinMaxCurve orbitalOffsetZ) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetZ( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve orbitalOffsetZ) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.velocityOverLifetime; @@ -277,7 +410,18 @@ public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetZ(this Particle /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetZ(this ParticleSystem particleSystem, Func orbitalOffsetZChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetZ( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func orbitalOffsetZChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(orbitalOffsetZChanger != null, "orbitalOffsetZChanger cannot be null"); @@ -300,7 +444,11 @@ public static VelocityOverLifetimeModule SetOrbitalOffsetZ(this VelocityOverLife /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetOrbitalOffsetZ(this VelocityOverLifetimeModule module, Func orbitalOffsetZChanger) + public static VelocityOverLifetimeModule SetOrbitalOffsetZ(this VelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func orbitalOffsetZChanger) { Debug.Assert(orbitalOffsetZChanger != null, "orbitalOffsetZChanger cannot be null"); module.orbitalOffsetZ = orbitalOffsetZChanger(module.orbitalOffsetZ); @@ -313,7 +461,14 @@ public static VelocityOverLifetimeModule SetOrbitalOffsetZ(this VelocityOverLife /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetZMultiplier(this ParticleSystem particleSystem, float orbitalOffsetZMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetZMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float orbitalOffsetZMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.velocityOverLifetime; @@ -325,7 +480,18 @@ public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetZMultiplier(thi /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetZMultiplier(this ParticleSystem particleSystem, Func orbitalOffsetZMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetZMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func orbitalOffsetZMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(orbitalOffsetZMultiplierChanger != null, "orbitalOffsetZMultiplierChanger cannot be null"); @@ -348,7 +514,11 @@ public static VelocityOverLifetimeModule SetOrbitalOffsetZMultiplier(this Veloci /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetOrbitalOffsetZMultiplier(this VelocityOverLifetimeModule module, Func orbitalOffsetZMultiplierChanger) + public static VelocityOverLifetimeModule SetOrbitalOffsetZMultiplier(this VelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func orbitalOffsetZMultiplierChanger) { Debug.Assert(orbitalOffsetZMultiplierChanger != null, "orbitalOffsetZMultiplierChanger cannot be null"); module.orbitalOffsetZMultiplier = orbitalOffsetZMultiplierChanger(module.orbitalOffsetZMultiplier); @@ -361,7 +531,14 @@ public static VelocityOverLifetimeModule SetOrbitalOffsetZMultiplier(this Veloci /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalX(this ParticleSystem particleSystem, MinMaxCurve orbitalX) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeOrbitalX( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve orbitalX) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.velocityOverLifetime; @@ -373,7 +550,18 @@ public static ParticleSystem SetVelocityOverLifetimeOrbitalX(this ParticleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalX(this ParticleSystem particleSystem, Func orbitalXChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeOrbitalX( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func orbitalXChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(orbitalXChanger != null, "orbitalXChanger cannot be null"); @@ -396,7 +584,11 @@ public static VelocityOverLifetimeModule SetOrbitalX(this VelocityOverLifetimeMo /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetOrbitalX(this VelocityOverLifetimeModule module, Func orbitalXChanger) + public static VelocityOverLifetimeModule SetOrbitalX(this VelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func orbitalXChanger) { Debug.Assert(orbitalXChanger != null, "orbitalXChanger cannot be null"); module.orbitalX = orbitalXChanger(module.orbitalX); @@ -409,7 +601,14 @@ public static VelocityOverLifetimeModule SetOrbitalX(this VelocityOverLifetimeMo /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalXMultiplier(this ParticleSystem particleSystem, float orbitalXMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeOrbitalXMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float orbitalXMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.velocityOverLifetime; @@ -421,7 +620,18 @@ public static ParticleSystem SetVelocityOverLifetimeOrbitalXMultiplier(this Part /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalXMultiplier(this ParticleSystem particleSystem, Func orbitalXMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeOrbitalXMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func orbitalXMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(orbitalXMultiplierChanger != null, "orbitalXMultiplierChanger cannot be null"); @@ -444,7 +654,11 @@ public static VelocityOverLifetimeModule SetOrbitalXMultiplier(this VelocityOver /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetOrbitalXMultiplier(this VelocityOverLifetimeModule module, Func orbitalXMultiplierChanger) + public static VelocityOverLifetimeModule SetOrbitalXMultiplier(this VelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func orbitalXMultiplierChanger) { Debug.Assert(orbitalXMultiplierChanger != null, "orbitalXMultiplierChanger cannot be null"); module.orbitalXMultiplier = orbitalXMultiplierChanger(module.orbitalXMultiplier); @@ -457,7 +671,14 @@ public static VelocityOverLifetimeModule SetOrbitalXMultiplier(this VelocityOver /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalY(this ParticleSystem particleSystem, MinMaxCurve orbitalY) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeOrbitalY( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve orbitalY) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.velocityOverLifetime; @@ -469,7 +690,18 @@ public static ParticleSystem SetVelocityOverLifetimeOrbitalY(this ParticleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalY(this ParticleSystem particleSystem, Func orbitalYChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeOrbitalY( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func orbitalYChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(orbitalYChanger != null, "orbitalYChanger cannot be null"); @@ -492,7 +724,11 @@ public static VelocityOverLifetimeModule SetOrbitalY(this VelocityOverLifetimeMo /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetOrbitalY(this VelocityOverLifetimeModule module, Func orbitalYChanger) + public static VelocityOverLifetimeModule SetOrbitalY(this VelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func orbitalYChanger) { Debug.Assert(orbitalYChanger != null, "orbitalYChanger cannot be null"); module.orbitalY = orbitalYChanger(module.orbitalY); @@ -505,7 +741,14 @@ public static VelocityOverLifetimeModule SetOrbitalY(this VelocityOverLifetimeMo /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalYMultiplier(this ParticleSystem particleSystem, float orbitalYMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeOrbitalYMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float orbitalYMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.velocityOverLifetime; @@ -517,7 +760,18 @@ public static ParticleSystem SetVelocityOverLifetimeOrbitalYMultiplier(this Part /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalYMultiplier(this ParticleSystem particleSystem, Func orbitalYMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeOrbitalYMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func orbitalYMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(orbitalYMultiplierChanger != null, "orbitalYMultiplierChanger cannot be null"); @@ -540,7 +794,11 @@ public static VelocityOverLifetimeModule SetOrbitalYMultiplier(this VelocityOver /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetOrbitalYMultiplier(this VelocityOverLifetimeModule module, Func orbitalYMultiplierChanger) + public static VelocityOverLifetimeModule SetOrbitalYMultiplier(this VelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func orbitalYMultiplierChanger) { Debug.Assert(orbitalYMultiplierChanger != null, "orbitalYMultiplierChanger cannot be null"); module.orbitalYMultiplier = orbitalYMultiplierChanger(module.orbitalYMultiplier); @@ -553,7 +811,14 @@ public static VelocityOverLifetimeModule SetOrbitalYMultiplier(this VelocityOver /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalZ(this ParticleSystem particleSystem, MinMaxCurve orbitalZ) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeOrbitalZ( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve orbitalZ) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.velocityOverLifetime; @@ -565,7 +830,18 @@ public static ParticleSystem SetVelocityOverLifetimeOrbitalZ(this ParticleSystem /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalZ(this ParticleSystem particleSystem, Func orbitalZChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeOrbitalZ( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func orbitalZChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(orbitalZChanger != null, "orbitalZChanger cannot be null"); @@ -588,7 +864,11 @@ public static VelocityOverLifetimeModule SetOrbitalZ(this VelocityOverLifetimeMo /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetOrbitalZ(this VelocityOverLifetimeModule module, Func orbitalZChanger) + public static VelocityOverLifetimeModule SetOrbitalZ(this VelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func orbitalZChanger) { Debug.Assert(orbitalZChanger != null, "orbitalZChanger cannot be null"); module.orbitalZ = orbitalZChanger(module.orbitalZ); @@ -601,7 +881,14 @@ public static VelocityOverLifetimeModule SetOrbitalZ(this VelocityOverLifetimeMo /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalZMultiplier(this ParticleSystem particleSystem, float orbitalZMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeOrbitalZMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float orbitalZMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.velocityOverLifetime; @@ -613,7 +900,18 @@ public static ParticleSystem SetVelocityOverLifetimeOrbitalZMultiplier(this Part /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalZMultiplier(this ParticleSystem particleSystem, Func orbitalZMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeOrbitalZMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func orbitalZMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(orbitalZMultiplierChanger != null, "orbitalZMultiplierChanger cannot be null"); @@ -636,7 +934,11 @@ public static VelocityOverLifetimeModule SetOrbitalZMultiplier(this VelocityOver /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetOrbitalZMultiplier(this VelocityOverLifetimeModule module, Func orbitalZMultiplierChanger) + public static VelocityOverLifetimeModule SetOrbitalZMultiplier(this VelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func orbitalZMultiplierChanger) { Debug.Assert(orbitalZMultiplierChanger != null, "orbitalZMultiplierChanger cannot be null"); module.orbitalZMultiplier = orbitalZMultiplierChanger(module.orbitalZMultiplier); @@ -649,7 +951,14 @@ public static VelocityOverLifetimeModule SetOrbitalZMultiplier(this VelocityOver /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeRadial(this ParticleSystem particleSystem, MinMaxCurve radial) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeRadial( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve radial) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.velocityOverLifetime; @@ -661,7 +970,18 @@ public static ParticleSystem SetVelocityOverLifetimeRadial(this ParticleSystem p /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeRadial(this ParticleSystem particleSystem, Func radialChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeRadial( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func radialChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(radialChanger != null, "radialChanger cannot be null"); @@ -684,7 +1004,11 @@ public static VelocityOverLifetimeModule SetRadial(this VelocityOverLifetimeModu /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetRadial(this VelocityOverLifetimeModule module, Func radialChanger) + public static VelocityOverLifetimeModule SetRadial(this VelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func radialChanger) { Debug.Assert(radialChanger != null, "radialChanger cannot be null"); module.radial = radialChanger(module.radial); @@ -697,7 +1021,14 @@ public static VelocityOverLifetimeModule SetRadial(this VelocityOverLifetimeModu /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeRadialMultiplier(this ParticleSystem particleSystem, float radialMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeRadialMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float radialMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.velocityOverLifetime; @@ -709,7 +1040,18 @@ public static ParticleSystem SetVelocityOverLifetimeRadialMultiplier(this Partic /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeRadialMultiplier(this ParticleSystem particleSystem, Func radialMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeRadialMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func radialMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(radialMultiplierChanger != null, "radialMultiplierChanger cannot be null"); @@ -732,7 +1074,11 @@ public static VelocityOverLifetimeModule SetRadialMultiplier(this VelocityOverLi /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetRadialMultiplier(this VelocityOverLifetimeModule module, Func radialMultiplierChanger) + public static VelocityOverLifetimeModule SetRadialMultiplier(this VelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func radialMultiplierChanger) { Debug.Assert(radialMultiplierChanger != null, "radialMultiplierChanger cannot be null"); module.radialMultiplier = radialMultiplierChanger(module.radialMultiplier); @@ -745,7 +1091,14 @@ public static VelocityOverLifetimeModule SetRadialMultiplier(this VelocityOverLi /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeSpace(this ParticleSystem particleSystem, ParticleSystemSimulationSpace space) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeSpace( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, ParticleSystemSimulationSpace space) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.velocityOverLifetime; @@ -757,7 +1110,18 @@ public static ParticleSystem SetVelocityOverLifetimeSpace(this ParticleSystem pa /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeSpace(this ParticleSystem particleSystem, Func spaceChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeSpace( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func spaceChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(spaceChanger != null, "spaceChanger cannot be null"); @@ -780,7 +1144,11 @@ public static VelocityOverLifetimeModule SetSpace(this VelocityOverLifetimeModul /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetSpace(this VelocityOverLifetimeModule module, Func spaceChanger) + public static VelocityOverLifetimeModule SetSpace(this VelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func spaceChanger) { Debug.Assert(spaceChanger != null, "spaceChanger cannot be null"); module.space = spaceChanger(module.space); @@ -793,7 +1161,14 @@ public static VelocityOverLifetimeModule SetSpace(this VelocityOverLifetimeModul /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeSpeedModifier(this ParticleSystem particleSystem, MinMaxCurve speedModifier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeSpeedModifier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve speedModifier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.velocityOverLifetime; @@ -805,7 +1180,18 @@ public static ParticleSystem SetVelocityOverLifetimeSpeedModifier(this ParticleS /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeSpeedModifier(this ParticleSystem particleSystem, Func speedModifierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeSpeedModifier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func speedModifierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(speedModifierChanger != null, "speedModifierChanger cannot be null"); @@ -828,7 +1214,11 @@ public static VelocityOverLifetimeModule SetSpeedModifier(this VelocityOverLifet /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetSpeedModifier(this VelocityOverLifetimeModule module, Func speedModifierChanger) + public static VelocityOverLifetimeModule SetSpeedModifier(this VelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func speedModifierChanger) { Debug.Assert(speedModifierChanger != null, "speedModifierChanger cannot be null"); module.speedModifier = speedModifierChanger(module.speedModifier); @@ -841,7 +1231,14 @@ public static VelocityOverLifetimeModule SetSpeedModifier(this VelocityOverLifet /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeSpeedModifierMultiplier(this ParticleSystem particleSystem, float speedModifierMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeSpeedModifierMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float speedModifierMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.velocityOverLifetime; @@ -853,7 +1250,18 @@ public static ParticleSystem SetVelocityOverLifetimeSpeedModifierMultiplier(this /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeSpeedModifierMultiplier(this ParticleSystem particleSystem, Func speedModifierMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeSpeedModifierMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func speedModifierMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(speedModifierMultiplierChanger != null, "speedModifierMultiplierChanger cannot be null"); @@ -876,7 +1284,11 @@ public static VelocityOverLifetimeModule SetSpeedModifierMultiplier(this Velocit /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetSpeedModifierMultiplier(this VelocityOverLifetimeModule module, Func speedModifierMultiplierChanger) + public static VelocityOverLifetimeModule SetSpeedModifierMultiplier(this VelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func speedModifierMultiplierChanger) { Debug.Assert(speedModifierMultiplierChanger != null, "speedModifierMultiplierChanger cannot be null"); module.speedModifierMultiplier = speedModifierMultiplierChanger(module.speedModifierMultiplier); @@ -889,7 +1301,14 @@ public static VelocityOverLifetimeModule SetSpeedModifierMultiplier(this Velocit /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeX(this ParticleSystem particleSystem, MinMaxCurve x) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeX( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve x) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.velocityOverLifetime; @@ -901,7 +1320,18 @@ public static ParticleSystem SetVelocityOverLifetimeX(this ParticleSystem partic /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeX(this ParticleSystem particleSystem, Func xChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeX( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func xChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(xChanger != null, "xChanger cannot be null"); @@ -924,7 +1354,11 @@ public static VelocityOverLifetimeModule SetX(this VelocityOverLifetimeModule mo /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetX(this VelocityOverLifetimeModule module, Func xChanger) + public static VelocityOverLifetimeModule SetX(this VelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func xChanger) { Debug.Assert(xChanger != null, "xChanger cannot be null"); module.x = xChanger(module.x); @@ -937,7 +1371,14 @@ public static VelocityOverLifetimeModule SetX(this VelocityOverLifetimeModule mo /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeXMultiplier(this ParticleSystem particleSystem, float xMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeXMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float xMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.velocityOverLifetime; @@ -949,7 +1390,18 @@ public static ParticleSystem SetVelocityOverLifetimeXMultiplier(this ParticleSys /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeXMultiplier(this ParticleSystem particleSystem, Func xMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeXMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func xMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(xMultiplierChanger != null, "xMultiplierChanger cannot be null"); @@ -972,7 +1424,11 @@ public static VelocityOverLifetimeModule SetXMultiplier(this VelocityOverLifetim /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetXMultiplier(this VelocityOverLifetimeModule module, Func xMultiplierChanger) + public static VelocityOverLifetimeModule SetXMultiplier(this VelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func xMultiplierChanger) { Debug.Assert(xMultiplierChanger != null, "xMultiplierChanger cannot be null"); module.xMultiplier = xMultiplierChanger(module.xMultiplier); @@ -985,7 +1441,14 @@ public static VelocityOverLifetimeModule SetXMultiplier(this VelocityOverLifetim /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeY(this ParticleSystem particleSystem, MinMaxCurve y) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeY( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve y) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.velocityOverLifetime; @@ -997,7 +1460,18 @@ public static ParticleSystem SetVelocityOverLifetimeY(this ParticleSystem partic /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeY(this ParticleSystem particleSystem, Func yChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeY( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func yChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(yChanger != null, "yChanger cannot be null"); @@ -1020,7 +1494,11 @@ public static VelocityOverLifetimeModule SetY(this VelocityOverLifetimeModule mo /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetY(this VelocityOverLifetimeModule module, Func yChanger) + public static VelocityOverLifetimeModule SetY(this VelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func yChanger) { Debug.Assert(yChanger != null, "yChanger cannot be null"); module.y = yChanger(module.y); @@ -1033,7 +1511,14 @@ public static VelocityOverLifetimeModule SetY(this VelocityOverLifetimeModule mo /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeYMultiplier(this ParticleSystem particleSystem, float yMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeYMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float yMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.velocityOverLifetime; @@ -1045,7 +1530,18 @@ public static ParticleSystem SetVelocityOverLifetimeYMultiplier(this ParticleSys /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeYMultiplier(this ParticleSystem particleSystem, Func yMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeYMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func yMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(yMultiplierChanger != null, "yMultiplierChanger cannot be null"); @@ -1068,7 +1564,11 @@ public static VelocityOverLifetimeModule SetYMultiplier(this VelocityOverLifetim /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetYMultiplier(this VelocityOverLifetimeModule module, Func yMultiplierChanger) + public static VelocityOverLifetimeModule SetYMultiplier(this VelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func yMultiplierChanger) { Debug.Assert(yMultiplierChanger != null, "yMultiplierChanger cannot be null"); module.yMultiplier = yMultiplierChanger(module.yMultiplier); @@ -1081,7 +1581,14 @@ public static VelocityOverLifetimeModule SetYMultiplier(this VelocityOverLifetim /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeZ(this ParticleSystem particleSystem, MinMaxCurve z) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeZ( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, MinMaxCurve z) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.velocityOverLifetime; @@ -1093,7 +1600,18 @@ public static ParticleSystem SetVelocityOverLifetimeZ(this ParticleSystem partic /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeZ(this ParticleSystem particleSystem, Func zChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeZ( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func zChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(zChanger != null, "zChanger cannot be null"); @@ -1116,7 +1634,11 @@ public static VelocityOverLifetimeModule SetZ(this VelocityOverLifetimeModule mo /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetZ(this VelocityOverLifetimeModule module, Func zChanger) + public static VelocityOverLifetimeModule SetZ(this VelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func zChanger) { Debug.Assert(zChanger != null, "zChanger cannot be null"); module.z = zChanger(module.z); @@ -1129,7 +1651,14 @@ public static VelocityOverLifetimeModule SetZ(this VelocityOverLifetimeModule mo /// Assign a value to /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeZMultiplier(this ParticleSystem particleSystem, float zMultiplier) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeZMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, float zMultiplier) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); var module = particleSystem.velocityOverLifetime; @@ -1141,7 +1670,18 @@ public static ParticleSystem SetVelocityOverLifetimeZMultiplier(this ParticleSys /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeZMultiplier(this ParticleSystem particleSystem, Func zMultiplierChanger) +#if UNITY_2020_2_OR_NEWER + [return: NotNull] +#endif + public static ParticleSystem SetVelocityOverLifetimeZMultiplier( +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + this ParticleSystem particleSystem, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func zMultiplierChanger) { Debug.Assert(particleSystem != null, "particleSystem cannot be null"); Debug.Assert(zMultiplierChanger != null, "zMultiplierChanger cannot be null"); @@ -1164,7 +1704,11 @@ public static VelocityOverLifetimeModule SetZMultiplier(this VelocityOverLifetim /// Edit /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetZMultiplier(this VelocityOverLifetimeModule module, Func zMultiplierChanger) + public static VelocityOverLifetimeModule SetZMultiplier(this VelocityOverLifetimeModule module, +#if UNITY_2020_2_OR_NEWER + [DisallowNull] +#endif + Func zMultiplierChanger) { Debug.Assert(zMultiplierChanger != null, "zMultiplierChanger cannot be null"); module.zMultiplier = zMultiplierChanger(module.zMultiplier); diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/VelocityOverLifetimeModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Extensions/VelocityOverLifetimeModuleExtension.cs.meta similarity index 100% rename from Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/VelocityOverLifetimeModuleExtension.cs.meta rename to Packages/FluentParticleSystem/Runtime/Extensions/VelocityOverLifetimeModuleExtension.cs.meta diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable.meta b/Packages/FluentParticleSystem/Runtime/NonNullable.meta deleted file mode 100644 index 606c871..0000000 --- a/Packages/FluentParticleSystem/Runtime/NonNullable.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: c5f77dd2d7d12e74f84703757554407b -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/CollisionModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/CollisionModuleExtension.cs deleted file mode 100644 index 0fad8e2..0000000 --- a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/CollisionModuleExtension.cs +++ /dev/null @@ -1,1140 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using UnityEngine; -using static UnityEngine.ParticleSystem; - -namespace OUCC.FluentParticleSystem -{ - public static class CollisionModuleExtension - { -#if UNITY_2018_4_OR_NEWER - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditCollision(this ParticleSystem particleSystem, Action moduleEditor) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); - moduleEditor(particleSystem.collision); - return particleSystem; - } - - #region Bounce - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionBounce(this ParticleSystem particleSystem, MinMaxCurve bounce) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.collision; - module.bounce = bounce; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionBounce(this ParticleSystem particleSystem, Func bounceChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(bounceChanger != null, "bounceChanger cannot be null"); - var module = particleSystem.collision; - module.bounce = bounceChanger(module.bounce); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetBounce(this CollisionModule module, MinMaxCurve bounce) - { - module.bounce = bounce; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetBounce(this CollisionModule module, Func bounceChanger) - { - Debug.Assert(bounceChanger != null, "bounceChanger cannot be null"); - module.bounce = bounceChanger(module.bounce); - return module; - } - #endregion - - #region BounceMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionBounceMultiplier(this ParticleSystem particleSystem, float bounceMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.collision; - module.bounceMultiplier = bounceMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionBounceMultiplier(this ParticleSystem particleSystem, Func bounceMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(bounceMultiplierChanger != null, "bounceMultiplierChanger cannot be null"); - var module = particleSystem.collision; - module.bounceMultiplier = bounceMultiplierChanger(module.bounceMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetBounceMultiplier(this CollisionModule module, float bounceMultiplier) - { - module.bounceMultiplier = bounceMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetBounceMultiplier(this CollisionModule module, Func bounceMultiplierChanger) - { - Debug.Assert(bounceMultiplierChanger != null, "bounceMultiplierChanger cannot be null"); - module.bounceMultiplier = bounceMultiplierChanger(module.bounceMultiplier); - return module; - } - #endregion - - #region ColliderForce - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionColliderForce(this ParticleSystem particleSystem, float colliderForce) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.collision; - module.colliderForce = colliderForce; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionColliderForce(this ParticleSystem particleSystem, Func colliderForceChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(colliderForceChanger != null, "colliderForceChanger cannot be null"); - var module = particleSystem.collision; - module.colliderForce = colliderForceChanger(module.colliderForce); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetColliderForce(this CollisionModule module, float colliderForce) - { - module.colliderForce = colliderForce; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetColliderForce(this CollisionModule module, Func colliderForceChanger) - { - Debug.Assert(colliderForceChanger != null, "colliderForceChanger cannot be null"); - module.colliderForce = colliderForceChanger(module.colliderForce); - return module; - } - #endregion - - #region CollidesWith - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionCollidesWith(this ParticleSystem particleSystem, LayerMask collidesWith) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.collision; - module.collidesWith = collidesWith; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionCollidesWith(this ParticleSystem particleSystem, Func collidesWithChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(collidesWithChanger != null, "collidesWithChanger cannot be null"); - var module = particleSystem.collision; - module.collidesWith = collidesWithChanger(module.collidesWith); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetCollidesWith(this CollisionModule module, LayerMask collidesWith) - { - module.collidesWith = collidesWith; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetCollidesWith(this CollisionModule module, Func collidesWithChanger) - { - Debug.Assert(collidesWithChanger != null, "collidesWithChanger cannot be null"); - module.collidesWith = collidesWithChanger(module.collidesWith); - return module; - } - #endregion - - #region Dampen - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionDampen(this ParticleSystem particleSystem, MinMaxCurve dampen) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.collision; - module.dampen = dampen; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionDampen(this ParticleSystem particleSystem, Func dampenChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(dampenChanger != null, "dampenChanger cannot be null"); - var module = particleSystem.collision; - module.dampen = dampenChanger(module.dampen); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetDampen(this CollisionModule module, MinMaxCurve dampen) - { - module.dampen = dampen; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetDampen(this CollisionModule module, Func dampenChanger) - { - Debug.Assert(dampenChanger != null, "dampenChanger cannot be null"); - module.dampen = dampenChanger(module.dampen); - return module; - } - #endregion - - #region DampenMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionDampenMultiplier(this ParticleSystem particleSystem, float dampenMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.collision; - module.dampenMultiplier = dampenMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionDampenMultiplier(this ParticleSystem particleSystem, Func dampenMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(dampenMultiplierChanger != null, "dampenMultiplierChanger cannot be null"); - var module = particleSystem.collision; - module.dampenMultiplier = dampenMultiplierChanger(module.dampenMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetDampenMultiplier(this CollisionModule module, float dampenMultiplier) - { - module.dampenMultiplier = dampenMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetDampenMultiplier(this CollisionModule module, Func dampenMultiplierChanger) - { - Debug.Assert(dampenMultiplierChanger != null, "dampenMultiplierChanger cannot be null"); - module.dampenMultiplier = dampenMultiplierChanger(module.dampenMultiplier); - return module; - } - #endregion - - #region Enabled - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionEnabled(this ParticleSystem particleSystem, bool enabled) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.collision; - module.enabled = enabled; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionEnabled(this ParticleSystem particleSystem, Func enabledChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - var module = particleSystem.collision; - module.enabled = enabledChanger(module.enabled); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetEnabled(this CollisionModule module, bool enabled) - { - module.enabled = enabled; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetEnabled(this CollisionModule module, Func enabledChanger) - { - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - module.enabled = enabledChanger(module.enabled); - return module; - } - #endregion - - #region EnableDynamicColliders - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionEnableDynamicColliders(this ParticleSystem particleSystem, bool enableDynamicColliders) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.collision; - module.enableDynamicColliders = enableDynamicColliders; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionEnableDynamicColliders(this ParticleSystem particleSystem, Func enableDynamicCollidersChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(enableDynamicCollidersChanger != null, "enableDynamicCollidersChanger cannot be null"); - var module = particleSystem.collision; - module.enableDynamicColliders = enableDynamicCollidersChanger(module.enableDynamicColliders); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetEnableDynamicColliders(this CollisionModule module, bool enableDynamicColliders) - { - module.enableDynamicColliders = enableDynamicColliders; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetEnableDynamicColliders(this CollisionModule module, Func enableDynamicCollidersChanger) - { - Debug.Assert(enableDynamicCollidersChanger != null, "enableDynamicCollidersChanger cannot be null"); - module.enableDynamicColliders = enableDynamicCollidersChanger(module.enableDynamicColliders); - return module; - } - #endregion - - #region EnableInteriorCollisions - /// - /// Assign a value to - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("enableInteriorCollisions property is deprecated and is no longer required and has no effect on the particle system.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionEnableInteriorCollisions(this ParticleSystem particleSystem, bool enableInteriorCollisions) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.collision; - module.enableInteriorCollisions = enableInteriorCollisions; - return particleSystem; - } - - /// - /// Edit - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("enableInteriorCollisions property is deprecated and is no longer required and has no effect on the particle system.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionEnableInteriorCollisions(this ParticleSystem particleSystem, Func enableInteriorCollisionsChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(enableInteriorCollisionsChanger != null, "enableInteriorCollisionsChanger cannot be null"); - var module = particleSystem.collision; - module.enableInteriorCollisions = enableInteriorCollisionsChanger(module.enableInteriorCollisions); - return particleSystem; - } - - /// - /// Assign a value to - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("enableInteriorCollisions property is deprecated and is no longer required and has no effect on the particle system.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetEnableInteriorCollisions(this CollisionModule module, bool enableInteriorCollisions) - { - module.enableInteriorCollisions = enableInteriorCollisions; - return module; - } - - /// - /// Edit - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("enableInteriorCollisions property is deprecated and is no longer required and has no effect on the particle system.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetEnableInteriorCollisions(this CollisionModule module, Func enableInteriorCollisionsChanger) - { - Debug.Assert(enableInteriorCollisionsChanger != null, "enableInteriorCollisionsChanger cannot be null"); - module.enableInteriorCollisions = enableInteriorCollisionsChanger(module.enableInteriorCollisions); - return module; - } - #endregion - - #region LifetimeLoss - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionLifetimeLoss(this ParticleSystem particleSystem, MinMaxCurve lifetimeLoss) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.collision; - module.lifetimeLoss = lifetimeLoss; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionLifetimeLoss(this ParticleSystem particleSystem, Func lifetimeLossChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(lifetimeLossChanger != null, "lifetimeLossChanger cannot be null"); - var module = particleSystem.collision; - module.lifetimeLoss = lifetimeLossChanger(module.lifetimeLoss); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetLifetimeLoss(this CollisionModule module, MinMaxCurve lifetimeLoss) - { - module.lifetimeLoss = lifetimeLoss; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetLifetimeLoss(this CollisionModule module, Func lifetimeLossChanger) - { - Debug.Assert(lifetimeLossChanger != null, "lifetimeLossChanger cannot be null"); - module.lifetimeLoss = lifetimeLossChanger(module.lifetimeLoss); - return module; - } - #endregion - - #region LifetimeLossMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionLifetimeLossMultiplier(this ParticleSystem particleSystem, float lifetimeLossMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.collision; - module.lifetimeLossMultiplier = lifetimeLossMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionLifetimeLossMultiplier(this ParticleSystem particleSystem, Func lifetimeLossMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(lifetimeLossMultiplierChanger != null, "lifetimeLossMultiplierChanger cannot be null"); - var module = particleSystem.collision; - module.lifetimeLossMultiplier = lifetimeLossMultiplierChanger(module.lifetimeLossMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetLifetimeLossMultiplier(this CollisionModule module, float lifetimeLossMultiplier) - { - module.lifetimeLossMultiplier = lifetimeLossMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetLifetimeLossMultiplier(this CollisionModule module, Func lifetimeLossMultiplierChanger) - { - Debug.Assert(lifetimeLossMultiplierChanger != null, "lifetimeLossMultiplierChanger cannot be null"); - module.lifetimeLossMultiplier = lifetimeLossMultiplierChanger(module.lifetimeLossMultiplier); - return module; - } - #endregion - - #region MaxCollisionShapes - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionMaxCollisionShapes(this ParticleSystem particleSystem, int maxCollisionShapes) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.collision; - module.maxCollisionShapes = maxCollisionShapes; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionMaxCollisionShapes(this ParticleSystem particleSystem, Func maxCollisionShapesChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(maxCollisionShapesChanger != null, "maxCollisionShapesChanger cannot be null"); - var module = particleSystem.collision; - module.maxCollisionShapes = maxCollisionShapesChanger(module.maxCollisionShapes); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetMaxCollisionShapes(this CollisionModule module, int maxCollisionShapes) - { - module.maxCollisionShapes = maxCollisionShapes; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetMaxCollisionShapes(this CollisionModule module, Func maxCollisionShapesChanger) - { - Debug.Assert(maxCollisionShapesChanger != null, "maxCollisionShapesChanger cannot be null"); - module.maxCollisionShapes = maxCollisionShapesChanger(module.maxCollisionShapes); - return module; - } - #endregion - - #region MaxKillSpeed - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionMaxKillSpeed(this ParticleSystem particleSystem, float maxKillSpeed) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.collision; - module.maxKillSpeed = maxKillSpeed; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionMaxKillSpeed(this ParticleSystem particleSystem, Func maxKillSpeedChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(maxKillSpeedChanger != null, "maxKillSpeedChanger cannot be null"); - var module = particleSystem.collision; - module.maxKillSpeed = maxKillSpeedChanger(module.maxKillSpeed); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetMaxKillSpeed(this CollisionModule module, float maxKillSpeed) - { - module.maxKillSpeed = maxKillSpeed; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetMaxKillSpeed(this CollisionModule module, Func maxKillSpeedChanger) - { - Debug.Assert(maxKillSpeedChanger != null, "maxKillSpeedChanger cannot be null"); - module.maxKillSpeed = maxKillSpeedChanger(module.maxKillSpeed); - return module; - } - #endregion - - #region MinKillSpeed - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionMinKillSpeed(this ParticleSystem particleSystem, float minKillSpeed) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.collision; - module.minKillSpeed = minKillSpeed; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionMinKillSpeed(this ParticleSystem particleSystem, Func minKillSpeedChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(minKillSpeedChanger != null, "minKillSpeedChanger cannot be null"); - var module = particleSystem.collision; - module.minKillSpeed = minKillSpeedChanger(module.minKillSpeed); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetMinKillSpeed(this CollisionModule module, float minKillSpeed) - { - module.minKillSpeed = minKillSpeed; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetMinKillSpeed(this CollisionModule module, Func minKillSpeedChanger) - { - Debug.Assert(minKillSpeedChanger != null, "minKillSpeedChanger cannot be null"); - module.minKillSpeed = minKillSpeedChanger(module.minKillSpeed); - return module; - } - #endregion - - #region Mode - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionMode(this ParticleSystem particleSystem, ParticleSystemCollisionMode mode) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.collision; - module.mode = mode; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionMode(this ParticleSystem particleSystem, Func modeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(modeChanger != null, "modeChanger cannot be null"); - var module = particleSystem.collision; - module.mode = modeChanger(module.mode); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetMode(this CollisionModule module, ParticleSystemCollisionMode mode) - { - module.mode = mode; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetMode(this CollisionModule module, Func modeChanger) - { - Debug.Assert(modeChanger != null, "modeChanger cannot be null"); - module.mode = modeChanger(module.mode); - return module; - } - #endregion - - #region MultiplyColliderForceByCollisionAngle - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionMultiplyColliderForceByCollisionAngle(this ParticleSystem particleSystem, bool multiplyColliderForceByCollisionAngle) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.collision; - module.multiplyColliderForceByCollisionAngle = multiplyColliderForceByCollisionAngle; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionMultiplyColliderForceByCollisionAngle(this ParticleSystem particleSystem, Func multiplyColliderForceByCollisionAngleChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(multiplyColliderForceByCollisionAngleChanger != null, "multiplyColliderForceByCollisionAngleChanger cannot be null"); - var module = particleSystem.collision; - module.multiplyColliderForceByCollisionAngle = multiplyColliderForceByCollisionAngleChanger(module.multiplyColliderForceByCollisionAngle); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetMultiplyColliderForceByCollisionAngle(this CollisionModule module, bool multiplyColliderForceByCollisionAngle) - { - module.multiplyColliderForceByCollisionAngle = multiplyColliderForceByCollisionAngle; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetMultiplyColliderForceByCollisionAngle(this CollisionModule module, Func multiplyColliderForceByCollisionAngleChanger) - { - Debug.Assert(multiplyColliderForceByCollisionAngleChanger != null, "multiplyColliderForceByCollisionAngleChanger cannot be null"); - module.multiplyColliderForceByCollisionAngle = multiplyColliderForceByCollisionAngleChanger(module.multiplyColliderForceByCollisionAngle); - return module; - } - #endregion - - #region MultiplyColliderForceByParticleSize - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionMultiplyColliderForceByParticleSize(this ParticleSystem particleSystem, bool multiplyColliderForceByParticleSize) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.collision; - module.multiplyColliderForceByParticleSize = multiplyColliderForceByParticleSize; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionMultiplyColliderForceByParticleSize(this ParticleSystem particleSystem, Func multiplyColliderForceByParticleSizeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(multiplyColliderForceByParticleSizeChanger != null, "multiplyColliderForceByParticleSizeChanger cannot be null"); - var module = particleSystem.collision; - module.multiplyColliderForceByParticleSize = multiplyColliderForceByParticleSizeChanger(module.multiplyColliderForceByParticleSize); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetMultiplyColliderForceByParticleSize(this CollisionModule module, bool multiplyColliderForceByParticleSize) - { - module.multiplyColliderForceByParticleSize = multiplyColliderForceByParticleSize; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetMultiplyColliderForceByParticleSize(this CollisionModule module, Func multiplyColliderForceByParticleSizeChanger) - { - Debug.Assert(multiplyColliderForceByParticleSizeChanger != null, "multiplyColliderForceByParticleSizeChanger cannot be null"); - module.multiplyColliderForceByParticleSize = multiplyColliderForceByParticleSizeChanger(module.multiplyColliderForceByParticleSize); - return module; - } - #endregion - - #region MultiplyColliderForceByParticleSpeed - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionMultiplyColliderForceByParticleSpeed(this ParticleSystem particleSystem, bool multiplyColliderForceByParticleSpeed) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.collision; - module.multiplyColliderForceByParticleSpeed = multiplyColliderForceByParticleSpeed; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionMultiplyColliderForceByParticleSpeed(this ParticleSystem particleSystem, Func multiplyColliderForceByParticleSpeedChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(multiplyColliderForceByParticleSpeedChanger != null, "multiplyColliderForceByParticleSpeedChanger cannot be null"); - var module = particleSystem.collision; - module.multiplyColliderForceByParticleSpeed = multiplyColliderForceByParticleSpeedChanger(module.multiplyColliderForceByParticleSpeed); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetMultiplyColliderForceByParticleSpeed(this CollisionModule module, bool multiplyColliderForceByParticleSpeed) - { - module.multiplyColliderForceByParticleSpeed = multiplyColliderForceByParticleSpeed; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetMultiplyColliderForceByParticleSpeed(this CollisionModule module, Func multiplyColliderForceByParticleSpeedChanger) - { - Debug.Assert(multiplyColliderForceByParticleSpeedChanger != null, "multiplyColliderForceByParticleSpeedChanger cannot be null"); - module.multiplyColliderForceByParticleSpeed = multiplyColliderForceByParticleSpeedChanger(module.multiplyColliderForceByParticleSpeed); - return module; - } - #endregion - - #region Quality - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionQuality(this ParticleSystem particleSystem, ParticleSystemCollisionQuality quality) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.collision; - module.quality = quality; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionQuality(this ParticleSystem particleSystem, Func qualityChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(qualityChanger != null, "qualityChanger cannot be null"); - var module = particleSystem.collision; - module.quality = qualityChanger(module.quality); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetQuality(this CollisionModule module, ParticleSystemCollisionQuality quality) - { - module.quality = quality; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetQuality(this CollisionModule module, Func qualityChanger) - { - Debug.Assert(qualityChanger != null, "qualityChanger cannot be null"); - module.quality = qualityChanger(module.quality); - return module; - } - #endregion - - #region RadiusScale - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionRadiusScale(this ParticleSystem particleSystem, float radiusScale) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.collision; - module.radiusScale = radiusScale; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionRadiusScale(this ParticleSystem particleSystem, Func radiusScaleChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(radiusScaleChanger != null, "radiusScaleChanger cannot be null"); - var module = particleSystem.collision; - module.radiusScale = radiusScaleChanger(module.radiusScale); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetRadiusScale(this CollisionModule module, float radiusScale) - { - module.radiusScale = radiusScale; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetRadiusScale(this CollisionModule module, Func radiusScaleChanger) - { - Debug.Assert(radiusScaleChanger != null, "radiusScaleChanger cannot be null"); - module.radiusScale = radiusScaleChanger(module.radiusScale); - return module; - } - #endregion - - #region SendCollisionMessages - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionSendCollisionMessages(this ParticleSystem particleSystem, bool sendCollisionMessages) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.collision; - module.sendCollisionMessages = sendCollisionMessages; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionSendCollisionMessages(this ParticleSystem particleSystem, Func sendCollisionMessagesChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(sendCollisionMessagesChanger != null, "sendCollisionMessagesChanger cannot be null"); - var module = particleSystem.collision; - module.sendCollisionMessages = sendCollisionMessagesChanger(module.sendCollisionMessages); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetSendCollisionMessages(this CollisionModule module, bool sendCollisionMessages) - { - module.sendCollisionMessages = sendCollisionMessages; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetSendCollisionMessages(this CollisionModule module, Func sendCollisionMessagesChanger) - { - Debug.Assert(sendCollisionMessagesChanger != null, "sendCollisionMessagesChanger cannot be null"); - module.sendCollisionMessages = sendCollisionMessagesChanger(module.sendCollisionMessages); - return module; - } - #endregion - - #region Type - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionType(this ParticleSystem particleSystem, ParticleSystemCollisionType type) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.collision; - module.type = type; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionType(this ParticleSystem particleSystem, Func typeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(typeChanger != null, "typeChanger cannot be null"); - var module = particleSystem.collision; - module.type = typeChanger(module.type); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetType(this CollisionModule module, ParticleSystemCollisionType type) - { - module.type = type; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetType(this CollisionModule module, Func typeChanger) - { - Debug.Assert(typeChanger != null, "typeChanger cannot be null"); - module.type = typeChanger(module.type); - return module; - } - #endregion - - #region VoxelSize - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionVoxelSize(this ParticleSystem particleSystem, float voxelSize) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.collision; - module.voxelSize = voxelSize; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCollisionVoxelSize(this ParticleSystem particleSystem, Func voxelSizeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(voxelSizeChanger != null, "voxelSizeChanger cannot be null"); - var module = particleSystem.collision; - module.voxelSize = voxelSizeChanger(module.voxelSize); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetVoxelSize(this CollisionModule module, float voxelSize) - { - module.voxelSize = voxelSize; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CollisionModule SetVoxelSize(this CollisionModule module, Func voxelSizeChanger) - { - Debug.Assert(voxelSizeChanger != null, "voxelSizeChanger cannot be null"); - module.voxelSize = voxelSizeChanger(module.voxelSize); - return module; - } - #endregion -#endif - } -} diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/ColorBySpeedModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/ColorBySpeedModuleExtension.cs deleted file mode 100644 index 584364d..0000000 --- a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/ColorBySpeedModuleExtension.cs +++ /dev/null @@ -1,168 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using UnityEngine; -using static UnityEngine.ParticleSystem; - -namespace OUCC.FluentParticleSystem -{ - public static class ColorBySpeedModuleExtension - { -#if UNITY_2018_4_OR_NEWER - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditColorBySpeed(this ParticleSystem particleSystem, Action moduleEditor) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); - moduleEditor(particleSystem.colorBySpeed); - return particleSystem; - } - - #region Color - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetColorBySpeedColor(this ParticleSystem particleSystem, MinMaxGradient color) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.colorBySpeed; - module.color = color; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetColorBySpeedColor(this ParticleSystem particleSystem, Func colorChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(colorChanger != null, "colorChanger cannot be null"); - var module = particleSystem.colorBySpeed; - module.color = colorChanger(module.color); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ColorBySpeedModule SetColor(this ColorBySpeedModule module, MinMaxGradient color) - { - module.color = color; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ColorBySpeedModule SetColor(this ColorBySpeedModule module, Func colorChanger) - { - Debug.Assert(colorChanger != null, "colorChanger cannot be null"); - module.color = colorChanger(module.color); - return module; - } - #endregion - - #region Enabled - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetColorBySpeedEnabled(this ParticleSystem particleSystem, bool enabled) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.colorBySpeed; - module.enabled = enabled; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetColorBySpeedEnabled(this ParticleSystem particleSystem, Func enabledChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - var module = particleSystem.colorBySpeed; - module.enabled = enabledChanger(module.enabled); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ColorBySpeedModule SetEnabled(this ColorBySpeedModule module, bool enabled) - { - module.enabled = enabled; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ColorBySpeedModule SetEnabled(this ColorBySpeedModule module, Func enabledChanger) - { - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - module.enabled = enabledChanger(module.enabled); - return module; - } - #endregion - - #region Range - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetColorBySpeedRange(this ParticleSystem particleSystem, Vector2 range) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.colorBySpeed; - module.range = range; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetColorBySpeedRange(this ParticleSystem particleSystem, Func rangeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(rangeChanger != null, "rangeChanger cannot be null"); - var module = particleSystem.colorBySpeed; - module.range = rangeChanger(module.range); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ColorBySpeedModule SetRange(this ColorBySpeedModule module, Vector2 range) - { - module.range = range; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ColorBySpeedModule SetRange(this ColorBySpeedModule module, Func rangeChanger) - { - Debug.Assert(rangeChanger != null, "rangeChanger cannot be null"); - module.range = rangeChanger(module.range); - return module; - } - #endregion -#endif - } -} diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/LifetimeByEmitterSpeedModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/LifetimeByEmitterSpeedModuleExtension.cs deleted file mode 100644 index 2a63bc5..0000000 --- a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/LifetimeByEmitterSpeedModuleExtension.cs +++ /dev/null @@ -1,216 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using UnityEngine; -using static UnityEngine.ParticleSystem; - -namespace OUCC.FluentParticleSystem -{ - public static class LifetimeByEmitterSpeedModuleExtension - { -#if UNITY_2020_3_OR_NEWER - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditLifetimeByEmitterSpeed(this ParticleSystem particleSystem, Action moduleEditor) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); - moduleEditor(particleSystem.lifetimeByEmitterSpeed); - return particleSystem; - } - - #region Curve - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLifetimeByEmitterSpeedCurve(this ParticleSystem particleSystem, MinMaxCurve curve) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.lifetimeByEmitterSpeed; - module.curve = curve; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLifetimeByEmitterSpeedCurve(this ParticleSystem particleSystem, Func curveChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(curveChanger != null, "curveChanger cannot be null"); - var module = particleSystem.lifetimeByEmitterSpeed; - module.curve = curveChanger(module.curve); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LifetimeByEmitterSpeedModule SetCurve(this LifetimeByEmitterSpeedModule module, MinMaxCurve curve) - { - module.curve = curve; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LifetimeByEmitterSpeedModule SetCurve(this LifetimeByEmitterSpeedModule module, Func curveChanger) - { - Debug.Assert(curveChanger != null, "curveChanger cannot be null"); - module.curve = curveChanger(module.curve); - return module; - } - #endregion - - #region CurveMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLifetimeByEmitterSpeedCurveMultiplier(this ParticleSystem particleSystem, float curveMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.lifetimeByEmitterSpeed; - module.curveMultiplier = curveMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLifetimeByEmitterSpeedCurveMultiplier(this ParticleSystem particleSystem, Func curveMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(curveMultiplierChanger != null, "curveMultiplierChanger cannot be null"); - var module = particleSystem.lifetimeByEmitterSpeed; - module.curveMultiplier = curveMultiplierChanger(module.curveMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LifetimeByEmitterSpeedModule SetCurveMultiplier(this LifetimeByEmitterSpeedModule module, float curveMultiplier) - { - module.curveMultiplier = curveMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LifetimeByEmitterSpeedModule SetCurveMultiplier(this LifetimeByEmitterSpeedModule module, Func curveMultiplierChanger) - { - Debug.Assert(curveMultiplierChanger != null, "curveMultiplierChanger cannot be null"); - module.curveMultiplier = curveMultiplierChanger(module.curveMultiplier); - return module; - } - #endregion - - #region Enabled - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLifetimeByEmitterSpeedEnabled(this ParticleSystem particleSystem, bool enabled) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.lifetimeByEmitterSpeed; - module.enabled = enabled; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLifetimeByEmitterSpeedEnabled(this ParticleSystem particleSystem, Func enabledChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - var module = particleSystem.lifetimeByEmitterSpeed; - module.enabled = enabledChanger(module.enabled); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LifetimeByEmitterSpeedModule SetEnabled(this LifetimeByEmitterSpeedModule module, bool enabled) - { - module.enabled = enabled; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LifetimeByEmitterSpeedModule SetEnabled(this LifetimeByEmitterSpeedModule module, Func enabledChanger) - { - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - module.enabled = enabledChanger(module.enabled); - return module; - } - #endregion - - #region Range - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLifetimeByEmitterSpeedRange(this ParticleSystem particleSystem, Vector2 range) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.lifetimeByEmitterSpeed; - module.range = range; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLifetimeByEmitterSpeedRange(this ParticleSystem particleSystem, Func rangeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(rangeChanger != null, "rangeChanger cannot be null"); - var module = particleSystem.lifetimeByEmitterSpeed; - module.range = rangeChanger(module.range); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LifetimeByEmitterSpeedModule SetRange(this LifetimeByEmitterSpeedModule module, Vector2 range) - { - module.range = range; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LifetimeByEmitterSpeedModule SetRange(this LifetimeByEmitterSpeedModule module, Func rangeChanger) - { - Debug.Assert(rangeChanger != null, "rangeChanger cannot be null"); - module.range = rangeChanger(module.range); - return module; - } - #endregion -#endif - } -} diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/LightsModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/LightsModuleExtension.cs deleted file mode 100644 index 4f635a5..0000000 --- a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/LightsModuleExtension.cs +++ /dev/null @@ -1,600 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using UnityEngine; -using static UnityEngine.ParticleSystem; - -namespace OUCC.FluentParticleSystem -{ - public static class LightsModuleExtension - { -#if UNITY_2018_4_OR_NEWER - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditLights(this ParticleSystem particleSystem, Action moduleEditor) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); - moduleEditor(particleSystem.lights); - return particleSystem; - } - - #region AlphaAffectsIntensity - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsAlphaAffectsIntensity(this ParticleSystem particleSystem, bool alphaAffectsIntensity) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.lights; - module.alphaAffectsIntensity = alphaAffectsIntensity; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsAlphaAffectsIntensity(this ParticleSystem particleSystem, Func alphaAffectsIntensityChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(alphaAffectsIntensityChanger != null, "alphaAffectsIntensityChanger cannot be null"); - var module = particleSystem.lights; - module.alphaAffectsIntensity = alphaAffectsIntensityChanger(module.alphaAffectsIntensity); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LightsModule SetAlphaAffectsIntensity(this LightsModule module, bool alphaAffectsIntensity) - { - module.alphaAffectsIntensity = alphaAffectsIntensity; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LightsModule SetAlphaAffectsIntensity(this LightsModule module, Func alphaAffectsIntensityChanger) - { - Debug.Assert(alphaAffectsIntensityChanger != null, "alphaAffectsIntensityChanger cannot be null"); - module.alphaAffectsIntensity = alphaAffectsIntensityChanger(module.alphaAffectsIntensity); - return module; - } - #endregion - - #region Enabled - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsEnabled(this ParticleSystem particleSystem, bool enabled) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.lights; - module.enabled = enabled; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsEnabled(this ParticleSystem particleSystem, Func enabledChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - var module = particleSystem.lights; - module.enabled = enabledChanger(module.enabled); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LightsModule SetEnabled(this LightsModule module, bool enabled) - { - module.enabled = enabled; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LightsModule SetEnabled(this LightsModule module, Func enabledChanger) - { - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - module.enabled = enabledChanger(module.enabled); - return module; - } - #endregion - - #region Intensity - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsIntensity(this ParticleSystem particleSystem, MinMaxCurve intensity) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.lights; - module.intensity = intensity; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsIntensity(this ParticleSystem particleSystem, Func intensityChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(intensityChanger != null, "intensityChanger cannot be null"); - var module = particleSystem.lights; - module.intensity = intensityChanger(module.intensity); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LightsModule SetIntensity(this LightsModule module, MinMaxCurve intensity) - { - module.intensity = intensity; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LightsModule SetIntensity(this LightsModule module, Func intensityChanger) - { - Debug.Assert(intensityChanger != null, "intensityChanger cannot be null"); - module.intensity = intensityChanger(module.intensity); - return module; - } - #endregion - - #region IntensityMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsIntensityMultiplier(this ParticleSystem particleSystem, float intensityMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.lights; - module.intensityMultiplier = intensityMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsIntensityMultiplier(this ParticleSystem particleSystem, Func intensityMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(intensityMultiplierChanger != null, "intensityMultiplierChanger cannot be null"); - var module = particleSystem.lights; - module.intensityMultiplier = intensityMultiplierChanger(module.intensityMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LightsModule SetIntensityMultiplier(this LightsModule module, float intensityMultiplier) - { - module.intensityMultiplier = intensityMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LightsModule SetIntensityMultiplier(this LightsModule module, Func intensityMultiplierChanger) - { - Debug.Assert(intensityMultiplierChanger != null, "intensityMultiplierChanger cannot be null"); - module.intensityMultiplier = intensityMultiplierChanger(module.intensityMultiplier); - return module; - } - #endregion - - #region Light - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsLight(this ParticleSystem particleSystem, Light light) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.lights; - module.light = light; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsLight(this ParticleSystem particleSystem, Func lightChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(lightChanger != null, "lightChanger cannot be null"); - var module = particleSystem.lights; - module.light = lightChanger(module.light); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LightsModule SetLight(this LightsModule module, Light light) - { - module.light = light; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LightsModule SetLight(this LightsModule module, Func lightChanger) - { - Debug.Assert(lightChanger != null, "lightChanger cannot be null"); - module.light = lightChanger(module.light); - return module; - } - #endregion - - #region MaxLights - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsMaxLights(this ParticleSystem particleSystem, int maxLights) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.lights; - module.maxLights = maxLights; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsMaxLights(this ParticleSystem particleSystem, Func maxLightsChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(maxLightsChanger != null, "maxLightsChanger cannot be null"); - var module = particleSystem.lights; - module.maxLights = maxLightsChanger(module.maxLights); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LightsModule SetMaxLights(this LightsModule module, int maxLights) - { - module.maxLights = maxLights; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LightsModule SetMaxLights(this LightsModule module, Func maxLightsChanger) - { - Debug.Assert(maxLightsChanger != null, "maxLightsChanger cannot be null"); - module.maxLights = maxLightsChanger(module.maxLights); - return module; - } - #endregion - - #region Range - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsRange(this ParticleSystem particleSystem, MinMaxCurve range) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.lights; - module.range = range; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsRange(this ParticleSystem particleSystem, Func rangeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(rangeChanger != null, "rangeChanger cannot be null"); - var module = particleSystem.lights; - module.range = rangeChanger(module.range); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LightsModule SetRange(this LightsModule module, MinMaxCurve range) - { - module.range = range; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LightsModule SetRange(this LightsModule module, Func rangeChanger) - { - Debug.Assert(rangeChanger != null, "rangeChanger cannot be null"); - module.range = rangeChanger(module.range); - return module; - } - #endregion - - #region RangeMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsRangeMultiplier(this ParticleSystem particleSystem, float rangeMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.lights; - module.rangeMultiplier = rangeMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsRangeMultiplier(this ParticleSystem particleSystem, Func rangeMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(rangeMultiplierChanger != null, "rangeMultiplierChanger cannot be null"); - var module = particleSystem.lights; - module.rangeMultiplier = rangeMultiplierChanger(module.rangeMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LightsModule SetRangeMultiplier(this LightsModule module, float rangeMultiplier) - { - module.rangeMultiplier = rangeMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LightsModule SetRangeMultiplier(this LightsModule module, Func rangeMultiplierChanger) - { - Debug.Assert(rangeMultiplierChanger != null, "rangeMultiplierChanger cannot be null"); - module.rangeMultiplier = rangeMultiplierChanger(module.rangeMultiplier); - return module; - } - #endregion - - #region Ratio - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsRatio(this ParticleSystem particleSystem, float ratio) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.lights; - module.ratio = ratio; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsRatio(this ParticleSystem particleSystem, Func ratioChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(ratioChanger != null, "ratioChanger cannot be null"); - var module = particleSystem.lights; - module.ratio = ratioChanger(module.ratio); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LightsModule SetRatio(this LightsModule module, float ratio) - { - module.ratio = ratio; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LightsModule SetRatio(this LightsModule module, Func ratioChanger) - { - Debug.Assert(ratioChanger != null, "ratioChanger cannot be null"); - module.ratio = ratioChanger(module.ratio); - return module; - } - #endregion - - #region SizeAffectsRange - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsSizeAffectsRange(this ParticleSystem particleSystem, bool sizeAffectsRange) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.lights; - module.sizeAffectsRange = sizeAffectsRange; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsSizeAffectsRange(this ParticleSystem particleSystem, Func sizeAffectsRangeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(sizeAffectsRangeChanger != null, "sizeAffectsRangeChanger cannot be null"); - var module = particleSystem.lights; - module.sizeAffectsRange = sizeAffectsRangeChanger(module.sizeAffectsRange); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LightsModule SetSizeAffectsRange(this LightsModule module, bool sizeAffectsRange) - { - module.sizeAffectsRange = sizeAffectsRange; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LightsModule SetSizeAffectsRange(this LightsModule module, Func sizeAffectsRangeChanger) - { - Debug.Assert(sizeAffectsRangeChanger != null, "sizeAffectsRangeChanger cannot be null"); - module.sizeAffectsRange = sizeAffectsRangeChanger(module.sizeAffectsRange); - return module; - } - #endregion - - #region UseParticleColor - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsUseParticleColor(this ParticleSystem particleSystem, bool useParticleColor) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.lights; - module.useParticleColor = useParticleColor; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsUseParticleColor(this ParticleSystem particleSystem, Func useParticleColorChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(useParticleColorChanger != null, "useParticleColorChanger cannot be null"); - var module = particleSystem.lights; - module.useParticleColor = useParticleColorChanger(module.useParticleColor); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LightsModule SetUseParticleColor(this LightsModule module, bool useParticleColor) - { - module.useParticleColor = useParticleColor; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LightsModule SetUseParticleColor(this LightsModule module, Func useParticleColorChanger) - { - Debug.Assert(useParticleColorChanger != null, "useParticleColorChanger cannot be null"); - module.useParticleColor = useParticleColorChanger(module.useParticleColor); - return module; - } - #endregion - - #region UseRandomDistribution - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsUseRandomDistribution(this ParticleSystem particleSystem, bool useRandomDistribution) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.lights; - module.useRandomDistribution = useRandomDistribution; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLightsUseRandomDistribution(this ParticleSystem particleSystem, Func useRandomDistributionChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(useRandomDistributionChanger != null, "useRandomDistributionChanger cannot be null"); - var module = particleSystem.lights; - module.useRandomDistribution = useRandomDistributionChanger(module.useRandomDistribution); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LightsModule SetUseRandomDistribution(this LightsModule module, bool useRandomDistribution) - { - module.useRandomDistribution = useRandomDistribution; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LightsModule SetUseRandomDistribution(this LightsModule module, Func useRandomDistributionChanger) - { - Debug.Assert(useRandomDistributionChanger != null, "useRandomDistributionChanger cannot be null"); - module.useRandomDistribution = useRandomDistributionChanger(module.useRandomDistribution); - return module; - } - #endregion -#endif - } -} diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/NoiseModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/NoiseModuleExtension.cs deleted file mode 100644 index ffa2a29..0000000 --- a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/NoiseModuleExtension.cs +++ /dev/null @@ -1,1464 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using UnityEngine; -using static UnityEngine.ParticleSystem; - -namespace OUCC.FluentParticleSystem -{ - public static class NoiseModuleExtension - { -#if UNITY_2018_4_OR_NEWER - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditNoise(this ParticleSystem particleSystem, Action moduleEditor) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); - moduleEditor(particleSystem.noise); - return particleSystem; - } - - #region Damping - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseDamping(this ParticleSystem particleSystem, bool damping) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.noise; - module.damping = damping; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseDamping(this ParticleSystem particleSystem, Func dampingChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(dampingChanger != null, "dampingChanger cannot be null"); - var module = particleSystem.noise; - module.damping = dampingChanger(module.damping); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetDamping(this NoiseModule module, bool damping) - { - module.damping = damping; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetDamping(this NoiseModule module, Func dampingChanger) - { - Debug.Assert(dampingChanger != null, "dampingChanger cannot be null"); - module.damping = dampingChanger(module.damping); - return module; - } - #endregion - - #region Enabled - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseEnabled(this ParticleSystem particleSystem, bool enabled) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.noise; - module.enabled = enabled; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseEnabled(this ParticleSystem particleSystem, Func enabledChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - var module = particleSystem.noise; - module.enabled = enabledChanger(module.enabled); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetEnabled(this NoiseModule module, bool enabled) - { - module.enabled = enabled; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetEnabled(this NoiseModule module, Func enabledChanger) - { - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - module.enabled = enabledChanger(module.enabled); - return module; - } - #endregion - - #region Frequency - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseFrequency(this ParticleSystem particleSystem, float frequency) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.noise; - module.frequency = frequency; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseFrequency(this ParticleSystem particleSystem, Func frequencyChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(frequencyChanger != null, "frequencyChanger cannot be null"); - var module = particleSystem.noise; - module.frequency = frequencyChanger(module.frequency); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetFrequency(this NoiseModule module, float frequency) - { - module.frequency = frequency; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetFrequency(this NoiseModule module, Func frequencyChanger) - { - Debug.Assert(frequencyChanger != null, "frequencyChanger cannot be null"); - module.frequency = frequencyChanger(module.frequency); - return module; - } - #endregion - - #region OctaveCount - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseOctaveCount(this ParticleSystem particleSystem, int octaveCount) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.noise; - module.octaveCount = octaveCount; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseOctaveCount(this ParticleSystem particleSystem, Func octaveCountChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(octaveCountChanger != null, "octaveCountChanger cannot be null"); - var module = particleSystem.noise; - module.octaveCount = octaveCountChanger(module.octaveCount); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetOctaveCount(this NoiseModule module, int octaveCount) - { - module.octaveCount = octaveCount; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetOctaveCount(this NoiseModule module, Func octaveCountChanger) - { - Debug.Assert(octaveCountChanger != null, "octaveCountChanger cannot be null"); - module.octaveCount = octaveCountChanger(module.octaveCount); - return module; - } - #endregion - - #region OctaveMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseOctaveMultiplier(this ParticleSystem particleSystem, float octaveMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.noise; - module.octaveMultiplier = octaveMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseOctaveMultiplier(this ParticleSystem particleSystem, Func octaveMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(octaveMultiplierChanger != null, "octaveMultiplierChanger cannot be null"); - var module = particleSystem.noise; - module.octaveMultiplier = octaveMultiplierChanger(module.octaveMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetOctaveMultiplier(this NoiseModule module, float octaveMultiplier) - { - module.octaveMultiplier = octaveMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetOctaveMultiplier(this NoiseModule module, Func octaveMultiplierChanger) - { - Debug.Assert(octaveMultiplierChanger != null, "octaveMultiplierChanger cannot be null"); - module.octaveMultiplier = octaveMultiplierChanger(module.octaveMultiplier); - return module; - } - #endregion - - #region OctaveScale - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseOctaveScale(this ParticleSystem particleSystem, float octaveScale) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.noise; - module.octaveScale = octaveScale; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseOctaveScale(this ParticleSystem particleSystem, Func octaveScaleChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(octaveScaleChanger != null, "octaveScaleChanger cannot be null"); - var module = particleSystem.noise; - module.octaveScale = octaveScaleChanger(module.octaveScale); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetOctaveScale(this NoiseModule module, float octaveScale) - { - module.octaveScale = octaveScale; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetOctaveScale(this NoiseModule module, Func octaveScaleChanger) - { - Debug.Assert(octaveScaleChanger != null, "octaveScaleChanger cannot be null"); - module.octaveScale = octaveScaleChanger(module.octaveScale); - return module; - } - #endregion - - #region PositionAmount - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoisePositionAmount(this ParticleSystem particleSystem, MinMaxCurve positionAmount) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.noise; - module.positionAmount = positionAmount; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoisePositionAmount(this ParticleSystem particleSystem, Func positionAmountChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(positionAmountChanger != null, "positionAmountChanger cannot be null"); - var module = particleSystem.noise; - module.positionAmount = positionAmountChanger(module.positionAmount); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetPositionAmount(this NoiseModule module, MinMaxCurve positionAmount) - { - module.positionAmount = positionAmount; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetPositionAmount(this NoiseModule module, Func positionAmountChanger) - { - Debug.Assert(positionAmountChanger != null, "positionAmountChanger cannot be null"); - module.positionAmount = positionAmountChanger(module.positionAmount); - return module; - } - #endregion - - #region Quality - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseQuality(this ParticleSystem particleSystem, ParticleSystemNoiseQuality quality) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.noise; - module.quality = quality; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseQuality(this ParticleSystem particleSystem, Func qualityChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(qualityChanger != null, "qualityChanger cannot be null"); - var module = particleSystem.noise; - module.quality = qualityChanger(module.quality); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetQuality(this NoiseModule module, ParticleSystemNoiseQuality quality) - { - module.quality = quality; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetQuality(this NoiseModule module, Func qualityChanger) - { - Debug.Assert(qualityChanger != null, "qualityChanger cannot be null"); - module.quality = qualityChanger(module.quality); - return module; - } - #endregion - - #region Remap - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRemap(this ParticleSystem particleSystem, MinMaxCurve remap) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.noise; - module.remap = remap; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRemap(this ParticleSystem particleSystem, Func remapChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(remapChanger != null, "remapChanger cannot be null"); - var module = particleSystem.noise; - module.remap = remapChanger(module.remap); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetRemap(this NoiseModule module, MinMaxCurve remap) - { - module.remap = remap; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetRemap(this NoiseModule module, Func remapChanger) - { - Debug.Assert(remapChanger != null, "remapChanger cannot be null"); - module.remap = remapChanger(module.remap); - return module; - } - #endregion - - #region RemapEnabled - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRemapEnabled(this ParticleSystem particleSystem, bool remapEnabled) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.noise; - module.remapEnabled = remapEnabled; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRemapEnabled(this ParticleSystem particleSystem, Func remapEnabledChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(remapEnabledChanger != null, "remapEnabledChanger cannot be null"); - var module = particleSystem.noise; - module.remapEnabled = remapEnabledChanger(module.remapEnabled); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetRemapEnabled(this NoiseModule module, bool remapEnabled) - { - module.remapEnabled = remapEnabled; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetRemapEnabled(this NoiseModule module, Func remapEnabledChanger) - { - Debug.Assert(remapEnabledChanger != null, "remapEnabledChanger cannot be null"); - module.remapEnabled = remapEnabledChanger(module.remapEnabled); - return module; - } - #endregion - - #region RemapMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRemapMultiplier(this ParticleSystem particleSystem, float remapMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.noise; - module.remapMultiplier = remapMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRemapMultiplier(this ParticleSystem particleSystem, Func remapMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(remapMultiplierChanger != null, "remapMultiplierChanger cannot be null"); - var module = particleSystem.noise; - module.remapMultiplier = remapMultiplierChanger(module.remapMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetRemapMultiplier(this NoiseModule module, float remapMultiplier) - { - module.remapMultiplier = remapMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetRemapMultiplier(this NoiseModule module, Func remapMultiplierChanger) - { - Debug.Assert(remapMultiplierChanger != null, "remapMultiplierChanger cannot be null"); - module.remapMultiplier = remapMultiplierChanger(module.remapMultiplier); - return module; - } - #endregion - - #region RemapX - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRemapX(this ParticleSystem particleSystem, MinMaxCurve remapX) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.noise; - module.remapX = remapX; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRemapX(this ParticleSystem particleSystem, Func remapXChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(remapXChanger != null, "remapXChanger cannot be null"); - var module = particleSystem.noise; - module.remapX = remapXChanger(module.remapX); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetRemapX(this NoiseModule module, MinMaxCurve remapX) - { - module.remapX = remapX; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetRemapX(this NoiseModule module, Func remapXChanger) - { - Debug.Assert(remapXChanger != null, "remapXChanger cannot be null"); - module.remapX = remapXChanger(module.remapX); - return module; - } - #endregion - - #region RemapXMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRemapXMultiplier(this ParticleSystem particleSystem, float remapXMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.noise; - module.remapXMultiplier = remapXMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRemapXMultiplier(this ParticleSystem particleSystem, Func remapXMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(remapXMultiplierChanger != null, "remapXMultiplierChanger cannot be null"); - var module = particleSystem.noise; - module.remapXMultiplier = remapXMultiplierChanger(module.remapXMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetRemapXMultiplier(this NoiseModule module, float remapXMultiplier) - { - module.remapXMultiplier = remapXMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetRemapXMultiplier(this NoiseModule module, Func remapXMultiplierChanger) - { - Debug.Assert(remapXMultiplierChanger != null, "remapXMultiplierChanger cannot be null"); - module.remapXMultiplier = remapXMultiplierChanger(module.remapXMultiplier); - return module; - } - #endregion - - #region RemapY - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRemapY(this ParticleSystem particleSystem, MinMaxCurve remapY) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.noise; - module.remapY = remapY; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRemapY(this ParticleSystem particleSystem, Func remapYChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(remapYChanger != null, "remapYChanger cannot be null"); - var module = particleSystem.noise; - module.remapY = remapYChanger(module.remapY); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetRemapY(this NoiseModule module, MinMaxCurve remapY) - { - module.remapY = remapY; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetRemapY(this NoiseModule module, Func remapYChanger) - { - Debug.Assert(remapYChanger != null, "remapYChanger cannot be null"); - module.remapY = remapYChanger(module.remapY); - return module; - } - #endregion - - #region RemapYMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRemapYMultiplier(this ParticleSystem particleSystem, float remapYMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.noise; - module.remapYMultiplier = remapYMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRemapYMultiplier(this ParticleSystem particleSystem, Func remapYMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(remapYMultiplierChanger != null, "remapYMultiplierChanger cannot be null"); - var module = particleSystem.noise; - module.remapYMultiplier = remapYMultiplierChanger(module.remapYMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetRemapYMultiplier(this NoiseModule module, float remapYMultiplier) - { - module.remapYMultiplier = remapYMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetRemapYMultiplier(this NoiseModule module, Func remapYMultiplierChanger) - { - Debug.Assert(remapYMultiplierChanger != null, "remapYMultiplierChanger cannot be null"); - module.remapYMultiplier = remapYMultiplierChanger(module.remapYMultiplier); - return module; - } - #endregion - - #region RemapZ - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRemapZ(this ParticleSystem particleSystem, MinMaxCurve remapZ) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.noise; - module.remapZ = remapZ; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRemapZ(this ParticleSystem particleSystem, Func remapZChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(remapZChanger != null, "remapZChanger cannot be null"); - var module = particleSystem.noise; - module.remapZ = remapZChanger(module.remapZ); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetRemapZ(this NoiseModule module, MinMaxCurve remapZ) - { - module.remapZ = remapZ; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetRemapZ(this NoiseModule module, Func remapZChanger) - { - Debug.Assert(remapZChanger != null, "remapZChanger cannot be null"); - module.remapZ = remapZChanger(module.remapZ); - return module; - } - #endregion - - #region RemapZMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRemapZMultiplier(this ParticleSystem particleSystem, float remapZMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.noise; - module.remapZMultiplier = remapZMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRemapZMultiplier(this ParticleSystem particleSystem, Func remapZMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(remapZMultiplierChanger != null, "remapZMultiplierChanger cannot be null"); - var module = particleSystem.noise; - module.remapZMultiplier = remapZMultiplierChanger(module.remapZMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetRemapZMultiplier(this NoiseModule module, float remapZMultiplier) - { - module.remapZMultiplier = remapZMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetRemapZMultiplier(this NoiseModule module, Func remapZMultiplierChanger) - { - Debug.Assert(remapZMultiplierChanger != null, "remapZMultiplierChanger cannot be null"); - module.remapZMultiplier = remapZMultiplierChanger(module.remapZMultiplier); - return module; - } - #endregion - - #region RotationAmount - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRotationAmount(this ParticleSystem particleSystem, MinMaxCurve rotationAmount) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.noise; - module.rotationAmount = rotationAmount; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseRotationAmount(this ParticleSystem particleSystem, Func rotationAmountChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(rotationAmountChanger != null, "rotationAmountChanger cannot be null"); - var module = particleSystem.noise; - module.rotationAmount = rotationAmountChanger(module.rotationAmount); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetRotationAmount(this NoiseModule module, MinMaxCurve rotationAmount) - { - module.rotationAmount = rotationAmount; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetRotationAmount(this NoiseModule module, Func rotationAmountChanger) - { - Debug.Assert(rotationAmountChanger != null, "rotationAmountChanger cannot be null"); - module.rotationAmount = rotationAmountChanger(module.rotationAmount); - return module; - } - #endregion - - #region ScrollSpeed - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseScrollSpeed(this ParticleSystem particleSystem, MinMaxCurve scrollSpeed) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.noise; - module.scrollSpeed = scrollSpeed; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseScrollSpeed(this ParticleSystem particleSystem, Func scrollSpeedChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(scrollSpeedChanger != null, "scrollSpeedChanger cannot be null"); - var module = particleSystem.noise; - module.scrollSpeed = scrollSpeedChanger(module.scrollSpeed); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetScrollSpeed(this NoiseModule module, MinMaxCurve scrollSpeed) - { - module.scrollSpeed = scrollSpeed; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetScrollSpeed(this NoiseModule module, Func scrollSpeedChanger) - { - Debug.Assert(scrollSpeedChanger != null, "scrollSpeedChanger cannot be null"); - module.scrollSpeed = scrollSpeedChanger(module.scrollSpeed); - return module; - } - #endregion - - #region ScrollSpeedMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseScrollSpeedMultiplier(this ParticleSystem particleSystem, float scrollSpeedMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.noise; - module.scrollSpeedMultiplier = scrollSpeedMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseScrollSpeedMultiplier(this ParticleSystem particleSystem, Func scrollSpeedMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(scrollSpeedMultiplierChanger != null, "scrollSpeedMultiplierChanger cannot be null"); - var module = particleSystem.noise; - module.scrollSpeedMultiplier = scrollSpeedMultiplierChanger(module.scrollSpeedMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetScrollSpeedMultiplier(this NoiseModule module, float scrollSpeedMultiplier) - { - module.scrollSpeedMultiplier = scrollSpeedMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetScrollSpeedMultiplier(this NoiseModule module, Func scrollSpeedMultiplierChanger) - { - Debug.Assert(scrollSpeedMultiplierChanger != null, "scrollSpeedMultiplierChanger cannot be null"); - module.scrollSpeedMultiplier = scrollSpeedMultiplierChanger(module.scrollSpeedMultiplier); - return module; - } - #endregion - - #region SeparateAxes - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseSeparateAxes(this ParticleSystem particleSystem, bool separateAxes) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.noise; - module.separateAxes = separateAxes; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseSeparateAxes(this ParticleSystem particleSystem, Func separateAxesChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(separateAxesChanger != null, "separateAxesChanger cannot be null"); - var module = particleSystem.noise; - module.separateAxes = separateAxesChanger(module.separateAxes); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetSeparateAxes(this NoiseModule module, bool separateAxes) - { - module.separateAxes = separateAxes; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetSeparateAxes(this NoiseModule module, Func separateAxesChanger) - { - Debug.Assert(separateAxesChanger != null, "separateAxesChanger cannot be null"); - module.separateAxes = separateAxesChanger(module.separateAxes); - return module; - } - #endregion - - #region SizeAmount - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseSizeAmount(this ParticleSystem particleSystem, MinMaxCurve sizeAmount) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.noise; - module.sizeAmount = sizeAmount; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseSizeAmount(this ParticleSystem particleSystem, Func sizeAmountChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(sizeAmountChanger != null, "sizeAmountChanger cannot be null"); - var module = particleSystem.noise; - module.sizeAmount = sizeAmountChanger(module.sizeAmount); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetSizeAmount(this NoiseModule module, MinMaxCurve sizeAmount) - { - module.sizeAmount = sizeAmount; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetSizeAmount(this NoiseModule module, Func sizeAmountChanger) - { - Debug.Assert(sizeAmountChanger != null, "sizeAmountChanger cannot be null"); - module.sizeAmount = sizeAmountChanger(module.sizeAmount); - return module; - } - #endregion - - #region Strength - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseStrength(this ParticleSystem particleSystem, MinMaxCurve strength) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.noise; - module.strength = strength; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseStrength(this ParticleSystem particleSystem, Func strengthChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(strengthChanger != null, "strengthChanger cannot be null"); - var module = particleSystem.noise; - module.strength = strengthChanger(module.strength); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetStrength(this NoiseModule module, MinMaxCurve strength) - { - module.strength = strength; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetStrength(this NoiseModule module, Func strengthChanger) - { - Debug.Assert(strengthChanger != null, "strengthChanger cannot be null"); - module.strength = strengthChanger(module.strength); - return module; - } - #endregion - - #region StrengthMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseStrengthMultiplier(this ParticleSystem particleSystem, float strengthMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.noise; - module.strengthMultiplier = strengthMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseStrengthMultiplier(this ParticleSystem particleSystem, Func strengthMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(strengthMultiplierChanger != null, "strengthMultiplierChanger cannot be null"); - var module = particleSystem.noise; - module.strengthMultiplier = strengthMultiplierChanger(module.strengthMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetStrengthMultiplier(this NoiseModule module, float strengthMultiplier) - { - module.strengthMultiplier = strengthMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetStrengthMultiplier(this NoiseModule module, Func strengthMultiplierChanger) - { - Debug.Assert(strengthMultiplierChanger != null, "strengthMultiplierChanger cannot be null"); - module.strengthMultiplier = strengthMultiplierChanger(module.strengthMultiplier); - return module; - } - #endregion - - #region StrengthX - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseStrengthX(this ParticleSystem particleSystem, MinMaxCurve strengthX) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.noise; - module.strengthX = strengthX; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseStrengthX(this ParticleSystem particleSystem, Func strengthXChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(strengthXChanger != null, "strengthXChanger cannot be null"); - var module = particleSystem.noise; - module.strengthX = strengthXChanger(module.strengthX); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetStrengthX(this NoiseModule module, MinMaxCurve strengthX) - { - module.strengthX = strengthX; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetStrengthX(this NoiseModule module, Func strengthXChanger) - { - Debug.Assert(strengthXChanger != null, "strengthXChanger cannot be null"); - module.strengthX = strengthXChanger(module.strengthX); - return module; - } - #endregion - - #region StrengthXMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseStrengthXMultiplier(this ParticleSystem particleSystem, float strengthXMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.noise; - module.strengthXMultiplier = strengthXMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseStrengthXMultiplier(this ParticleSystem particleSystem, Func strengthXMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(strengthXMultiplierChanger != null, "strengthXMultiplierChanger cannot be null"); - var module = particleSystem.noise; - module.strengthXMultiplier = strengthXMultiplierChanger(module.strengthXMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetStrengthXMultiplier(this NoiseModule module, float strengthXMultiplier) - { - module.strengthXMultiplier = strengthXMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetStrengthXMultiplier(this NoiseModule module, Func strengthXMultiplierChanger) - { - Debug.Assert(strengthXMultiplierChanger != null, "strengthXMultiplierChanger cannot be null"); - module.strengthXMultiplier = strengthXMultiplierChanger(module.strengthXMultiplier); - return module; - } - #endregion - - #region StrengthY - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseStrengthY(this ParticleSystem particleSystem, MinMaxCurve strengthY) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.noise; - module.strengthY = strengthY; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseStrengthY(this ParticleSystem particleSystem, Func strengthYChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(strengthYChanger != null, "strengthYChanger cannot be null"); - var module = particleSystem.noise; - module.strengthY = strengthYChanger(module.strengthY); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetStrengthY(this NoiseModule module, MinMaxCurve strengthY) - { - module.strengthY = strengthY; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetStrengthY(this NoiseModule module, Func strengthYChanger) - { - Debug.Assert(strengthYChanger != null, "strengthYChanger cannot be null"); - module.strengthY = strengthYChanger(module.strengthY); - return module; - } - #endregion - - #region StrengthYMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseStrengthYMultiplier(this ParticleSystem particleSystem, float strengthYMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.noise; - module.strengthYMultiplier = strengthYMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseStrengthYMultiplier(this ParticleSystem particleSystem, Func strengthYMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(strengthYMultiplierChanger != null, "strengthYMultiplierChanger cannot be null"); - var module = particleSystem.noise; - module.strengthYMultiplier = strengthYMultiplierChanger(module.strengthYMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetStrengthYMultiplier(this NoiseModule module, float strengthYMultiplier) - { - module.strengthYMultiplier = strengthYMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetStrengthYMultiplier(this NoiseModule module, Func strengthYMultiplierChanger) - { - Debug.Assert(strengthYMultiplierChanger != null, "strengthYMultiplierChanger cannot be null"); - module.strengthYMultiplier = strengthYMultiplierChanger(module.strengthYMultiplier); - return module; - } - #endregion - - #region StrengthZ - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseStrengthZ(this ParticleSystem particleSystem, MinMaxCurve strengthZ) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.noise; - module.strengthZ = strengthZ; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseStrengthZ(this ParticleSystem particleSystem, Func strengthZChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(strengthZChanger != null, "strengthZChanger cannot be null"); - var module = particleSystem.noise; - module.strengthZ = strengthZChanger(module.strengthZ); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetStrengthZ(this NoiseModule module, MinMaxCurve strengthZ) - { - module.strengthZ = strengthZ; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetStrengthZ(this NoiseModule module, Func strengthZChanger) - { - Debug.Assert(strengthZChanger != null, "strengthZChanger cannot be null"); - module.strengthZ = strengthZChanger(module.strengthZ); - return module; - } - #endregion - - #region StrengthZMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseStrengthZMultiplier(this ParticleSystem particleSystem, float strengthZMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.noise; - module.strengthZMultiplier = strengthZMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetNoiseStrengthZMultiplier(this ParticleSystem particleSystem, Func strengthZMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(strengthZMultiplierChanger != null, "strengthZMultiplierChanger cannot be null"); - var module = particleSystem.noise; - module.strengthZMultiplier = strengthZMultiplierChanger(module.strengthZMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetStrengthZMultiplier(this NoiseModule module, float strengthZMultiplier) - { - module.strengthZMultiplier = strengthZMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static NoiseModule SetStrengthZMultiplier(this NoiseModule module, Func strengthZMultiplierChanger) - { - Debug.Assert(strengthZMultiplierChanger != null, "strengthZMultiplierChanger cannot be null"); - module.strengthZMultiplier = strengthZMultiplierChanger(module.strengthZMultiplier); - return module; - } - #endregion -#endif - } -} diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/RotationOverLifetimeModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/RotationOverLifetimeModuleExtension.cs deleted file mode 100644 index 7da0197..0000000 --- a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/RotationOverLifetimeModuleExtension.cs +++ /dev/null @@ -1,408 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using UnityEngine; -using static UnityEngine.ParticleSystem; - -namespace OUCC.FluentParticleSystem -{ - public static class RotationOverLifetimeModuleExtension - { -#if UNITY_2018_4_OR_NEWER - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditRotationOverLifetime(this ParticleSystem particleSystem, Action moduleEditor) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); - moduleEditor(particleSystem.rotationOverLifetime); - return particleSystem; - } - - #region Enabled - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationOverLifetimeEnabled(this ParticleSystem particleSystem, bool enabled) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.rotationOverLifetime; - module.enabled = enabled; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationOverLifetimeEnabled(this ParticleSystem particleSystem, Func enabledChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - var module = particleSystem.rotationOverLifetime; - module.enabled = enabledChanger(module.enabled); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationOverLifetimeModule SetEnabled(this RotationOverLifetimeModule module, bool enabled) - { - module.enabled = enabled; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationOverLifetimeModule SetEnabled(this RotationOverLifetimeModule module, Func enabledChanger) - { - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - module.enabled = enabledChanger(module.enabled); - return module; - } - #endregion - - #region SeparateAxes - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationOverLifetimeSeparateAxes(this ParticleSystem particleSystem, bool separateAxes) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.rotationOverLifetime; - module.separateAxes = separateAxes; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationOverLifetimeSeparateAxes(this ParticleSystem particleSystem, Func separateAxesChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(separateAxesChanger != null, "separateAxesChanger cannot be null"); - var module = particleSystem.rotationOverLifetime; - module.separateAxes = separateAxesChanger(module.separateAxes); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationOverLifetimeModule SetSeparateAxes(this RotationOverLifetimeModule module, bool separateAxes) - { - module.separateAxes = separateAxes; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationOverLifetimeModule SetSeparateAxes(this RotationOverLifetimeModule module, Func separateAxesChanger) - { - Debug.Assert(separateAxesChanger != null, "separateAxesChanger cannot be null"); - module.separateAxes = separateAxesChanger(module.separateAxes); - return module; - } - #endregion - - #region X - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationOverLifetimeX(this ParticleSystem particleSystem, MinMaxCurve x) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.rotationOverLifetime; - module.x = x; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationOverLifetimeX(this ParticleSystem particleSystem, Func xChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(xChanger != null, "xChanger cannot be null"); - var module = particleSystem.rotationOverLifetime; - module.x = xChanger(module.x); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationOverLifetimeModule SetX(this RotationOverLifetimeModule module, MinMaxCurve x) - { - module.x = x; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationOverLifetimeModule SetX(this RotationOverLifetimeModule module, Func xChanger) - { - Debug.Assert(xChanger != null, "xChanger cannot be null"); - module.x = xChanger(module.x); - return module; - } - #endregion - - #region XMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationOverLifetimeXMultiplier(this ParticleSystem particleSystem, float xMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.rotationOverLifetime; - module.xMultiplier = xMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationOverLifetimeXMultiplier(this ParticleSystem particleSystem, Func xMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(xMultiplierChanger != null, "xMultiplierChanger cannot be null"); - var module = particleSystem.rotationOverLifetime; - module.xMultiplier = xMultiplierChanger(module.xMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationOverLifetimeModule SetXMultiplier(this RotationOverLifetimeModule module, float xMultiplier) - { - module.xMultiplier = xMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationOverLifetimeModule SetXMultiplier(this RotationOverLifetimeModule module, Func xMultiplierChanger) - { - Debug.Assert(xMultiplierChanger != null, "xMultiplierChanger cannot be null"); - module.xMultiplier = xMultiplierChanger(module.xMultiplier); - return module; - } - #endregion - - #region Y - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationOverLifetimeY(this ParticleSystem particleSystem, MinMaxCurve y) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.rotationOverLifetime; - module.y = y; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationOverLifetimeY(this ParticleSystem particleSystem, Func yChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(yChanger != null, "yChanger cannot be null"); - var module = particleSystem.rotationOverLifetime; - module.y = yChanger(module.y); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationOverLifetimeModule SetY(this RotationOverLifetimeModule module, MinMaxCurve y) - { - module.y = y; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationOverLifetimeModule SetY(this RotationOverLifetimeModule module, Func yChanger) - { - Debug.Assert(yChanger != null, "yChanger cannot be null"); - module.y = yChanger(module.y); - return module; - } - #endregion - - #region YMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationOverLifetimeYMultiplier(this ParticleSystem particleSystem, float yMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.rotationOverLifetime; - module.yMultiplier = yMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationOverLifetimeYMultiplier(this ParticleSystem particleSystem, Func yMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(yMultiplierChanger != null, "yMultiplierChanger cannot be null"); - var module = particleSystem.rotationOverLifetime; - module.yMultiplier = yMultiplierChanger(module.yMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationOverLifetimeModule SetYMultiplier(this RotationOverLifetimeModule module, float yMultiplier) - { - module.yMultiplier = yMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationOverLifetimeModule SetYMultiplier(this RotationOverLifetimeModule module, Func yMultiplierChanger) - { - Debug.Assert(yMultiplierChanger != null, "yMultiplierChanger cannot be null"); - module.yMultiplier = yMultiplierChanger(module.yMultiplier); - return module; - } - #endregion - - #region Z - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationOverLifetimeZ(this ParticleSystem particleSystem, MinMaxCurve z) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.rotationOverLifetime; - module.z = z; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationOverLifetimeZ(this ParticleSystem particleSystem, Func zChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(zChanger != null, "zChanger cannot be null"); - var module = particleSystem.rotationOverLifetime; - module.z = zChanger(module.z); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationOverLifetimeModule SetZ(this RotationOverLifetimeModule module, MinMaxCurve z) - { - module.z = z; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationOverLifetimeModule SetZ(this RotationOverLifetimeModule module, Func zChanger) - { - Debug.Assert(zChanger != null, "zChanger cannot be null"); - module.z = zChanger(module.z); - return module; - } - #endregion - - #region ZMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationOverLifetimeZMultiplier(this ParticleSystem particleSystem, float zMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.rotationOverLifetime; - module.zMultiplier = zMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationOverLifetimeZMultiplier(this ParticleSystem particleSystem, Func zMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(zMultiplierChanger != null, "zMultiplierChanger cannot be null"); - var module = particleSystem.rotationOverLifetime; - module.zMultiplier = zMultiplierChanger(module.zMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationOverLifetimeModule SetZMultiplier(this RotationOverLifetimeModule module, float zMultiplier) - { - module.zMultiplier = zMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationOverLifetimeModule SetZMultiplier(this RotationOverLifetimeModule module, Func zMultiplierChanger) - { - Debug.Assert(zMultiplierChanger != null, "zMultiplierChanger cannot be null"); - module.zMultiplier = zMultiplierChanger(module.zMultiplier); - return module; - } - #endregion -#endif - } -} diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/ShapeModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/ShapeModuleExtension.cs deleted file mode 100644 index a6f388f..0000000 --- a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/ShapeModuleExtension.cs +++ /dev/null @@ -1,2364 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using UnityEngine; -using static UnityEngine.ParticleSystem; - -namespace OUCC.FluentParticleSystem -{ - public static class ShapeModuleExtension - { -#if UNITY_2018_4_OR_NEWER - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditShape(this ParticleSystem particleSystem, Action moduleEditor) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); - moduleEditor(particleSystem.shape); - return particleSystem; - } - - #region AlignToDirection - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeAlignToDirection(this ParticleSystem particleSystem, bool alignToDirection) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.alignToDirection = alignToDirection; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeAlignToDirection(this ParticleSystem particleSystem, Func alignToDirectionChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(alignToDirectionChanger != null, "alignToDirectionChanger cannot be null"); - var module = particleSystem.shape; - module.alignToDirection = alignToDirectionChanger(module.alignToDirection); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetAlignToDirection(this ShapeModule module, bool alignToDirection) - { - module.alignToDirection = alignToDirection; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetAlignToDirection(this ShapeModule module, Func alignToDirectionChanger) - { - Debug.Assert(alignToDirectionChanger != null, "alignToDirectionChanger cannot be null"); - module.alignToDirection = alignToDirectionChanger(module.alignToDirection); - return module; - } - #endregion - - #region Angle - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeAngle(this ParticleSystem particleSystem, float angle) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.angle = angle; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeAngle(this ParticleSystem particleSystem, Func angleChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(angleChanger != null, "angleChanger cannot be null"); - var module = particleSystem.shape; - module.angle = angleChanger(module.angle); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetAngle(this ShapeModule module, float angle) - { - module.angle = angle; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetAngle(this ShapeModule module, Func angleChanger) - { - Debug.Assert(angleChanger != null, "angleChanger cannot be null"); - module.angle = angleChanger(module.angle); - return module; - } - #endregion - - #region Arc - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeArc(this ParticleSystem particleSystem, float arc) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.arc = arc; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeArc(this ParticleSystem particleSystem, Func arcChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(arcChanger != null, "arcChanger cannot be null"); - var module = particleSystem.shape; - module.arc = arcChanger(module.arc); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetArc(this ShapeModule module, float arc) - { - module.arc = arc; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetArc(this ShapeModule module, Func arcChanger) - { - Debug.Assert(arcChanger != null, "arcChanger cannot be null"); - module.arc = arcChanger(module.arc); - return module; - } - #endregion - - #region ArcMode - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeArcMode(this ParticleSystem particleSystem, ParticleSystemShapeMultiModeValue arcMode) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.arcMode = arcMode; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeArcMode(this ParticleSystem particleSystem, Func arcModeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(arcModeChanger != null, "arcModeChanger cannot be null"); - var module = particleSystem.shape; - module.arcMode = arcModeChanger(module.arcMode); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetArcMode(this ShapeModule module, ParticleSystemShapeMultiModeValue arcMode) - { - module.arcMode = arcMode; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetArcMode(this ShapeModule module, Func arcModeChanger) - { - Debug.Assert(arcModeChanger != null, "arcModeChanger cannot be null"); - module.arcMode = arcModeChanger(module.arcMode); - return module; - } - #endregion - - #region ArcSpeed - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeArcSpeed(this ParticleSystem particleSystem, MinMaxCurve arcSpeed) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.arcSpeed = arcSpeed; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeArcSpeed(this ParticleSystem particleSystem, Func arcSpeedChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(arcSpeedChanger != null, "arcSpeedChanger cannot be null"); - var module = particleSystem.shape; - module.arcSpeed = arcSpeedChanger(module.arcSpeed); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetArcSpeed(this ShapeModule module, MinMaxCurve arcSpeed) - { - module.arcSpeed = arcSpeed; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetArcSpeed(this ShapeModule module, Func arcSpeedChanger) - { - Debug.Assert(arcSpeedChanger != null, "arcSpeedChanger cannot be null"); - module.arcSpeed = arcSpeedChanger(module.arcSpeed); - return module; - } - #endregion - - #region ArcSpeedMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeArcSpeedMultiplier(this ParticleSystem particleSystem, float arcSpeedMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.arcSpeedMultiplier = arcSpeedMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeArcSpeedMultiplier(this ParticleSystem particleSystem, Func arcSpeedMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(arcSpeedMultiplierChanger != null, "arcSpeedMultiplierChanger cannot be null"); - var module = particleSystem.shape; - module.arcSpeedMultiplier = arcSpeedMultiplierChanger(module.arcSpeedMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetArcSpeedMultiplier(this ShapeModule module, float arcSpeedMultiplier) - { - module.arcSpeedMultiplier = arcSpeedMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetArcSpeedMultiplier(this ShapeModule module, Func arcSpeedMultiplierChanger) - { - Debug.Assert(arcSpeedMultiplierChanger != null, "arcSpeedMultiplierChanger cannot be null"); - module.arcSpeedMultiplier = arcSpeedMultiplierChanger(module.arcSpeedMultiplier); - return module; - } - #endregion - - #region ArcSpread - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeArcSpread(this ParticleSystem particleSystem, float arcSpread) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.arcSpread = arcSpread; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeArcSpread(this ParticleSystem particleSystem, Func arcSpreadChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(arcSpreadChanger != null, "arcSpreadChanger cannot be null"); - var module = particleSystem.shape; - module.arcSpread = arcSpreadChanger(module.arcSpread); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetArcSpread(this ShapeModule module, float arcSpread) - { - module.arcSpread = arcSpread; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetArcSpread(this ShapeModule module, Func arcSpreadChanger) - { - Debug.Assert(arcSpreadChanger != null, "arcSpreadChanger cannot be null"); - module.arcSpread = arcSpreadChanger(module.arcSpread); - return module; - } - #endregion - - #region Box - /// - /// Assign a value to - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("Please use scale instead. (UnityUpgradable) -> UnityEngine.ParticleSystem/ShapeModule.scale", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeBox(this ParticleSystem particleSystem, Vector3 box) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.box = box; - return particleSystem; - } - - /// - /// Edit - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("Please use scale instead. (UnityUpgradable) -> UnityEngine.ParticleSystem/ShapeModule.scale", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeBox(this ParticleSystem particleSystem, Func boxChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(boxChanger != null, "boxChanger cannot be null"); - var module = particleSystem.shape; - module.box = boxChanger(module.box); - return particleSystem; - } - - /// - /// Assign a value to - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("Please use scale instead. (UnityUpgradable) -> UnityEngine.ParticleSystem/ShapeModule.scale", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetBox(this ShapeModule module, Vector3 box) - { - module.box = box; - return module; - } - - /// - /// Edit - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("Please use scale instead. (UnityUpgradable) -> UnityEngine.ParticleSystem/ShapeModule.scale", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetBox(this ShapeModule module, Func boxChanger) - { - Debug.Assert(boxChanger != null, "boxChanger cannot be null"); - module.box = boxChanger(module.box); - return module; - } - #endregion - - #region BoxThickness - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeBoxThickness(this ParticleSystem particleSystem, Vector3 boxThickness) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.boxThickness = boxThickness; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeBoxThickness(this ParticleSystem particleSystem, Func boxThicknessChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(boxThicknessChanger != null, "boxThicknessChanger cannot be null"); - var module = particleSystem.shape; - module.boxThickness = boxThicknessChanger(module.boxThickness); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetBoxThickness(this ShapeModule module, Vector3 boxThickness) - { - module.boxThickness = boxThickness; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetBoxThickness(this ShapeModule module, Func boxThicknessChanger) - { - Debug.Assert(boxThicknessChanger != null, "boxThicknessChanger cannot be null"); - module.boxThickness = boxThicknessChanger(module.boxThickness); - return module; - } - #endregion - - #region DonutRadius - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeDonutRadius(this ParticleSystem particleSystem, float donutRadius) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.donutRadius = donutRadius; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeDonutRadius(this ParticleSystem particleSystem, Func donutRadiusChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(donutRadiusChanger != null, "donutRadiusChanger cannot be null"); - var module = particleSystem.shape; - module.donutRadius = donutRadiusChanger(module.donutRadius); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetDonutRadius(this ShapeModule module, float donutRadius) - { - module.donutRadius = donutRadius; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetDonutRadius(this ShapeModule module, Func donutRadiusChanger) - { - Debug.Assert(donutRadiusChanger != null, "donutRadiusChanger cannot be null"); - module.donutRadius = donutRadiusChanger(module.donutRadius); - return module; - } - #endregion - - #region Enabled - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeEnabled(this ParticleSystem particleSystem, bool enabled) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.enabled = enabled; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeEnabled(this ParticleSystem particleSystem, Func enabledChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - var module = particleSystem.shape; - module.enabled = enabledChanger(module.enabled); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetEnabled(this ShapeModule module, bool enabled) - { - module.enabled = enabled; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetEnabled(this ShapeModule module, Func enabledChanger) - { - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - module.enabled = enabledChanger(module.enabled); - return module; - } - #endregion - - #region Length - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeLength(this ParticleSystem particleSystem, float length) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.length = length; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeLength(this ParticleSystem particleSystem, Func lengthChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(lengthChanger != null, "lengthChanger cannot be null"); - var module = particleSystem.shape; - module.length = lengthChanger(module.length); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetLength(this ShapeModule module, float length) - { - module.length = length; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetLength(this ShapeModule module, Func lengthChanger) - { - Debug.Assert(lengthChanger != null, "lengthChanger cannot be null"); - module.length = lengthChanger(module.length); - return module; - } - #endregion - - #region Mesh - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeMesh(this ParticleSystem particleSystem, Mesh mesh) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.mesh = mesh; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeMesh(this ParticleSystem particleSystem, Func meshChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(meshChanger != null, "meshChanger cannot be null"); - var module = particleSystem.shape; - module.mesh = meshChanger(module.mesh); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetMesh(this ShapeModule module, Mesh mesh) - { - module.mesh = mesh; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetMesh(this ShapeModule module, Func meshChanger) - { - Debug.Assert(meshChanger != null, "meshChanger cannot be null"); - module.mesh = meshChanger(module.mesh); - return module; - } - #endregion - - #region MeshMaterialIndex - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeMeshMaterialIndex(this ParticleSystem particleSystem, int meshMaterialIndex) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.meshMaterialIndex = meshMaterialIndex; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeMeshMaterialIndex(this ParticleSystem particleSystem, Func meshMaterialIndexChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(meshMaterialIndexChanger != null, "meshMaterialIndexChanger cannot be null"); - var module = particleSystem.shape; - module.meshMaterialIndex = meshMaterialIndexChanger(module.meshMaterialIndex); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetMeshMaterialIndex(this ShapeModule module, int meshMaterialIndex) - { - module.meshMaterialIndex = meshMaterialIndex; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetMeshMaterialIndex(this ShapeModule module, Func meshMaterialIndexChanger) - { - Debug.Assert(meshMaterialIndexChanger != null, "meshMaterialIndexChanger cannot be null"); - module.meshMaterialIndex = meshMaterialIndexChanger(module.meshMaterialIndex); - return module; - } - #endregion - - #region MeshRenderer - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeMeshRenderer(this ParticleSystem particleSystem, MeshRenderer meshRenderer) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.meshRenderer = meshRenderer; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeMeshRenderer(this ParticleSystem particleSystem, Func meshRendererChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(meshRendererChanger != null, "meshRendererChanger cannot be null"); - var module = particleSystem.shape; - module.meshRenderer = meshRendererChanger(module.meshRenderer); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetMeshRenderer(this ShapeModule module, MeshRenderer meshRenderer) - { - module.meshRenderer = meshRenderer; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetMeshRenderer(this ShapeModule module, Func meshRendererChanger) - { - Debug.Assert(meshRendererChanger != null, "meshRendererChanger cannot be null"); - module.meshRenderer = meshRendererChanger(module.meshRenderer); - return module; - } - #endregion - - #region MeshScale - /// - /// Assign a value to - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("meshScale property is deprecated.Please use scale instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeMeshScale(this ParticleSystem particleSystem, float meshScale) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.meshScale = meshScale; - return particleSystem; - } - - /// - /// Edit - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("meshScale property is deprecated.Please use scale instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeMeshScale(this ParticleSystem particleSystem, Func meshScaleChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(meshScaleChanger != null, "meshScaleChanger cannot be null"); - var module = particleSystem.shape; - module.meshScale = meshScaleChanger(module.meshScale); - return particleSystem; - } - - /// - /// Assign a value to - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("meshScale property is deprecated.Please use scale instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetMeshScale(this ShapeModule module, float meshScale) - { - module.meshScale = meshScale; - return module; - } - - /// - /// Edit - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("meshScale property is deprecated.Please use scale instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetMeshScale(this ShapeModule module, Func meshScaleChanger) - { - Debug.Assert(meshScaleChanger != null, "meshScaleChanger cannot be null"); - module.meshScale = meshScaleChanger(module.meshScale); - return module; - } - #endregion - - #region MeshShapeType - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeMeshShapeType(this ParticleSystem particleSystem, ParticleSystemMeshShapeType meshShapeType) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.meshShapeType = meshShapeType; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeMeshShapeType(this ParticleSystem particleSystem, Func meshShapeTypeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(meshShapeTypeChanger != null, "meshShapeTypeChanger cannot be null"); - var module = particleSystem.shape; - module.meshShapeType = meshShapeTypeChanger(module.meshShapeType); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetMeshShapeType(this ShapeModule module, ParticleSystemMeshShapeType meshShapeType) - { - module.meshShapeType = meshShapeType; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetMeshShapeType(this ShapeModule module, Func meshShapeTypeChanger) - { - Debug.Assert(meshShapeTypeChanger != null, "meshShapeTypeChanger cannot be null"); - module.meshShapeType = meshShapeTypeChanger(module.meshShapeType); - return module; - } - #endregion - - #region MeshSpawnMode - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeMeshSpawnMode(this ParticleSystem particleSystem, ParticleSystemShapeMultiModeValue meshSpawnMode) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.meshSpawnMode = meshSpawnMode; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeMeshSpawnMode(this ParticleSystem particleSystem, Func meshSpawnModeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(meshSpawnModeChanger != null, "meshSpawnModeChanger cannot be null"); - var module = particleSystem.shape; - module.meshSpawnMode = meshSpawnModeChanger(module.meshSpawnMode); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetMeshSpawnMode(this ShapeModule module, ParticleSystemShapeMultiModeValue meshSpawnMode) - { - module.meshSpawnMode = meshSpawnMode; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetMeshSpawnMode(this ShapeModule module, Func meshSpawnModeChanger) - { - Debug.Assert(meshSpawnModeChanger != null, "meshSpawnModeChanger cannot be null"); - module.meshSpawnMode = meshSpawnModeChanger(module.meshSpawnMode); - return module; - } - #endregion - - #region MeshSpawnSpeed - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeMeshSpawnSpeed(this ParticleSystem particleSystem, MinMaxCurve meshSpawnSpeed) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.meshSpawnSpeed = meshSpawnSpeed; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeMeshSpawnSpeed(this ParticleSystem particleSystem, Func meshSpawnSpeedChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(meshSpawnSpeedChanger != null, "meshSpawnSpeedChanger cannot be null"); - var module = particleSystem.shape; - module.meshSpawnSpeed = meshSpawnSpeedChanger(module.meshSpawnSpeed); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetMeshSpawnSpeed(this ShapeModule module, MinMaxCurve meshSpawnSpeed) - { - module.meshSpawnSpeed = meshSpawnSpeed; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetMeshSpawnSpeed(this ShapeModule module, Func meshSpawnSpeedChanger) - { - Debug.Assert(meshSpawnSpeedChanger != null, "meshSpawnSpeedChanger cannot be null"); - module.meshSpawnSpeed = meshSpawnSpeedChanger(module.meshSpawnSpeed); - return module; - } - #endregion - - #region MeshSpawnSpeedMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeMeshSpawnSpeedMultiplier(this ParticleSystem particleSystem, float meshSpawnSpeedMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.meshSpawnSpeedMultiplier = meshSpawnSpeedMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeMeshSpawnSpeedMultiplier(this ParticleSystem particleSystem, Func meshSpawnSpeedMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(meshSpawnSpeedMultiplierChanger != null, "meshSpawnSpeedMultiplierChanger cannot be null"); - var module = particleSystem.shape; - module.meshSpawnSpeedMultiplier = meshSpawnSpeedMultiplierChanger(module.meshSpawnSpeedMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetMeshSpawnSpeedMultiplier(this ShapeModule module, float meshSpawnSpeedMultiplier) - { - module.meshSpawnSpeedMultiplier = meshSpawnSpeedMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetMeshSpawnSpeedMultiplier(this ShapeModule module, Func meshSpawnSpeedMultiplierChanger) - { - Debug.Assert(meshSpawnSpeedMultiplierChanger != null, "meshSpawnSpeedMultiplierChanger cannot be null"); - module.meshSpawnSpeedMultiplier = meshSpawnSpeedMultiplierChanger(module.meshSpawnSpeedMultiplier); - return module; - } - #endregion - - #region MeshSpawnSpread - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeMeshSpawnSpread(this ParticleSystem particleSystem, float meshSpawnSpread) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.meshSpawnSpread = meshSpawnSpread; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeMeshSpawnSpread(this ParticleSystem particleSystem, Func meshSpawnSpreadChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(meshSpawnSpreadChanger != null, "meshSpawnSpreadChanger cannot be null"); - var module = particleSystem.shape; - module.meshSpawnSpread = meshSpawnSpreadChanger(module.meshSpawnSpread); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetMeshSpawnSpread(this ShapeModule module, float meshSpawnSpread) - { - module.meshSpawnSpread = meshSpawnSpread; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetMeshSpawnSpread(this ShapeModule module, Func meshSpawnSpreadChanger) - { - Debug.Assert(meshSpawnSpreadChanger != null, "meshSpawnSpreadChanger cannot be null"); - module.meshSpawnSpread = meshSpawnSpreadChanger(module.meshSpawnSpread); - return module; - } - #endregion - - #region NormalOffset - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeNormalOffset(this ParticleSystem particleSystem, float normalOffset) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.normalOffset = normalOffset; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeNormalOffset(this ParticleSystem particleSystem, Func normalOffsetChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(normalOffsetChanger != null, "normalOffsetChanger cannot be null"); - var module = particleSystem.shape; - module.normalOffset = normalOffsetChanger(module.normalOffset); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetNormalOffset(this ShapeModule module, float normalOffset) - { - module.normalOffset = normalOffset; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetNormalOffset(this ShapeModule module, Func normalOffsetChanger) - { - Debug.Assert(normalOffsetChanger != null, "normalOffsetChanger cannot be null"); - module.normalOffset = normalOffsetChanger(module.normalOffset); - return module; - } - #endregion - - #region Position - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapePosition(this ParticleSystem particleSystem, Vector3 position) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.position = position; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapePosition(this ParticleSystem particleSystem, Func positionChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(positionChanger != null, "positionChanger cannot be null"); - var module = particleSystem.shape; - module.position = positionChanger(module.position); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetPosition(this ShapeModule module, Vector3 position) - { - module.position = position; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetPosition(this ShapeModule module, Func positionChanger) - { - Debug.Assert(positionChanger != null, "positionChanger cannot be null"); - module.position = positionChanger(module.position); - return module; - } - #endregion - - #region Radius - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeRadius(this ParticleSystem particleSystem, float radius) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.radius = radius; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeRadius(this ParticleSystem particleSystem, Func radiusChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(radiusChanger != null, "radiusChanger cannot be null"); - var module = particleSystem.shape; - module.radius = radiusChanger(module.radius); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetRadius(this ShapeModule module, float radius) - { - module.radius = radius; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetRadius(this ShapeModule module, Func radiusChanger) - { - Debug.Assert(radiusChanger != null, "radiusChanger cannot be null"); - module.radius = radiusChanger(module.radius); - return module; - } - #endregion - - #region RadiusMode - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeRadiusMode(this ParticleSystem particleSystem, ParticleSystemShapeMultiModeValue radiusMode) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.radiusMode = radiusMode; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeRadiusMode(this ParticleSystem particleSystem, Func radiusModeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(radiusModeChanger != null, "radiusModeChanger cannot be null"); - var module = particleSystem.shape; - module.radiusMode = radiusModeChanger(module.radiusMode); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetRadiusMode(this ShapeModule module, ParticleSystemShapeMultiModeValue radiusMode) - { - module.radiusMode = radiusMode; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetRadiusMode(this ShapeModule module, Func radiusModeChanger) - { - Debug.Assert(radiusModeChanger != null, "radiusModeChanger cannot be null"); - module.radiusMode = radiusModeChanger(module.radiusMode); - return module; - } - #endregion - - #region RadiusSpeed - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeRadiusSpeed(this ParticleSystem particleSystem, MinMaxCurve radiusSpeed) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.radiusSpeed = radiusSpeed; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeRadiusSpeed(this ParticleSystem particleSystem, Func radiusSpeedChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(radiusSpeedChanger != null, "radiusSpeedChanger cannot be null"); - var module = particleSystem.shape; - module.radiusSpeed = radiusSpeedChanger(module.radiusSpeed); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetRadiusSpeed(this ShapeModule module, MinMaxCurve radiusSpeed) - { - module.radiusSpeed = radiusSpeed; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetRadiusSpeed(this ShapeModule module, Func radiusSpeedChanger) - { - Debug.Assert(radiusSpeedChanger != null, "radiusSpeedChanger cannot be null"); - module.radiusSpeed = radiusSpeedChanger(module.radiusSpeed); - return module; - } - #endregion - - #region RadiusSpeedMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeRadiusSpeedMultiplier(this ParticleSystem particleSystem, float radiusSpeedMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.radiusSpeedMultiplier = radiusSpeedMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeRadiusSpeedMultiplier(this ParticleSystem particleSystem, Func radiusSpeedMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(radiusSpeedMultiplierChanger != null, "radiusSpeedMultiplierChanger cannot be null"); - var module = particleSystem.shape; - module.radiusSpeedMultiplier = radiusSpeedMultiplierChanger(module.radiusSpeedMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetRadiusSpeedMultiplier(this ShapeModule module, float radiusSpeedMultiplier) - { - module.radiusSpeedMultiplier = radiusSpeedMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetRadiusSpeedMultiplier(this ShapeModule module, Func radiusSpeedMultiplierChanger) - { - Debug.Assert(radiusSpeedMultiplierChanger != null, "radiusSpeedMultiplierChanger cannot be null"); - module.radiusSpeedMultiplier = radiusSpeedMultiplierChanger(module.radiusSpeedMultiplier); - return module; - } - #endregion - - #region RadiusSpread - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeRadiusSpread(this ParticleSystem particleSystem, float radiusSpread) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.radiusSpread = radiusSpread; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeRadiusSpread(this ParticleSystem particleSystem, Func radiusSpreadChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(radiusSpreadChanger != null, "radiusSpreadChanger cannot be null"); - var module = particleSystem.shape; - module.radiusSpread = radiusSpreadChanger(module.radiusSpread); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetRadiusSpread(this ShapeModule module, float radiusSpread) - { - module.radiusSpread = radiusSpread; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetRadiusSpread(this ShapeModule module, Func radiusSpreadChanger) - { - Debug.Assert(radiusSpreadChanger != null, "radiusSpreadChanger cannot be null"); - module.radiusSpread = radiusSpreadChanger(module.radiusSpread); - return module; - } - #endregion - - #region RadiusThickness - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeRadiusThickness(this ParticleSystem particleSystem, float radiusThickness) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.radiusThickness = radiusThickness; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeRadiusThickness(this ParticleSystem particleSystem, Func radiusThicknessChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(radiusThicknessChanger != null, "radiusThicknessChanger cannot be null"); - var module = particleSystem.shape; - module.radiusThickness = radiusThicknessChanger(module.radiusThickness); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetRadiusThickness(this ShapeModule module, float radiusThickness) - { - module.radiusThickness = radiusThickness; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetRadiusThickness(this ShapeModule module, Func radiusThicknessChanger) - { - Debug.Assert(radiusThicknessChanger != null, "radiusThicknessChanger cannot be null"); - module.radiusThickness = radiusThicknessChanger(module.radiusThickness); - return module; - } - #endregion - - #region RandomDirection - /// - /// Assign a value to - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("randomDirection property is deprecated. Use randomDirectionAmount instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeRandomDirection(this ParticleSystem particleSystem, bool randomDirection) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.randomDirection = randomDirection; - return particleSystem; - } - - /// - /// Edit - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("randomDirection property is deprecated. Use randomDirectionAmount instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeRandomDirection(this ParticleSystem particleSystem, Func randomDirectionChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(randomDirectionChanger != null, "randomDirectionChanger cannot be null"); - var module = particleSystem.shape; - module.randomDirection = randomDirectionChanger(module.randomDirection); - return particleSystem; - } - - /// - /// Assign a value to - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("randomDirection property is deprecated. Use randomDirectionAmount instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetRandomDirection(this ShapeModule module, bool randomDirection) - { - module.randomDirection = randomDirection; - return module; - } - - /// - /// Edit - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("randomDirection property is deprecated. Use randomDirectionAmount instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetRandomDirection(this ShapeModule module, Func randomDirectionChanger) - { - Debug.Assert(randomDirectionChanger != null, "randomDirectionChanger cannot be null"); - module.randomDirection = randomDirectionChanger(module.randomDirection); - return module; - } - #endregion - - #region RandomDirectionAmount - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeRandomDirectionAmount(this ParticleSystem particleSystem, float randomDirectionAmount) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.randomDirectionAmount = randomDirectionAmount; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeRandomDirectionAmount(this ParticleSystem particleSystem, Func randomDirectionAmountChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(randomDirectionAmountChanger != null, "randomDirectionAmountChanger cannot be null"); - var module = particleSystem.shape; - module.randomDirectionAmount = randomDirectionAmountChanger(module.randomDirectionAmount); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetRandomDirectionAmount(this ShapeModule module, float randomDirectionAmount) - { - module.randomDirectionAmount = randomDirectionAmount; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetRandomDirectionAmount(this ShapeModule module, Func randomDirectionAmountChanger) - { - Debug.Assert(randomDirectionAmountChanger != null, "randomDirectionAmountChanger cannot be null"); - module.randomDirectionAmount = randomDirectionAmountChanger(module.randomDirectionAmount); - return module; - } - #endregion - - #region RandomPositionAmount - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeRandomPositionAmount(this ParticleSystem particleSystem, float randomPositionAmount) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.randomPositionAmount = randomPositionAmount; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeRandomPositionAmount(this ParticleSystem particleSystem, Func randomPositionAmountChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(randomPositionAmountChanger != null, "randomPositionAmountChanger cannot be null"); - var module = particleSystem.shape; - module.randomPositionAmount = randomPositionAmountChanger(module.randomPositionAmount); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetRandomPositionAmount(this ShapeModule module, float randomPositionAmount) - { - module.randomPositionAmount = randomPositionAmount; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetRandomPositionAmount(this ShapeModule module, Func randomPositionAmountChanger) - { - Debug.Assert(randomPositionAmountChanger != null, "randomPositionAmountChanger cannot be null"); - module.randomPositionAmount = randomPositionAmountChanger(module.randomPositionAmount); - return module; - } - #endregion - - #region Rotation - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeRotation(this ParticleSystem particleSystem, Vector3 rotation) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.rotation = rotation; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeRotation(this ParticleSystem particleSystem, Func rotationChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(rotationChanger != null, "rotationChanger cannot be null"); - var module = particleSystem.shape; - module.rotation = rotationChanger(module.rotation); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetRotation(this ShapeModule module, Vector3 rotation) - { - module.rotation = rotation; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetRotation(this ShapeModule module, Func rotationChanger) - { - Debug.Assert(rotationChanger != null, "rotationChanger cannot be null"); - module.rotation = rotationChanger(module.rotation); - return module; - } - #endregion - - #region Scale - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeScale(this ParticleSystem particleSystem, Vector3 scale) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.scale = scale; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeScale(this ParticleSystem particleSystem, Func scaleChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(scaleChanger != null, "scaleChanger cannot be null"); - var module = particleSystem.shape; - module.scale = scaleChanger(module.scale); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetScale(this ShapeModule module, Vector3 scale) - { - module.scale = scale; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetScale(this ShapeModule module, Func scaleChanger) - { - Debug.Assert(scaleChanger != null, "scaleChanger cannot be null"); - module.scale = scaleChanger(module.scale); - return module; - } - #endregion - - #region ShapeType - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeShapeType(this ParticleSystem particleSystem, ParticleSystemShapeType shapeType) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.shapeType = shapeType; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeShapeType(this ParticleSystem particleSystem, Func shapeTypeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(shapeTypeChanger != null, "shapeTypeChanger cannot be null"); - var module = particleSystem.shape; - module.shapeType = shapeTypeChanger(module.shapeType); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetShapeType(this ShapeModule module, ParticleSystemShapeType shapeType) - { - module.shapeType = shapeType; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetShapeType(this ShapeModule module, Func shapeTypeChanger) - { - Debug.Assert(shapeTypeChanger != null, "shapeTypeChanger cannot be null"); - module.shapeType = shapeTypeChanger(module.shapeType); - return module; - } - #endregion - - #region SkinnedMeshRenderer - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeSkinnedMeshRenderer(this ParticleSystem particleSystem, SkinnedMeshRenderer skinnedMeshRenderer) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.skinnedMeshRenderer = skinnedMeshRenderer; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeSkinnedMeshRenderer(this ParticleSystem particleSystem, Func skinnedMeshRendererChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(skinnedMeshRendererChanger != null, "skinnedMeshRendererChanger cannot be null"); - var module = particleSystem.shape; - module.skinnedMeshRenderer = skinnedMeshRendererChanger(module.skinnedMeshRenderer); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetSkinnedMeshRenderer(this ShapeModule module, SkinnedMeshRenderer skinnedMeshRenderer) - { - module.skinnedMeshRenderer = skinnedMeshRenderer; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetSkinnedMeshRenderer(this ShapeModule module, Func skinnedMeshRendererChanger) - { - Debug.Assert(skinnedMeshRendererChanger != null, "skinnedMeshRendererChanger cannot be null"); - module.skinnedMeshRenderer = skinnedMeshRendererChanger(module.skinnedMeshRenderer); - return module; - } - #endregion - - #region SphericalDirectionAmount - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeSphericalDirectionAmount(this ParticleSystem particleSystem, float sphericalDirectionAmount) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.sphericalDirectionAmount = sphericalDirectionAmount; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeSphericalDirectionAmount(this ParticleSystem particleSystem, Func sphericalDirectionAmountChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(sphericalDirectionAmountChanger != null, "sphericalDirectionAmountChanger cannot be null"); - var module = particleSystem.shape; - module.sphericalDirectionAmount = sphericalDirectionAmountChanger(module.sphericalDirectionAmount); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetSphericalDirectionAmount(this ShapeModule module, float sphericalDirectionAmount) - { - module.sphericalDirectionAmount = sphericalDirectionAmount; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetSphericalDirectionAmount(this ShapeModule module, Func sphericalDirectionAmountChanger) - { - Debug.Assert(sphericalDirectionAmountChanger != null, "sphericalDirectionAmountChanger cannot be null"); - module.sphericalDirectionAmount = sphericalDirectionAmountChanger(module.sphericalDirectionAmount); - return module; - } - #endregion - - #region Sprite - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeSprite(this ParticleSystem particleSystem, Sprite sprite) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.sprite = sprite; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeSprite(this ParticleSystem particleSystem, Func spriteChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(spriteChanger != null, "spriteChanger cannot be null"); - var module = particleSystem.shape; - module.sprite = spriteChanger(module.sprite); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetSprite(this ShapeModule module, Sprite sprite) - { - module.sprite = sprite; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetSprite(this ShapeModule module, Func spriteChanger) - { - Debug.Assert(spriteChanger != null, "spriteChanger cannot be null"); - module.sprite = spriteChanger(module.sprite); - return module; - } - #endregion - - #region SpriteRenderer - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeSpriteRenderer(this ParticleSystem particleSystem, SpriteRenderer spriteRenderer) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.spriteRenderer = spriteRenderer; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeSpriteRenderer(this ParticleSystem particleSystem, Func spriteRendererChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(spriteRendererChanger != null, "spriteRendererChanger cannot be null"); - var module = particleSystem.shape; - module.spriteRenderer = spriteRendererChanger(module.spriteRenderer); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetSpriteRenderer(this ShapeModule module, SpriteRenderer spriteRenderer) - { - module.spriteRenderer = spriteRenderer; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetSpriteRenderer(this ShapeModule module, Func spriteRendererChanger) - { - Debug.Assert(spriteRendererChanger != null, "spriteRendererChanger cannot be null"); - module.spriteRenderer = spriteRendererChanger(module.spriteRenderer); - return module; - } - #endregion - - #region Texture - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeTexture(this ParticleSystem particleSystem, Texture2D texture) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.texture = texture; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeTexture(this ParticleSystem particleSystem, Func textureChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(textureChanger != null, "textureChanger cannot be null"); - var module = particleSystem.shape; - module.texture = textureChanger(module.texture); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetTexture(this ShapeModule module, Texture2D texture) - { - module.texture = texture; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetTexture(this ShapeModule module, Func textureChanger) - { - Debug.Assert(textureChanger != null, "textureChanger cannot be null"); - module.texture = textureChanger(module.texture); - return module; - } - #endregion - - #region TextureAlphaAffectsParticles - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeTextureAlphaAffectsParticles(this ParticleSystem particleSystem, bool textureAlphaAffectsParticles) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.textureAlphaAffectsParticles = textureAlphaAffectsParticles; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeTextureAlphaAffectsParticles(this ParticleSystem particleSystem, Func textureAlphaAffectsParticlesChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(textureAlphaAffectsParticlesChanger != null, "textureAlphaAffectsParticlesChanger cannot be null"); - var module = particleSystem.shape; - module.textureAlphaAffectsParticles = textureAlphaAffectsParticlesChanger(module.textureAlphaAffectsParticles); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetTextureAlphaAffectsParticles(this ShapeModule module, bool textureAlphaAffectsParticles) - { - module.textureAlphaAffectsParticles = textureAlphaAffectsParticles; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetTextureAlphaAffectsParticles(this ShapeModule module, Func textureAlphaAffectsParticlesChanger) - { - Debug.Assert(textureAlphaAffectsParticlesChanger != null, "textureAlphaAffectsParticlesChanger cannot be null"); - module.textureAlphaAffectsParticles = textureAlphaAffectsParticlesChanger(module.textureAlphaAffectsParticles); - return module; - } - #endregion - - #region TextureBilinearFiltering - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeTextureBilinearFiltering(this ParticleSystem particleSystem, bool textureBilinearFiltering) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.textureBilinearFiltering = textureBilinearFiltering; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeTextureBilinearFiltering(this ParticleSystem particleSystem, Func textureBilinearFilteringChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(textureBilinearFilteringChanger != null, "textureBilinearFilteringChanger cannot be null"); - var module = particleSystem.shape; - module.textureBilinearFiltering = textureBilinearFilteringChanger(module.textureBilinearFiltering); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetTextureBilinearFiltering(this ShapeModule module, bool textureBilinearFiltering) - { - module.textureBilinearFiltering = textureBilinearFiltering; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetTextureBilinearFiltering(this ShapeModule module, Func textureBilinearFilteringChanger) - { - Debug.Assert(textureBilinearFilteringChanger != null, "textureBilinearFilteringChanger cannot be null"); - module.textureBilinearFiltering = textureBilinearFilteringChanger(module.textureBilinearFiltering); - return module; - } - #endregion - - #region TextureClipChannel - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeTextureClipChannel(this ParticleSystem particleSystem, ParticleSystemShapeTextureChannel textureClipChannel) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.textureClipChannel = textureClipChannel; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeTextureClipChannel(this ParticleSystem particleSystem, Func textureClipChannelChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(textureClipChannelChanger != null, "textureClipChannelChanger cannot be null"); - var module = particleSystem.shape; - module.textureClipChannel = textureClipChannelChanger(module.textureClipChannel); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetTextureClipChannel(this ShapeModule module, ParticleSystemShapeTextureChannel textureClipChannel) - { - module.textureClipChannel = textureClipChannel; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetTextureClipChannel(this ShapeModule module, Func textureClipChannelChanger) - { - Debug.Assert(textureClipChannelChanger != null, "textureClipChannelChanger cannot be null"); - module.textureClipChannel = textureClipChannelChanger(module.textureClipChannel); - return module; - } - #endregion - - #region TextureClipThreshold - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeTextureClipThreshold(this ParticleSystem particleSystem, float textureClipThreshold) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.textureClipThreshold = textureClipThreshold; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeTextureClipThreshold(this ParticleSystem particleSystem, Func textureClipThresholdChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(textureClipThresholdChanger != null, "textureClipThresholdChanger cannot be null"); - var module = particleSystem.shape; - module.textureClipThreshold = textureClipThresholdChanger(module.textureClipThreshold); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetTextureClipThreshold(this ShapeModule module, float textureClipThreshold) - { - module.textureClipThreshold = textureClipThreshold; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetTextureClipThreshold(this ShapeModule module, Func textureClipThresholdChanger) - { - Debug.Assert(textureClipThresholdChanger != null, "textureClipThresholdChanger cannot be null"); - module.textureClipThreshold = textureClipThresholdChanger(module.textureClipThreshold); - return module; - } - #endregion - - #region TextureColorAffectsParticles - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeTextureColorAffectsParticles(this ParticleSystem particleSystem, bool textureColorAffectsParticles) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.textureColorAffectsParticles = textureColorAffectsParticles; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeTextureColorAffectsParticles(this ParticleSystem particleSystem, Func textureColorAffectsParticlesChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(textureColorAffectsParticlesChanger != null, "textureColorAffectsParticlesChanger cannot be null"); - var module = particleSystem.shape; - module.textureColorAffectsParticles = textureColorAffectsParticlesChanger(module.textureColorAffectsParticles); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetTextureColorAffectsParticles(this ShapeModule module, bool textureColorAffectsParticles) - { - module.textureColorAffectsParticles = textureColorAffectsParticles; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetTextureColorAffectsParticles(this ShapeModule module, Func textureColorAffectsParticlesChanger) - { - Debug.Assert(textureColorAffectsParticlesChanger != null, "textureColorAffectsParticlesChanger cannot be null"); - module.textureColorAffectsParticles = textureColorAffectsParticlesChanger(module.textureColorAffectsParticles); - return module; - } - #endregion - - #region TextureUVChannel - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeTextureUVChannel(this ParticleSystem particleSystem, int textureUVChannel) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.textureUVChannel = textureUVChannel; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeTextureUVChannel(this ParticleSystem particleSystem, Func textureUVChannelChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(textureUVChannelChanger != null, "textureUVChannelChanger cannot be null"); - var module = particleSystem.shape; - module.textureUVChannel = textureUVChannelChanger(module.textureUVChannel); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetTextureUVChannel(this ShapeModule module, int textureUVChannel) - { - module.textureUVChannel = textureUVChannel; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetTextureUVChannel(this ShapeModule module, Func textureUVChannelChanger) - { - Debug.Assert(textureUVChannelChanger != null, "textureUVChannelChanger cannot be null"); - module.textureUVChannel = textureUVChannelChanger(module.textureUVChannel); - return module; - } - #endregion - - #region UseMeshColors - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeUseMeshColors(this ParticleSystem particleSystem, bool useMeshColors) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.useMeshColors = useMeshColors; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeUseMeshColors(this ParticleSystem particleSystem, Func useMeshColorsChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(useMeshColorsChanger != null, "useMeshColorsChanger cannot be null"); - var module = particleSystem.shape; - module.useMeshColors = useMeshColorsChanger(module.useMeshColors); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetUseMeshColors(this ShapeModule module, bool useMeshColors) - { - module.useMeshColors = useMeshColors; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetUseMeshColors(this ShapeModule module, Func useMeshColorsChanger) - { - Debug.Assert(useMeshColorsChanger != null, "useMeshColorsChanger cannot be null"); - module.useMeshColors = useMeshColorsChanger(module.useMeshColors); - return module; - } - #endregion - - #region UseMeshMaterialIndex - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeUseMeshMaterialIndex(this ParticleSystem particleSystem, bool useMeshMaterialIndex) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.shape; - module.useMeshMaterialIndex = useMeshMaterialIndex; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetShapeUseMeshMaterialIndex(this ParticleSystem particleSystem, Func useMeshMaterialIndexChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(useMeshMaterialIndexChanger != null, "useMeshMaterialIndexChanger cannot be null"); - var module = particleSystem.shape; - module.useMeshMaterialIndex = useMeshMaterialIndexChanger(module.useMeshMaterialIndex); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetUseMeshMaterialIndex(this ShapeModule module, bool useMeshMaterialIndex) - { - module.useMeshMaterialIndex = useMeshMaterialIndex; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ShapeModule SetUseMeshMaterialIndex(this ShapeModule module, Func useMeshMaterialIndexChanger) - { - Debug.Assert(useMeshMaterialIndexChanger != null, "useMeshMaterialIndexChanger cannot be null"); - module.useMeshMaterialIndex = useMeshMaterialIndexChanger(module.useMeshMaterialIndex); - return module; - } - #endregion -#endif - } -} diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/SubEmittersModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/SubEmittersModuleExtension.cs deleted file mode 100644 index ea3bda7..0000000 --- a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/SubEmittersModuleExtension.cs +++ /dev/null @@ -1,432 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using UnityEngine; -using static UnityEngine.ParticleSystem; - -namespace OUCC.FluentParticleSystem -{ - public static class SubEmittersModuleExtension - { -#if UNITY_2018_4_OR_NEWER - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditSubEmitters(this ParticleSystem particleSystem, Action moduleEditor) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); - moduleEditor(particleSystem.subEmitters); - return particleSystem; - } - - #region Birth0 - /// - /// Assign a value to - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("birth0 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSubEmittersBirth0(this ParticleSystem particleSystem, ParticleSystem birth0) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.subEmitters; - module.birth0 = birth0; - return particleSystem; - } - - /// - /// Edit - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("birth0 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSubEmittersBirth0(this ParticleSystem particleSystem, Func birth0Changer) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(birth0Changer != null, "birth0Changer cannot be null"); - var module = particleSystem.subEmitters; - module.birth0 = birth0Changer(module.birth0); - return particleSystem; - } - - /// - /// Assign a value to - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("birth0 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SubEmittersModule SetBirth0(this SubEmittersModule module, ParticleSystem birth0) - { - module.birth0 = birth0; - return module; - } - - /// - /// Edit - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("birth0 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SubEmittersModule SetBirth0(this SubEmittersModule module, Func birth0Changer) - { - Debug.Assert(birth0Changer != null, "birth0Changer cannot be null"); - module.birth0 = birth0Changer(module.birth0); - return module; - } - #endregion - - #region Birth1 - /// - /// Assign a value to - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("birth1 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSubEmittersBirth1(this ParticleSystem particleSystem, ParticleSystem birth1) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.subEmitters; - module.birth1 = birth1; - return particleSystem; - } - - /// - /// Edit - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("birth1 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSubEmittersBirth1(this ParticleSystem particleSystem, Func birth1Changer) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(birth1Changer != null, "birth1Changer cannot be null"); - var module = particleSystem.subEmitters; - module.birth1 = birth1Changer(module.birth1); - return particleSystem; - } - - /// - /// Assign a value to - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("birth1 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SubEmittersModule SetBirth1(this SubEmittersModule module, ParticleSystem birth1) - { - module.birth1 = birth1; - return module; - } - - /// - /// Edit - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("birth1 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SubEmittersModule SetBirth1(this SubEmittersModule module, Func birth1Changer) - { - Debug.Assert(birth1Changer != null, "birth1Changer cannot be null"); - module.birth1 = birth1Changer(module.birth1); - return module; - } - #endregion - - #region Collision0 - /// - /// Assign a value to - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("collision0 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSubEmittersCollision0(this ParticleSystem particleSystem, ParticleSystem collision0) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.subEmitters; - module.collision0 = collision0; - return particleSystem; - } - - /// - /// Edit - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("collision0 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSubEmittersCollision0(this ParticleSystem particleSystem, Func collision0Changer) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(collision0Changer != null, "collision0Changer cannot be null"); - var module = particleSystem.subEmitters; - module.collision0 = collision0Changer(module.collision0); - return particleSystem; - } - - /// - /// Assign a value to - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("collision0 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SubEmittersModule SetCollision0(this SubEmittersModule module, ParticleSystem collision0) - { - module.collision0 = collision0; - return module; - } - - /// - /// Edit - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("collision0 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SubEmittersModule SetCollision0(this SubEmittersModule module, Func collision0Changer) - { - Debug.Assert(collision0Changer != null, "collision0Changer cannot be null"); - module.collision0 = collision0Changer(module.collision0); - return module; - } - #endregion - - #region Collision1 - /// - /// Assign a value to - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("collision1 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSubEmittersCollision1(this ParticleSystem particleSystem, ParticleSystem collision1) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.subEmitters; - module.collision1 = collision1; - return particleSystem; - } - - /// - /// Edit - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("collision1 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSubEmittersCollision1(this ParticleSystem particleSystem, Func collision1Changer) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(collision1Changer != null, "collision1Changer cannot be null"); - var module = particleSystem.subEmitters; - module.collision1 = collision1Changer(module.collision1); - return particleSystem; - } - - /// - /// Assign a value to - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("collision1 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SubEmittersModule SetCollision1(this SubEmittersModule module, ParticleSystem collision1) - { - module.collision1 = collision1; - return module; - } - - /// - /// Edit - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("collision1 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SubEmittersModule SetCollision1(this SubEmittersModule module, Func collision1Changer) - { - Debug.Assert(collision1Changer != null, "collision1Changer cannot be null"); - module.collision1 = collision1Changer(module.collision1); - return module; - } - #endregion - - #region Death0 - /// - /// Assign a value to - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("death0 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSubEmittersDeath0(this ParticleSystem particleSystem, ParticleSystem death0) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.subEmitters; - module.death0 = death0; - return particleSystem; - } - - /// - /// Edit - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("death0 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSubEmittersDeath0(this ParticleSystem particleSystem, Func death0Changer) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(death0Changer != null, "death0Changer cannot be null"); - var module = particleSystem.subEmitters; - module.death0 = death0Changer(module.death0); - return particleSystem; - } - - /// - /// Assign a value to - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("death0 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SubEmittersModule SetDeath0(this SubEmittersModule module, ParticleSystem death0) - { - module.death0 = death0; - return module; - } - - /// - /// Edit - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("death0 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SubEmittersModule SetDeath0(this SubEmittersModule module, Func death0Changer) - { - Debug.Assert(death0Changer != null, "death0Changer cannot be null"); - module.death0 = death0Changer(module.death0); - return module; - } - #endregion - - #region Death1 - /// - /// Assign a value to - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("death1 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSubEmittersDeath1(this ParticleSystem particleSystem, ParticleSystem death1) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.subEmitters; - module.death1 = death1; - return particleSystem; - } - - /// - /// Edit - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("death1 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSubEmittersDeath1(this ParticleSystem particleSystem, Func death1Changer) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(death1Changer != null, "death1Changer cannot be null"); - var module = particleSystem.subEmitters; - module.death1 = death1Changer(module.death1); - return particleSystem; - } - - /// - /// Assign a value to - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("death1 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SubEmittersModule SetDeath1(this SubEmittersModule module, ParticleSystem death1) - { - module.death1 = death1; - return module; - } - - /// - /// Edit - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("death1 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SubEmittersModule SetDeath1(this SubEmittersModule module, Func death1Changer) - { - Debug.Assert(death1Changer != null, "death1Changer cannot be null"); - module.death1 = death1Changer(module.death1); - return module; - } - #endregion - - #region Enabled - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSubEmittersEnabled(this ParticleSystem particleSystem, bool enabled) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.subEmitters; - module.enabled = enabled; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSubEmittersEnabled(this ParticleSystem particleSystem, Func enabledChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - var module = particleSystem.subEmitters; - module.enabled = enabledChanger(module.enabled); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SubEmittersModule SetEnabled(this SubEmittersModule module, bool enabled) - { - module.enabled = enabled; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SubEmittersModule SetEnabled(this SubEmittersModule module, Func enabledChanger) - { - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - module.enabled = enabledChanger(module.enabled); - return module; - } - #endregion -#endif - } -} diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/TriggerModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/TriggerModuleExtension.cs deleted file mode 100644 index 96a3b9a..0000000 --- a/Packages/FluentParticleSystem/Runtime/NonNullable/Extensions/TriggerModuleExtension.cs +++ /dev/null @@ -1,364 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using UnityEngine; -using static UnityEngine.ParticleSystem; - -namespace OUCC.FluentParticleSystem -{ - public static class TriggerModuleExtension - { -#if UNITY_2018_4_OR_NEWER - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditTrigger(this ParticleSystem particleSystem, Action moduleEditor) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); - moduleEditor(particleSystem.trigger); - return particleSystem; - } -#endif - -#if UNITY_2020_3_OR_NEWER - #region ColliderQueryMode - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTriggerColliderQueryMode(this ParticleSystem particleSystem, ParticleSystemColliderQueryMode colliderQueryMode) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.trigger; - module.colliderQueryMode = colliderQueryMode; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTriggerColliderQueryMode(this ParticleSystem particleSystem, Func colliderQueryModeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(colliderQueryModeChanger != null, "colliderQueryModeChanger cannot be null"); - var module = particleSystem.trigger; - module.colliderQueryMode = colliderQueryModeChanger(module.colliderQueryMode); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TriggerModule SetColliderQueryMode(this TriggerModule module, ParticleSystemColliderQueryMode colliderQueryMode) - { - module.colliderQueryMode = colliderQueryMode; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TriggerModule SetColliderQueryMode(this TriggerModule module, Func colliderQueryModeChanger) - { - Debug.Assert(colliderQueryModeChanger != null, "colliderQueryModeChanger cannot be null"); - module.colliderQueryMode = colliderQueryModeChanger(module.colliderQueryMode); - return module; - } - #endregion -#endif - -#if UNITY_2018_4_OR_NEWER - #region Enabled - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTriggerEnabled(this ParticleSystem particleSystem, bool enabled) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.trigger; - module.enabled = enabled; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTriggerEnabled(this ParticleSystem particleSystem, Func enabledChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - var module = particleSystem.trigger; - module.enabled = enabledChanger(module.enabled); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TriggerModule SetEnabled(this TriggerModule module, bool enabled) - { - module.enabled = enabled; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TriggerModule SetEnabled(this TriggerModule module, Func enabledChanger) - { - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - module.enabled = enabledChanger(module.enabled); - return module; - } - #endregion - - #region Enter - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTriggerEnter(this ParticleSystem particleSystem, ParticleSystemOverlapAction enter) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.trigger; - module.enter = enter; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTriggerEnter(this ParticleSystem particleSystem, Func enterChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(enterChanger != null, "enterChanger cannot be null"); - var module = particleSystem.trigger; - module.enter = enterChanger(module.enter); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TriggerModule SetEnter(this TriggerModule module, ParticleSystemOverlapAction enter) - { - module.enter = enter; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TriggerModule SetEnter(this TriggerModule module, Func enterChanger) - { - Debug.Assert(enterChanger != null, "enterChanger cannot be null"); - module.enter = enterChanger(module.enter); - return module; - } - #endregion - - #region Exit - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTriggerExit(this ParticleSystem particleSystem, ParticleSystemOverlapAction exit) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.trigger; - module.exit = exit; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTriggerExit(this ParticleSystem particleSystem, Func exitChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(exitChanger != null, "exitChanger cannot be null"); - var module = particleSystem.trigger; - module.exit = exitChanger(module.exit); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TriggerModule SetExit(this TriggerModule module, ParticleSystemOverlapAction exit) - { - module.exit = exit; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TriggerModule SetExit(this TriggerModule module, Func exitChanger) - { - Debug.Assert(exitChanger != null, "exitChanger cannot be null"); - module.exit = exitChanger(module.exit); - return module; - } - #endregion - - #region Inside - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTriggerInside(this ParticleSystem particleSystem, ParticleSystemOverlapAction inside) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.trigger; - module.inside = inside; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTriggerInside(this ParticleSystem particleSystem, Func insideChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(insideChanger != null, "insideChanger cannot be null"); - var module = particleSystem.trigger; - module.inside = insideChanger(module.inside); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TriggerModule SetInside(this TriggerModule module, ParticleSystemOverlapAction inside) - { - module.inside = inside; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TriggerModule SetInside(this TriggerModule module, Func insideChanger) - { - Debug.Assert(insideChanger != null, "insideChanger cannot be null"); - module.inside = insideChanger(module.inside); - return module; - } - #endregion - - #region Outside - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTriggerOutside(this ParticleSystem particleSystem, ParticleSystemOverlapAction outside) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.trigger; - module.outside = outside; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTriggerOutside(this ParticleSystem particleSystem, Func outsideChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(outsideChanger != null, "outsideChanger cannot be null"); - var module = particleSystem.trigger; - module.outside = outsideChanger(module.outside); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TriggerModule SetOutside(this TriggerModule module, ParticleSystemOverlapAction outside) - { - module.outside = outside; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TriggerModule SetOutside(this TriggerModule module, Func outsideChanger) - { - Debug.Assert(outsideChanger != null, "outsideChanger cannot be null"); - module.outside = outsideChanger(module.outside); - return module; - } - #endregion - - #region RadiusScale - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTriggerRadiusScale(this ParticleSystem particleSystem, float radiusScale) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.trigger; - module.radiusScale = radiusScale; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTriggerRadiusScale(this ParticleSystem particleSystem, Func radiusScaleChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(radiusScaleChanger != null, "radiusScaleChanger cannot be null"); - var module = particleSystem.trigger; - module.radiusScale = radiusScaleChanger(module.radiusScale); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TriggerModule SetRadiusScale(this TriggerModule module, float radiusScale) - { - module.radiusScale = radiusScale; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TriggerModule SetRadiusScale(this TriggerModule module, Func radiusScaleChanger) - { - Debug.Assert(radiusScaleChanger != null, "radiusScaleChanger cannot be null"); - module.radiusScale = radiusScaleChanger(module.radiusScale); - return module; - } - #endregion -#endif - } -} diff --git a/Packages/FluentParticleSystem/Runtime/Nullable.meta b/Packages/FluentParticleSystem/Runtime/Nullable.meta deleted file mode 100644 index 6abb511..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 823fbd73a1ff44349aa8cf62475a1554 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Debug.cs b/Packages/FluentParticleSystem/Runtime/Nullable/Debug.cs deleted file mode 100644 index a5cd08b..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Debug.cs +++ /dev/null @@ -1,21 +0,0 @@ -#nullable enable -using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; - -using UDebug = UnityEngine.Debug; - -namespace OUCC.FluentParticleSystem -{ - internal static class Debug - { - [Conditional("UNITY_ASSERTIONS")] - internal static void Assert( -#if UNITY_2020_2_OR_NEWER - [DoesNotReturnIf(false)] -#endif - bool condition, string message) - { - UDebug.Assert(condition, message); - } - } -} diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Debug.cs.meta b/Packages/FluentParticleSystem/Runtime/Nullable/Debug.cs.meta deleted file mode 100644 index b195c02..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Debug.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 328ad5090e287b84e88e11a35720c83b -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions.meta b/Packages/FluentParticleSystem/Runtime/Nullable/Extensions.meta deleted file mode 100644 index fd8ae7e..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 9c98feacd59447d4bab9fc7fdfbef7eb -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/CollisionModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/CollisionModuleExtension.cs.meta deleted file mode 100644 index 509254c..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/CollisionModuleExtension.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 00e5d8d275305474485ffedb6467d81a -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/ColorBySpeedModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/ColorBySpeedModuleExtension.cs.meta deleted file mode 100644 index 519d08d..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/ColorBySpeedModuleExtension.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: eabd2dfd757f00b48b13ecb2a6acb3de -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/ColorOverLifetimeModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/ColorOverLifetimeModuleExtension.cs deleted file mode 100644 index e49098c..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/ColorOverLifetimeModuleExtension.cs +++ /dev/null @@ -1,121 +0,0 @@ -#nullable enable -using System; -using System.Runtime.CompilerServices; -using UnityEngine; -using static UnityEngine.ParticleSystem; - -namespace OUCC.FluentParticleSystem -{ - public static class ColorOverLifetimeModuleExtension - { -#if UNITY_2018_4_OR_NEWER - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditColorOverLifetime(this ParticleSystem particleSystem, Action moduleEditor) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); - moduleEditor(particleSystem.colorOverLifetime); - return particleSystem; - } - - #region Color - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetColorOverLifetimeColor(this ParticleSystem particleSystem, MinMaxGradient color) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.colorOverLifetime; - module.color = color; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetColorOverLifetimeColor(this ParticleSystem particleSystem, Func colorChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(colorChanger != null, "colorChanger cannot be null"); - var module = particleSystem.colorOverLifetime; - module.color = colorChanger(module.color); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ColorOverLifetimeModule SetColor(this ColorOverLifetimeModule module, MinMaxGradient color) - { - module.color = color; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ColorOverLifetimeModule SetColor(this ColorOverLifetimeModule module, Func colorChanger) - { - Debug.Assert(colorChanger != null, "colorChanger cannot be null"); - module.color = colorChanger(module.color); - return module; - } - #endregion - - #region Enabled - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetColorOverLifetimeEnabled(this ParticleSystem particleSystem, bool enabled) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.colorOverLifetime; - module.enabled = enabled; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetColorOverLifetimeEnabled(this ParticleSystem particleSystem, Func enabledChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - var module = particleSystem.colorOverLifetime; - module.enabled = enabledChanger(module.enabled); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ColorOverLifetimeModule SetEnabled(this ColorOverLifetimeModule module, bool enabled) - { - module.enabled = enabled; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ColorOverLifetimeModule SetEnabled(this ColorOverLifetimeModule module, Func enabledChanger) - { - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - module.enabled = enabledChanger(module.enabled); - return module; - } - #endregion -#endif - } -} diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/ColorOverLifetimeModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/ColorOverLifetimeModuleExtension.cs.meta deleted file mode 100644 index 20cae3b..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/ColorOverLifetimeModuleExtension.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: c1c2fa53e67371249ae5712b0094b430 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/CustomDataModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/CustomDataModuleExtension.cs deleted file mode 100644 index f658acd..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/CustomDataModuleExtension.cs +++ /dev/null @@ -1,73 +0,0 @@ -#nullable enable -using System; -using System.Runtime.CompilerServices; -using UnityEngine; -using static UnityEngine.ParticleSystem; - -namespace OUCC.FluentParticleSystem -{ - public static class CustomDataModuleExtension - { -#if UNITY_2018_4_OR_NEWER - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditCustomData(this ParticleSystem particleSystem, Action moduleEditor) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); - moduleEditor(particleSystem.customData); - return particleSystem; - } - - #region Enabled - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCustomDataEnabled(this ParticleSystem particleSystem, bool enabled) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.customData; - module.enabled = enabled; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetCustomDataEnabled(this ParticleSystem particleSystem, Func enabledChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - var module = particleSystem.customData; - module.enabled = enabledChanger(module.enabled); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CustomDataModule SetEnabled(this CustomDataModule module, bool enabled) - { - module.enabled = enabled; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static CustomDataModule SetEnabled(this CustomDataModule module, Func enabledChanger) - { - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - module.enabled = enabledChanger(module.enabled); - return module; - } - #endregion -#endif - } -} diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/CustomDataModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/CustomDataModuleExtension.cs.meta deleted file mode 100644 index 2297df8..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/CustomDataModuleExtension.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 9c18af4c3eb922d438d67f741319295b -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/EmissionModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/EmissionModuleExtension.cs deleted file mode 100644 index dbf8ffc..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/EmissionModuleExtension.cs +++ /dev/null @@ -1,493 +0,0 @@ -#nullable enable -using System; -using System.Runtime.CompilerServices; -using UnityEngine; -using static UnityEngine.ParticleSystem; - -namespace OUCC.FluentParticleSystem -{ - public static class EmissionModuleExtension - { -#if UNITY_2018_4_OR_NEWER - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditEmission(this ParticleSystem particleSystem, Action moduleEditor) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); - moduleEditor(particleSystem.emission); - return particleSystem; - } - - #region BurstCount - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetEmissionBurstCount(this ParticleSystem particleSystem, int burstCount) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.emission; - module.burstCount = burstCount; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetEmissionBurstCount(this ParticleSystem particleSystem, Func burstCountChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(burstCountChanger != null, "burstCountChanger cannot be null"); - var module = particleSystem.emission; - module.burstCount = burstCountChanger(module.burstCount); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EmissionModule SetBurstCount(this EmissionModule module, int burstCount) - { - module.burstCount = burstCount; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EmissionModule SetBurstCount(this EmissionModule module, Func burstCountChanger) - { - Debug.Assert(burstCountChanger != null, "burstCountChanger cannot be null"); - module.burstCount = burstCountChanger(module.burstCount); - return module; - } - #endregion - - #region Enabled - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetEmissionEnabled(this ParticleSystem particleSystem, bool enabled) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.emission; - module.enabled = enabled; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetEmissionEnabled(this ParticleSystem particleSystem, Func enabledChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - var module = particleSystem.emission; - module.enabled = enabledChanger(module.enabled); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EmissionModule SetEnabled(this EmissionModule module, bool enabled) - { - module.enabled = enabled; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EmissionModule SetEnabled(this EmissionModule module, Func enabledChanger) - { - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - module.enabled = enabledChanger(module.enabled); - return module; - } - #endregion - - #region Rate - /// - /// Assign a value to - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("rate property is deprecated. Use rateOverTime or rateOverDistance instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetEmissionRate(this ParticleSystem particleSystem, MinMaxCurve rate) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.emission; - module.rate = rate; - return particleSystem; - } - - /// - /// Edit - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("rate property is deprecated. Use rateOverTime or rateOverDistance instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetEmissionRate(this ParticleSystem particleSystem, Func rateChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(rateChanger != null, "rateChanger cannot be null"); - var module = particleSystem.emission; - module.rate = rateChanger(module.rate); - return particleSystem; - } - - /// - /// Assign a value to - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("rate property is deprecated. Use rateOverTime or rateOverDistance instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EmissionModule SetRate(this EmissionModule module, MinMaxCurve rate) - { - module.rate = rate; - return module; - } - - /// - /// Edit - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("rate property is deprecated. Use rateOverTime or rateOverDistance instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EmissionModule SetRate(this EmissionModule module, Func rateChanger) - { - Debug.Assert(rateChanger != null, "rateChanger cannot be null"); - module.rate = rateChanger(module.rate); - return module; - } - #endregion - - #region RateMultiplier - /// - /// Assign a value to - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("rateMultiplier property is deprecated. Use rateOverTimeMultiplier or rateOverDistanceMultiplier instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetEmissionRateMultiplier(this ParticleSystem particleSystem, float rateMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.emission; - module.rateMultiplier = rateMultiplier; - return particleSystem; - } - - /// - /// Edit - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("rateMultiplier property is deprecated. Use rateOverTimeMultiplier or rateOverDistanceMultiplier instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetEmissionRateMultiplier(this ParticleSystem particleSystem, Func rateMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(rateMultiplierChanger != null, "rateMultiplierChanger cannot be null"); - var module = particleSystem.emission; - module.rateMultiplier = rateMultiplierChanger(module.rateMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("rateMultiplier property is deprecated. Use rateOverTimeMultiplier or rateOverDistanceMultiplier instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EmissionModule SetRateMultiplier(this EmissionModule module, float rateMultiplier) - { - module.rateMultiplier = rateMultiplier; - return module; - } - - /// - /// Edit - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("rateMultiplier property is deprecated. Use rateOverTimeMultiplier or rateOverDistanceMultiplier instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EmissionModule SetRateMultiplier(this EmissionModule module, Func rateMultiplierChanger) - { - Debug.Assert(rateMultiplierChanger != null, "rateMultiplierChanger cannot be null"); - module.rateMultiplier = rateMultiplierChanger(module.rateMultiplier); - return module; - } - #endregion - - #region RateOverDistance - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetEmissionRateOverDistance(this ParticleSystem particleSystem, MinMaxCurve rateOverDistance) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.emission; - module.rateOverDistance = rateOverDistance; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetEmissionRateOverDistance(this ParticleSystem particleSystem, Func rateOverDistanceChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(rateOverDistanceChanger != null, "rateOverDistanceChanger cannot be null"); - var module = particleSystem.emission; - module.rateOverDistance = rateOverDistanceChanger(module.rateOverDistance); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EmissionModule SetRateOverDistance(this EmissionModule module, MinMaxCurve rateOverDistance) - { - module.rateOverDistance = rateOverDistance; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EmissionModule SetRateOverDistance(this EmissionModule module, Func rateOverDistanceChanger) - { - Debug.Assert(rateOverDistanceChanger != null, "rateOverDistanceChanger cannot be null"); - module.rateOverDistance = rateOverDistanceChanger(module.rateOverDistance); - return module; - } - #endregion - - #region RateOverDistanceMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetEmissionRateOverDistanceMultiplier(this ParticleSystem particleSystem, float rateOverDistanceMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.emission; - module.rateOverDistanceMultiplier = rateOverDistanceMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetEmissionRateOverDistanceMultiplier(this ParticleSystem particleSystem, Func rateOverDistanceMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(rateOverDistanceMultiplierChanger != null, "rateOverDistanceMultiplierChanger cannot be null"); - var module = particleSystem.emission; - module.rateOverDistanceMultiplier = rateOverDistanceMultiplierChanger(module.rateOverDistanceMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EmissionModule SetRateOverDistanceMultiplier(this EmissionModule module, float rateOverDistanceMultiplier) - { - module.rateOverDistanceMultiplier = rateOverDistanceMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EmissionModule SetRateOverDistanceMultiplier(this EmissionModule module, Func rateOverDistanceMultiplierChanger) - { - Debug.Assert(rateOverDistanceMultiplierChanger != null, "rateOverDistanceMultiplierChanger cannot be null"); - module.rateOverDistanceMultiplier = rateOverDistanceMultiplierChanger(module.rateOverDistanceMultiplier); - return module; - } - #endregion - - #region RateOverTime - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetEmissionRateOverTime(this ParticleSystem particleSystem, MinMaxCurve rateOverTime) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.emission; - module.rateOverTime = rateOverTime; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetEmissionRateOverTime(this ParticleSystem particleSystem, Func rateOverTimeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(rateOverTimeChanger != null, "rateOverTimeChanger cannot be null"); - var module = particleSystem.emission; - module.rateOverTime = rateOverTimeChanger(module.rateOverTime); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EmissionModule SetRateOverTime(this EmissionModule module, MinMaxCurve rateOverTime) - { - module.rateOverTime = rateOverTime; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EmissionModule SetRateOverTime(this EmissionModule module, Func rateOverTimeChanger) - { - Debug.Assert(rateOverTimeChanger != null, "rateOverTimeChanger cannot be null"); - module.rateOverTime = rateOverTimeChanger(module.rateOverTime); - return module; - } - #endregion - - #region RateOverTimeMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetEmissionRateOverTimeMultiplier(this ParticleSystem particleSystem, float rateOverTimeMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.emission; - module.rateOverTimeMultiplier = rateOverTimeMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetEmissionRateOverTimeMultiplier(this ParticleSystem particleSystem, Func rateOverTimeMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(rateOverTimeMultiplierChanger != null, "rateOverTimeMultiplierChanger cannot be null"); - var module = particleSystem.emission; - module.rateOverTimeMultiplier = rateOverTimeMultiplierChanger(module.rateOverTimeMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EmissionModule SetRateOverTimeMultiplier(this EmissionModule module, float rateOverTimeMultiplier) - { - module.rateOverTimeMultiplier = rateOverTimeMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EmissionModule SetRateOverTimeMultiplier(this EmissionModule module, Func rateOverTimeMultiplierChanger) - { - Debug.Assert(rateOverTimeMultiplierChanger != null, "rateOverTimeMultiplierChanger cannot be null"); - module.rateOverTimeMultiplier = rateOverTimeMultiplierChanger(module.rateOverTimeMultiplier); - return module; - } - #endregion - - #region Type - /// - /// Assign a value to - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("ParticleSystemEmissionType no longer does anything. Time and Distance based emission are now both always active.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetEmissionType(this ParticleSystem particleSystem, ParticleSystemEmissionType type) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.emission; - module.type = type; - return particleSystem; - } - - /// - /// Edit - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("ParticleSystemEmissionType no longer does anything. Time and Distance based emission are now both always active.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetEmissionType(this ParticleSystem particleSystem, Func typeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(typeChanger != null, "typeChanger cannot be null"); - var module = particleSystem.emission; - module.type = typeChanger(module.type); - return particleSystem; - } - - /// - /// Assign a value to - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("ParticleSystemEmissionType no longer does anything. Time and Distance based emission are now both always active.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EmissionModule SetType(this EmissionModule module, ParticleSystemEmissionType type) - { - module.type = type; - return module; - } - - /// - /// Edit - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("ParticleSystemEmissionType no longer does anything. Time and Distance based emission are now both always active.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EmissionModule SetType(this EmissionModule module, Func typeChanger) - { - Debug.Assert(typeChanger != null, "typeChanger cannot be null"); - module.type = typeChanger(module.type); - return module; - } - #endregion -#endif - } -} diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/EmissionModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/EmissionModuleExtension.cs.meta deleted file mode 100644 index 67a3f06..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/EmissionModuleExtension.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 87fef9a9d4b8c9f489d78a70d62b8df0 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/ExternalForcesModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/ExternalForcesModuleExtension.cs deleted file mode 100644 index fff6171..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/ExternalForcesModuleExtension.cs +++ /dev/null @@ -1,271 +0,0 @@ -#nullable enable -using System; -using System.Runtime.CompilerServices; -using UnityEngine; -using static UnityEngine.ParticleSystem; - -namespace OUCC.FluentParticleSystem -{ - public static class ExternalForcesModuleExtension - { -#if UNITY_2018_4_OR_NEWER - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditExternalForces(this ParticleSystem particleSystem, Action moduleEditor) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); - moduleEditor(particleSystem.externalForces); - return particleSystem; - } - - #region Enabled - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetExternalForcesEnabled(this ParticleSystem particleSystem, bool enabled) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.externalForces; - module.enabled = enabled; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetExternalForcesEnabled(this ParticleSystem particleSystem, Func enabledChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - var module = particleSystem.externalForces; - module.enabled = enabledChanger(module.enabled); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ExternalForcesModule SetEnabled(this ExternalForcesModule module, bool enabled) - { - module.enabled = enabled; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ExternalForcesModule SetEnabled(this ExternalForcesModule module, Func enabledChanger) - { - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - module.enabled = enabledChanger(module.enabled); - return module; - } - #endregion - - #region InfluenceFilter - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetExternalForcesInfluenceFilter(this ParticleSystem particleSystem, ParticleSystemGameObjectFilter influenceFilter) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.externalForces; - module.influenceFilter = influenceFilter; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetExternalForcesInfluenceFilter(this ParticleSystem particleSystem, Func influenceFilterChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(influenceFilterChanger != null, "influenceFilterChanger cannot be null"); - var module = particleSystem.externalForces; - module.influenceFilter = influenceFilterChanger(module.influenceFilter); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ExternalForcesModule SetInfluenceFilter(this ExternalForcesModule module, ParticleSystemGameObjectFilter influenceFilter) - { - module.influenceFilter = influenceFilter; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ExternalForcesModule SetInfluenceFilter(this ExternalForcesModule module, Func influenceFilterChanger) - { - Debug.Assert(influenceFilterChanger != null, "influenceFilterChanger cannot be null"); - module.influenceFilter = influenceFilterChanger(module.influenceFilter); - return module; - } - #endregion -#endif - -#if UNITY_2019_4_OR_NEWER - #region InfluenceMask - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetExternalForcesInfluenceMask(this ParticleSystem particleSystem, LayerMask influenceMask) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.externalForces; - module.influenceMask = influenceMask; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetExternalForcesInfluenceMask(this ParticleSystem particleSystem, Func influenceMaskChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(influenceMaskChanger != null, "influenceMaskChanger cannot be null"); - var module = particleSystem.externalForces; - module.influenceMask = influenceMaskChanger(module.influenceMask); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ExternalForcesModule SetInfluenceMask(this ExternalForcesModule module, LayerMask influenceMask) - { - module.influenceMask = influenceMask; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ExternalForcesModule SetInfluenceMask(this ExternalForcesModule module, Func influenceMaskChanger) - { - Debug.Assert(influenceMaskChanger != null, "influenceMaskChanger cannot be null"); - module.influenceMask = influenceMaskChanger(module.influenceMask); - return module; - } - #endregion -#endif - -#if UNITY_2018_4_OR_NEWER - #region Multiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetExternalForcesMultiplier(this ParticleSystem particleSystem, float multiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.externalForces; - module.multiplier = multiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetExternalForcesMultiplier(this ParticleSystem particleSystem, Func multiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(multiplierChanger != null, "multiplierChanger cannot be null"); - var module = particleSystem.externalForces; - module.multiplier = multiplierChanger(module.multiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ExternalForcesModule SetMultiplier(this ExternalForcesModule module, float multiplier) - { - module.multiplier = multiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ExternalForcesModule SetMultiplier(this ExternalForcesModule module, Func multiplierChanger) - { - Debug.Assert(multiplierChanger != null, "multiplierChanger cannot be null"); - module.multiplier = multiplierChanger(module.multiplier); - return module; - } - #endregion -#endif - -#if UNITY_2019_4_OR_NEWER - #region MultiplierCurve - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetExternalForcesMultiplierCurve(this ParticleSystem particleSystem, MinMaxCurve multiplierCurve) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.externalForces; - module.multiplierCurve = multiplierCurve; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetExternalForcesMultiplierCurve(this ParticleSystem particleSystem, Func multiplierCurveChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(multiplierCurveChanger != null, "multiplierCurveChanger cannot be null"); - var module = particleSystem.externalForces; - module.multiplierCurve = multiplierCurveChanger(module.multiplierCurve); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ExternalForcesModule SetMultiplierCurve(this ExternalForcesModule module, MinMaxCurve multiplierCurve) - { - module.multiplierCurve = multiplierCurve; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ExternalForcesModule SetMultiplierCurve(this ExternalForcesModule module, Func multiplierCurveChanger) - { - Debug.Assert(multiplierCurveChanger != null, "multiplierCurveChanger cannot be null"); - module.multiplierCurve = multiplierCurveChanger(module.multiplierCurve); - return module; - } - #endregion -#endif - } -} diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/ExternalForcesModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/ExternalForcesModuleExtension.cs.meta deleted file mode 100644 index a5b755e..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/ExternalForcesModuleExtension.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 8a426f20311721141aa7c7c5c542126b -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/ForceOverLifetimeModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/ForceOverLifetimeModuleExtension.cs deleted file mode 100644 index acc5a06..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/ForceOverLifetimeModuleExtension.cs +++ /dev/null @@ -1,457 +0,0 @@ -#nullable enable -using System; -using System.Runtime.CompilerServices; -using UnityEngine; -using static UnityEngine.ParticleSystem; - -namespace OUCC.FluentParticleSystem -{ - public static class ForceOverLifetimeModuleExtension - { -#if UNITY_2018_4_OR_NEWER - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditForceOverLifetime(this ParticleSystem particleSystem, Action moduleEditor) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); - moduleEditor(particleSystem.forceOverLifetime); - return particleSystem; - } - - #region Enabled - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetForceOverLifetimeEnabled(this ParticleSystem particleSystem, bool enabled) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.forceOverLifetime; - module.enabled = enabled; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetForceOverLifetimeEnabled(this ParticleSystem particleSystem, Func enabledChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - var module = particleSystem.forceOverLifetime; - module.enabled = enabledChanger(module.enabled); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ForceOverLifetimeModule SetEnabled(this ForceOverLifetimeModule module, bool enabled) - { - module.enabled = enabled; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ForceOverLifetimeModule SetEnabled(this ForceOverLifetimeModule module, Func enabledChanger) - { - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - module.enabled = enabledChanger(module.enabled); - return module; - } - #endregion - - #region Randomized - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetForceOverLifetimeRandomized(this ParticleSystem particleSystem, bool randomized) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.forceOverLifetime; - module.randomized = randomized; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetForceOverLifetimeRandomized(this ParticleSystem particleSystem, Func randomizedChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(randomizedChanger != null, "randomizedChanger cannot be null"); - var module = particleSystem.forceOverLifetime; - module.randomized = randomizedChanger(module.randomized); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ForceOverLifetimeModule SetRandomized(this ForceOverLifetimeModule module, bool randomized) - { - module.randomized = randomized; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ForceOverLifetimeModule SetRandomized(this ForceOverLifetimeModule module, Func randomizedChanger) - { - Debug.Assert(randomizedChanger != null, "randomizedChanger cannot be null"); - module.randomized = randomizedChanger(module.randomized); - return module; - } - #endregion - - #region Space - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetForceOverLifetimeSpace(this ParticleSystem particleSystem, ParticleSystemSimulationSpace space) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.forceOverLifetime; - module.space = space; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetForceOverLifetimeSpace(this ParticleSystem particleSystem, Func spaceChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(spaceChanger != null, "spaceChanger cannot be null"); - var module = particleSystem.forceOverLifetime; - module.space = spaceChanger(module.space); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ForceOverLifetimeModule SetSpace(this ForceOverLifetimeModule module, ParticleSystemSimulationSpace space) - { - module.space = space; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ForceOverLifetimeModule SetSpace(this ForceOverLifetimeModule module, Func spaceChanger) - { - Debug.Assert(spaceChanger != null, "spaceChanger cannot be null"); - module.space = spaceChanger(module.space); - return module; - } - #endregion - - #region X - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetForceOverLifetimeX(this ParticleSystem particleSystem, MinMaxCurve x) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.forceOverLifetime; - module.x = x; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetForceOverLifetimeX(this ParticleSystem particleSystem, Func xChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(xChanger != null, "xChanger cannot be null"); - var module = particleSystem.forceOverLifetime; - module.x = xChanger(module.x); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ForceOverLifetimeModule SetX(this ForceOverLifetimeModule module, MinMaxCurve x) - { - module.x = x; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ForceOverLifetimeModule SetX(this ForceOverLifetimeModule module, Func xChanger) - { - Debug.Assert(xChanger != null, "xChanger cannot be null"); - module.x = xChanger(module.x); - return module; - } - #endregion - - #region XMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetForceOverLifetimeXMultiplier(this ParticleSystem particleSystem, float xMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.forceOverLifetime; - module.xMultiplier = xMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetForceOverLifetimeXMultiplier(this ParticleSystem particleSystem, Func xMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(xMultiplierChanger != null, "xMultiplierChanger cannot be null"); - var module = particleSystem.forceOverLifetime; - module.xMultiplier = xMultiplierChanger(module.xMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ForceOverLifetimeModule SetXMultiplier(this ForceOverLifetimeModule module, float xMultiplier) - { - module.xMultiplier = xMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ForceOverLifetimeModule SetXMultiplier(this ForceOverLifetimeModule module, Func xMultiplierChanger) - { - Debug.Assert(xMultiplierChanger != null, "xMultiplierChanger cannot be null"); - module.xMultiplier = xMultiplierChanger(module.xMultiplier); - return module; - } - #endregion - - #region Y - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetForceOverLifetimeY(this ParticleSystem particleSystem, MinMaxCurve y) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.forceOverLifetime; - module.y = y; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetForceOverLifetimeY(this ParticleSystem particleSystem, Func yChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(yChanger != null, "yChanger cannot be null"); - var module = particleSystem.forceOverLifetime; - module.y = yChanger(module.y); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ForceOverLifetimeModule SetY(this ForceOverLifetimeModule module, MinMaxCurve y) - { - module.y = y; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ForceOverLifetimeModule SetY(this ForceOverLifetimeModule module, Func yChanger) - { - Debug.Assert(yChanger != null, "yChanger cannot be null"); - module.y = yChanger(module.y); - return module; - } - #endregion - - #region YMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetForceOverLifetimeYMultiplier(this ParticleSystem particleSystem, float yMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.forceOverLifetime; - module.yMultiplier = yMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetForceOverLifetimeYMultiplier(this ParticleSystem particleSystem, Func yMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(yMultiplierChanger != null, "yMultiplierChanger cannot be null"); - var module = particleSystem.forceOverLifetime; - module.yMultiplier = yMultiplierChanger(module.yMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ForceOverLifetimeModule SetYMultiplier(this ForceOverLifetimeModule module, float yMultiplier) - { - module.yMultiplier = yMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ForceOverLifetimeModule SetYMultiplier(this ForceOverLifetimeModule module, Func yMultiplierChanger) - { - Debug.Assert(yMultiplierChanger != null, "yMultiplierChanger cannot be null"); - module.yMultiplier = yMultiplierChanger(module.yMultiplier); - return module; - } - #endregion - - #region Z - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetForceOverLifetimeZ(this ParticleSystem particleSystem, MinMaxCurve z) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.forceOverLifetime; - module.z = z; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetForceOverLifetimeZ(this ParticleSystem particleSystem, Func zChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(zChanger != null, "zChanger cannot be null"); - var module = particleSystem.forceOverLifetime; - module.z = zChanger(module.z); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ForceOverLifetimeModule SetZ(this ForceOverLifetimeModule module, MinMaxCurve z) - { - module.z = z; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ForceOverLifetimeModule SetZ(this ForceOverLifetimeModule module, Func zChanger) - { - Debug.Assert(zChanger != null, "zChanger cannot be null"); - module.z = zChanger(module.z); - return module; - } - #endregion - - #region ZMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetForceOverLifetimeZMultiplier(this ParticleSystem particleSystem, float zMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.forceOverLifetime; - module.zMultiplier = zMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetForceOverLifetimeZMultiplier(this ParticleSystem particleSystem, Func zMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(zMultiplierChanger != null, "zMultiplierChanger cannot be null"); - var module = particleSystem.forceOverLifetime; - module.zMultiplier = zMultiplierChanger(module.zMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ForceOverLifetimeModule SetZMultiplier(this ForceOverLifetimeModule module, float zMultiplier) - { - module.zMultiplier = zMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ForceOverLifetimeModule SetZMultiplier(this ForceOverLifetimeModule module, Func zMultiplierChanger) - { - Debug.Assert(zMultiplierChanger != null, "zMultiplierChanger cannot be null"); - module.zMultiplier = zMultiplierChanger(module.zMultiplier); - return module; - } - #endregion -#endif - } -} diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/ForceOverLifetimeModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/ForceOverLifetimeModuleExtension.cs.meta deleted file mode 100644 index 4a17281..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/ForceOverLifetimeModuleExtension.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 5950b63bfecad7849b9aa9b3d81fdaa2 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/InheritVelocityModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/InheritVelocityModuleExtension.cs deleted file mode 100644 index 142bf27..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/InheritVelocityModuleExtension.cs +++ /dev/null @@ -1,217 +0,0 @@ -#nullable enable -using System; -using System.Runtime.CompilerServices; -using UnityEngine; -using static UnityEngine.ParticleSystem; - -namespace OUCC.FluentParticleSystem -{ - public static class InheritVelocityModuleExtension - { -#if UNITY_2018_4_OR_NEWER - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditInheritVelocity(this ParticleSystem particleSystem, Action moduleEditor) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); - moduleEditor(particleSystem.inheritVelocity); - return particleSystem; - } - - #region Curve - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetInheritVelocityCurve(this ParticleSystem particleSystem, MinMaxCurve curve) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.inheritVelocity; - module.curve = curve; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetInheritVelocityCurve(this ParticleSystem particleSystem, Func curveChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(curveChanger != null, "curveChanger cannot be null"); - var module = particleSystem.inheritVelocity; - module.curve = curveChanger(module.curve); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static InheritVelocityModule SetCurve(this InheritVelocityModule module, MinMaxCurve curve) - { - module.curve = curve; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static InheritVelocityModule SetCurve(this InheritVelocityModule module, Func curveChanger) - { - Debug.Assert(curveChanger != null, "curveChanger cannot be null"); - module.curve = curveChanger(module.curve); - return module; - } - #endregion - - #region CurveMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetInheritVelocityCurveMultiplier(this ParticleSystem particleSystem, float curveMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.inheritVelocity; - module.curveMultiplier = curveMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetInheritVelocityCurveMultiplier(this ParticleSystem particleSystem, Func curveMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(curveMultiplierChanger != null, "curveMultiplierChanger cannot be null"); - var module = particleSystem.inheritVelocity; - module.curveMultiplier = curveMultiplierChanger(module.curveMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static InheritVelocityModule SetCurveMultiplier(this InheritVelocityModule module, float curveMultiplier) - { - module.curveMultiplier = curveMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static InheritVelocityModule SetCurveMultiplier(this InheritVelocityModule module, Func curveMultiplierChanger) - { - Debug.Assert(curveMultiplierChanger != null, "curveMultiplierChanger cannot be null"); - module.curveMultiplier = curveMultiplierChanger(module.curveMultiplier); - return module; - } - #endregion - - #region Enabled - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetInheritVelocityEnabled(this ParticleSystem particleSystem, bool enabled) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.inheritVelocity; - module.enabled = enabled; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetInheritVelocityEnabled(this ParticleSystem particleSystem, Func enabledChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - var module = particleSystem.inheritVelocity; - module.enabled = enabledChanger(module.enabled); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static InheritVelocityModule SetEnabled(this InheritVelocityModule module, bool enabled) - { - module.enabled = enabled; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static InheritVelocityModule SetEnabled(this InheritVelocityModule module, Func enabledChanger) - { - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - module.enabled = enabledChanger(module.enabled); - return module; - } - #endregion - - #region Mode - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetInheritVelocityMode(this ParticleSystem particleSystem, ParticleSystemInheritVelocityMode mode) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.inheritVelocity; - module.mode = mode; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetInheritVelocityMode(this ParticleSystem particleSystem, Func modeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(modeChanger != null, "modeChanger cannot be null"); - var module = particleSystem.inheritVelocity; - module.mode = modeChanger(module.mode); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static InheritVelocityModule SetMode(this InheritVelocityModule module, ParticleSystemInheritVelocityMode mode) - { - module.mode = mode; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static InheritVelocityModule SetMode(this InheritVelocityModule module, Func modeChanger) - { - Debug.Assert(modeChanger != null, "modeChanger cannot be null"); - module.mode = modeChanger(module.mode); - return module; - } - #endregion -#endif - } -} diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/InheritVelocityModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/InheritVelocityModuleExtension.cs.meta deleted file mode 100644 index 112110f..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/InheritVelocityModuleExtension.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 0f56b341cc30c0841b766c7f9e5be69f -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/LifetimeByEmitterSpeedModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/LifetimeByEmitterSpeedModuleExtension.cs.meta deleted file mode 100644 index ec2e086..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/LifetimeByEmitterSpeedModuleExtension.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 05a663d63830197429b3fe629eaf3891 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/LightsModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/LightsModuleExtension.cs.meta deleted file mode 100644 index b8d0117..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/LightsModuleExtension.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: d2d78017e619af248b838790291df3f5 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/LimitVelocityOverLifetimeModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/LimitVelocityOverLifetimeModuleExtension.cs deleted file mode 100644 index c0d7072..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/LimitVelocityOverLifetimeModuleExtension.cs +++ /dev/null @@ -1,793 +0,0 @@ -#nullable enable -using System; -using System.Runtime.CompilerServices; -using UnityEngine; -using static UnityEngine.ParticleSystem; - -namespace OUCC.FluentParticleSystem -{ - public static class LimitVelocityOverLifetimeModuleExtension - { -#if UNITY_2018_4_OR_NEWER - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditLimitVelocityOverLifetime(this ParticleSystem particleSystem, Action moduleEditor) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); - moduleEditor(particleSystem.limitVelocityOverLifetime); - return particleSystem; - } - - #region Dampen - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeDampen(this ParticleSystem particleSystem, float dampen) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.limitVelocityOverLifetime; - module.dampen = dampen; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeDampen(this ParticleSystem particleSystem, Func dampenChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(dampenChanger != null, "dampenChanger cannot be null"); - var module = particleSystem.limitVelocityOverLifetime; - module.dampen = dampenChanger(module.dampen); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetDampen(this LimitVelocityOverLifetimeModule module, float dampen) - { - module.dampen = dampen; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetDampen(this LimitVelocityOverLifetimeModule module, Func dampenChanger) - { - Debug.Assert(dampenChanger != null, "dampenChanger cannot be null"); - module.dampen = dampenChanger(module.dampen); - return module; - } - #endregion - - #region Drag - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeDrag(this ParticleSystem particleSystem, MinMaxCurve drag) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.limitVelocityOverLifetime; - module.drag = drag; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeDrag(this ParticleSystem particleSystem, Func dragChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(dragChanger != null, "dragChanger cannot be null"); - var module = particleSystem.limitVelocityOverLifetime; - module.drag = dragChanger(module.drag); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetDrag(this LimitVelocityOverLifetimeModule module, MinMaxCurve drag) - { - module.drag = drag; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetDrag(this LimitVelocityOverLifetimeModule module, Func dragChanger) - { - Debug.Assert(dragChanger != null, "dragChanger cannot be null"); - module.drag = dragChanger(module.drag); - return module; - } - #endregion - - #region DragMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeDragMultiplier(this ParticleSystem particleSystem, float dragMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.limitVelocityOverLifetime; - module.dragMultiplier = dragMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeDragMultiplier(this ParticleSystem particleSystem, Func dragMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(dragMultiplierChanger != null, "dragMultiplierChanger cannot be null"); - var module = particleSystem.limitVelocityOverLifetime; - module.dragMultiplier = dragMultiplierChanger(module.dragMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetDragMultiplier(this LimitVelocityOverLifetimeModule module, float dragMultiplier) - { - module.dragMultiplier = dragMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetDragMultiplier(this LimitVelocityOverLifetimeModule module, Func dragMultiplierChanger) - { - Debug.Assert(dragMultiplierChanger != null, "dragMultiplierChanger cannot be null"); - module.dragMultiplier = dragMultiplierChanger(module.dragMultiplier); - return module; - } - #endregion - - #region Enabled - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeEnabled(this ParticleSystem particleSystem, bool enabled) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.limitVelocityOverLifetime; - module.enabled = enabled; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeEnabled(this ParticleSystem particleSystem, Func enabledChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - var module = particleSystem.limitVelocityOverLifetime; - module.enabled = enabledChanger(module.enabled); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetEnabled(this LimitVelocityOverLifetimeModule module, bool enabled) - { - module.enabled = enabled; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetEnabled(this LimitVelocityOverLifetimeModule module, Func enabledChanger) - { - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - module.enabled = enabledChanger(module.enabled); - return module; - } - #endregion - - #region Limit - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeLimit(this ParticleSystem particleSystem, MinMaxCurve limit) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.limitVelocityOverLifetime; - module.limit = limit; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeLimit(this ParticleSystem particleSystem, Func limitChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(limitChanger != null, "limitChanger cannot be null"); - var module = particleSystem.limitVelocityOverLifetime; - module.limit = limitChanger(module.limit); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetLimit(this LimitVelocityOverLifetimeModule module, MinMaxCurve limit) - { - module.limit = limit; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetLimit(this LimitVelocityOverLifetimeModule module, Func limitChanger) - { - Debug.Assert(limitChanger != null, "limitChanger cannot be null"); - module.limit = limitChanger(module.limit); - return module; - } - #endregion - - #region LimitMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeLimitMultiplier(this ParticleSystem particleSystem, float limitMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.limitVelocityOverLifetime; - module.limitMultiplier = limitMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeLimitMultiplier(this ParticleSystem particleSystem, Func limitMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(limitMultiplierChanger != null, "limitMultiplierChanger cannot be null"); - var module = particleSystem.limitVelocityOverLifetime; - module.limitMultiplier = limitMultiplierChanger(module.limitMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetLimitMultiplier(this LimitVelocityOverLifetimeModule module, float limitMultiplier) - { - module.limitMultiplier = limitMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetLimitMultiplier(this LimitVelocityOverLifetimeModule module, Func limitMultiplierChanger) - { - Debug.Assert(limitMultiplierChanger != null, "limitMultiplierChanger cannot be null"); - module.limitMultiplier = limitMultiplierChanger(module.limitMultiplier); - return module; - } - #endregion - - #region LimitX - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeLimitX(this ParticleSystem particleSystem, MinMaxCurve limitX) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.limitVelocityOverLifetime; - module.limitX = limitX; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeLimitX(this ParticleSystem particleSystem, Func limitXChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(limitXChanger != null, "limitXChanger cannot be null"); - var module = particleSystem.limitVelocityOverLifetime; - module.limitX = limitXChanger(module.limitX); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetLimitX(this LimitVelocityOverLifetimeModule module, MinMaxCurve limitX) - { - module.limitX = limitX; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetLimitX(this LimitVelocityOverLifetimeModule module, Func limitXChanger) - { - Debug.Assert(limitXChanger != null, "limitXChanger cannot be null"); - module.limitX = limitXChanger(module.limitX); - return module; - } - #endregion - - #region LimitXMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeLimitXMultiplier(this ParticleSystem particleSystem, float limitXMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.limitVelocityOverLifetime; - module.limitXMultiplier = limitXMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeLimitXMultiplier(this ParticleSystem particleSystem, Func limitXMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(limitXMultiplierChanger != null, "limitXMultiplierChanger cannot be null"); - var module = particleSystem.limitVelocityOverLifetime; - module.limitXMultiplier = limitXMultiplierChanger(module.limitXMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetLimitXMultiplier(this LimitVelocityOverLifetimeModule module, float limitXMultiplier) - { - module.limitXMultiplier = limitXMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetLimitXMultiplier(this LimitVelocityOverLifetimeModule module, Func limitXMultiplierChanger) - { - Debug.Assert(limitXMultiplierChanger != null, "limitXMultiplierChanger cannot be null"); - module.limitXMultiplier = limitXMultiplierChanger(module.limitXMultiplier); - return module; - } - #endregion - - #region LimitY - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeLimitY(this ParticleSystem particleSystem, MinMaxCurve limitY) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.limitVelocityOverLifetime; - module.limitY = limitY; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeLimitY(this ParticleSystem particleSystem, Func limitYChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(limitYChanger != null, "limitYChanger cannot be null"); - var module = particleSystem.limitVelocityOverLifetime; - module.limitY = limitYChanger(module.limitY); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetLimitY(this LimitVelocityOverLifetimeModule module, MinMaxCurve limitY) - { - module.limitY = limitY; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetLimitY(this LimitVelocityOverLifetimeModule module, Func limitYChanger) - { - Debug.Assert(limitYChanger != null, "limitYChanger cannot be null"); - module.limitY = limitYChanger(module.limitY); - return module; - } - #endregion - - #region LimitYMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeLimitYMultiplier(this ParticleSystem particleSystem, float limitYMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.limitVelocityOverLifetime; - module.limitYMultiplier = limitYMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeLimitYMultiplier(this ParticleSystem particleSystem, Func limitYMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(limitYMultiplierChanger != null, "limitYMultiplierChanger cannot be null"); - var module = particleSystem.limitVelocityOverLifetime; - module.limitYMultiplier = limitYMultiplierChanger(module.limitYMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetLimitYMultiplier(this LimitVelocityOverLifetimeModule module, float limitYMultiplier) - { - module.limitYMultiplier = limitYMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetLimitYMultiplier(this LimitVelocityOverLifetimeModule module, Func limitYMultiplierChanger) - { - Debug.Assert(limitYMultiplierChanger != null, "limitYMultiplierChanger cannot be null"); - module.limitYMultiplier = limitYMultiplierChanger(module.limitYMultiplier); - return module; - } - #endregion - - #region LimitZ - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeLimitZ(this ParticleSystem particleSystem, MinMaxCurve limitZ) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.limitVelocityOverLifetime; - module.limitZ = limitZ; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeLimitZ(this ParticleSystem particleSystem, Func limitZChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(limitZChanger != null, "limitZChanger cannot be null"); - var module = particleSystem.limitVelocityOverLifetime; - module.limitZ = limitZChanger(module.limitZ); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetLimitZ(this LimitVelocityOverLifetimeModule module, MinMaxCurve limitZ) - { - module.limitZ = limitZ; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetLimitZ(this LimitVelocityOverLifetimeModule module, Func limitZChanger) - { - Debug.Assert(limitZChanger != null, "limitZChanger cannot be null"); - module.limitZ = limitZChanger(module.limitZ); - return module; - } - #endregion - - #region LimitZMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeLimitZMultiplier(this ParticleSystem particleSystem, float limitZMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.limitVelocityOverLifetime; - module.limitZMultiplier = limitZMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeLimitZMultiplier(this ParticleSystem particleSystem, Func limitZMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(limitZMultiplierChanger != null, "limitZMultiplierChanger cannot be null"); - var module = particleSystem.limitVelocityOverLifetime; - module.limitZMultiplier = limitZMultiplierChanger(module.limitZMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetLimitZMultiplier(this LimitVelocityOverLifetimeModule module, float limitZMultiplier) - { - module.limitZMultiplier = limitZMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetLimitZMultiplier(this LimitVelocityOverLifetimeModule module, Func limitZMultiplierChanger) - { - Debug.Assert(limitZMultiplierChanger != null, "limitZMultiplierChanger cannot be null"); - module.limitZMultiplier = limitZMultiplierChanger(module.limitZMultiplier); - return module; - } - #endregion - - #region MultiplyDragByParticleSize - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeMultiplyDragByParticleSize(this ParticleSystem particleSystem, bool multiplyDragByParticleSize) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.limitVelocityOverLifetime; - module.multiplyDragByParticleSize = multiplyDragByParticleSize; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeMultiplyDragByParticleSize(this ParticleSystem particleSystem, Func multiplyDragByParticleSizeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(multiplyDragByParticleSizeChanger != null, "multiplyDragByParticleSizeChanger cannot be null"); - var module = particleSystem.limitVelocityOverLifetime; - module.multiplyDragByParticleSize = multiplyDragByParticleSizeChanger(module.multiplyDragByParticleSize); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetMultiplyDragByParticleSize(this LimitVelocityOverLifetimeModule module, bool multiplyDragByParticleSize) - { - module.multiplyDragByParticleSize = multiplyDragByParticleSize; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetMultiplyDragByParticleSize(this LimitVelocityOverLifetimeModule module, Func multiplyDragByParticleSizeChanger) - { - Debug.Assert(multiplyDragByParticleSizeChanger != null, "multiplyDragByParticleSizeChanger cannot be null"); - module.multiplyDragByParticleSize = multiplyDragByParticleSizeChanger(module.multiplyDragByParticleSize); - return module; - } - #endregion - - #region MultiplyDragByParticleVelocity - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeMultiplyDragByParticleVelocity(this ParticleSystem particleSystem, bool multiplyDragByParticleVelocity) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.limitVelocityOverLifetime; - module.multiplyDragByParticleVelocity = multiplyDragByParticleVelocity; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeMultiplyDragByParticleVelocity(this ParticleSystem particleSystem, Func multiplyDragByParticleVelocityChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(multiplyDragByParticleVelocityChanger != null, "multiplyDragByParticleVelocityChanger cannot be null"); - var module = particleSystem.limitVelocityOverLifetime; - module.multiplyDragByParticleVelocity = multiplyDragByParticleVelocityChanger(module.multiplyDragByParticleVelocity); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetMultiplyDragByParticleVelocity(this LimitVelocityOverLifetimeModule module, bool multiplyDragByParticleVelocity) - { - module.multiplyDragByParticleVelocity = multiplyDragByParticleVelocity; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetMultiplyDragByParticleVelocity(this LimitVelocityOverLifetimeModule module, Func multiplyDragByParticleVelocityChanger) - { - Debug.Assert(multiplyDragByParticleVelocityChanger != null, "multiplyDragByParticleVelocityChanger cannot be null"); - module.multiplyDragByParticleVelocity = multiplyDragByParticleVelocityChanger(module.multiplyDragByParticleVelocity); - return module; - } - #endregion - - #region SeparateAxes - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeSeparateAxes(this ParticleSystem particleSystem, bool separateAxes) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.limitVelocityOverLifetime; - module.separateAxes = separateAxes; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeSeparateAxes(this ParticleSystem particleSystem, Func separateAxesChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(separateAxesChanger != null, "separateAxesChanger cannot be null"); - var module = particleSystem.limitVelocityOverLifetime; - module.separateAxes = separateAxesChanger(module.separateAxes); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetSeparateAxes(this LimitVelocityOverLifetimeModule module, bool separateAxes) - { - module.separateAxes = separateAxes; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetSeparateAxes(this LimitVelocityOverLifetimeModule module, Func separateAxesChanger) - { - Debug.Assert(separateAxesChanger != null, "separateAxesChanger cannot be null"); - module.separateAxes = separateAxesChanger(module.separateAxes); - return module; - } - #endregion - - #region Space - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeSpace(this ParticleSystem particleSystem, ParticleSystemSimulationSpace space) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.limitVelocityOverLifetime; - module.space = space; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetLimitVelocityOverLifetimeSpace(this ParticleSystem particleSystem, Func spaceChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(spaceChanger != null, "spaceChanger cannot be null"); - var module = particleSystem.limitVelocityOverLifetime; - module.space = spaceChanger(module.space); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetSpace(this LimitVelocityOverLifetimeModule module, ParticleSystemSimulationSpace space) - { - module.space = space; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LimitVelocityOverLifetimeModule SetSpace(this LimitVelocityOverLifetimeModule module, Func spaceChanger) - { - Debug.Assert(spaceChanger != null, "spaceChanger cannot be null"); - module.space = spaceChanger(module.space); - return module; - } - #endregion -#endif - } -} diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/LimitVelocityOverLifetimeModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/LimitVelocityOverLifetimeModuleExtension.cs.meta deleted file mode 100644 index aee149f..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/LimitVelocityOverLifetimeModuleExtension.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: a1a8f7179bdc4ab429eccdb30c370d5e -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/MainModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/MainModuleExtension.cs deleted file mode 100644 index 30790ae..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/MainModuleExtension.cs +++ /dev/null @@ -1,2253 +0,0 @@ -#nullable enable -using System; -using System.Runtime.CompilerServices; -using UnityEngine; -using static UnityEngine.ParticleSystem; - -namespace OUCC.FluentParticleSystem -{ - public static class MainModuleExtension - { -#if UNITY_2018_4_OR_NEWER - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditMain(this ParticleSystem particleSystem, Action moduleEditor) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); - moduleEditor(particleSystem.main); - return particleSystem; - } - - #region CullingMode - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainCullingMode(this ParticleSystem particleSystem, ParticleSystemCullingMode cullingMode) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.cullingMode = cullingMode; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainCullingMode(this ParticleSystem particleSystem, Func cullingModeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(cullingModeChanger != null, "cullingModeChanger cannot be null"); - var module = particleSystem.main; - module.cullingMode = cullingModeChanger(module.cullingMode); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetCullingMode(this MainModule module, ParticleSystemCullingMode cullingMode) - { - module.cullingMode = cullingMode; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetCullingMode(this MainModule module, Func cullingModeChanger) - { - Debug.Assert(cullingModeChanger != null, "cullingModeChanger cannot be null"); - module.cullingMode = cullingModeChanger(module.cullingMode); - return module; - } - #endregion - - #region CustomSimulationSpace - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainCustomSimulationSpace(this ParticleSystem particleSystem, Transform customSimulationSpace) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.customSimulationSpace = customSimulationSpace; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainCustomSimulationSpace(this ParticleSystem particleSystem, Func customSimulationSpaceChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(customSimulationSpaceChanger != null, "customSimulationSpaceChanger cannot be null"); - var module = particleSystem.main; - module.customSimulationSpace = customSimulationSpaceChanger(module.customSimulationSpace); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetCustomSimulationSpace(this MainModule module, Transform customSimulationSpace) - { - module.customSimulationSpace = customSimulationSpace; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetCustomSimulationSpace(this MainModule module, Func customSimulationSpaceChanger) - { - Debug.Assert(customSimulationSpaceChanger != null, "customSimulationSpaceChanger cannot be null"); - module.customSimulationSpace = customSimulationSpaceChanger(module.customSimulationSpace); - return module; - } - #endregion - - #region Duration - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainDuration(this ParticleSystem particleSystem, float duration) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.duration = duration; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainDuration(this ParticleSystem particleSystem, Func durationChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(durationChanger != null, "durationChanger cannot be null"); - var module = particleSystem.main; - module.duration = durationChanger(module.duration); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetDuration(this MainModule module, float duration) - { - module.duration = duration; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetDuration(this MainModule module, Func durationChanger) - { - Debug.Assert(durationChanger != null, "durationChanger cannot be null"); - module.duration = durationChanger(module.duration); - return module; - } - #endregion -#endif - -#if UNITY_2021_3_OR_NEWER - #region EmitterVelocity - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainEmitterVelocity(this ParticleSystem particleSystem, Vector3 emitterVelocity) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.emitterVelocity = emitterVelocity; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainEmitterVelocity(this ParticleSystem particleSystem, Func emitterVelocityChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(emitterVelocityChanger != null, "emitterVelocityChanger cannot be null"); - var module = particleSystem.main; - module.emitterVelocity = emitterVelocityChanger(module.emitterVelocity); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetEmitterVelocity(this MainModule module, Vector3 emitterVelocity) - { - module.emitterVelocity = emitterVelocity; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetEmitterVelocity(this MainModule module, Func emitterVelocityChanger) - { - Debug.Assert(emitterVelocityChanger != null, "emitterVelocityChanger cannot be null"); - module.emitterVelocity = emitterVelocityChanger(module.emitterVelocity); - return module; - } - #endregion -#endif - -#if UNITY_2018_4_OR_NEWER - #region EmitterVelocityMode - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainEmitterVelocityMode(this ParticleSystem particleSystem, ParticleSystemEmitterVelocityMode emitterVelocityMode) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.emitterVelocityMode = emitterVelocityMode; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainEmitterVelocityMode(this ParticleSystem particleSystem, Func emitterVelocityModeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(emitterVelocityModeChanger != null, "emitterVelocityModeChanger cannot be null"); - var module = particleSystem.main; - module.emitterVelocityMode = emitterVelocityModeChanger(module.emitterVelocityMode); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetEmitterVelocityMode(this MainModule module, ParticleSystemEmitterVelocityMode emitterVelocityMode) - { - module.emitterVelocityMode = emitterVelocityMode; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetEmitterVelocityMode(this MainModule module, Func emitterVelocityModeChanger) - { - Debug.Assert(emitterVelocityModeChanger != null, "emitterVelocityModeChanger cannot be null"); - module.emitterVelocityMode = emitterVelocityModeChanger(module.emitterVelocityMode); - return module; - } - #endregion - - #region FlipRotation - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainFlipRotation(this ParticleSystem particleSystem, float flipRotation) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.flipRotation = flipRotation; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainFlipRotation(this ParticleSystem particleSystem, Func flipRotationChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(flipRotationChanger != null, "flipRotationChanger cannot be null"); - var module = particleSystem.main; - module.flipRotation = flipRotationChanger(module.flipRotation); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetFlipRotation(this MainModule module, float flipRotation) - { - module.flipRotation = flipRotation; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetFlipRotation(this MainModule module, Func flipRotationChanger) - { - Debug.Assert(flipRotationChanger != null, "flipRotationChanger cannot be null"); - module.flipRotation = flipRotationChanger(module.flipRotation); - return module; - } - #endregion - - #region GravityModifier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainGravityModifier(this ParticleSystem particleSystem, MinMaxCurve gravityModifier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.gravityModifier = gravityModifier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainGravityModifier(this ParticleSystem particleSystem, Func gravityModifierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(gravityModifierChanger != null, "gravityModifierChanger cannot be null"); - var module = particleSystem.main; - module.gravityModifier = gravityModifierChanger(module.gravityModifier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetGravityModifier(this MainModule module, MinMaxCurve gravityModifier) - { - module.gravityModifier = gravityModifier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetGravityModifier(this MainModule module, Func gravityModifierChanger) - { - Debug.Assert(gravityModifierChanger != null, "gravityModifierChanger cannot be null"); - module.gravityModifier = gravityModifierChanger(module.gravityModifier); - return module; - } - #endregion - - #region GravityModifierMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainGravityModifierMultiplier(this ParticleSystem particleSystem, float gravityModifierMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.gravityModifierMultiplier = gravityModifierMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainGravityModifierMultiplier(this ParticleSystem particleSystem, Func gravityModifierMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(gravityModifierMultiplierChanger != null, "gravityModifierMultiplierChanger cannot be null"); - var module = particleSystem.main; - module.gravityModifierMultiplier = gravityModifierMultiplierChanger(module.gravityModifierMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetGravityModifierMultiplier(this MainModule module, float gravityModifierMultiplier) - { - module.gravityModifierMultiplier = gravityModifierMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetGravityModifierMultiplier(this MainModule module, Func gravityModifierMultiplierChanger) - { - Debug.Assert(gravityModifierMultiplierChanger != null, "gravityModifierMultiplierChanger cannot be null"); - module.gravityModifierMultiplier = gravityModifierMultiplierChanger(module.gravityModifierMultiplier); - return module; - } - #endregion -#endif - -#if UNITY_2022_2_OR_NEWER - #region GravitySource - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainGravitySource(this ParticleSystem particleSystem, ParticleSystemGravitySource gravitySource) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.gravitySource = gravitySource; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainGravitySource(this ParticleSystem particleSystem, Func gravitySourceChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(gravitySourceChanger != null, "gravitySourceChanger cannot be null"); - var module = particleSystem.main; - module.gravitySource = gravitySourceChanger(module.gravitySource); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetGravitySource(this MainModule module, ParticleSystemGravitySource gravitySource) - { - module.gravitySource = gravitySource; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetGravitySource(this MainModule module, Func gravitySourceChanger) - { - Debug.Assert(gravitySourceChanger != null, "gravitySourceChanger cannot be null"); - module.gravitySource = gravitySourceChanger(module.gravitySource); - return module; - } - #endregion -#endif - -#if UNITY_2018_4_OR_NEWER - #region Loop - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainLoop(this ParticleSystem particleSystem, bool loop) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.loop = loop; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainLoop(this ParticleSystem particleSystem, Func loopChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(loopChanger != null, "loopChanger cannot be null"); - var module = particleSystem.main; - module.loop = loopChanger(module.loop); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetLoop(this MainModule module, bool loop) - { - module.loop = loop; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetLoop(this MainModule module, Func loopChanger) - { - Debug.Assert(loopChanger != null, "loopChanger cannot be null"); - module.loop = loopChanger(module.loop); - return module; - } - #endregion - - #region MaxParticles - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainMaxParticles(this ParticleSystem particleSystem, int maxParticles) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.maxParticles = maxParticles; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainMaxParticles(this ParticleSystem particleSystem, Func maxParticlesChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(maxParticlesChanger != null, "maxParticlesChanger cannot be null"); - var module = particleSystem.main; - module.maxParticles = maxParticlesChanger(module.maxParticles); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetMaxParticles(this MainModule module, int maxParticles) - { - module.maxParticles = maxParticles; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetMaxParticles(this MainModule module, Func maxParticlesChanger) - { - Debug.Assert(maxParticlesChanger != null, "maxParticlesChanger cannot be null"); - module.maxParticles = maxParticlesChanger(module.maxParticles); - return module; - } - #endregion - - #region PlayOnAwake - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainPlayOnAwake(this ParticleSystem particleSystem, bool playOnAwake) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.playOnAwake = playOnAwake; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainPlayOnAwake(this ParticleSystem particleSystem, Func playOnAwakeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(playOnAwakeChanger != null, "playOnAwakeChanger cannot be null"); - var module = particleSystem.main; - module.playOnAwake = playOnAwakeChanger(module.playOnAwake); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetPlayOnAwake(this MainModule module, bool playOnAwake) - { - module.playOnAwake = playOnAwake; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetPlayOnAwake(this MainModule module, Func playOnAwakeChanger) - { - Debug.Assert(playOnAwakeChanger != null, "playOnAwakeChanger cannot be null"); - module.playOnAwake = playOnAwakeChanger(module.playOnAwake); - return module; - } - #endregion - - #region Prewarm - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainPrewarm(this ParticleSystem particleSystem, bool prewarm) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.prewarm = prewarm; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainPrewarm(this ParticleSystem particleSystem, Func prewarmChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(prewarmChanger != null, "prewarmChanger cannot be null"); - var module = particleSystem.main; - module.prewarm = prewarmChanger(module.prewarm); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetPrewarm(this MainModule module, bool prewarm) - { - module.prewarm = prewarm; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetPrewarm(this MainModule module, Func prewarmChanger) - { - Debug.Assert(prewarmChanger != null, "prewarmChanger cannot be null"); - module.prewarm = prewarmChanger(module.prewarm); - return module; - } - #endregion - - #region RandomizeRotationDirection - /// - /// Assign a value to - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("Please use flipRotation instead. (UnityUpgradable) -> UnityEngine.ParticleSystem/MainModule.flipRotation", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainRandomizeRotationDirection(this ParticleSystem particleSystem, float randomizeRotationDirection) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.randomizeRotationDirection = randomizeRotationDirection; - return particleSystem; - } - - /// - /// Edit - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("Please use flipRotation instead. (UnityUpgradable) -> UnityEngine.ParticleSystem/MainModule.flipRotation", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainRandomizeRotationDirection(this ParticleSystem particleSystem, Func randomizeRotationDirectionChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(randomizeRotationDirectionChanger != null, "randomizeRotationDirectionChanger cannot be null"); - var module = particleSystem.main; - module.randomizeRotationDirection = randomizeRotationDirectionChanger(module.randomizeRotationDirection); - return particleSystem; - } - - /// - /// Assign a value to - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("Please use flipRotation instead. (UnityUpgradable) -> UnityEngine.ParticleSystem/MainModule.flipRotation", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetRandomizeRotationDirection(this MainModule module, float randomizeRotationDirection) - { - module.randomizeRotationDirection = randomizeRotationDirection; - return module; - } - - /// - /// Edit - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("Please use flipRotation instead. (UnityUpgradable) -> UnityEngine.ParticleSystem/MainModule.flipRotation", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetRandomizeRotationDirection(this MainModule module, Func randomizeRotationDirectionChanger) - { - Debug.Assert(randomizeRotationDirectionChanger != null, "randomizeRotationDirectionChanger cannot be null"); - module.randomizeRotationDirection = randomizeRotationDirectionChanger(module.randomizeRotationDirection); - return module; - } - #endregion - - #region RingBufferLoopRange - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainRingBufferLoopRange(this ParticleSystem particleSystem, Vector2 ringBufferLoopRange) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.ringBufferLoopRange = ringBufferLoopRange; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainRingBufferLoopRange(this ParticleSystem particleSystem, Func ringBufferLoopRangeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(ringBufferLoopRangeChanger != null, "ringBufferLoopRangeChanger cannot be null"); - var module = particleSystem.main; - module.ringBufferLoopRange = ringBufferLoopRangeChanger(module.ringBufferLoopRange); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetRingBufferLoopRange(this MainModule module, Vector2 ringBufferLoopRange) - { - module.ringBufferLoopRange = ringBufferLoopRange; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetRingBufferLoopRange(this MainModule module, Func ringBufferLoopRangeChanger) - { - Debug.Assert(ringBufferLoopRangeChanger != null, "ringBufferLoopRangeChanger cannot be null"); - module.ringBufferLoopRange = ringBufferLoopRangeChanger(module.ringBufferLoopRange); - return module; - } - #endregion - - #region RingBufferMode - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainRingBufferMode(this ParticleSystem particleSystem, ParticleSystemRingBufferMode ringBufferMode) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.ringBufferMode = ringBufferMode; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainRingBufferMode(this ParticleSystem particleSystem, Func ringBufferModeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(ringBufferModeChanger != null, "ringBufferModeChanger cannot be null"); - var module = particleSystem.main; - module.ringBufferMode = ringBufferModeChanger(module.ringBufferMode); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetRingBufferMode(this MainModule module, ParticleSystemRingBufferMode ringBufferMode) - { - module.ringBufferMode = ringBufferMode; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetRingBufferMode(this MainModule module, Func ringBufferModeChanger) - { - Debug.Assert(ringBufferModeChanger != null, "ringBufferModeChanger cannot be null"); - module.ringBufferMode = ringBufferModeChanger(module.ringBufferMode); - return module; - } - #endregion - - #region ScalingMode - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainScalingMode(this ParticleSystem particleSystem, ParticleSystemScalingMode scalingMode) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.scalingMode = scalingMode; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainScalingMode(this ParticleSystem particleSystem, Func scalingModeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(scalingModeChanger != null, "scalingModeChanger cannot be null"); - var module = particleSystem.main; - module.scalingMode = scalingModeChanger(module.scalingMode); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetScalingMode(this MainModule module, ParticleSystemScalingMode scalingMode) - { - module.scalingMode = scalingMode; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetScalingMode(this MainModule module, Func scalingModeChanger) - { - Debug.Assert(scalingModeChanger != null, "scalingModeChanger cannot be null"); - module.scalingMode = scalingModeChanger(module.scalingMode); - return module; - } - #endregion - - #region SimulationSpace - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainSimulationSpace(this ParticleSystem particleSystem, ParticleSystemSimulationSpace simulationSpace) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.simulationSpace = simulationSpace; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainSimulationSpace(this ParticleSystem particleSystem, Func simulationSpaceChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(simulationSpaceChanger != null, "simulationSpaceChanger cannot be null"); - var module = particleSystem.main; - module.simulationSpace = simulationSpaceChanger(module.simulationSpace); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetSimulationSpace(this MainModule module, ParticleSystemSimulationSpace simulationSpace) - { - module.simulationSpace = simulationSpace; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetSimulationSpace(this MainModule module, Func simulationSpaceChanger) - { - Debug.Assert(simulationSpaceChanger != null, "simulationSpaceChanger cannot be null"); - module.simulationSpace = simulationSpaceChanger(module.simulationSpace); - return module; - } - #endregion - - #region SimulationSpeed - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainSimulationSpeed(this ParticleSystem particleSystem, float simulationSpeed) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.simulationSpeed = simulationSpeed; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainSimulationSpeed(this ParticleSystem particleSystem, Func simulationSpeedChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(simulationSpeedChanger != null, "simulationSpeedChanger cannot be null"); - var module = particleSystem.main; - module.simulationSpeed = simulationSpeedChanger(module.simulationSpeed); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetSimulationSpeed(this MainModule module, float simulationSpeed) - { - module.simulationSpeed = simulationSpeed; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetSimulationSpeed(this MainModule module, Func simulationSpeedChanger) - { - Debug.Assert(simulationSpeedChanger != null, "simulationSpeedChanger cannot be null"); - module.simulationSpeed = simulationSpeedChanger(module.simulationSpeed); - return module; - } - #endregion - - #region StartColor - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartColor(this ParticleSystem particleSystem, MinMaxGradient startColor) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.startColor = startColor; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartColor(this ParticleSystem particleSystem, Func startColorChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(startColorChanger != null, "startColorChanger cannot be null"); - var module = particleSystem.main; - module.startColor = startColorChanger(module.startColor); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartColor(this MainModule module, MinMaxGradient startColor) - { - module.startColor = startColor; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartColor(this MainModule module, Func startColorChanger) - { - Debug.Assert(startColorChanger != null, "startColorChanger cannot be null"); - module.startColor = startColorChanger(module.startColor); - return module; - } - #endregion - - #region StartDelay - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartDelay(this ParticleSystem particleSystem, MinMaxCurve startDelay) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.startDelay = startDelay; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartDelay(this ParticleSystem particleSystem, Func startDelayChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(startDelayChanger != null, "startDelayChanger cannot be null"); - var module = particleSystem.main; - module.startDelay = startDelayChanger(module.startDelay); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartDelay(this MainModule module, MinMaxCurve startDelay) - { - module.startDelay = startDelay; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartDelay(this MainModule module, Func startDelayChanger) - { - Debug.Assert(startDelayChanger != null, "startDelayChanger cannot be null"); - module.startDelay = startDelayChanger(module.startDelay); - return module; - } - #endregion - - #region StartDelayMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartDelayMultiplier(this ParticleSystem particleSystem, float startDelayMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.startDelayMultiplier = startDelayMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartDelayMultiplier(this ParticleSystem particleSystem, Func startDelayMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(startDelayMultiplierChanger != null, "startDelayMultiplierChanger cannot be null"); - var module = particleSystem.main; - module.startDelayMultiplier = startDelayMultiplierChanger(module.startDelayMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartDelayMultiplier(this MainModule module, float startDelayMultiplier) - { - module.startDelayMultiplier = startDelayMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartDelayMultiplier(this MainModule module, Func startDelayMultiplierChanger) - { - Debug.Assert(startDelayMultiplierChanger != null, "startDelayMultiplierChanger cannot be null"); - module.startDelayMultiplier = startDelayMultiplierChanger(module.startDelayMultiplier); - return module; - } - #endregion - - #region StartLifetime - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartLifetime(this ParticleSystem particleSystem, MinMaxCurve startLifetime) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.startLifetime = startLifetime; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartLifetime(this ParticleSystem particleSystem, Func startLifetimeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(startLifetimeChanger != null, "startLifetimeChanger cannot be null"); - var module = particleSystem.main; - module.startLifetime = startLifetimeChanger(module.startLifetime); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartLifetime(this MainModule module, MinMaxCurve startLifetime) - { - module.startLifetime = startLifetime; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartLifetime(this MainModule module, Func startLifetimeChanger) - { - Debug.Assert(startLifetimeChanger != null, "startLifetimeChanger cannot be null"); - module.startLifetime = startLifetimeChanger(module.startLifetime); - return module; - } - #endregion - - #region StartLifetimeMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartLifetimeMultiplier(this ParticleSystem particleSystem, float startLifetimeMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.startLifetimeMultiplier = startLifetimeMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartLifetimeMultiplier(this ParticleSystem particleSystem, Func startLifetimeMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(startLifetimeMultiplierChanger != null, "startLifetimeMultiplierChanger cannot be null"); - var module = particleSystem.main; - module.startLifetimeMultiplier = startLifetimeMultiplierChanger(module.startLifetimeMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartLifetimeMultiplier(this MainModule module, float startLifetimeMultiplier) - { - module.startLifetimeMultiplier = startLifetimeMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartLifetimeMultiplier(this MainModule module, Func startLifetimeMultiplierChanger) - { - Debug.Assert(startLifetimeMultiplierChanger != null, "startLifetimeMultiplierChanger cannot be null"); - module.startLifetimeMultiplier = startLifetimeMultiplierChanger(module.startLifetimeMultiplier); - return module; - } - #endregion - - #region StartRotation - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartRotation(this ParticleSystem particleSystem, MinMaxCurve startRotation) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.startRotation = startRotation; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartRotation(this ParticleSystem particleSystem, Func startRotationChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(startRotationChanger != null, "startRotationChanger cannot be null"); - var module = particleSystem.main; - module.startRotation = startRotationChanger(module.startRotation); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartRotation(this MainModule module, MinMaxCurve startRotation) - { - module.startRotation = startRotation; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartRotation(this MainModule module, Func startRotationChanger) - { - Debug.Assert(startRotationChanger != null, "startRotationChanger cannot be null"); - module.startRotation = startRotationChanger(module.startRotation); - return module; - } - #endregion - - #region StartRotation3D - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartRotation3D(this ParticleSystem particleSystem, bool startRotation3D) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.startRotation3D = startRotation3D; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartRotation3D(this ParticleSystem particleSystem, Func startRotation3DChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(startRotation3DChanger != null, "startRotation3DChanger cannot be null"); - var module = particleSystem.main; - module.startRotation3D = startRotation3DChanger(module.startRotation3D); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartRotation3D(this MainModule module, bool startRotation3D) - { - module.startRotation3D = startRotation3D; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartRotation3D(this MainModule module, Func startRotation3DChanger) - { - Debug.Assert(startRotation3DChanger != null, "startRotation3DChanger cannot be null"); - module.startRotation3D = startRotation3DChanger(module.startRotation3D); - return module; - } - #endregion - - #region StartRotationMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartRotationMultiplier(this ParticleSystem particleSystem, float startRotationMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.startRotationMultiplier = startRotationMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartRotationMultiplier(this ParticleSystem particleSystem, Func startRotationMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(startRotationMultiplierChanger != null, "startRotationMultiplierChanger cannot be null"); - var module = particleSystem.main; - module.startRotationMultiplier = startRotationMultiplierChanger(module.startRotationMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartRotationMultiplier(this MainModule module, float startRotationMultiplier) - { - module.startRotationMultiplier = startRotationMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartRotationMultiplier(this MainModule module, Func startRotationMultiplierChanger) - { - Debug.Assert(startRotationMultiplierChanger != null, "startRotationMultiplierChanger cannot be null"); - module.startRotationMultiplier = startRotationMultiplierChanger(module.startRotationMultiplier); - return module; - } - #endregion - - #region StartRotationX - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartRotationX(this ParticleSystem particleSystem, MinMaxCurve startRotationX) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.startRotationX = startRotationX; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartRotationX(this ParticleSystem particleSystem, Func startRotationXChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(startRotationXChanger != null, "startRotationXChanger cannot be null"); - var module = particleSystem.main; - module.startRotationX = startRotationXChanger(module.startRotationX); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartRotationX(this MainModule module, MinMaxCurve startRotationX) - { - module.startRotationX = startRotationX; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartRotationX(this MainModule module, Func startRotationXChanger) - { - Debug.Assert(startRotationXChanger != null, "startRotationXChanger cannot be null"); - module.startRotationX = startRotationXChanger(module.startRotationX); - return module; - } - #endregion - - #region StartRotationXMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartRotationXMultiplier(this ParticleSystem particleSystem, float startRotationXMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.startRotationXMultiplier = startRotationXMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartRotationXMultiplier(this ParticleSystem particleSystem, Func startRotationXMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(startRotationXMultiplierChanger != null, "startRotationXMultiplierChanger cannot be null"); - var module = particleSystem.main; - module.startRotationXMultiplier = startRotationXMultiplierChanger(module.startRotationXMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartRotationXMultiplier(this MainModule module, float startRotationXMultiplier) - { - module.startRotationXMultiplier = startRotationXMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartRotationXMultiplier(this MainModule module, Func startRotationXMultiplierChanger) - { - Debug.Assert(startRotationXMultiplierChanger != null, "startRotationXMultiplierChanger cannot be null"); - module.startRotationXMultiplier = startRotationXMultiplierChanger(module.startRotationXMultiplier); - return module; - } - #endregion - - #region StartRotationY - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartRotationY(this ParticleSystem particleSystem, MinMaxCurve startRotationY) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.startRotationY = startRotationY; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartRotationY(this ParticleSystem particleSystem, Func startRotationYChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(startRotationYChanger != null, "startRotationYChanger cannot be null"); - var module = particleSystem.main; - module.startRotationY = startRotationYChanger(module.startRotationY); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartRotationY(this MainModule module, MinMaxCurve startRotationY) - { - module.startRotationY = startRotationY; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartRotationY(this MainModule module, Func startRotationYChanger) - { - Debug.Assert(startRotationYChanger != null, "startRotationYChanger cannot be null"); - module.startRotationY = startRotationYChanger(module.startRotationY); - return module; - } - #endregion - - #region StartRotationYMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartRotationYMultiplier(this ParticleSystem particleSystem, float startRotationYMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.startRotationYMultiplier = startRotationYMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartRotationYMultiplier(this ParticleSystem particleSystem, Func startRotationYMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(startRotationYMultiplierChanger != null, "startRotationYMultiplierChanger cannot be null"); - var module = particleSystem.main; - module.startRotationYMultiplier = startRotationYMultiplierChanger(module.startRotationYMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartRotationYMultiplier(this MainModule module, float startRotationYMultiplier) - { - module.startRotationYMultiplier = startRotationYMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartRotationYMultiplier(this MainModule module, Func startRotationYMultiplierChanger) - { - Debug.Assert(startRotationYMultiplierChanger != null, "startRotationYMultiplierChanger cannot be null"); - module.startRotationYMultiplier = startRotationYMultiplierChanger(module.startRotationYMultiplier); - return module; - } - #endregion - - #region StartRotationZ - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartRotationZ(this ParticleSystem particleSystem, MinMaxCurve startRotationZ) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.startRotationZ = startRotationZ; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartRotationZ(this ParticleSystem particleSystem, Func startRotationZChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(startRotationZChanger != null, "startRotationZChanger cannot be null"); - var module = particleSystem.main; - module.startRotationZ = startRotationZChanger(module.startRotationZ); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartRotationZ(this MainModule module, MinMaxCurve startRotationZ) - { - module.startRotationZ = startRotationZ; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartRotationZ(this MainModule module, Func startRotationZChanger) - { - Debug.Assert(startRotationZChanger != null, "startRotationZChanger cannot be null"); - module.startRotationZ = startRotationZChanger(module.startRotationZ); - return module; - } - #endregion - - #region StartRotationZMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartRotationZMultiplier(this ParticleSystem particleSystem, float startRotationZMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.startRotationZMultiplier = startRotationZMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartRotationZMultiplier(this ParticleSystem particleSystem, Func startRotationZMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(startRotationZMultiplierChanger != null, "startRotationZMultiplierChanger cannot be null"); - var module = particleSystem.main; - module.startRotationZMultiplier = startRotationZMultiplierChanger(module.startRotationZMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartRotationZMultiplier(this MainModule module, float startRotationZMultiplier) - { - module.startRotationZMultiplier = startRotationZMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartRotationZMultiplier(this MainModule module, Func startRotationZMultiplierChanger) - { - Debug.Assert(startRotationZMultiplierChanger != null, "startRotationZMultiplierChanger cannot be null"); - module.startRotationZMultiplier = startRotationZMultiplierChanger(module.startRotationZMultiplier); - return module; - } - #endregion - - #region StartSize - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSize(this ParticleSystem particleSystem, MinMaxCurve startSize) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.startSize = startSize; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSize(this ParticleSystem particleSystem, Func startSizeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(startSizeChanger != null, "startSizeChanger cannot be null"); - var module = particleSystem.main; - module.startSize = startSizeChanger(module.startSize); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartSize(this MainModule module, MinMaxCurve startSize) - { - module.startSize = startSize; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartSize(this MainModule module, Func startSizeChanger) - { - Debug.Assert(startSizeChanger != null, "startSizeChanger cannot be null"); - module.startSize = startSizeChanger(module.startSize); - return module; - } - #endregion - - #region StartSize3D - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSize3D(this ParticleSystem particleSystem, bool startSize3D) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.startSize3D = startSize3D; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSize3D(this ParticleSystem particleSystem, Func startSize3DChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(startSize3DChanger != null, "startSize3DChanger cannot be null"); - var module = particleSystem.main; - module.startSize3D = startSize3DChanger(module.startSize3D); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartSize3D(this MainModule module, bool startSize3D) - { - module.startSize3D = startSize3D; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartSize3D(this MainModule module, Func startSize3DChanger) - { - Debug.Assert(startSize3DChanger != null, "startSize3DChanger cannot be null"); - module.startSize3D = startSize3DChanger(module.startSize3D); - return module; - } - #endregion - - #region StartSizeMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSizeMultiplier(this ParticleSystem particleSystem, float startSizeMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.startSizeMultiplier = startSizeMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSizeMultiplier(this ParticleSystem particleSystem, Func startSizeMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(startSizeMultiplierChanger != null, "startSizeMultiplierChanger cannot be null"); - var module = particleSystem.main; - module.startSizeMultiplier = startSizeMultiplierChanger(module.startSizeMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartSizeMultiplier(this MainModule module, float startSizeMultiplier) - { - module.startSizeMultiplier = startSizeMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartSizeMultiplier(this MainModule module, Func startSizeMultiplierChanger) - { - Debug.Assert(startSizeMultiplierChanger != null, "startSizeMultiplierChanger cannot be null"); - module.startSizeMultiplier = startSizeMultiplierChanger(module.startSizeMultiplier); - return module; - } - #endregion - - #region StartSizeX - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSizeX(this ParticleSystem particleSystem, MinMaxCurve startSizeX) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.startSizeX = startSizeX; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSizeX(this ParticleSystem particleSystem, Func startSizeXChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(startSizeXChanger != null, "startSizeXChanger cannot be null"); - var module = particleSystem.main; - module.startSizeX = startSizeXChanger(module.startSizeX); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartSizeX(this MainModule module, MinMaxCurve startSizeX) - { - module.startSizeX = startSizeX; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartSizeX(this MainModule module, Func startSizeXChanger) - { - Debug.Assert(startSizeXChanger != null, "startSizeXChanger cannot be null"); - module.startSizeX = startSizeXChanger(module.startSizeX); - return module; - } - #endregion - - #region StartSizeXMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSizeXMultiplier(this ParticleSystem particleSystem, float startSizeXMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.startSizeXMultiplier = startSizeXMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSizeXMultiplier(this ParticleSystem particleSystem, Func startSizeXMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(startSizeXMultiplierChanger != null, "startSizeXMultiplierChanger cannot be null"); - var module = particleSystem.main; - module.startSizeXMultiplier = startSizeXMultiplierChanger(module.startSizeXMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartSizeXMultiplier(this MainModule module, float startSizeXMultiplier) - { - module.startSizeXMultiplier = startSizeXMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartSizeXMultiplier(this MainModule module, Func startSizeXMultiplierChanger) - { - Debug.Assert(startSizeXMultiplierChanger != null, "startSizeXMultiplierChanger cannot be null"); - module.startSizeXMultiplier = startSizeXMultiplierChanger(module.startSizeXMultiplier); - return module; - } - #endregion - - #region StartSizeY - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSizeY(this ParticleSystem particleSystem, MinMaxCurve startSizeY) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.startSizeY = startSizeY; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSizeY(this ParticleSystem particleSystem, Func startSizeYChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(startSizeYChanger != null, "startSizeYChanger cannot be null"); - var module = particleSystem.main; - module.startSizeY = startSizeYChanger(module.startSizeY); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartSizeY(this MainModule module, MinMaxCurve startSizeY) - { - module.startSizeY = startSizeY; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartSizeY(this MainModule module, Func startSizeYChanger) - { - Debug.Assert(startSizeYChanger != null, "startSizeYChanger cannot be null"); - module.startSizeY = startSizeYChanger(module.startSizeY); - return module; - } - #endregion - - #region StartSizeYMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSizeYMultiplier(this ParticleSystem particleSystem, float startSizeYMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.startSizeYMultiplier = startSizeYMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSizeYMultiplier(this ParticleSystem particleSystem, Func startSizeYMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(startSizeYMultiplierChanger != null, "startSizeYMultiplierChanger cannot be null"); - var module = particleSystem.main; - module.startSizeYMultiplier = startSizeYMultiplierChanger(module.startSizeYMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartSizeYMultiplier(this MainModule module, float startSizeYMultiplier) - { - module.startSizeYMultiplier = startSizeYMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartSizeYMultiplier(this MainModule module, Func startSizeYMultiplierChanger) - { - Debug.Assert(startSizeYMultiplierChanger != null, "startSizeYMultiplierChanger cannot be null"); - module.startSizeYMultiplier = startSizeYMultiplierChanger(module.startSizeYMultiplier); - return module; - } - #endregion - - #region StartSizeZ - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSizeZ(this ParticleSystem particleSystem, MinMaxCurve startSizeZ) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.startSizeZ = startSizeZ; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSizeZ(this ParticleSystem particleSystem, Func startSizeZChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(startSizeZChanger != null, "startSizeZChanger cannot be null"); - var module = particleSystem.main; - module.startSizeZ = startSizeZChanger(module.startSizeZ); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartSizeZ(this MainModule module, MinMaxCurve startSizeZ) - { - module.startSizeZ = startSizeZ; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartSizeZ(this MainModule module, Func startSizeZChanger) - { - Debug.Assert(startSizeZChanger != null, "startSizeZChanger cannot be null"); - module.startSizeZ = startSizeZChanger(module.startSizeZ); - return module; - } - #endregion - - #region StartSizeZMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSizeZMultiplier(this ParticleSystem particleSystem, float startSizeZMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.startSizeZMultiplier = startSizeZMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSizeZMultiplier(this ParticleSystem particleSystem, Func startSizeZMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(startSizeZMultiplierChanger != null, "startSizeZMultiplierChanger cannot be null"); - var module = particleSystem.main; - module.startSizeZMultiplier = startSizeZMultiplierChanger(module.startSizeZMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartSizeZMultiplier(this MainModule module, float startSizeZMultiplier) - { - module.startSizeZMultiplier = startSizeZMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartSizeZMultiplier(this MainModule module, Func startSizeZMultiplierChanger) - { - Debug.Assert(startSizeZMultiplierChanger != null, "startSizeZMultiplierChanger cannot be null"); - module.startSizeZMultiplier = startSizeZMultiplierChanger(module.startSizeZMultiplier); - return module; - } - #endregion - - #region StartSpeed - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSpeed(this ParticleSystem particleSystem, MinMaxCurve startSpeed) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.startSpeed = startSpeed; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSpeed(this ParticleSystem particleSystem, Func startSpeedChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(startSpeedChanger != null, "startSpeedChanger cannot be null"); - var module = particleSystem.main; - module.startSpeed = startSpeedChanger(module.startSpeed); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartSpeed(this MainModule module, MinMaxCurve startSpeed) - { - module.startSpeed = startSpeed; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartSpeed(this MainModule module, Func startSpeedChanger) - { - Debug.Assert(startSpeedChanger != null, "startSpeedChanger cannot be null"); - module.startSpeed = startSpeedChanger(module.startSpeed); - return module; - } - #endregion - - #region StartSpeedMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSpeedMultiplier(this ParticleSystem particleSystem, float startSpeedMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.startSpeedMultiplier = startSpeedMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStartSpeedMultiplier(this ParticleSystem particleSystem, Func startSpeedMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(startSpeedMultiplierChanger != null, "startSpeedMultiplierChanger cannot be null"); - var module = particleSystem.main; - module.startSpeedMultiplier = startSpeedMultiplierChanger(module.startSpeedMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartSpeedMultiplier(this MainModule module, float startSpeedMultiplier) - { - module.startSpeedMultiplier = startSpeedMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStartSpeedMultiplier(this MainModule module, Func startSpeedMultiplierChanger) - { - Debug.Assert(startSpeedMultiplierChanger != null, "startSpeedMultiplierChanger cannot be null"); - module.startSpeedMultiplier = startSpeedMultiplierChanger(module.startSpeedMultiplier); - return module; - } - #endregion - - #region StopAction - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStopAction(this ParticleSystem particleSystem, ParticleSystemStopAction stopAction) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.stopAction = stopAction; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainStopAction(this ParticleSystem particleSystem, Func stopActionChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(stopActionChanger != null, "stopActionChanger cannot be null"); - var module = particleSystem.main; - module.stopAction = stopActionChanger(module.stopAction); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStopAction(this MainModule module, ParticleSystemStopAction stopAction) - { - module.stopAction = stopAction; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetStopAction(this MainModule module, Func stopActionChanger) - { - Debug.Assert(stopActionChanger != null, "stopActionChanger cannot be null"); - module.stopAction = stopActionChanger(module.stopAction); - return module; - } - #endregion - - #region UseUnscaledTime - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainUseUnscaledTime(this ParticleSystem particleSystem, bool useUnscaledTime) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.main; - module.useUnscaledTime = useUnscaledTime; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetMainUseUnscaledTime(this ParticleSystem particleSystem, Func useUnscaledTimeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(useUnscaledTimeChanger != null, "useUnscaledTimeChanger cannot be null"); - var module = particleSystem.main; - module.useUnscaledTime = useUnscaledTimeChanger(module.useUnscaledTime); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetUseUnscaledTime(this MainModule module, bool useUnscaledTime) - { - module.useUnscaledTime = useUnscaledTime; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MainModule SetUseUnscaledTime(this MainModule module, Func useUnscaledTimeChanger) - { - Debug.Assert(useUnscaledTimeChanger != null, "useUnscaledTimeChanger cannot be null"); - module.useUnscaledTime = useUnscaledTimeChanger(module.useUnscaledTime); - return module; - } - #endregion -#endif - } -} diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/MainModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/MainModuleExtension.cs.meta deleted file mode 100644 index 9dc1c82..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/MainModuleExtension.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 4aae0cb671ffb774894c6dc2195f4979 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/NoiseModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/NoiseModuleExtension.cs.meta deleted file mode 100644 index 4b978b2..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/NoiseModuleExtension.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: f4499671e45cb9d48a4cefcadefbf8e8 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/RotationBySpeedModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/RotationBySpeedModuleExtension.cs deleted file mode 100644 index 77c3255..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/RotationBySpeedModuleExtension.cs +++ /dev/null @@ -1,457 +0,0 @@ -#nullable enable -using System; -using System.Runtime.CompilerServices; -using UnityEngine; -using static UnityEngine.ParticleSystem; - -namespace OUCC.FluentParticleSystem -{ - public static class RotationBySpeedModuleExtension - { -#if UNITY_2018_4_OR_NEWER - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditRotationBySpeed(this ParticleSystem particleSystem, Action moduleEditor) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); - moduleEditor(particleSystem.rotationBySpeed); - return particleSystem; - } - - #region Enabled - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationBySpeedEnabled(this ParticleSystem particleSystem, bool enabled) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.rotationBySpeed; - module.enabled = enabled; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationBySpeedEnabled(this ParticleSystem particleSystem, Func enabledChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - var module = particleSystem.rotationBySpeed; - module.enabled = enabledChanger(module.enabled); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationBySpeedModule SetEnabled(this RotationBySpeedModule module, bool enabled) - { - module.enabled = enabled; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationBySpeedModule SetEnabled(this RotationBySpeedModule module, Func enabledChanger) - { - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - module.enabled = enabledChanger(module.enabled); - return module; - } - #endregion - - #region Range - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationBySpeedRange(this ParticleSystem particleSystem, Vector2 range) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.rotationBySpeed; - module.range = range; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationBySpeedRange(this ParticleSystem particleSystem, Func rangeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(rangeChanger != null, "rangeChanger cannot be null"); - var module = particleSystem.rotationBySpeed; - module.range = rangeChanger(module.range); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationBySpeedModule SetRange(this RotationBySpeedModule module, Vector2 range) - { - module.range = range; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationBySpeedModule SetRange(this RotationBySpeedModule module, Func rangeChanger) - { - Debug.Assert(rangeChanger != null, "rangeChanger cannot be null"); - module.range = rangeChanger(module.range); - return module; - } - #endregion - - #region SeparateAxes - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationBySpeedSeparateAxes(this ParticleSystem particleSystem, bool separateAxes) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.rotationBySpeed; - module.separateAxes = separateAxes; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationBySpeedSeparateAxes(this ParticleSystem particleSystem, Func separateAxesChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(separateAxesChanger != null, "separateAxesChanger cannot be null"); - var module = particleSystem.rotationBySpeed; - module.separateAxes = separateAxesChanger(module.separateAxes); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationBySpeedModule SetSeparateAxes(this RotationBySpeedModule module, bool separateAxes) - { - module.separateAxes = separateAxes; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationBySpeedModule SetSeparateAxes(this RotationBySpeedModule module, Func separateAxesChanger) - { - Debug.Assert(separateAxesChanger != null, "separateAxesChanger cannot be null"); - module.separateAxes = separateAxesChanger(module.separateAxes); - return module; - } - #endregion - - #region X - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationBySpeedX(this ParticleSystem particleSystem, MinMaxCurve x) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.rotationBySpeed; - module.x = x; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationBySpeedX(this ParticleSystem particleSystem, Func xChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(xChanger != null, "xChanger cannot be null"); - var module = particleSystem.rotationBySpeed; - module.x = xChanger(module.x); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationBySpeedModule SetX(this RotationBySpeedModule module, MinMaxCurve x) - { - module.x = x; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationBySpeedModule SetX(this RotationBySpeedModule module, Func xChanger) - { - Debug.Assert(xChanger != null, "xChanger cannot be null"); - module.x = xChanger(module.x); - return module; - } - #endregion - - #region XMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationBySpeedXMultiplier(this ParticleSystem particleSystem, float xMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.rotationBySpeed; - module.xMultiplier = xMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationBySpeedXMultiplier(this ParticleSystem particleSystem, Func xMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(xMultiplierChanger != null, "xMultiplierChanger cannot be null"); - var module = particleSystem.rotationBySpeed; - module.xMultiplier = xMultiplierChanger(module.xMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationBySpeedModule SetXMultiplier(this RotationBySpeedModule module, float xMultiplier) - { - module.xMultiplier = xMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationBySpeedModule SetXMultiplier(this RotationBySpeedModule module, Func xMultiplierChanger) - { - Debug.Assert(xMultiplierChanger != null, "xMultiplierChanger cannot be null"); - module.xMultiplier = xMultiplierChanger(module.xMultiplier); - return module; - } - #endregion - - #region Y - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationBySpeedY(this ParticleSystem particleSystem, MinMaxCurve y) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.rotationBySpeed; - module.y = y; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationBySpeedY(this ParticleSystem particleSystem, Func yChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(yChanger != null, "yChanger cannot be null"); - var module = particleSystem.rotationBySpeed; - module.y = yChanger(module.y); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationBySpeedModule SetY(this RotationBySpeedModule module, MinMaxCurve y) - { - module.y = y; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationBySpeedModule SetY(this RotationBySpeedModule module, Func yChanger) - { - Debug.Assert(yChanger != null, "yChanger cannot be null"); - module.y = yChanger(module.y); - return module; - } - #endregion - - #region YMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationBySpeedYMultiplier(this ParticleSystem particleSystem, float yMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.rotationBySpeed; - module.yMultiplier = yMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationBySpeedYMultiplier(this ParticleSystem particleSystem, Func yMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(yMultiplierChanger != null, "yMultiplierChanger cannot be null"); - var module = particleSystem.rotationBySpeed; - module.yMultiplier = yMultiplierChanger(module.yMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationBySpeedModule SetYMultiplier(this RotationBySpeedModule module, float yMultiplier) - { - module.yMultiplier = yMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationBySpeedModule SetYMultiplier(this RotationBySpeedModule module, Func yMultiplierChanger) - { - Debug.Assert(yMultiplierChanger != null, "yMultiplierChanger cannot be null"); - module.yMultiplier = yMultiplierChanger(module.yMultiplier); - return module; - } - #endregion - - #region Z - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationBySpeedZ(this ParticleSystem particleSystem, MinMaxCurve z) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.rotationBySpeed; - module.z = z; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationBySpeedZ(this ParticleSystem particleSystem, Func zChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(zChanger != null, "zChanger cannot be null"); - var module = particleSystem.rotationBySpeed; - module.z = zChanger(module.z); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationBySpeedModule SetZ(this RotationBySpeedModule module, MinMaxCurve z) - { - module.z = z; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationBySpeedModule SetZ(this RotationBySpeedModule module, Func zChanger) - { - Debug.Assert(zChanger != null, "zChanger cannot be null"); - module.z = zChanger(module.z); - return module; - } - #endregion - - #region ZMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationBySpeedZMultiplier(this ParticleSystem particleSystem, float zMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.rotationBySpeed; - module.zMultiplier = zMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetRotationBySpeedZMultiplier(this ParticleSystem particleSystem, Func zMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(zMultiplierChanger != null, "zMultiplierChanger cannot be null"); - var module = particleSystem.rotationBySpeed; - module.zMultiplier = zMultiplierChanger(module.zMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationBySpeedModule SetZMultiplier(this RotationBySpeedModule module, float zMultiplier) - { - module.zMultiplier = zMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RotationBySpeedModule SetZMultiplier(this RotationBySpeedModule module, Func zMultiplierChanger) - { - Debug.Assert(zMultiplierChanger != null, "zMultiplierChanger cannot be null"); - module.zMultiplier = zMultiplierChanger(module.zMultiplier); - return module; - } - #endregion -#endif - } -} diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/RotationBySpeedModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/RotationBySpeedModuleExtension.cs.meta deleted file mode 100644 index 6b6c3ea..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/RotationBySpeedModuleExtension.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 14bbd0b5c0099bd40afb32e35ad9c058 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/RotationOverLifetimeModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/RotationOverLifetimeModuleExtension.cs.meta deleted file mode 100644 index 60e4693..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/RotationOverLifetimeModuleExtension.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 9228d9c13e23ed242969fe4a68dccddf -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/ShapeModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/ShapeModuleExtension.cs.meta deleted file mode 100644 index 2795120..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/ShapeModuleExtension.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 9b2ee02219fbc3a4a9f1e94792e5627a -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/SizeBySpeedModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/SizeBySpeedModuleExtension.cs deleted file mode 100644 index cbb9e2d..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/SizeBySpeedModuleExtension.cs +++ /dev/null @@ -1,553 +0,0 @@ -#nullable enable -using System; -using System.Runtime.CompilerServices; -using UnityEngine; -using static UnityEngine.ParticleSystem; - -namespace OUCC.FluentParticleSystem -{ - public static class SizeBySpeedModuleExtension - { -#if UNITY_2018_4_OR_NEWER - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditSizeBySpeed(this ParticleSystem particleSystem, Action moduleEditor) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); - moduleEditor(particleSystem.sizeBySpeed); - return particleSystem; - } - - #region Enabled - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedEnabled(this ParticleSystem particleSystem, bool enabled) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.sizeBySpeed; - module.enabled = enabled; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedEnabled(this ParticleSystem particleSystem, Func enabledChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - var module = particleSystem.sizeBySpeed; - module.enabled = enabledChanger(module.enabled); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeBySpeedModule SetEnabled(this SizeBySpeedModule module, bool enabled) - { - module.enabled = enabled; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeBySpeedModule SetEnabled(this SizeBySpeedModule module, Func enabledChanger) - { - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - module.enabled = enabledChanger(module.enabled); - return module; - } - #endregion - - #region Range - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedRange(this ParticleSystem particleSystem, Vector2 range) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.sizeBySpeed; - module.range = range; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedRange(this ParticleSystem particleSystem, Func rangeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(rangeChanger != null, "rangeChanger cannot be null"); - var module = particleSystem.sizeBySpeed; - module.range = rangeChanger(module.range); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeBySpeedModule SetRange(this SizeBySpeedModule module, Vector2 range) - { - module.range = range; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeBySpeedModule SetRange(this SizeBySpeedModule module, Func rangeChanger) - { - Debug.Assert(rangeChanger != null, "rangeChanger cannot be null"); - module.range = rangeChanger(module.range); - return module; - } - #endregion - - #region SeparateAxes - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedSeparateAxes(this ParticleSystem particleSystem, bool separateAxes) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.sizeBySpeed; - module.separateAxes = separateAxes; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedSeparateAxes(this ParticleSystem particleSystem, Func separateAxesChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(separateAxesChanger != null, "separateAxesChanger cannot be null"); - var module = particleSystem.sizeBySpeed; - module.separateAxes = separateAxesChanger(module.separateAxes); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeBySpeedModule SetSeparateAxes(this SizeBySpeedModule module, bool separateAxes) - { - module.separateAxes = separateAxes; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeBySpeedModule SetSeparateAxes(this SizeBySpeedModule module, Func separateAxesChanger) - { - Debug.Assert(separateAxesChanger != null, "separateAxesChanger cannot be null"); - module.separateAxes = separateAxesChanger(module.separateAxes); - return module; - } - #endregion - - #region Size - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedSize(this ParticleSystem particleSystem, MinMaxCurve size) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.sizeBySpeed; - module.size = size; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedSize(this ParticleSystem particleSystem, Func sizeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(sizeChanger != null, "sizeChanger cannot be null"); - var module = particleSystem.sizeBySpeed; - module.size = sizeChanger(module.size); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeBySpeedModule SetSize(this SizeBySpeedModule module, MinMaxCurve size) - { - module.size = size; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeBySpeedModule SetSize(this SizeBySpeedModule module, Func sizeChanger) - { - Debug.Assert(sizeChanger != null, "sizeChanger cannot be null"); - module.size = sizeChanger(module.size); - return module; - } - #endregion - - #region SizeMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedSizeMultiplier(this ParticleSystem particleSystem, float sizeMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.sizeBySpeed; - module.sizeMultiplier = sizeMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedSizeMultiplier(this ParticleSystem particleSystem, Func sizeMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(sizeMultiplierChanger != null, "sizeMultiplierChanger cannot be null"); - var module = particleSystem.sizeBySpeed; - module.sizeMultiplier = sizeMultiplierChanger(module.sizeMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeBySpeedModule SetSizeMultiplier(this SizeBySpeedModule module, float sizeMultiplier) - { - module.sizeMultiplier = sizeMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeBySpeedModule SetSizeMultiplier(this SizeBySpeedModule module, Func sizeMultiplierChanger) - { - Debug.Assert(sizeMultiplierChanger != null, "sizeMultiplierChanger cannot be null"); - module.sizeMultiplier = sizeMultiplierChanger(module.sizeMultiplier); - return module; - } - #endregion - - #region X - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedX(this ParticleSystem particleSystem, MinMaxCurve x) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.sizeBySpeed; - module.x = x; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedX(this ParticleSystem particleSystem, Func xChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(xChanger != null, "xChanger cannot be null"); - var module = particleSystem.sizeBySpeed; - module.x = xChanger(module.x); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeBySpeedModule SetX(this SizeBySpeedModule module, MinMaxCurve x) - { - module.x = x; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeBySpeedModule SetX(this SizeBySpeedModule module, Func xChanger) - { - Debug.Assert(xChanger != null, "xChanger cannot be null"); - module.x = xChanger(module.x); - return module; - } - #endregion - - #region XMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedXMultiplier(this ParticleSystem particleSystem, float xMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.sizeBySpeed; - module.xMultiplier = xMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedXMultiplier(this ParticleSystem particleSystem, Func xMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(xMultiplierChanger != null, "xMultiplierChanger cannot be null"); - var module = particleSystem.sizeBySpeed; - module.xMultiplier = xMultiplierChanger(module.xMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeBySpeedModule SetXMultiplier(this SizeBySpeedModule module, float xMultiplier) - { - module.xMultiplier = xMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeBySpeedModule SetXMultiplier(this SizeBySpeedModule module, Func xMultiplierChanger) - { - Debug.Assert(xMultiplierChanger != null, "xMultiplierChanger cannot be null"); - module.xMultiplier = xMultiplierChanger(module.xMultiplier); - return module; - } - #endregion - - #region Y - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedY(this ParticleSystem particleSystem, MinMaxCurve y) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.sizeBySpeed; - module.y = y; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedY(this ParticleSystem particleSystem, Func yChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(yChanger != null, "yChanger cannot be null"); - var module = particleSystem.sizeBySpeed; - module.y = yChanger(module.y); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeBySpeedModule SetY(this SizeBySpeedModule module, MinMaxCurve y) - { - module.y = y; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeBySpeedModule SetY(this SizeBySpeedModule module, Func yChanger) - { - Debug.Assert(yChanger != null, "yChanger cannot be null"); - module.y = yChanger(module.y); - return module; - } - #endregion - - #region YMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedYMultiplier(this ParticleSystem particleSystem, float yMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.sizeBySpeed; - module.yMultiplier = yMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedYMultiplier(this ParticleSystem particleSystem, Func yMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(yMultiplierChanger != null, "yMultiplierChanger cannot be null"); - var module = particleSystem.sizeBySpeed; - module.yMultiplier = yMultiplierChanger(module.yMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeBySpeedModule SetYMultiplier(this SizeBySpeedModule module, float yMultiplier) - { - module.yMultiplier = yMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeBySpeedModule SetYMultiplier(this SizeBySpeedModule module, Func yMultiplierChanger) - { - Debug.Assert(yMultiplierChanger != null, "yMultiplierChanger cannot be null"); - module.yMultiplier = yMultiplierChanger(module.yMultiplier); - return module; - } - #endregion - - #region Z - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedZ(this ParticleSystem particleSystem, MinMaxCurve z) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.sizeBySpeed; - module.z = z; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedZ(this ParticleSystem particleSystem, Func zChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(zChanger != null, "zChanger cannot be null"); - var module = particleSystem.sizeBySpeed; - module.z = zChanger(module.z); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeBySpeedModule SetZ(this SizeBySpeedModule module, MinMaxCurve z) - { - module.z = z; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeBySpeedModule SetZ(this SizeBySpeedModule module, Func zChanger) - { - Debug.Assert(zChanger != null, "zChanger cannot be null"); - module.z = zChanger(module.z); - return module; - } - #endregion - - #region ZMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedZMultiplier(this ParticleSystem particleSystem, float zMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.sizeBySpeed; - module.zMultiplier = zMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeBySpeedZMultiplier(this ParticleSystem particleSystem, Func zMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(zMultiplierChanger != null, "zMultiplierChanger cannot be null"); - var module = particleSystem.sizeBySpeed; - module.zMultiplier = zMultiplierChanger(module.zMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeBySpeedModule SetZMultiplier(this SizeBySpeedModule module, float zMultiplier) - { - module.zMultiplier = zMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeBySpeedModule SetZMultiplier(this SizeBySpeedModule module, Func zMultiplierChanger) - { - Debug.Assert(zMultiplierChanger != null, "zMultiplierChanger cannot be null"); - module.zMultiplier = zMultiplierChanger(module.zMultiplier); - return module; - } - #endregion -#endif - } -} diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/SizeBySpeedModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/SizeBySpeedModuleExtension.cs.meta deleted file mode 100644 index 0695dea..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/SizeBySpeedModuleExtension.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 29b43cfce64cfc64b97ad3aaa210e0f2 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/SizeOverLifetimeModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/SizeOverLifetimeModuleExtension.cs deleted file mode 100644 index 3f8ba0f..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/SizeOverLifetimeModuleExtension.cs +++ /dev/null @@ -1,505 +0,0 @@ -#nullable enable -using System; -using System.Runtime.CompilerServices; -using UnityEngine; -using static UnityEngine.ParticleSystem; - -namespace OUCC.FluentParticleSystem -{ - public static class SizeOverLifetimeModuleExtension - { -#if UNITY_2018_4_OR_NEWER - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditSizeOverLifetime(this ParticleSystem particleSystem, Action moduleEditor) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); - moduleEditor(particleSystem.sizeOverLifetime); - return particleSystem; - } - - #region Enabled - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeEnabled(this ParticleSystem particleSystem, bool enabled) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.sizeOverLifetime; - module.enabled = enabled; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeEnabled(this ParticleSystem particleSystem, Func enabledChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - var module = particleSystem.sizeOverLifetime; - module.enabled = enabledChanger(module.enabled); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeOverLifetimeModule SetEnabled(this SizeOverLifetimeModule module, bool enabled) - { - module.enabled = enabled; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeOverLifetimeModule SetEnabled(this SizeOverLifetimeModule module, Func enabledChanger) - { - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - module.enabled = enabledChanger(module.enabled); - return module; - } - #endregion - - #region SeparateAxes - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeSeparateAxes(this ParticleSystem particleSystem, bool separateAxes) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.sizeOverLifetime; - module.separateAxes = separateAxes; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeSeparateAxes(this ParticleSystem particleSystem, Func separateAxesChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(separateAxesChanger != null, "separateAxesChanger cannot be null"); - var module = particleSystem.sizeOverLifetime; - module.separateAxes = separateAxesChanger(module.separateAxes); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeOverLifetimeModule SetSeparateAxes(this SizeOverLifetimeModule module, bool separateAxes) - { - module.separateAxes = separateAxes; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeOverLifetimeModule SetSeparateAxes(this SizeOverLifetimeModule module, Func separateAxesChanger) - { - Debug.Assert(separateAxesChanger != null, "separateAxesChanger cannot be null"); - module.separateAxes = separateAxesChanger(module.separateAxes); - return module; - } - #endregion - - #region Size - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeSize(this ParticleSystem particleSystem, MinMaxCurve size) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.sizeOverLifetime; - module.size = size; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeSize(this ParticleSystem particleSystem, Func sizeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(sizeChanger != null, "sizeChanger cannot be null"); - var module = particleSystem.sizeOverLifetime; - module.size = sizeChanger(module.size); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeOverLifetimeModule SetSize(this SizeOverLifetimeModule module, MinMaxCurve size) - { - module.size = size; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeOverLifetimeModule SetSize(this SizeOverLifetimeModule module, Func sizeChanger) - { - Debug.Assert(sizeChanger != null, "sizeChanger cannot be null"); - module.size = sizeChanger(module.size); - return module; - } - #endregion - - #region SizeMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeSizeMultiplier(this ParticleSystem particleSystem, float sizeMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.sizeOverLifetime; - module.sizeMultiplier = sizeMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeSizeMultiplier(this ParticleSystem particleSystem, Func sizeMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(sizeMultiplierChanger != null, "sizeMultiplierChanger cannot be null"); - var module = particleSystem.sizeOverLifetime; - module.sizeMultiplier = sizeMultiplierChanger(module.sizeMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeOverLifetimeModule SetSizeMultiplier(this SizeOverLifetimeModule module, float sizeMultiplier) - { - module.sizeMultiplier = sizeMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeOverLifetimeModule SetSizeMultiplier(this SizeOverLifetimeModule module, Func sizeMultiplierChanger) - { - Debug.Assert(sizeMultiplierChanger != null, "sizeMultiplierChanger cannot be null"); - module.sizeMultiplier = sizeMultiplierChanger(module.sizeMultiplier); - return module; - } - #endregion - - #region X - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeX(this ParticleSystem particleSystem, MinMaxCurve x) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.sizeOverLifetime; - module.x = x; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeX(this ParticleSystem particleSystem, Func xChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(xChanger != null, "xChanger cannot be null"); - var module = particleSystem.sizeOverLifetime; - module.x = xChanger(module.x); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeOverLifetimeModule SetX(this SizeOverLifetimeModule module, MinMaxCurve x) - { - module.x = x; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeOverLifetimeModule SetX(this SizeOverLifetimeModule module, Func xChanger) - { - Debug.Assert(xChanger != null, "xChanger cannot be null"); - module.x = xChanger(module.x); - return module; - } - #endregion - - #region XMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeXMultiplier(this ParticleSystem particleSystem, float xMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.sizeOverLifetime; - module.xMultiplier = xMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeXMultiplier(this ParticleSystem particleSystem, Func xMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(xMultiplierChanger != null, "xMultiplierChanger cannot be null"); - var module = particleSystem.sizeOverLifetime; - module.xMultiplier = xMultiplierChanger(module.xMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeOverLifetimeModule SetXMultiplier(this SizeOverLifetimeModule module, float xMultiplier) - { - module.xMultiplier = xMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeOverLifetimeModule SetXMultiplier(this SizeOverLifetimeModule module, Func xMultiplierChanger) - { - Debug.Assert(xMultiplierChanger != null, "xMultiplierChanger cannot be null"); - module.xMultiplier = xMultiplierChanger(module.xMultiplier); - return module; - } - #endregion - - #region Y - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeY(this ParticleSystem particleSystem, MinMaxCurve y) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.sizeOverLifetime; - module.y = y; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeY(this ParticleSystem particleSystem, Func yChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(yChanger != null, "yChanger cannot be null"); - var module = particleSystem.sizeOverLifetime; - module.y = yChanger(module.y); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeOverLifetimeModule SetY(this SizeOverLifetimeModule module, MinMaxCurve y) - { - module.y = y; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeOverLifetimeModule SetY(this SizeOverLifetimeModule module, Func yChanger) - { - Debug.Assert(yChanger != null, "yChanger cannot be null"); - module.y = yChanger(module.y); - return module; - } - #endregion - - #region YMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeYMultiplier(this ParticleSystem particleSystem, float yMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.sizeOverLifetime; - module.yMultiplier = yMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeYMultiplier(this ParticleSystem particleSystem, Func yMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(yMultiplierChanger != null, "yMultiplierChanger cannot be null"); - var module = particleSystem.sizeOverLifetime; - module.yMultiplier = yMultiplierChanger(module.yMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeOverLifetimeModule SetYMultiplier(this SizeOverLifetimeModule module, float yMultiplier) - { - module.yMultiplier = yMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeOverLifetimeModule SetYMultiplier(this SizeOverLifetimeModule module, Func yMultiplierChanger) - { - Debug.Assert(yMultiplierChanger != null, "yMultiplierChanger cannot be null"); - module.yMultiplier = yMultiplierChanger(module.yMultiplier); - return module; - } - #endregion - - #region Z - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeZ(this ParticleSystem particleSystem, MinMaxCurve z) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.sizeOverLifetime; - module.z = z; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeZ(this ParticleSystem particleSystem, Func zChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(zChanger != null, "zChanger cannot be null"); - var module = particleSystem.sizeOverLifetime; - module.z = zChanger(module.z); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeOverLifetimeModule SetZ(this SizeOverLifetimeModule module, MinMaxCurve z) - { - module.z = z; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeOverLifetimeModule SetZ(this SizeOverLifetimeModule module, Func zChanger) - { - Debug.Assert(zChanger != null, "zChanger cannot be null"); - module.z = zChanger(module.z); - return module; - } - #endregion - - #region ZMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeZMultiplier(this ParticleSystem particleSystem, float zMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.sizeOverLifetime; - module.zMultiplier = zMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetSizeOverLifetimeZMultiplier(this ParticleSystem particleSystem, Func zMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(zMultiplierChanger != null, "zMultiplierChanger cannot be null"); - var module = particleSystem.sizeOverLifetime; - module.zMultiplier = zMultiplierChanger(module.zMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeOverLifetimeModule SetZMultiplier(this SizeOverLifetimeModule module, float zMultiplier) - { - module.zMultiplier = zMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static SizeOverLifetimeModule SetZMultiplier(this SizeOverLifetimeModule module, Func zMultiplierChanger) - { - Debug.Assert(zMultiplierChanger != null, "zMultiplierChanger cannot be null"); - module.zMultiplier = zMultiplierChanger(module.zMultiplier); - return module; - } - #endregion -#endif - } -} diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/SizeOverLifetimeModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/SizeOverLifetimeModuleExtension.cs.meta deleted file mode 100644 index 541a9a6..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/SizeOverLifetimeModuleExtension.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 7b05ae944353998418872ce465c32354 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/SubEmittersModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/SubEmittersModuleExtension.cs.meta deleted file mode 100644 index 3eb5567..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/SubEmittersModuleExtension.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: bea4a5c06bbef454992e25422b5c38d6 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/TextureSheetAnimationModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/TextureSheetAnimationModuleExtension.cs deleted file mode 100644 index b9ca954..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/TextureSheetAnimationModuleExtension.cs +++ /dev/null @@ -1,977 +0,0 @@ -#nullable enable -using System; -using System.Runtime.CompilerServices; -using UnityEngine; -using static UnityEngine.ParticleSystem; - -namespace OUCC.FluentParticleSystem -{ - public static class TextureSheetAnimationModuleExtension - { -#if UNITY_2018_4_OR_NEWER - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditTextureSheetAnimation(this ParticleSystem particleSystem, Action moduleEditor) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); - moduleEditor(particleSystem.textureSheetAnimation); - return particleSystem; - } - - #region Animation - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationAnimation(this ParticleSystem particleSystem, ParticleSystemAnimationType animation) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.textureSheetAnimation; - module.animation = animation; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationAnimation(this ParticleSystem particleSystem, Func animationChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(animationChanger != null, "animationChanger cannot be null"); - var module = particleSystem.textureSheetAnimation; - module.animation = animationChanger(module.animation); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetAnimation(this TextureSheetAnimationModule module, ParticleSystemAnimationType animation) - { - module.animation = animation; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetAnimation(this TextureSheetAnimationModule module, Func animationChanger) - { - Debug.Assert(animationChanger != null, "animationChanger cannot be null"); - module.animation = animationChanger(module.animation); - return module; - } - #endregion - - #region CycleCount - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationCycleCount(this ParticleSystem particleSystem, int cycleCount) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.textureSheetAnimation; - module.cycleCount = cycleCount; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationCycleCount(this ParticleSystem particleSystem, Func cycleCountChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(cycleCountChanger != null, "cycleCountChanger cannot be null"); - var module = particleSystem.textureSheetAnimation; - module.cycleCount = cycleCountChanger(module.cycleCount); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetCycleCount(this TextureSheetAnimationModule module, int cycleCount) - { - module.cycleCount = cycleCount; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetCycleCount(this TextureSheetAnimationModule module, Func cycleCountChanger) - { - Debug.Assert(cycleCountChanger != null, "cycleCountChanger cannot be null"); - module.cycleCount = cycleCountChanger(module.cycleCount); - return module; - } - #endregion - - #region Enabled - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationEnabled(this ParticleSystem particleSystem, bool enabled) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.textureSheetAnimation; - module.enabled = enabled; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationEnabled(this ParticleSystem particleSystem, Func enabledChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - var module = particleSystem.textureSheetAnimation; - module.enabled = enabledChanger(module.enabled); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetEnabled(this TextureSheetAnimationModule module, bool enabled) - { - module.enabled = enabled; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetEnabled(this TextureSheetAnimationModule module, Func enabledChanger) - { - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - module.enabled = enabledChanger(module.enabled); - return module; - } - #endregion - - #region FlipU - /// - /// Assign a value to - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("flipU property is deprecated. Use ParticleSystemRenderer.flip.x instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationFlipU(this ParticleSystem particleSystem, float flipU) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.textureSheetAnimation; - module.flipU = flipU; - return particleSystem; - } - - /// - /// Edit - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("flipU property is deprecated. Use ParticleSystemRenderer.flip.x instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationFlipU(this ParticleSystem particleSystem, Func flipUChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(flipUChanger != null, "flipUChanger cannot be null"); - var module = particleSystem.textureSheetAnimation; - module.flipU = flipUChanger(module.flipU); - return particleSystem; - } - - /// - /// Assign a value to - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("flipU property is deprecated. Use ParticleSystemRenderer.flip.x instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetFlipU(this TextureSheetAnimationModule module, float flipU) - { - module.flipU = flipU; - return module; - } - - /// - /// Edit - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("flipU property is deprecated. Use ParticleSystemRenderer.flip.x instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetFlipU(this TextureSheetAnimationModule module, Func flipUChanger) - { - Debug.Assert(flipUChanger != null, "flipUChanger cannot be null"); - module.flipU = flipUChanger(module.flipU); - return module; - } - #endregion - - #region FlipV - /// - /// Assign a value to - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("flipV property is deprecated. Use ParticleSystemRenderer.flip.y instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationFlipV(this ParticleSystem particleSystem, float flipV) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.textureSheetAnimation; - module.flipV = flipV; - return particleSystem; - } - - /// - /// Edit - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("flipV property is deprecated. Use ParticleSystemRenderer.flip.y instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationFlipV(this ParticleSystem particleSystem, Func flipVChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(flipVChanger != null, "flipVChanger cannot be null"); - var module = particleSystem.textureSheetAnimation; - module.flipV = flipVChanger(module.flipV); - return particleSystem; - } - - /// - /// Assign a value to - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("flipV property is deprecated. Use ParticleSystemRenderer.flip.y instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetFlipV(this TextureSheetAnimationModule module, float flipV) - { - module.flipV = flipV; - return module; - } - - /// - /// Edit - /// -#if UNITY_2018_4_OR_NEWER - [Obsolete("flipV property is deprecated. Use ParticleSystemRenderer.flip.y instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetFlipV(this TextureSheetAnimationModule module, Func flipVChanger) - { - Debug.Assert(flipVChanger != null, "flipVChanger cannot be null"); - module.flipV = flipVChanger(module.flipV); - return module; - } - #endregion - - #region Fps - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationFps(this ParticleSystem particleSystem, float fps) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.textureSheetAnimation; - module.fps = fps; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationFps(this ParticleSystem particleSystem, Func fpsChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(fpsChanger != null, "fpsChanger cannot be null"); - var module = particleSystem.textureSheetAnimation; - module.fps = fpsChanger(module.fps); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetFps(this TextureSheetAnimationModule module, float fps) - { - module.fps = fps; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetFps(this TextureSheetAnimationModule module, Func fpsChanger) - { - Debug.Assert(fpsChanger != null, "fpsChanger cannot be null"); - module.fps = fpsChanger(module.fps); - return module; - } - #endregion - - #region FrameOverTime - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationFrameOverTime(this ParticleSystem particleSystem, MinMaxCurve frameOverTime) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.textureSheetAnimation; - module.frameOverTime = frameOverTime; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationFrameOverTime(this ParticleSystem particleSystem, Func frameOverTimeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(frameOverTimeChanger != null, "frameOverTimeChanger cannot be null"); - var module = particleSystem.textureSheetAnimation; - module.frameOverTime = frameOverTimeChanger(module.frameOverTime); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetFrameOverTime(this TextureSheetAnimationModule module, MinMaxCurve frameOverTime) - { - module.frameOverTime = frameOverTime; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetFrameOverTime(this TextureSheetAnimationModule module, Func frameOverTimeChanger) - { - Debug.Assert(frameOverTimeChanger != null, "frameOverTimeChanger cannot be null"); - module.frameOverTime = frameOverTimeChanger(module.frameOverTime); - return module; - } - #endregion - - #region FrameOverTimeMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationFrameOverTimeMultiplier(this ParticleSystem particleSystem, float frameOverTimeMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.textureSheetAnimation; - module.frameOverTimeMultiplier = frameOverTimeMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationFrameOverTimeMultiplier(this ParticleSystem particleSystem, Func frameOverTimeMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(frameOverTimeMultiplierChanger != null, "frameOverTimeMultiplierChanger cannot be null"); - var module = particleSystem.textureSheetAnimation; - module.frameOverTimeMultiplier = frameOverTimeMultiplierChanger(module.frameOverTimeMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetFrameOverTimeMultiplier(this TextureSheetAnimationModule module, float frameOverTimeMultiplier) - { - module.frameOverTimeMultiplier = frameOverTimeMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetFrameOverTimeMultiplier(this TextureSheetAnimationModule module, Func frameOverTimeMultiplierChanger) - { - Debug.Assert(frameOverTimeMultiplierChanger != null, "frameOverTimeMultiplierChanger cannot be null"); - module.frameOverTimeMultiplier = frameOverTimeMultiplierChanger(module.frameOverTimeMultiplier); - return module; - } - #endregion - - #region Mode - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationMode(this ParticleSystem particleSystem, ParticleSystemAnimationMode mode) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.textureSheetAnimation; - module.mode = mode; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationMode(this ParticleSystem particleSystem, Func modeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(modeChanger != null, "modeChanger cannot be null"); - var module = particleSystem.textureSheetAnimation; - module.mode = modeChanger(module.mode); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetMode(this TextureSheetAnimationModule module, ParticleSystemAnimationMode mode) - { - module.mode = mode; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetMode(this TextureSheetAnimationModule module, Func modeChanger) - { - Debug.Assert(modeChanger != null, "modeChanger cannot be null"); - module.mode = modeChanger(module.mode); - return module; - } - #endregion - - #region NumTilesX - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationNumTilesX(this ParticleSystem particleSystem, int numTilesX) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.textureSheetAnimation; - module.numTilesX = numTilesX; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationNumTilesX(this ParticleSystem particleSystem, Func numTilesXChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(numTilesXChanger != null, "numTilesXChanger cannot be null"); - var module = particleSystem.textureSheetAnimation; - module.numTilesX = numTilesXChanger(module.numTilesX); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetNumTilesX(this TextureSheetAnimationModule module, int numTilesX) - { - module.numTilesX = numTilesX; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetNumTilesX(this TextureSheetAnimationModule module, Func numTilesXChanger) - { - Debug.Assert(numTilesXChanger != null, "numTilesXChanger cannot be null"); - module.numTilesX = numTilesXChanger(module.numTilesX); - return module; - } - #endregion - - #region NumTilesY - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationNumTilesY(this ParticleSystem particleSystem, int numTilesY) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.textureSheetAnimation; - module.numTilesY = numTilesY; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationNumTilesY(this ParticleSystem particleSystem, Func numTilesYChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(numTilesYChanger != null, "numTilesYChanger cannot be null"); - var module = particleSystem.textureSheetAnimation; - module.numTilesY = numTilesYChanger(module.numTilesY); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetNumTilesY(this TextureSheetAnimationModule module, int numTilesY) - { - module.numTilesY = numTilesY; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetNumTilesY(this TextureSheetAnimationModule module, Func numTilesYChanger) - { - Debug.Assert(numTilesYChanger != null, "numTilesYChanger cannot be null"); - module.numTilesY = numTilesYChanger(module.numTilesY); - return module; - } - #endregion - - #region RowIndex - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationRowIndex(this ParticleSystem particleSystem, int rowIndex) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.textureSheetAnimation; - module.rowIndex = rowIndex; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationRowIndex(this ParticleSystem particleSystem, Func rowIndexChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(rowIndexChanger != null, "rowIndexChanger cannot be null"); - var module = particleSystem.textureSheetAnimation; - module.rowIndex = rowIndexChanger(module.rowIndex); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetRowIndex(this TextureSheetAnimationModule module, int rowIndex) - { - module.rowIndex = rowIndex; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetRowIndex(this TextureSheetAnimationModule module, Func rowIndexChanger) - { - Debug.Assert(rowIndexChanger != null, "rowIndexChanger cannot be null"); - module.rowIndex = rowIndexChanger(module.rowIndex); - return module; - } - #endregion -#endif - -#if UNITY_2019_4_OR_NEWER - #region RowMode - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationRowMode(this ParticleSystem particleSystem, ParticleSystemAnimationRowMode rowMode) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.textureSheetAnimation; - module.rowMode = rowMode; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationRowMode(this ParticleSystem particleSystem, Func rowModeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(rowModeChanger != null, "rowModeChanger cannot be null"); - var module = particleSystem.textureSheetAnimation; - module.rowMode = rowModeChanger(module.rowMode); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetRowMode(this TextureSheetAnimationModule module, ParticleSystemAnimationRowMode rowMode) - { - module.rowMode = rowMode; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetRowMode(this TextureSheetAnimationModule module, Func rowModeChanger) - { - Debug.Assert(rowModeChanger != null, "rowModeChanger cannot be null"); - module.rowMode = rowModeChanger(module.rowMode); - return module; - } - #endregion -#endif - -#if UNITY_2018_4_OR_NEWER - #region SpeedRange - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationSpeedRange(this ParticleSystem particleSystem, Vector2 speedRange) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.textureSheetAnimation; - module.speedRange = speedRange; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationSpeedRange(this ParticleSystem particleSystem, Func speedRangeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(speedRangeChanger != null, "speedRangeChanger cannot be null"); - var module = particleSystem.textureSheetAnimation; - module.speedRange = speedRangeChanger(module.speedRange); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetSpeedRange(this TextureSheetAnimationModule module, Vector2 speedRange) - { - module.speedRange = speedRange; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetSpeedRange(this TextureSheetAnimationModule module, Func speedRangeChanger) - { - Debug.Assert(speedRangeChanger != null, "speedRangeChanger cannot be null"); - module.speedRange = speedRangeChanger(module.speedRange); - return module; - } - #endregion - - #region StartFrame - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationStartFrame(this ParticleSystem particleSystem, MinMaxCurve startFrame) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.textureSheetAnimation; - module.startFrame = startFrame; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationStartFrame(this ParticleSystem particleSystem, Func startFrameChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(startFrameChanger != null, "startFrameChanger cannot be null"); - var module = particleSystem.textureSheetAnimation; - module.startFrame = startFrameChanger(module.startFrame); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetStartFrame(this TextureSheetAnimationModule module, MinMaxCurve startFrame) - { - module.startFrame = startFrame; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetStartFrame(this TextureSheetAnimationModule module, Func startFrameChanger) - { - Debug.Assert(startFrameChanger != null, "startFrameChanger cannot be null"); - module.startFrame = startFrameChanger(module.startFrame); - return module; - } - #endregion - - #region StartFrameMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationStartFrameMultiplier(this ParticleSystem particleSystem, float startFrameMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.textureSheetAnimation; - module.startFrameMultiplier = startFrameMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationStartFrameMultiplier(this ParticleSystem particleSystem, Func startFrameMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(startFrameMultiplierChanger != null, "startFrameMultiplierChanger cannot be null"); - var module = particleSystem.textureSheetAnimation; - module.startFrameMultiplier = startFrameMultiplierChanger(module.startFrameMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetStartFrameMultiplier(this TextureSheetAnimationModule module, float startFrameMultiplier) - { - module.startFrameMultiplier = startFrameMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetStartFrameMultiplier(this TextureSheetAnimationModule module, Func startFrameMultiplierChanger) - { - Debug.Assert(startFrameMultiplierChanger != null, "startFrameMultiplierChanger cannot be null"); - module.startFrameMultiplier = startFrameMultiplierChanger(module.startFrameMultiplier); - return module; - } - #endregion - - #region TimeMode - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationTimeMode(this ParticleSystem particleSystem, ParticleSystemAnimationTimeMode timeMode) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.textureSheetAnimation; - module.timeMode = timeMode; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationTimeMode(this ParticleSystem particleSystem, Func timeModeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(timeModeChanger != null, "timeModeChanger cannot be null"); - var module = particleSystem.textureSheetAnimation; - module.timeMode = timeModeChanger(module.timeMode); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetTimeMode(this TextureSheetAnimationModule module, ParticleSystemAnimationTimeMode timeMode) - { - module.timeMode = timeMode; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetTimeMode(this TextureSheetAnimationModule module, Func timeModeChanger) - { - Debug.Assert(timeModeChanger != null, "timeModeChanger cannot be null"); - module.timeMode = timeModeChanger(module.timeMode); - return module; - } - #endregion - - #region UseRandomRow - /// - /// Assign a value to - /// -#if UNITY_2019_4_OR_NEWER - [Obsolete("useRandomRow property is deprecated. Use rowMode instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationUseRandomRow(this ParticleSystem particleSystem, bool useRandomRow) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.textureSheetAnimation; - module.useRandomRow = useRandomRow; - return particleSystem; - } - - /// - /// Edit - /// -#if UNITY_2019_4_OR_NEWER - [Obsolete("useRandomRow property is deprecated. Use rowMode instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationUseRandomRow(this ParticleSystem particleSystem, Func useRandomRowChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(useRandomRowChanger != null, "useRandomRowChanger cannot be null"); - var module = particleSystem.textureSheetAnimation; - module.useRandomRow = useRandomRowChanger(module.useRandomRow); - return particleSystem; - } - - /// - /// Assign a value to - /// -#if UNITY_2019_4_OR_NEWER - [Obsolete("useRandomRow property is deprecated. Use rowMode instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetUseRandomRow(this TextureSheetAnimationModule module, bool useRandomRow) - { - module.useRandomRow = useRandomRow; - return module; - } - - /// - /// Edit - /// -#if UNITY_2019_4_OR_NEWER - [Obsolete("useRandomRow property is deprecated. Use rowMode instead.", false)] -#endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetUseRandomRow(this TextureSheetAnimationModule module, Func useRandomRowChanger) - { - Debug.Assert(useRandomRowChanger != null, "useRandomRowChanger cannot be null"); - module.useRandomRow = useRandomRowChanger(module.useRandomRow); - return module; - } - #endregion - - #region UvChannelMask - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationUvChannelMask(this ParticleSystem particleSystem, UnityEngine.Rendering.UVChannelFlags uvChannelMask) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.textureSheetAnimation; - module.uvChannelMask = uvChannelMask; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTextureSheetAnimationUvChannelMask(this ParticleSystem particleSystem, Func uvChannelMaskChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(uvChannelMaskChanger != null, "uvChannelMaskChanger cannot be null"); - var module = particleSystem.textureSheetAnimation; - module.uvChannelMask = uvChannelMaskChanger(module.uvChannelMask); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetUvChannelMask(this TextureSheetAnimationModule module, UnityEngine.Rendering.UVChannelFlags uvChannelMask) - { - module.uvChannelMask = uvChannelMask; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TextureSheetAnimationModule SetUvChannelMask(this TextureSheetAnimationModule module, Func uvChannelMaskChanger) - { - Debug.Assert(uvChannelMaskChanger != null, "uvChannelMaskChanger cannot be null"); - module.uvChannelMask = uvChannelMaskChanger(module.uvChannelMask); - return module; - } - #endregion -#endif - } -} diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/TextureSheetAnimationModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/TextureSheetAnimationModuleExtension.cs.meta deleted file mode 100644 index 6576a21..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/TextureSheetAnimationModuleExtension.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: bc825d7d9d5c3d446b72b074468d8875 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/TrailModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/TrailModuleExtension.cs deleted file mode 100644 index 0cffb77..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/TrailModuleExtension.cs +++ /dev/null @@ -1,1085 +0,0 @@ -#nullable enable -using System; -using System.Runtime.CompilerServices; -using UnityEngine; -using static UnityEngine.ParticleSystem; - -namespace OUCC.FluentParticleSystem -{ - public static class TrailModuleExtension - { -#if UNITY_2018_4_OR_NEWER - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditTrails(this ParticleSystem particleSystem, Action moduleEditor) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); - moduleEditor(particleSystem.trails); - return particleSystem; - } - - #region AttachRibbonsToTransform - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsAttachRibbonsToTransform(this ParticleSystem particleSystem, bool attachRibbonsToTransform) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.trails; - module.attachRibbonsToTransform = attachRibbonsToTransform; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsAttachRibbonsToTransform(this ParticleSystem particleSystem, Func attachRibbonsToTransformChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(attachRibbonsToTransformChanger != null, "attachRibbonsToTransformChanger cannot be null"); - var module = particleSystem.trails; - module.attachRibbonsToTransform = attachRibbonsToTransformChanger(module.attachRibbonsToTransform); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetAttachRibbonsToTransform(this TrailModule module, bool attachRibbonsToTransform) - { - module.attachRibbonsToTransform = attachRibbonsToTransform; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetAttachRibbonsToTransform(this TrailModule module, Func attachRibbonsToTransformChanger) - { - Debug.Assert(attachRibbonsToTransformChanger != null, "attachRibbonsToTransformChanger cannot be null"); - module.attachRibbonsToTransform = attachRibbonsToTransformChanger(module.attachRibbonsToTransform); - return module; - } - #endregion - - #region ColorOverLifetime - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsColorOverLifetime(this ParticleSystem particleSystem, MinMaxGradient colorOverLifetime) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.trails; - module.colorOverLifetime = colorOverLifetime; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsColorOverLifetime(this ParticleSystem particleSystem, Func colorOverLifetimeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(colorOverLifetimeChanger != null, "colorOverLifetimeChanger cannot be null"); - var module = particleSystem.trails; - module.colorOverLifetime = colorOverLifetimeChanger(module.colorOverLifetime); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetColorOverLifetime(this TrailModule module, MinMaxGradient colorOverLifetime) - { - module.colorOverLifetime = colorOverLifetime; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetColorOverLifetime(this TrailModule module, Func colorOverLifetimeChanger) - { - Debug.Assert(colorOverLifetimeChanger != null, "colorOverLifetimeChanger cannot be null"); - module.colorOverLifetime = colorOverLifetimeChanger(module.colorOverLifetime); - return module; - } - #endregion - - #region ColorOverTrail - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsColorOverTrail(this ParticleSystem particleSystem, MinMaxGradient colorOverTrail) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.trails; - module.colorOverTrail = colorOverTrail; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsColorOverTrail(this ParticleSystem particleSystem, Func colorOverTrailChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(colorOverTrailChanger != null, "colorOverTrailChanger cannot be null"); - var module = particleSystem.trails; - module.colorOverTrail = colorOverTrailChanger(module.colorOverTrail); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetColorOverTrail(this TrailModule module, MinMaxGradient colorOverTrail) - { - module.colorOverTrail = colorOverTrail; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetColorOverTrail(this TrailModule module, Func colorOverTrailChanger) - { - Debug.Assert(colorOverTrailChanger != null, "colorOverTrailChanger cannot be null"); - module.colorOverTrail = colorOverTrailChanger(module.colorOverTrail); - return module; - } - #endregion - - #region DieWithParticles - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsDieWithParticles(this ParticleSystem particleSystem, bool dieWithParticles) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.trails; - module.dieWithParticles = dieWithParticles; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsDieWithParticles(this ParticleSystem particleSystem, Func dieWithParticlesChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(dieWithParticlesChanger != null, "dieWithParticlesChanger cannot be null"); - var module = particleSystem.trails; - module.dieWithParticles = dieWithParticlesChanger(module.dieWithParticles); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetDieWithParticles(this TrailModule module, bool dieWithParticles) - { - module.dieWithParticles = dieWithParticles; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetDieWithParticles(this TrailModule module, Func dieWithParticlesChanger) - { - Debug.Assert(dieWithParticlesChanger != null, "dieWithParticlesChanger cannot be null"); - module.dieWithParticles = dieWithParticlesChanger(module.dieWithParticles); - return module; - } - #endregion - - #region Enabled - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsEnabled(this ParticleSystem particleSystem, bool enabled) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.trails; - module.enabled = enabled; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsEnabled(this ParticleSystem particleSystem, Func enabledChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - var module = particleSystem.trails; - module.enabled = enabledChanger(module.enabled); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetEnabled(this TrailModule module, bool enabled) - { - module.enabled = enabled; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetEnabled(this TrailModule module, Func enabledChanger) - { - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - module.enabled = enabledChanger(module.enabled); - return module; - } - #endregion - - #region GenerateLightingData - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsGenerateLightingData(this ParticleSystem particleSystem, bool generateLightingData) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.trails; - module.generateLightingData = generateLightingData; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsGenerateLightingData(this ParticleSystem particleSystem, Func generateLightingDataChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(generateLightingDataChanger != null, "generateLightingDataChanger cannot be null"); - var module = particleSystem.trails; - module.generateLightingData = generateLightingDataChanger(module.generateLightingData); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetGenerateLightingData(this TrailModule module, bool generateLightingData) - { - module.generateLightingData = generateLightingData; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetGenerateLightingData(this TrailModule module, Func generateLightingDataChanger) - { - Debug.Assert(generateLightingDataChanger != null, "generateLightingDataChanger cannot be null"); - module.generateLightingData = generateLightingDataChanger(module.generateLightingData); - return module; - } - #endregion - - #region InheritParticleColor - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsInheritParticleColor(this ParticleSystem particleSystem, bool inheritParticleColor) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.trails; - module.inheritParticleColor = inheritParticleColor; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsInheritParticleColor(this ParticleSystem particleSystem, Func inheritParticleColorChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(inheritParticleColorChanger != null, "inheritParticleColorChanger cannot be null"); - var module = particleSystem.trails; - module.inheritParticleColor = inheritParticleColorChanger(module.inheritParticleColor); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetInheritParticleColor(this TrailModule module, bool inheritParticleColor) - { - module.inheritParticleColor = inheritParticleColor; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetInheritParticleColor(this TrailModule module, Func inheritParticleColorChanger) - { - Debug.Assert(inheritParticleColorChanger != null, "inheritParticleColorChanger cannot be null"); - module.inheritParticleColor = inheritParticleColorChanger(module.inheritParticleColor); - return module; - } - #endregion - - #region Lifetime - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsLifetime(this ParticleSystem particleSystem, MinMaxCurve lifetime) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.trails; - module.lifetime = lifetime; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsLifetime(this ParticleSystem particleSystem, Func lifetimeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(lifetimeChanger != null, "lifetimeChanger cannot be null"); - var module = particleSystem.trails; - module.lifetime = lifetimeChanger(module.lifetime); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetLifetime(this TrailModule module, MinMaxCurve lifetime) - { - module.lifetime = lifetime; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetLifetime(this TrailModule module, Func lifetimeChanger) - { - Debug.Assert(lifetimeChanger != null, "lifetimeChanger cannot be null"); - module.lifetime = lifetimeChanger(module.lifetime); - return module; - } - #endregion - - #region LifetimeMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsLifetimeMultiplier(this ParticleSystem particleSystem, float lifetimeMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.trails; - module.lifetimeMultiplier = lifetimeMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsLifetimeMultiplier(this ParticleSystem particleSystem, Func lifetimeMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(lifetimeMultiplierChanger != null, "lifetimeMultiplierChanger cannot be null"); - var module = particleSystem.trails; - module.lifetimeMultiplier = lifetimeMultiplierChanger(module.lifetimeMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetLifetimeMultiplier(this TrailModule module, float lifetimeMultiplier) - { - module.lifetimeMultiplier = lifetimeMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetLifetimeMultiplier(this TrailModule module, Func lifetimeMultiplierChanger) - { - Debug.Assert(lifetimeMultiplierChanger != null, "lifetimeMultiplierChanger cannot be null"); - module.lifetimeMultiplier = lifetimeMultiplierChanger(module.lifetimeMultiplier); - return module; - } - #endregion - - #region MinVertexDistance - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsMinVertexDistance(this ParticleSystem particleSystem, float minVertexDistance) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.trails; - module.minVertexDistance = minVertexDistance; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsMinVertexDistance(this ParticleSystem particleSystem, Func minVertexDistanceChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(minVertexDistanceChanger != null, "minVertexDistanceChanger cannot be null"); - var module = particleSystem.trails; - module.minVertexDistance = minVertexDistanceChanger(module.minVertexDistance); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetMinVertexDistance(this TrailModule module, float minVertexDistance) - { - module.minVertexDistance = minVertexDistance; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetMinVertexDistance(this TrailModule module, Func minVertexDistanceChanger) - { - Debug.Assert(minVertexDistanceChanger != null, "minVertexDistanceChanger cannot be null"); - module.minVertexDistance = minVertexDistanceChanger(module.minVertexDistance); - return module; - } - #endregion - - #region Mode - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsMode(this ParticleSystem particleSystem, ParticleSystemTrailMode mode) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.trails; - module.mode = mode; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsMode(this ParticleSystem particleSystem, Func modeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(modeChanger != null, "modeChanger cannot be null"); - var module = particleSystem.trails; - module.mode = modeChanger(module.mode); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetMode(this TrailModule module, ParticleSystemTrailMode mode) - { - module.mode = mode; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetMode(this TrailModule module, Func modeChanger) - { - Debug.Assert(modeChanger != null, "modeChanger cannot be null"); - module.mode = modeChanger(module.mode); - return module; - } - #endregion - - #region Ratio - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsRatio(this ParticleSystem particleSystem, float ratio) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.trails; - module.ratio = ratio; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsRatio(this ParticleSystem particleSystem, Func ratioChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(ratioChanger != null, "ratioChanger cannot be null"); - var module = particleSystem.trails; - module.ratio = ratioChanger(module.ratio); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetRatio(this TrailModule module, float ratio) - { - module.ratio = ratio; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetRatio(this TrailModule module, Func ratioChanger) - { - Debug.Assert(ratioChanger != null, "ratioChanger cannot be null"); - module.ratio = ratioChanger(module.ratio); - return module; - } - #endregion - - #region RibbonCount - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsRibbonCount(this ParticleSystem particleSystem, int ribbonCount) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.trails; - module.ribbonCount = ribbonCount; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsRibbonCount(this ParticleSystem particleSystem, Func ribbonCountChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(ribbonCountChanger != null, "ribbonCountChanger cannot be null"); - var module = particleSystem.trails; - module.ribbonCount = ribbonCountChanger(module.ribbonCount); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetRibbonCount(this TrailModule module, int ribbonCount) - { - module.ribbonCount = ribbonCount; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetRibbonCount(this TrailModule module, Func ribbonCountChanger) - { - Debug.Assert(ribbonCountChanger != null, "ribbonCountChanger cannot be null"); - module.ribbonCount = ribbonCountChanger(module.ribbonCount); - return module; - } - #endregion - - #region ShadowBias - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsShadowBias(this ParticleSystem particleSystem, float shadowBias) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.trails; - module.shadowBias = shadowBias; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsShadowBias(this ParticleSystem particleSystem, Func shadowBiasChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(shadowBiasChanger != null, "shadowBiasChanger cannot be null"); - var module = particleSystem.trails; - module.shadowBias = shadowBiasChanger(module.shadowBias); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetShadowBias(this TrailModule module, float shadowBias) - { - module.shadowBias = shadowBias; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetShadowBias(this TrailModule module, Func shadowBiasChanger) - { - Debug.Assert(shadowBiasChanger != null, "shadowBiasChanger cannot be null"); - module.shadowBias = shadowBiasChanger(module.shadowBias); - return module; - } - #endregion - - #region SizeAffectsLifetime - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsSizeAffectsLifetime(this ParticleSystem particleSystem, bool sizeAffectsLifetime) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.trails; - module.sizeAffectsLifetime = sizeAffectsLifetime; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsSizeAffectsLifetime(this ParticleSystem particleSystem, Func sizeAffectsLifetimeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(sizeAffectsLifetimeChanger != null, "sizeAffectsLifetimeChanger cannot be null"); - var module = particleSystem.trails; - module.sizeAffectsLifetime = sizeAffectsLifetimeChanger(module.sizeAffectsLifetime); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetSizeAffectsLifetime(this TrailModule module, bool sizeAffectsLifetime) - { - module.sizeAffectsLifetime = sizeAffectsLifetime; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetSizeAffectsLifetime(this TrailModule module, Func sizeAffectsLifetimeChanger) - { - Debug.Assert(sizeAffectsLifetimeChanger != null, "sizeAffectsLifetimeChanger cannot be null"); - module.sizeAffectsLifetime = sizeAffectsLifetimeChanger(module.sizeAffectsLifetime); - return module; - } - #endregion - - #region SizeAffectsWidth - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsSizeAffectsWidth(this ParticleSystem particleSystem, bool sizeAffectsWidth) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.trails; - module.sizeAffectsWidth = sizeAffectsWidth; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsSizeAffectsWidth(this ParticleSystem particleSystem, Func sizeAffectsWidthChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(sizeAffectsWidthChanger != null, "sizeAffectsWidthChanger cannot be null"); - var module = particleSystem.trails; - module.sizeAffectsWidth = sizeAffectsWidthChanger(module.sizeAffectsWidth); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetSizeAffectsWidth(this TrailModule module, bool sizeAffectsWidth) - { - module.sizeAffectsWidth = sizeAffectsWidth; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetSizeAffectsWidth(this TrailModule module, Func sizeAffectsWidthChanger) - { - Debug.Assert(sizeAffectsWidthChanger != null, "sizeAffectsWidthChanger cannot be null"); - module.sizeAffectsWidth = sizeAffectsWidthChanger(module.sizeAffectsWidth); - return module; - } - #endregion - - #region SplitSubEmitterRibbons - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsSplitSubEmitterRibbons(this ParticleSystem particleSystem, bool splitSubEmitterRibbons) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.trails; - module.splitSubEmitterRibbons = splitSubEmitterRibbons; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsSplitSubEmitterRibbons(this ParticleSystem particleSystem, Func splitSubEmitterRibbonsChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(splitSubEmitterRibbonsChanger != null, "splitSubEmitterRibbonsChanger cannot be null"); - var module = particleSystem.trails; - module.splitSubEmitterRibbons = splitSubEmitterRibbonsChanger(module.splitSubEmitterRibbons); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetSplitSubEmitterRibbons(this TrailModule module, bool splitSubEmitterRibbons) - { - module.splitSubEmitterRibbons = splitSubEmitterRibbons; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetSplitSubEmitterRibbons(this TrailModule module, Func splitSubEmitterRibbonsChanger) - { - Debug.Assert(splitSubEmitterRibbonsChanger != null, "splitSubEmitterRibbonsChanger cannot be null"); - module.splitSubEmitterRibbons = splitSubEmitterRibbonsChanger(module.splitSubEmitterRibbons); - return module; - } - #endregion - - #region TextureMode - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsTextureMode(this ParticleSystem particleSystem, ParticleSystemTrailTextureMode textureMode) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.trails; - module.textureMode = textureMode; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsTextureMode(this ParticleSystem particleSystem, Func textureModeChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(textureModeChanger != null, "textureModeChanger cannot be null"); - var module = particleSystem.trails; - module.textureMode = textureModeChanger(module.textureMode); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetTextureMode(this TrailModule module, ParticleSystemTrailTextureMode textureMode) - { - module.textureMode = textureMode; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetTextureMode(this TrailModule module, Func textureModeChanger) - { - Debug.Assert(textureModeChanger != null, "textureModeChanger cannot be null"); - module.textureMode = textureModeChanger(module.textureMode); - return module; - } - #endregion -#endif - -#if UNITY_2022_2_OR_NEWER - #region TextureScale - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsTextureScale(this ParticleSystem particleSystem, Vector2 textureScale) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.trails; - module.textureScale = textureScale; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsTextureScale(this ParticleSystem particleSystem, Func textureScaleChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(textureScaleChanger != null, "textureScaleChanger cannot be null"); - var module = particleSystem.trails; - module.textureScale = textureScaleChanger(module.textureScale); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetTextureScale(this TrailModule module, Vector2 textureScale) - { - module.textureScale = textureScale; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetTextureScale(this TrailModule module, Func textureScaleChanger) - { - Debug.Assert(textureScaleChanger != null, "textureScaleChanger cannot be null"); - module.textureScale = textureScaleChanger(module.textureScale); - return module; - } - #endregion -#endif - -#if UNITY_2018_4_OR_NEWER - #region WidthOverTrail - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsWidthOverTrail(this ParticleSystem particleSystem, MinMaxCurve widthOverTrail) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.trails; - module.widthOverTrail = widthOverTrail; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsWidthOverTrail(this ParticleSystem particleSystem, Func widthOverTrailChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(widthOverTrailChanger != null, "widthOverTrailChanger cannot be null"); - var module = particleSystem.trails; - module.widthOverTrail = widthOverTrailChanger(module.widthOverTrail); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetWidthOverTrail(this TrailModule module, MinMaxCurve widthOverTrail) - { - module.widthOverTrail = widthOverTrail; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetWidthOverTrail(this TrailModule module, Func widthOverTrailChanger) - { - Debug.Assert(widthOverTrailChanger != null, "widthOverTrailChanger cannot be null"); - module.widthOverTrail = widthOverTrailChanger(module.widthOverTrail); - return module; - } - #endregion - - #region WidthOverTrailMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsWidthOverTrailMultiplier(this ParticleSystem particleSystem, float widthOverTrailMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.trails; - module.widthOverTrailMultiplier = widthOverTrailMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsWidthOverTrailMultiplier(this ParticleSystem particleSystem, Func widthOverTrailMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(widthOverTrailMultiplierChanger != null, "widthOverTrailMultiplierChanger cannot be null"); - var module = particleSystem.trails; - module.widthOverTrailMultiplier = widthOverTrailMultiplierChanger(module.widthOverTrailMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetWidthOverTrailMultiplier(this TrailModule module, float widthOverTrailMultiplier) - { - module.widthOverTrailMultiplier = widthOverTrailMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetWidthOverTrailMultiplier(this TrailModule module, Func widthOverTrailMultiplierChanger) - { - Debug.Assert(widthOverTrailMultiplierChanger != null, "widthOverTrailMultiplierChanger cannot be null"); - module.widthOverTrailMultiplier = widthOverTrailMultiplierChanger(module.widthOverTrailMultiplier); - return module; - } - #endregion - - #region WorldSpace - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsWorldSpace(this ParticleSystem particleSystem, bool worldSpace) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.trails; - module.worldSpace = worldSpace; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetTrailsWorldSpace(this ParticleSystem particleSystem, Func worldSpaceChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(worldSpaceChanger != null, "worldSpaceChanger cannot be null"); - var module = particleSystem.trails; - module.worldSpace = worldSpaceChanger(module.worldSpace); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetWorldSpace(this TrailModule module, bool worldSpace) - { - module.worldSpace = worldSpace; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TrailModule SetWorldSpace(this TrailModule module, Func worldSpaceChanger) - { - Debug.Assert(worldSpaceChanger != null, "worldSpaceChanger cannot be null"); - module.worldSpace = worldSpaceChanger(module.worldSpace); - return module; - } - #endregion -#endif - } -} diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/TrailModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/TrailModuleExtension.cs.meta deleted file mode 100644 index ce104cd..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/TrailModuleExtension.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: d3a897240c2b7e84ca28f290b1cc2832 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/TriggerModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/TriggerModuleExtension.cs.meta deleted file mode 100644 index dfb711d..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/TriggerModuleExtension.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 9e46479b4106b7843bbf15e80f9ffca2 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/VelocityOverLifetimeModuleExtension.cs b/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/VelocityOverLifetimeModuleExtension.cs deleted file mode 100644 index 6f2dc1f..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/VelocityOverLifetimeModuleExtension.cs +++ /dev/null @@ -1,1177 +0,0 @@ -#nullable enable -using System; -using System.Runtime.CompilerServices; -using UnityEngine; -using static UnityEngine.ParticleSystem; - -namespace OUCC.FluentParticleSystem -{ - public static class VelocityOverLifetimeModuleExtension - { -#if UNITY_2018_4_OR_NEWER - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem EditVelocityOverLifetime(this ParticleSystem particleSystem, Action moduleEditor) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(moduleEditor != null, "moduleEditor cannot be null"); - moduleEditor(particleSystem.velocityOverLifetime); - return particleSystem; - } - - #region Enabled - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeEnabled(this ParticleSystem particleSystem, bool enabled) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.enabled = enabled; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeEnabled(this ParticleSystem particleSystem, Func enabledChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.enabled = enabledChanger(module.enabled); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetEnabled(this VelocityOverLifetimeModule module, bool enabled) - { - module.enabled = enabled; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetEnabled(this VelocityOverLifetimeModule module, Func enabledChanger) - { - Debug.Assert(enabledChanger != null, "enabledChanger cannot be null"); - module.enabled = enabledChanger(module.enabled); - return module; - } - #endregion - - #region OrbitalOffsetX - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetX(this ParticleSystem particleSystem, MinMaxCurve orbitalOffsetX) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.orbitalOffsetX = orbitalOffsetX; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetX(this ParticleSystem particleSystem, Func orbitalOffsetXChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(orbitalOffsetXChanger != null, "orbitalOffsetXChanger cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.orbitalOffsetX = orbitalOffsetXChanger(module.orbitalOffsetX); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetOrbitalOffsetX(this VelocityOverLifetimeModule module, MinMaxCurve orbitalOffsetX) - { - module.orbitalOffsetX = orbitalOffsetX; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetOrbitalOffsetX(this VelocityOverLifetimeModule module, Func orbitalOffsetXChanger) - { - Debug.Assert(orbitalOffsetXChanger != null, "orbitalOffsetXChanger cannot be null"); - module.orbitalOffsetX = orbitalOffsetXChanger(module.orbitalOffsetX); - return module; - } - #endregion - - #region OrbitalOffsetXMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetXMultiplier(this ParticleSystem particleSystem, float orbitalOffsetXMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.orbitalOffsetXMultiplier = orbitalOffsetXMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetXMultiplier(this ParticleSystem particleSystem, Func orbitalOffsetXMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(orbitalOffsetXMultiplierChanger != null, "orbitalOffsetXMultiplierChanger cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.orbitalOffsetXMultiplier = orbitalOffsetXMultiplierChanger(module.orbitalOffsetXMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetOrbitalOffsetXMultiplier(this VelocityOverLifetimeModule module, float orbitalOffsetXMultiplier) - { - module.orbitalOffsetXMultiplier = orbitalOffsetXMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetOrbitalOffsetXMultiplier(this VelocityOverLifetimeModule module, Func orbitalOffsetXMultiplierChanger) - { - Debug.Assert(orbitalOffsetXMultiplierChanger != null, "orbitalOffsetXMultiplierChanger cannot be null"); - module.orbitalOffsetXMultiplier = orbitalOffsetXMultiplierChanger(module.orbitalOffsetXMultiplier); - return module; - } - #endregion - - #region OrbitalOffsetY - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetY(this ParticleSystem particleSystem, MinMaxCurve orbitalOffsetY) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.orbitalOffsetY = orbitalOffsetY; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetY(this ParticleSystem particleSystem, Func orbitalOffsetYChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(orbitalOffsetYChanger != null, "orbitalOffsetYChanger cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.orbitalOffsetY = orbitalOffsetYChanger(module.orbitalOffsetY); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetOrbitalOffsetY(this VelocityOverLifetimeModule module, MinMaxCurve orbitalOffsetY) - { - module.orbitalOffsetY = orbitalOffsetY; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetOrbitalOffsetY(this VelocityOverLifetimeModule module, Func orbitalOffsetYChanger) - { - Debug.Assert(orbitalOffsetYChanger != null, "orbitalOffsetYChanger cannot be null"); - module.orbitalOffsetY = orbitalOffsetYChanger(module.orbitalOffsetY); - return module; - } - #endregion - - #region OrbitalOffsetYMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetYMultiplier(this ParticleSystem particleSystem, float orbitalOffsetYMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.orbitalOffsetYMultiplier = orbitalOffsetYMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetYMultiplier(this ParticleSystem particleSystem, Func orbitalOffsetYMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(orbitalOffsetYMultiplierChanger != null, "orbitalOffsetYMultiplierChanger cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.orbitalOffsetYMultiplier = orbitalOffsetYMultiplierChanger(module.orbitalOffsetYMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetOrbitalOffsetYMultiplier(this VelocityOverLifetimeModule module, float orbitalOffsetYMultiplier) - { - module.orbitalOffsetYMultiplier = orbitalOffsetYMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetOrbitalOffsetYMultiplier(this VelocityOverLifetimeModule module, Func orbitalOffsetYMultiplierChanger) - { - Debug.Assert(orbitalOffsetYMultiplierChanger != null, "orbitalOffsetYMultiplierChanger cannot be null"); - module.orbitalOffsetYMultiplier = orbitalOffsetYMultiplierChanger(module.orbitalOffsetYMultiplier); - return module; - } - #endregion - - #region OrbitalOffsetZ - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetZ(this ParticleSystem particleSystem, MinMaxCurve orbitalOffsetZ) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.orbitalOffsetZ = orbitalOffsetZ; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetZ(this ParticleSystem particleSystem, Func orbitalOffsetZChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(orbitalOffsetZChanger != null, "orbitalOffsetZChanger cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.orbitalOffsetZ = orbitalOffsetZChanger(module.orbitalOffsetZ); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetOrbitalOffsetZ(this VelocityOverLifetimeModule module, MinMaxCurve orbitalOffsetZ) - { - module.orbitalOffsetZ = orbitalOffsetZ; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetOrbitalOffsetZ(this VelocityOverLifetimeModule module, Func orbitalOffsetZChanger) - { - Debug.Assert(orbitalOffsetZChanger != null, "orbitalOffsetZChanger cannot be null"); - module.orbitalOffsetZ = orbitalOffsetZChanger(module.orbitalOffsetZ); - return module; - } - #endregion - - #region OrbitalOffsetZMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetZMultiplier(this ParticleSystem particleSystem, float orbitalOffsetZMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.orbitalOffsetZMultiplier = orbitalOffsetZMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalOffsetZMultiplier(this ParticleSystem particleSystem, Func orbitalOffsetZMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(orbitalOffsetZMultiplierChanger != null, "orbitalOffsetZMultiplierChanger cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.orbitalOffsetZMultiplier = orbitalOffsetZMultiplierChanger(module.orbitalOffsetZMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetOrbitalOffsetZMultiplier(this VelocityOverLifetimeModule module, float orbitalOffsetZMultiplier) - { - module.orbitalOffsetZMultiplier = orbitalOffsetZMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetOrbitalOffsetZMultiplier(this VelocityOverLifetimeModule module, Func orbitalOffsetZMultiplierChanger) - { - Debug.Assert(orbitalOffsetZMultiplierChanger != null, "orbitalOffsetZMultiplierChanger cannot be null"); - module.orbitalOffsetZMultiplier = orbitalOffsetZMultiplierChanger(module.orbitalOffsetZMultiplier); - return module; - } - #endregion - - #region OrbitalX - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalX(this ParticleSystem particleSystem, MinMaxCurve orbitalX) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.orbitalX = orbitalX; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalX(this ParticleSystem particleSystem, Func orbitalXChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(orbitalXChanger != null, "orbitalXChanger cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.orbitalX = orbitalXChanger(module.orbitalX); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetOrbitalX(this VelocityOverLifetimeModule module, MinMaxCurve orbitalX) - { - module.orbitalX = orbitalX; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetOrbitalX(this VelocityOverLifetimeModule module, Func orbitalXChanger) - { - Debug.Assert(orbitalXChanger != null, "orbitalXChanger cannot be null"); - module.orbitalX = orbitalXChanger(module.orbitalX); - return module; - } - #endregion - - #region OrbitalXMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalXMultiplier(this ParticleSystem particleSystem, float orbitalXMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.orbitalXMultiplier = orbitalXMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalXMultiplier(this ParticleSystem particleSystem, Func orbitalXMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(orbitalXMultiplierChanger != null, "orbitalXMultiplierChanger cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.orbitalXMultiplier = orbitalXMultiplierChanger(module.orbitalXMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetOrbitalXMultiplier(this VelocityOverLifetimeModule module, float orbitalXMultiplier) - { - module.orbitalXMultiplier = orbitalXMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetOrbitalXMultiplier(this VelocityOverLifetimeModule module, Func orbitalXMultiplierChanger) - { - Debug.Assert(orbitalXMultiplierChanger != null, "orbitalXMultiplierChanger cannot be null"); - module.orbitalXMultiplier = orbitalXMultiplierChanger(module.orbitalXMultiplier); - return module; - } - #endregion - - #region OrbitalY - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalY(this ParticleSystem particleSystem, MinMaxCurve orbitalY) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.orbitalY = orbitalY; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalY(this ParticleSystem particleSystem, Func orbitalYChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(orbitalYChanger != null, "orbitalYChanger cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.orbitalY = orbitalYChanger(module.orbitalY); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetOrbitalY(this VelocityOverLifetimeModule module, MinMaxCurve orbitalY) - { - module.orbitalY = orbitalY; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetOrbitalY(this VelocityOverLifetimeModule module, Func orbitalYChanger) - { - Debug.Assert(orbitalYChanger != null, "orbitalYChanger cannot be null"); - module.orbitalY = orbitalYChanger(module.orbitalY); - return module; - } - #endregion - - #region OrbitalYMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalYMultiplier(this ParticleSystem particleSystem, float orbitalYMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.orbitalYMultiplier = orbitalYMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalYMultiplier(this ParticleSystem particleSystem, Func orbitalYMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(orbitalYMultiplierChanger != null, "orbitalYMultiplierChanger cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.orbitalYMultiplier = orbitalYMultiplierChanger(module.orbitalYMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetOrbitalYMultiplier(this VelocityOverLifetimeModule module, float orbitalYMultiplier) - { - module.orbitalYMultiplier = orbitalYMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetOrbitalYMultiplier(this VelocityOverLifetimeModule module, Func orbitalYMultiplierChanger) - { - Debug.Assert(orbitalYMultiplierChanger != null, "orbitalYMultiplierChanger cannot be null"); - module.orbitalYMultiplier = orbitalYMultiplierChanger(module.orbitalYMultiplier); - return module; - } - #endregion - - #region OrbitalZ - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalZ(this ParticleSystem particleSystem, MinMaxCurve orbitalZ) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.orbitalZ = orbitalZ; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalZ(this ParticleSystem particleSystem, Func orbitalZChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(orbitalZChanger != null, "orbitalZChanger cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.orbitalZ = orbitalZChanger(module.orbitalZ); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetOrbitalZ(this VelocityOverLifetimeModule module, MinMaxCurve orbitalZ) - { - module.orbitalZ = orbitalZ; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetOrbitalZ(this VelocityOverLifetimeModule module, Func orbitalZChanger) - { - Debug.Assert(orbitalZChanger != null, "orbitalZChanger cannot be null"); - module.orbitalZ = orbitalZChanger(module.orbitalZ); - return module; - } - #endregion - - #region OrbitalZMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalZMultiplier(this ParticleSystem particleSystem, float orbitalZMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.orbitalZMultiplier = orbitalZMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeOrbitalZMultiplier(this ParticleSystem particleSystem, Func orbitalZMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(orbitalZMultiplierChanger != null, "orbitalZMultiplierChanger cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.orbitalZMultiplier = orbitalZMultiplierChanger(module.orbitalZMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetOrbitalZMultiplier(this VelocityOverLifetimeModule module, float orbitalZMultiplier) - { - module.orbitalZMultiplier = orbitalZMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetOrbitalZMultiplier(this VelocityOverLifetimeModule module, Func orbitalZMultiplierChanger) - { - Debug.Assert(orbitalZMultiplierChanger != null, "orbitalZMultiplierChanger cannot be null"); - module.orbitalZMultiplier = orbitalZMultiplierChanger(module.orbitalZMultiplier); - return module; - } - #endregion - - #region Radial - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeRadial(this ParticleSystem particleSystem, MinMaxCurve radial) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.radial = radial; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeRadial(this ParticleSystem particleSystem, Func radialChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(radialChanger != null, "radialChanger cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.radial = radialChanger(module.radial); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetRadial(this VelocityOverLifetimeModule module, MinMaxCurve radial) - { - module.radial = radial; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetRadial(this VelocityOverLifetimeModule module, Func radialChanger) - { - Debug.Assert(radialChanger != null, "radialChanger cannot be null"); - module.radial = radialChanger(module.radial); - return module; - } - #endregion - - #region RadialMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeRadialMultiplier(this ParticleSystem particleSystem, float radialMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.radialMultiplier = radialMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeRadialMultiplier(this ParticleSystem particleSystem, Func radialMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(radialMultiplierChanger != null, "radialMultiplierChanger cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.radialMultiplier = radialMultiplierChanger(module.radialMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetRadialMultiplier(this VelocityOverLifetimeModule module, float radialMultiplier) - { - module.radialMultiplier = radialMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetRadialMultiplier(this VelocityOverLifetimeModule module, Func radialMultiplierChanger) - { - Debug.Assert(radialMultiplierChanger != null, "radialMultiplierChanger cannot be null"); - module.radialMultiplier = radialMultiplierChanger(module.radialMultiplier); - return module; - } - #endregion - - #region Space - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeSpace(this ParticleSystem particleSystem, ParticleSystemSimulationSpace space) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.space = space; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeSpace(this ParticleSystem particleSystem, Func spaceChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(spaceChanger != null, "spaceChanger cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.space = spaceChanger(module.space); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetSpace(this VelocityOverLifetimeModule module, ParticleSystemSimulationSpace space) - { - module.space = space; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetSpace(this VelocityOverLifetimeModule module, Func spaceChanger) - { - Debug.Assert(spaceChanger != null, "spaceChanger cannot be null"); - module.space = spaceChanger(module.space); - return module; - } - #endregion - - #region SpeedModifier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeSpeedModifier(this ParticleSystem particleSystem, MinMaxCurve speedModifier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.speedModifier = speedModifier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeSpeedModifier(this ParticleSystem particleSystem, Func speedModifierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(speedModifierChanger != null, "speedModifierChanger cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.speedModifier = speedModifierChanger(module.speedModifier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetSpeedModifier(this VelocityOverLifetimeModule module, MinMaxCurve speedModifier) - { - module.speedModifier = speedModifier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetSpeedModifier(this VelocityOverLifetimeModule module, Func speedModifierChanger) - { - Debug.Assert(speedModifierChanger != null, "speedModifierChanger cannot be null"); - module.speedModifier = speedModifierChanger(module.speedModifier); - return module; - } - #endregion - - #region SpeedModifierMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeSpeedModifierMultiplier(this ParticleSystem particleSystem, float speedModifierMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.speedModifierMultiplier = speedModifierMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeSpeedModifierMultiplier(this ParticleSystem particleSystem, Func speedModifierMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(speedModifierMultiplierChanger != null, "speedModifierMultiplierChanger cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.speedModifierMultiplier = speedModifierMultiplierChanger(module.speedModifierMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetSpeedModifierMultiplier(this VelocityOverLifetimeModule module, float speedModifierMultiplier) - { - module.speedModifierMultiplier = speedModifierMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetSpeedModifierMultiplier(this VelocityOverLifetimeModule module, Func speedModifierMultiplierChanger) - { - Debug.Assert(speedModifierMultiplierChanger != null, "speedModifierMultiplierChanger cannot be null"); - module.speedModifierMultiplier = speedModifierMultiplierChanger(module.speedModifierMultiplier); - return module; - } - #endregion - - #region X - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeX(this ParticleSystem particleSystem, MinMaxCurve x) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.x = x; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeX(this ParticleSystem particleSystem, Func xChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(xChanger != null, "xChanger cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.x = xChanger(module.x); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetX(this VelocityOverLifetimeModule module, MinMaxCurve x) - { - module.x = x; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetX(this VelocityOverLifetimeModule module, Func xChanger) - { - Debug.Assert(xChanger != null, "xChanger cannot be null"); - module.x = xChanger(module.x); - return module; - } - #endregion - - #region XMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeXMultiplier(this ParticleSystem particleSystem, float xMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.xMultiplier = xMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeXMultiplier(this ParticleSystem particleSystem, Func xMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(xMultiplierChanger != null, "xMultiplierChanger cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.xMultiplier = xMultiplierChanger(module.xMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetXMultiplier(this VelocityOverLifetimeModule module, float xMultiplier) - { - module.xMultiplier = xMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetXMultiplier(this VelocityOverLifetimeModule module, Func xMultiplierChanger) - { - Debug.Assert(xMultiplierChanger != null, "xMultiplierChanger cannot be null"); - module.xMultiplier = xMultiplierChanger(module.xMultiplier); - return module; - } - #endregion - - #region Y - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeY(this ParticleSystem particleSystem, MinMaxCurve y) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.y = y; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeY(this ParticleSystem particleSystem, Func yChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(yChanger != null, "yChanger cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.y = yChanger(module.y); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetY(this VelocityOverLifetimeModule module, MinMaxCurve y) - { - module.y = y; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetY(this VelocityOverLifetimeModule module, Func yChanger) - { - Debug.Assert(yChanger != null, "yChanger cannot be null"); - module.y = yChanger(module.y); - return module; - } - #endregion - - #region YMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeYMultiplier(this ParticleSystem particleSystem, float yMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.yMultiplier = yMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeYMultiplier(this ParticleSystem particleSystem, Func yMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(yMultiplierChanger != null, "yMultiplierChanger cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.yMultiplier = yMultiplierChanger(module.yMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetYMultiplier(this VelocityOverLifetimeModule module, float yMultiplier) - { - module.yMultiplier = yMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetYMultiplier(this VelocityOverLifetimeModule module, Func yMultiplierChanger) - { - Debug.Assert(yMultiplierChanger != null, "yMultiplierChanger cannot be null"); - module.yMultiplier = yMultiplierChanger(module.yMultiplier); - return module; - } - #endregion - - #region Z - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeZ(this ParticleSystem particleSystem, MinMaxCurve z) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.z = z; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeZ(this ParticleSystem particleSystem, Func zChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(zChanger != null, "zChanger cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.z = zChanger(module.z); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetZ(this VelocityOverLifetimeModule module, MinMaxCurve z) - { - module.z = z; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetZ(this VelocityOverLifetimeModule module, Func zChanger) - { - Debug.Assert(zChanger != null, "zChanger cannot be null"); - module.z = zChanger(module.z); - return module; - } - #endregion - - #region ZMultiplier - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeZMultiplier(this ParticleSystem particleSystem, float zMultiplier) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.zMultiplier = zMultiplier; - return particleSystem; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ParticleSystem SetVelocityOverLifetimeZMultiplier(this ParticleSystem particleSystem, Func zMultiplierChanger) - { - Debug.Assert(particleSystem != null, "particleSystem cannot be null"); - Debug.Assert(zMultiplierChanger != null, "zMultiplierChanger cannot be null"); - var module = particleSystem.velocityOverLifetime; - module.zMultiplier = zMultiplierChanger(module.zMultiplier); - return particleSystem; - } - - /// - /// Assign a value to - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetZMultiplier(this VelocityOverLifetimeModule module, float zMultiplier) - { - module.zMultiplier = zMultiplier; - return module; - } - - /// - /// Edit - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static VelocityOverLifetimeModule SetZMultiplier(this VelocityOverLifetimeModule module, Func zMultiplierChanger) - { - Debug.Assert(zMultiplierChanger != null, "zMultiplierChanger cannot be null"); - module.zMultiplier = zMultiplierChanger(module.zMultiplier); - return module; - } - #endregion -#endif - } -} diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/VelocityOverLifetimeModuleExtension.cs.meta b/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/VelocityOverLifetimeModuleExtension.cs.meta deleted file mode 100644 index dc6d732..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/Extensions/VelocityOverLifetimeModuleExtension.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 8c81c0668b2103d41ad0fcebb41e2072 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/OUCC.FluentParticleSystem.asmdef b/Packages/FluentParticleSystem/Runtime/Nullable/OUCC.FluentParticleSystem.asmdef deleted file mode 100644 index e34589d..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/OUCC.FluentParticleSystem.asmdef +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "OUCC.FluentParticleSystem.Nullable", - "rootNamespace": "OUCC.FluentParticleSystem", - "references": [], - "includePlatforms": [], - "excludePlatforms": [], - "allowUnsafeCode": false, - "overrideReferences": false, - "precompiledReferences": [], - "autoReferenced": false, - "defineConstraints": [], - "versionDefines": [], - "noEngineReferences": false -} \ No newline at end of file diff --git a/Packages/FluentParticleSystem/Runtime/Nullable/OUCC.FluentParticleSystem.asmdef.meta b/Packages/FluentParticleSystem/Runtime/Nullable/OUCC.FluentParticleSystem.asmdef.meta deleted file mode 100644 index 39e46db..0000000 --- a/Packages/FluentParticleSystem/Runtime/Nullable/OUCC.FluentParticleSystem.asmdef.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: b676826d50103e446a2c7ce208ce708f -AssemblyDefinitionImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/OUCC.FluentParticleSystem.asmdef b/Packages/FluentParticleSystem/Runtime/OUCC.FluentParticleSystem.asmdef similarity index 100% rename from Packages/FluentParticleSystem/Runtime/NonNullable/OUCC.FluentParticleSystem.asmdef rename to Packages/FluentParticleSystem/Runtime/OUCC.FluentParticleSystem.asmdef diff --git a/Packages/FluentParticleSystem/Runtime/NonNullable/OUCC.FluentParticleSystem.asmdef.meta b/Packages/FluentParticleSystem/Runtime/OUCC.FluentParticleSystem.asmdef.meta similarity index 100% rename from Packages/FluentParticleSystem/Runtime/NonNullable/OUCC.FluentParticleSystem.asmdef.meta rename to Packages/FluentParticleSystem/Runtime/OUCC.FluentParticleSystem.asmdef.meta diff --git a/Packages/FluentParticleSystem/package.json b/Packages/FluentParticleSystem/package.json index 690b2c4..ef7fc8c 100644 --- a/Packages/FluentParticleSystem/package.json +++ b/Packages/FluentParticleSystem/package.json @@ -1,8 +1,8 @@ { "name": "org.oucc.fluent-particle-system", "displayName": "FluentParticleSystem", - "version": "20.0.0", - "unity": "2020.2", + "version": "1.1.0", + "unity": "2018.4", "description": "Provides extension methods to write ParticleSystem of Unity with method chains.", "license": "MIT", "author": {