internal StandardTextureHiddenSelection(MaterialBase.TextureData data, String name, Boolean scaleOffset)
        {
            this.name             = name;
            this.data             = data;
            this.showSelection    = false;
            this.startTexture     = this.data.texture;
            this.textureSelection = new ScrollableEnumSelection <Texture2DIndex>(Texture2DIndex.None, "Texture", (texInd) =>
            {
                Texture tex = null;
                if (texInd == Texture2DIndex.None)
                {
                    tex = this.startTexture;
                }
                else
                {
                    tex = AssetsCore.LoadAsset <Texture2D>(texInd);
                }
                this.data.texture = tex;
            });

            if (scaleOffset && data is MaterialBase.ScaleOffsetTextureData)
            {
                var soData    = data as MaterialBase.ScaleOffsetTextureData;
                var curScale  = soData.tiling;
                var curOffset = soData.offset;
                this.tilingEntry = new NamedVector2TextEntry(curScale, "Tiling", (vec) => soData.tiling = vec);
                this.offsetEntry = new NamedVector2TextEntry(curOffset, "Offset", (vec) => soData.offset = vec);
            }
        }
Exemplo n.º 2
0
 private static void SetupSmallTracerRenderer(this ParticleSystemRenderer renderer, Material material)
 {
     renderer.renderMode                 = ParticleSystemRenderMode.Mesh;
     renderer.mesh                       = AssetsCore.LoadAsset <Mesh>(MeshIndex.Quad);
     renderer.material                   = material;
     renderer.trailMaterial              = null;
     renderer.sortMode                   = ParticleSystemSortMode.None;
     renderer.sortingFudge               = 0;
     renderer.alignment                  = ParticleSystemRenderSpace.Local;
     renderer.flip                       = Vector3.zero;
     renderer.enableGPUInstancing        = true;
     renderer.pivot                      = Vector3.zero;
     renderer.maskInteraction            = SpriteMaskInteraction.None;
     renderer.shadowCastingMode          = UnityEngine.Rendering.ShadowCastingMode.Off;
     renderer.receiveShadows             = false;
     renderer.motionVectorGenerationMode = MotionVectorGenerationMode.Object;
     renderer.sortingLayerID             = LayerIndex.defaultLayer.intVal;
     renderer.sortingOrder               = 0;
     renderer.lightProbeUsage            = UnityEngine.Rendering.LightProbeUsage.Off;
     renderer.reflectionProbeUsage       = UnityEngine.Rendering.ReflectionProbeUsage.Off;
 }
Exemplo n.º 3
0
        private static ParticleSystemRenderer BurnRenderer(this ParticleSystemRenderer psr)
        {
            psr.renderMode                 = ParticleSystemRenderMode.Mesh;
            psr.mesh                       = AssetsCore.LoadAsset <Mesh>(MeshIndex.Quad);
            psr.material                   = MaterialModule.GetPlasmaBurnMaterial().material;
            psr.trailMaterial              = null;
            psr.sortMode                   = ParticleSystemSortMode.None;
            psr.sortingFudge               = 0;
            psr.alignment                  = ParticleSystemRenderSpace.Local;
            psr.flip                       = Vector3.zero;
            psr.enableGPUInstancing        = true;
            psr.pivot                      = Vector3.zero;
            psr.maskInteraction            = SpriteMaskInteraction.None;
            psr.shadowCastingMode          = UnityEngine.Rendering.ShadowCastingMode.Off;
            psr.receiveShadows             = false;
            psr.motionVectorGenerationMode = MotionVectorGenerationMode.Object;
            psr.sortingLayerID             = LayerIndex.defaultLayer.intVal;
            psr.sortingOrder               = 0;
            psr.lightProbeUsage            = UnityEngine.Rendering.LightProbeUsage.Off;
            psr.reflectionProbeUsage       = UnityEngine.Rendering.ReflectionProbeUsage.Off;

            return(psr);
        }
Exemplo n.º 4
0
        internal static Renderer AddMeshIndicator(GameObject mainObj, WispSkinnedEffect skin, MaterialType matType, MeshIndex mesh, Boolean useParticle = false, Boolean particleScaleToSize = false, Single timeToFullsize = 1f, Single duration = 10f, Boolean scaleX = true, Boolean scaleY = true, Boolean scaleZ = true)
        {
            if (!meshIndCounter.ContainsKey(mainObj))
            {
                meshIndCounter[mainObj] = 0u;
            }
            var obj = new GameObject("MeshIndicator" + meshIndCounter[mainObj]++);

            obj.transform.parent        = mainObj.transform;
            obj.transform.localPosition = Vector3.zero;
            obj.transform.localScale    = Vector3.one;
            obj.transform.localRotation = Quaternion.identity;

            Renderer renderer = null;
            Mesh     m        = AssetsCore.LoadAsset <Mesh>(mesh);

            if (useParticle)
            {
                var ps  = obj.AddComponent <ParticleSystem>();
                var psr = obj.AddOrGetComponent <ParticleSystemRenderer>();
                renderer       = psr;
                psr.renderMode = ParticleSystemRenderMode.Mesh;
                psr.alignment  = ParticleSystemRenderSpace.World;
                psr.mesh       = m;

                BasicSetup(ps);

                ps.useAutoRandomSeed = true;

                var psMain = ps.main;
                psMain.duration            = duration;
                psMain.loop                = false;
                psMain.startDelay          = 0f;
                psMain.startLifetime       = duration;
                psMain.startSpeed          = 0f;
                psMain.startSize3D         = false;
                psMain.startSize           = 1f;
                psMain.startRotation3D     = false;
                psMain.startRotation       = 0f;
                psMain.flipRotation        = 0f;
                psMain.startColor          = Color.white;
                psMain.gravityModifier     = 0f;
                psMain.simulationSpace     = ParticleSystemSimulationSpace.Local;
                psMain.useUnscaledTime     = false;
                psMain.scalingMode         = ParticleSystemScalingMode.Hierarchy;
                psMain.playOnAwake         = true;
                psMain.emitterVelocityMode = ParticleSystemEmitterVelocityMode.Transform;
                psMain.maxParticles        = 1;
                psMain.stopAction          = ParticleSystemStopAction.None;
                psMain.cullingMode         = ParticleSystemCullingMode.PauseAndCatchup;
                psMain.ringBufferMode      = ParticleSystemRingBufferMode.Disabled;

                var psEmis = ps.emission;
                psEmis.enabled    = true;
                psEmis.burstCount = 1;
                psEmis.SetBurst(0, new ParticleSystem.Burst(0f, 1));
                psEmis.rateOverTime     = 0f;
                psEmis.rateOverDistance = 0f;

                if (particleScaleToSize)
                {
                    var frac  = timeToFullsize / duration;
                    var psSOL = ps.sizeOverLifetime;
                    psSOL.enabled = true;
                    if (scaleX == false && scaleY == false && scaleZ == false)
                    {
                        psSOL.separateAxes = false;
                        psSOL.size         = new ParticleSystem.MinMaxCurve(1f, AnimationCurve.EaseInOut(0f, 0f, frac, 1f));
                    }
                    else
                    {
                        psSOL.separateAxes = true;
                        psSOL.x            = scaleX ? new ParticleSystem.MinMaxCurve(1f, AnimationCurve.EaseInOut(0f, 0f, frac, 1f)) : 1f;
                        psSOL.y            = scaleX ? new ParticleSystem.MinMaxCurve(1f, AnimationCurve.EaseInOut(0f, 0f, frac, 1f)) : 1f;
                        psSOL.z            = scaleX ? new ParticleSystem.MinMaxCurve(1f, AnimationCurve.EaseInOut(0f, 0f, frac, 1f)) : 1f;
                    }
                }
            }
            else
            {
                var meshRend   = obj.AddComponent <MeshRenderer>();
                var meshFilter = obj.AddOrGetComponent <MeshFilter>();
                renderer = meshRend;
                meshFilter.sharedMesh = m;
            }

            if (matType != MaterialType.Constant)
            {
                skin.AddRenderer(renderer, matType);
            }
            return(renderer);
        }
Exemplo n.º 5
0
        internal static ParticleSystem AddFlamePillar(GameObject mainObj, WispSkinnedEffect skin, MaterialType matType, Single height, Single radius, Single lifetime, Int16 count = 4)
        {
            var calcHeight = height * 0.15f;
            var calcRad    = radius * 0.3f;

            if (!flamePillarCounter.ContainsKey(mainObj))
            {
                flamePillarCounter[mainObj] = 0u;
            }
            var obj = new GameObject("FlamePillar" + flamePillarCounter[mainObj]++);

            obj.transform.parent        = mainObj.transform;
            obj.transform.localPosition = Vector3.zero;
            obj.transform.localScale    = Vector3.one;
            obj.transform.localRotation = Quaternion.identity;

            var ps  = obj.AddComponent <ParticleSystem>();
            var psr = obj.AddOrGetComponent <ParticleSystemRenderer>();

            if (matType != MaterialType.Constant)
            {
                skin.AddRenderer(psr, matType);
            }


            BasicSetup(ps);

            ps.useAutoRandomSeed = true;

            var psMain = ps.main;

            psMain.duration            = lifetime * 2f;
            psMain.loop                = false;
            psMain.prewarm             = false;
            psMain.startDelay          = 0.0f;
            psMain.startLifetime       = new ParticleSystem.MinMaxCurve(lifetime * 0.75f, lifetime * 1.25f);
            psMain.startSpeed          = 0f;
            psMain.startSize3D         = true;
            psMain.startSizeX          = new ParticleSystem.MinMaxCurve(calcRad * 0.75f, calcRad * 1.25f);
            psMain.startSizeY          = new ParticleSystem.MinMaxCurve(0.8f, 1.2f);
            psMain.startSizeZ          = calcHeight;
            psMain.startRotation3D     = true;
            psMain.startRotationX      = Mathf.PI / 2f;
            psMain.startRotationY      = new ParticleSystem.MinMaxCurve(0f, Mathf.PI * 2f);
            psMain.startRotationZ      = 0f;
            psMain.flipRotation        = 1f;
            psMain.startColor          = Color.white;
            psMain.gravityModifier     = 0f;
            psMain.simulationSpace     = ParticleSystemSimulationSpace.World;
            psMain.simulationSpeed     = 1f;
            psMain.useUnscaledTime     = false;
            psMain.scalingMode         = ParticleSystemScalingMode.Local;
            psMain.playOnAwake         = true;
            psMain.emitterVelocityMode = ParticleSystemEmitterVelocityMode.Transform;
            psMain.maxParticles        = 1000;
            psMain.stopAction          = ParticleSystemStopAction.None;
            psMain.cullingMode         = ParticleSystemCullingMode.PauseAndCatchup;
            psMain.ringBufferMode      = ParticleSystemRingBufferMode.Disabled;

            var psEmis = ps.emission;

            psEmis.enabled    = true;
            psEmis.burstCount = 1;
            psEmis.SetBurst(0, new ParticleSystem.Burst(0f, count, count, 1, 0.01f));
            psEmis.rateOverTime     = 0f;
            psEmis.rateOverDistance = 0f;

            //var psShape = ps.shape;
            //psShape.enabled = true;
            //psShape.shapeType = ParticleSystemShapeType.BoxEdge;
            //psShape.radius = 0.01f;
            //psShape.arcMode = ParticleSystemShapeMultiModeValue.Random;
            //psShape.arcSpread = 0f;
            //psShape.texture = null;
            //psShape.alignToDirection = true;
            //psShape.randomDirectionAmount = 0f;
            //psShape.sphericalDirectionAmount = 0f;


            var psCOL = ps.colorOverLifetime;

            psCOL.enabled = true;
            psCOL.color   = new ParticleSystem.MinMaxGradient(new Gradient
            {
                mode      = GradientMode.Blend,
                alphaKeys = new[]
                {
                    new GradientAlphaKey(1f, 0f),
                    new GradientAlphaKey(0f, 1f),
                },
                colorKeys = new[]
                {
                    new GradientColorKey(Color.white, 0f),
                    new GradientColorKey(Color.white, 1f),
                }
            });


            var psSOL = ps.sizeOverLifetime;

            psSOL.enabled      = true;
            psSOL.separateAxes = true;
            psSOL.x            = new ParticleSystem.MinMaxCurve(1f, AnimationCurve.EaseInOut(0f, 1f, 1f, 0f));
            psSOL.y            = new ParticleSystem.MinMaxCurve(1f, AnimationCurve.EaseInOut(0f, 1f, 1f, 0f));
            psSOL.z            = new ParticleSystem.MinMaxCurve(1f, AnimationCurve.EaseInOut(0.5f, 1f, 1f, 0.75f));
            //psSOL.size = new ParticleSystem.MinMaxCurve( 1f, AnimationCurve.Linear( 0f, 0.5f, 1f, 1f ) );

            var psROL = ps.rotationOverLifetime;

            psROL.enabled      = true;
            psROL.separateAxes = true;
            psROL.x            = 0f;
            psROL.y            = new ParticleSystem.MinMaxCurve(Mathf.PI * 0.75f * 3f, Mathf.PI * 1.25f * 3f);
            psROL.z            = 0f;


            psr.renderMode = ParticleSystemRenderMode.Mesh;
            psr.mesh       = AssetsCore.LoadAsset <Mesh>(MeshIndex.Spiral1);
            //psr.normalDirection = 1f;
            //psr.sortMode = ParticleSystemSortMode.None;
            //psr.minParticleSize = 0f;
            //psr.maxParticleSize = 1.04f;
            psr.alignment = ParticleSystemRenderSpace.World;
            //psr.flip = Vector3.zero;
            psr.enableGPUInstancing = true;
            //psr.allowRoll = true;
            //psr.pivot = Vector3.zero;
            psr.maskInteraction = SpriteMaskInteraction.None;
            //psr.SetActiveVertexStreams( null );
            //psr.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off;
            //psr.receiveShadows = true;
            //psr.shadowBias = 0f;
            //psr.motionVectorGenerationMode = MotionVectorGenerationMode.Object;
            //psr.sortingLayerID = default;
            //psr.sortingOrder = 0;
            //psr.lightProbeUsage = UnityEngine.Rendering.LightProbeUsage.BlendProbes;
            //psr.reflectionProbeUsage = UnityEngine.Rendering.ReflectionProbeUsage.Simple;
            //psr.probeAnchor = null;

            return(ps);
        }
Exemplo n.º 6
0
        internal static ParticleSystem AddArcaneCircle(GameObject mainObj, WispSkinnedEffect skin, MaterialType matType, Single size, Single lifetime)
        {
            if (!arcaneCircleCounter.ContainsKey(mainObj))
            {
                arcaneCircleCounter[mainObj] = 0u;
            }
            var obj = new GameObject("ArcaneCircle" + arcaneCircleCounter[mainObj]++);

            obj.transform.parent        = mainObj.transform;
            obj.transform.localPosition = Vector3.zero;
            obj.transform.localScale    = Vector3.one;
            obj.transform.localRotation = Quaternion.identity;

            //var rb = obj.AddComponent<Rigidbody>();
            //rb.useGravity = false;
            //rb.isKinematic = false;
            //rb.interpolation = RigidbodyInterpolation.Extrapolate;

            var ps  = obj.AddComponent <ParticleSystem>();
            var psr = obj.AddOrGetComponent <ParticleSystemRenderer>();

            if (matType != MaterialType.Constant)
            {
                skin.AddRenderer(psr, matType);
            }
            BasicSetup(ps);

            ps.useAutoRandomSeed = true;

            var psMain = ps.main;

            psMain.duration            = lifetime * 2;
            psMain.loop                = true;
            psMain.startDelay          = 0f;
            psMain.startLifetime       = lifetime;
            psMain.startSpeed          = 0f;
            psMain.startSize3D         = false;
            psMain.startSize           = size;
            psMain.startRotation3D     = false;
            psMain.startRotation       = 0f;
            psMain.flipRotation        = 0f;
            psMain.startColor          = Color.white;
            psMain.gravityModifier     = 0f;
            psMain.simulationSpace     = ParticleSystemSimulationSpace.World;
            psMain.useUnscaledTime     = false;
            psMain.scalingMode         = ParticleSystemScalingMode.Hierarchy;
            psMain.playOnAwake         = true;
            psMain.emitterVelocityMode = ParticleSystemEmitterVelocityMode.Rigidbody;
            psMain.maxParticles        = 10000;
            psMain.stopAction          = ParticleSystemStopAction.None;
            psMain.cullingMode         = ParticleSystemCullingMode.AlwaysSimulate;
            psMain.ringBufferMode      = ParticleSystemRingBufferMode.Disabled;

            var psEmis = ps.emission;

            psEmis.enabled          = true;
            psEmis.rateOverTime     = 0f;
            psEmis.rateOverDistance = 0f;
            psEmis.burstCount       = 0;

            var psShape = ps.shape;

            psShape.enabled                  = false;
            psShape.arcMode                  = ParticleSystemShapeMultiModeValue.Random;
            psShape.arcSpread                = 0f;
            psShape.texture                  = null;
            psShape.position                 = Vector3.zero;
            psShape.rotation                 = Vector3.zero;
            psShape.scale                    = Vector3.one;
            psShape.randomDirectionAmount    = 0f;
            psShape.randomPositionAmount     = 0f;
            psShape.sphericalDirectionAmount = 0f;

            var psCOL = ps.colorOverLifetime;

            psCOL.enabled = true;
            psCOL.color   = new ParticleSystem.MinMaxGradient(new Gradient
            {
                mode      = GradientMode.Blend,
                alphaKeys = new[]
                {
                    new GradientAlphaKey(1f, 0f),
                    new GradientAlphaKey(0f, 1f),
                },
                colorKeys = new[]
                {
                    new GradientColorKey(Color.white, 0f),
                    new GradientColorKey(Color.white, 1f),
                },
            });

            var psSOL = ps.sizeOverLifetime;

            psSOL.enabled = true;
            psSOL.size    = new ParticleSystem.MinMaxCurve(1f, AnimationCurve.EaseInOut(0f, 1f, 1f, 0f));


            psr.renderMode      = ParticleSystemRenderMode.Mesh;
            psr.mesh            = AssetsCore.LoadAsset <Mesh>(MeshIndex.Quad);
            psr.normalDirection = 1f;
            psr.sortMode        = ParticleSystemSortMode.None;
            psr.minParticleSize = 0f;
            psr.maxParticleSize = 1.04f;
            psr.alignment       = ParticleSystemRenderSpace.Local;
            psr.flip            = Vector3.zero;
            psr.allowRoll       = true;
            psr.pivot           = Vector3.zero;
            psr.maskInteraction = SpriteMaskInteraction.None;
            //psr.SetActiveVertexStreams( null );
            psr.shadowCastingMode          = UnityEngine.Rendering.ShadowCastingMode.Off;
            psr.receiveShadows             = true;
            psr.shadowBias                 = 0f;
            psr.motionVectorGenerationMode = MotionVectorGenerationMode.Object;
            psr.sortingLayerID             = default;
            psr.sortingOrder               = 0;
            psr.lightProbeUsage            = UnityEngine.Rendering.LightProbeUsage.BlendProbes;
            psr.reflectionProbeUsage       = UnityEngine.Rendering.ReflectionProbeUsage.Simple;
            psr.probeAnchor                = null;

            return(ps);
        }
Exemplo n.º 7
0
        internal static GameObject CreateKnifePickupSlash(CloudMaterial mat)
        {
            var obj    = AssetsCore.LoadAsset <GameObject>(PrefabIndex.refMercSwordSlashWhirlwind).ClonePrefab("Rein.SniperKnifeSlash", false);
            var effect = obj.GetComponent <EffectComponent>();

            effect.applyScale      = true;
            effect.disregardZScale = true;

            var swing = obj.transform.Find("SwingTrail");
            var dist  = obj.transform.Find("Distortion");

            var swingPs  = swing.GetComponent <ParticleSystem>();
            var swingPsr = swing.GetComponent <ParticleSystemRenderer>();

            var distPs  = dist.GetComponent <ParticleSystem>();
            var distPsr = dist.GetComponent <ParticleSystemRenderer>();

            //dist.localEulerAngles = swing.localEulerAngles = new(90f, 0f, 0f);

            var swingMain = swingPs.main;
            var distMain  = distPs.main;

            distMain.scalingMode = swingMain.scalingMode = ParticleSystemScalingMode.Hierarchy;

            dist.localScale = swing.localScale = new(0.2f, 0.2f, 1f);


            swingPsr.sharedMaterial = mat.material;

            var swing2 = swing.gameObject.Instantiate().transform;

            swing2.parent     = obj.transform;
            swing2.localScale = Vector3.Scale(swing2.localScale, new(0.5f, 0.5f, 1f));

            var swing3 = swing2.gameObject.Instantiate().transform;

            swing3.parent     = obj.transform;
            swing3.localScale = Vector3.Scale(swing3.localScale, new(0.5f, 0.5f, 1f));

            //var obj = PrefabsCore.CreatePrefab("Rein.SniperKnifePickupSlash", false);
            //var effect = obj.AddComponent<EffectComponent>();
            //effect.effectIndex = EffectIndex.Invalid;
            //effect.positionAtReferencedTransform = false;
            //effect.parentToReferencedTransform = false;
            //effect.applyScale = false;
            //effect.disregardZScale = false;
            //effect.soundName = "";

            //obj.AddComponent<DestroyOnParticleEnd>();
            //var shake = obj.AddComponent<ShakeEmitter>();
            //shake.shakeOnStart = true;
            //shake.wave = new Wave
            //{
            //    amplitude = 0.2f,
            //    cycleOffset = 0.25f,
            //    frequency = 0.1f,
            //};
            //shake.duration = 0.1f;
            //shake.radius = 20f;
            //shake.scaleShakeRadiusWithLocalScale = true;
            //shake.amplitudeTimeDecay = true;

            //var vfx = obj.AddComponent<VFXAttributes>();
            //vfx.vfxPriority = VFXAttributes.VFXPriority.Always;
            //vfx.vfxIntensity = VFXAttributes.VFXIntensity.Medium;
            //vfx.optionalLights = Array.Empty<Light>();
            //vfx.secondaryParticleSystem = Array.Empty<ParticleSystem>();



            //#region Lines
            //var linesObj = new GameObject("Lines");
            //linesObj.transform.parent = obj.transform;
            //linesObj.transform.localPosition = Vector3.zero;
            //linesObj.transform.localScale = Vector3.one;
            //linesObj.transform.localRotation = Quaternion.identity;

            //var linePs = linesObj.AddComponent<ParticleSystem>();
            //var linePsr = linesObj.AddOrGetComponent<ParticleSystemRenderer>();

            //var lineMain = linePs.main;
            //lineMain.duration = 1.0f;
            //lineMain.loop = false;
            //lineMain.prewarm = false;
            //lineMain.startDelay = 0f;
            //lineMain.startLifetime = 0.25f;
            //lineMain.startSpeed = 40f;
            //lineMain.startSize = 0.05f;
            //lineMain.startRotation = 0f;
            //lineMain.flipRotation = 0f;
            //lineMain.startColor = Color.white;
            //lineMain.gravityModifier = 0f;
            //lineMain.simulationSpace = ParticleSystemSimulationSpace.World;
            //lineMain.simulationSpeed = 1f;
            //lineMain.scalingMode = ParticleSystemScalingMode.Hierarchy;
            //lineMain.playOnAwake = true;
            //lineMain.emitterVelocityMode = ParticleSystemEmitterVelocityMode.Rigidbody;
            //lineMain.maxParticles = 200;
            //lineMain.stopAction = ParticleSystemStopAction.None;
            //lineMain.cullingMode = ParticleSystemCullingMode.AlwaysSimulate;
            //lineMain.ringBufferMode = ParticleSystemRingBufferMode.Disabled;

            //var lineEmis = linePs.emission;
            //lineEmis.enabled = true;
            //lineEmis.rateOverTime = 0f;
            //lineEmis.rateOverDistance = 0f;
            //lineEmis.burstCount = 1;
            //lineEmis.SetBurst(0, new ParticleSystem.Burst(0f, 50, 1, 0.01f));

            //var lineShape = linePs.shape;
            //lineShape.enabled = true;
            //lineShape.shapeType = ParticleSystemShapeType.Sphere;
            //lineShape.radius = 5f;
            //lineShape.radiusThickness = 0f;
            //lineShape.arc = 360f; //TODO: Radians or degrees?
            //lineShape.arcMode = ParticleSystemShapeMultiModeValue.Random;
            //lineShape.arcSpread = 0f;
            //lineShape.texture = null;
            //lineShape.position = Vector3.zero;
            //lineShape.rotation = Vector3.zero;
            //lineShape.scale = Vector3.one;
            //lineShape.alignToDirection = false;
            //lineShape.randomDirectionAmount = 0f;
            //lineShape.sphericalDirectionAmount = 0f;
            //lineShape.randomPositionAmount = 0f;

            //var lineVol = linePs.velocityOverLifetime;
            //lineVol.enabled = false;
            //lineVol.speedModifier = new(1f, new AnimationCurve(new(0f, 1f, 0f, 0f), new(0.25f, 0f, 0f, 0f), new(0.5f, 0f, 0f, 0f), new(1f, -1f, 0f, 0f)));

            //linePsr.renderMode = ParticleSystemRenderMode.Stretch;
            //linePsr.cameraVelocityScale = 0f;
            //linePsr.velocityScale = 0.5f;
            //linePsr.lengthScale = 1f;
            //linePsr.normalDirection = 1f;
            //linePsr.material = AssetsCore.LoadAsset<Material>(MaterialIndex.refMatTracerBright);
            //#endregion

            //#region Distortion
            //var distortObj = new GameObject("Distortion");
            //distortObj.transform.parent = obj.transform;
            //distortObj.transform.localPosition = Vector3.zero;
            //distortObj.transform.localScale = Vector3.one;
            //distortObj.transform.localRotation = Quaternion.identity;

            //var distortPs = distortObj.AddComponent<ParticleSystem>();
            //var distortPsr = distortObj.AddOrGetComponent<ParticleSystemRenderer>();

            //var distortMain = distortPs.main;
            //distortMain.duration = 1.0f;
            //distortMain.loop = false;
            //distortMain.prewarm = false;
            //distortMain.startDelay = 0f;
            //distortMain.startLifetime = 0.1f;
            //distortMain.startSpeed = 0f;
            //distortMain.startSize = 10f;
            //distortMain.startRotation = 0f;
            //distortMain.flipRotation = 0f;
            //distortMain.startColor = Color.white;
            //distortMain.gravityModifier = 0f;
            //distortMain.simulationSpace = ParticleSystemSimulationSpace.World;
            //distortMain.simulationSpeed = 1f;
            //distortMain.scalingMode = ParticleSystemScalingMode.Hierarchy;
            //distortMain.playOnAwake = true;
            //distortMain.emitterVelocityMode = ParticleSystemEmitterVelocityMode.Rigidbody;
            //distortMain.maxParticles = 10;
            //distortMain.stopAction = ParticleSystemStopAction.None;
            //distortMain.cullingMode = ParticleSystemCullingMode.AlwaysSimulate;
            //distortMain.ringBufferMode = ParticleSystemRingBufferMode.Disabled;

            //var distortEmis = distortPs.emission;
            //distortEmis.enabled = true;
            //distortEmis.rateOverTime = 0f;
            //distortEmis.rateOverDistance = 0f;
            //distortEmis.burstCount = 1;
            //distortEmis.SetBurst(0, new ParticleSystem.Burst(0f, 1, 1, 0.01f));

            //var distortShape = distortPs.shape;
            //distortShape.enabled = false;

            //var distortSol = distortPs.sizeOverLifetime;
            //distortSol.enabled = true;
            //distortSol.size = new(1f, new AnimationCurve(new(0f, 0.5f, 1f, 1f), new(0.25f, 1f, 0f, 0f), new(0.5f, 1f, 0f, 0f), new(1f, 0f, 0f, 0f)));

            //distortPsr.renderMode = ParticleSystemRenderMode.Mesh;
            //distortPsr.mesh = AssetsCore.LoadAsset<Mesh>(MeshIndex.Sphere);
            //distortPsr.material = AssetsCore.LoadAsset<Material>(MaterialIndex.refMatDistortionFaded);
            //#endregion
            //var obj = Resources.Load<GameObject>("");



            return(obj);
        }