style: format
parent
1ce4e31a96
commit
6a7f08c056
|
@ -17,6 +17,7 @@ using Object = UnityEngine.Object;
|
||||||
#endif
|
#endif
|
||||||
#if UNITY_2021_2_OR_NEWER
|
#if UNITY_2021_2_OR_NEWER
|
||||||
using UnityEditor.SceneManagement;
|
using UnityEditor.SceneManagement;
|
||||||
|
|
||||||
#elif UNITY_2018_3_OR_NEWER
|
#elif UNITY_2018_3_OR_NEWER
|
||||||
using UnityEditor.Experimental.SceneManagement;
|
using UnityEditor.Experimental.SceneManagement;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -148,7 +148,7 @@ namespace Coffee.UIExtensions
|
||||||
// Collect UIParticle if needed (same size as m_ParticleSystems)
|
// Collect UIParticle if needed (same size as m_ParticleSystems)
|
||||||
CollectUIParticlesIfNeeded();
|
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];
|
var particleSystem = m_ParticleSystems[particleIndex];
|
||||||
|
|
||||||
|
@ -163,21 +163,21 @@ namespace Coffee.UIExtensions
|
||||||
particleSystem.GetParticles(particles, count);
|
particleSystem.GetParticles(particles, count);
|
||||||
|
|
||||||
var uiParticle = _uiParticles[particleIndex];
|
var uiParticle = _uiParticles[particleIndex];
|
||||||
var dstPos = this.GetDestinationPosition(uiParticle, particleSystem);
|
var dstPos = GetDestinationPosition(uiParticle, particleSystem);
|
||||||
for (var i = 0; i < count; i++)
|
for (var i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
// Attracted
|
// Attracted
|
||||||
var p = particles[i];
|
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;
|
p.remainingLifetime = 0f;
|
||||||
particles[i] = p;
|
particles[i] = p;
|
||||||
|
|
||||||
if (this.m_OnAttracted != null)
|
if (m_OnAttracted != null)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
this.m_OnAttracted.Invoke();
|
m_OnAttracted.Invoke();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -189,7 +189,7 @@ namespace Coffee.UIExtensions
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calc attracting time
|
// Calc attracting time
|
||||||
var delayTime = p.startLifetime * this.m_DelayRate;
|
var delayTime = p.startLifetime * m_DelayRate;
|
||||||
var duration = p.startLifetime - delayTime;
|
var duration = p.startLifetime - delayTime;
|
||||||
var time = Mathf.Max(0, p.startLifetime - p.remainingLifetime - delayTime);
|
var time = Mathf.Max(0, p.startLifetime - p.remainingLifetime - delayTime);
|
||||||
|
|
||||||
|
@ -197,7 +197,7 @@ namespace Coffee.UIExtensions
|
||||||
if (time <= 0) continue;
|
if (time <= 0) continue;
|
||||||
|
|
||||||
// Attract
|
// Attract
|
||||||
p.position = this.GetAttractedPosition(p.position, dstPos, duration, time);
|
p.position = GetAttractedPosition(p.position, dstPos, duration, time);
|
||||||
p.velocity *= 0.5f;
|
p.velocity *= 0.5f;
|
||||||
particles[i] = p;
|
particles[i] = p;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,10 @@
|
||||||
Lighting Off
|
Lighting Off
|
||||||
ZWrite Off
|
ZWrite Off
|
||||||
ZTest [unity_GUIZTestMode]
|
ZTest [unity_GUIZTestMode]
|
||||||
Fog { Mode Off }
|
Fog
|
||||||
|
{
|
||||||
|
Mode Off
|
||||||
|
}
|
||||||
Blend One One
|
Blend One One
|
||||||
|
|
||||||
ColorMask [_ColorMask]
|
ColorMask [_ColorMask]
|
||||||
|
@ -61,21 +64,21 @@
|
||||||
|
|
||||||
struct appdata_t
|
struct appdata_t
|
||||||
{
|
{
|
||||||
float4 vertex : POSITION;
|
float4 vertex : POSITION;
|
||||||
float4 color : COLOR;
|
float4 color : COLOR;
|
||||||
float2 texcoord : TEXCOORD0;
|
float2 texcoord : TEXCOORD0;
|
||||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||||
};
|
};
|
||||||
|
|
||||||
struct v2f
|
struct v2f
|
||||||
{
|
{
|
||||||
float4 vertex : SV_POSITION;
|
float4 vertex : SV_POSITION;
|
||||||
fixed4 color : COLOR;
|
fixed4 color : COLOR;
|
||||||
float2 texcoord : TEXCOORD0;
|
float2 texcoord : TEXCOORD0;
|
||||||
float4 worldPosition : TEXCOORD1;
|
float4 worldPosition : TEXCOORD1;
|
||||||
UNITY_VERTEX_OUTPUT_STEREO
|
UNITY_VERTEX_OUTPUT_STEREO
|
||||||
};
|
};
|
||||||
|
|
||||||
fixed4 _Color;
|
fixed4 _Color;
|
||||||
sampler2D _MainTex;
|
sampler2D _MainTex;
|
||||||
float4 _MainTex_ST;
|
float4 _MainTex_ST;
|
||||||
|
@ -114,4 +117,4 @@
|
||||||
ENDCG
|
ENDCG
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue