From 6a7f08c05667f9f7e986037e474b864e55d84610 Mon Sep 17 00:00:00 2001 From: mob-sakai <12690315+mob-sakai@users.noreply.github.com> Date: Mon, 30 Sep 2024 01:12:08 +0900 Subject: [PATCH] style: format --- Packages/src/Editor/UIParticleEditor.cs | 1 + Packages/src/Runtime/UIParticleAttractor.cs | 14 +++++++------- Packages/src/Shaders/UIAdditive.shader | 21 ++++++++++++--------- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/Packages/src/Editor/UIParticleEditor.cs b/Packages/src/Editor/UIParticleEditor.cs index 1984b8c..16085db 100644 --- a/Packages/src/Editor/UIParticleEditor.cs +++ b/Packages/src/Editor/UIParticleEditor.cs @@ -17,6 +17,7 @@ using Object = UnityEngine.Object; #endif #if UNITY_2021_2_OR_NEWER using UnityEditor.SceneManagement; + #elif UNITY_2018_3_OR_NEWER using UnityEditor.Experimental.SceneManagement; #endif diff --git a/Packages/src/Runtime/UIParticleAttractor.cs b/Packages/src/Runtime/UIParticleAttractor.cs index 0593a12..0f5a73f 100644 --- a/Packages/src/Runtime/UIParticleAttractor.cs +++ b/Packages/src/Runtime/UIParticleAttractor.cs @@ -148,7 +148,7 @@ namespace Coffee.UIExtensions // Collect UIParticle if needed (same size as m_ParticleSystems) CollectUIParticlesIfNeeded(); - for (var particleIndex = 0; particleIndex < this.m_ParticleSystems.Count; particleIndex++) + for (var particleIndex = 0; particleIndex < m_ParticleSystems.Count; particleIndex++) { var particleSystem = m_ParticleSystems[particleIndex]; @@ -163,21 +163,21 @@ namespace Coffee.UIExtensions particleSystem.GetParticles(particles, count); var uiParticle = _uiParticles[particleIndex]; - var dstPos = this.GetDestinationPosition(uiParticle, particleSystem); + var dstPos = GetDestinationPosition(uiParticle, particleSystem); for (var i = 0; i < count; i++) { // Attracted var p = particles[i]; - if (0f < p.remainingLifetime && Vector3.Distance(p.position, dstPos) < this.m_DestinationRadius) + if (0f < p.remainingLifetime && Vector3.Distance(p.position, dstPos) < m_DestinationRadius) { p.remainingLifetime = 0f; particles[i] = p; - if (this.m_OnAttracted != null) + if (m_OnAttracted != null) { try { - this.m_OnAttracted.Invoke(); + m_OnAttracted.Invoke(); } catch (Exception e) { @@ -189,7 +189,7 @@ namespace Coffee.UIExtensions } // Calc attracting time - var delayTime = p.startLifetime * this.m_DelayRate; + var delayTime = p.startLifetime * m_DelayRate; var duration = p.startLifetime - delayTime; var time = Mathf.Max(0, p.startLifetime - p.remainingLifetime - delayTime); @@ -197,7 +197,7 @@ namespace Coffee.UIExtensions if (time <= 0) continue; // Attract - p.position = this.GetAttractedPosition(p.position, dstPos, duration, time); + p.position = GetAttractedPosition(p.position, dstPos, duration, time); p.velocity *= 0.5f; particles[i] = p; } diff --git a/Packages/src/Shaders/UIAdditive.shader b/Packages/src/Shaders/UIAdditive.shader index 59b6207..9910dcf 100644 --- a/Packages/src/Shaders/UIAdditive.shader +++ b/Packages/src/Shaders/UIAdditive.shader @@ -40,7 +40,10 @@ Lighting Off ZWrite Off ZTest [unity_GUIZTestMode] - Fog { Mode Off } + Fog + { + Mode Off + } Blend One One ColorMask [_ColorMask] @@ -61,21 +64,21 @@ struct appdata_t { - float4 vertex : POSITION; - float4 color : COLOR; + float4 vertex : POSITION; + float4 color : COLOR; float2 texcoord : TEXCOORD0; UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { - float4 vertex : SV_POSITION; - fixed4 color : COLOR; - float2 texcoord : TEXCOORD0; - float4 worldPosition : TEXCOORD1; + float4 vertex : SV_POSITION; + fixed4 color : COLOR; + float2 texcoord : TEXCOORD0; + float4 worldPosition : TEXCOORD1; UNITY_VERTEX_OUTPUT_STEREO }; - + fixed4 _Color; sampler2D _MainTex; float4 _MainTex_ST; @@ -114,4 +117,4 @@ ENDCG } } -} +} \ No newline at end of file