fix: fix warning
parent
f53a7faed3
commit
8a78ec13ad
|
@ -43,7 +43,7 @@ namespace Coffee.UIExtensions
|
||||||
{
|
{
|
||||||
if (visible)
|
if (visible)
|
||||||
{
|
{
|
||||||
WindowFunction(null, null);
|
WindowFunction();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,8 +75,9 @@ namespace Coffee.UIExtensions
|
||||||
private bool _showMax;
|
private bool _showMax;
|
||||||
|
|
||||||
private static readonly HashSet<Shader> s_Shaders = new HashSet<Shader>();
|
private static readonly HashSet<Shader> s_Shaders = new HashSet<Shader>();
|
||||||
|
#if UNITY_2018 || UNITY_2019
|
||||||
private static readonly List<ParticleSystemVertexStream> s_Streams = new List<ParticleSystemVertexStream>();
|
private static readonly List<ParticleSystemVertexStream> s_Streams = new List<ParticleSystemVertexStream>();
|
||||||
|
#endif
|
||||||
private static readonly List<string> s_MaskablePropertyNames = new List<string>
|
private static readonly List<string> s_MaskablePropertyNames = new List<string>
|
||||||
{
|
{
|
||||||
"_Stencil",
|
"_Stencil",
|
||||||
|
@ -128,6 +129,7 @@ namespace Coffee.UIExtensions
|
||||||
.Concat(Selection.gameObjects.Select(x => x.GetComponent<UIParticle>())
|
.Concat(Selection.gameObjects.Select(x => x.GetComponent<UIParticle>())
|
||||||
.Where(x => x && x.canvas))
|
.Where(x => x && x.canvas))
|
||||||
.Distinct()
|
.Distinct()
|
||||||
|
.OfType<Object>()
|
||||||
.ToArray();
|
.ToArray();
|
||||||
return 0 < uiParticles.Length ? new SerializedObject(uiParticles) : null;
|
return 0 < uiParticles.Length ? new SerializedObject(uiParticles) : null;
|
||||||
}
|
}
|
||||||
|
@ -332,6 +334,8 @@ namespace Coffee.UIExtensions
|
||||||
DestroyUIParticle(current);
|
DestroyUIParticle(current);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if UNITY_2018 || UNITY_2019
|
||||||
|
// (2018, 2019) Check to use 'TEXCOORD*.zw' components as custom vertex stream.
|
||||||
var allPsRenderers = targets.OfType<UIParticle>()
|
var allPsRenderers = targets.OfType<UIParticle>()
|
||||||
.SelectMany(x => x.particles)
|
.SelectMany(x => x.particles)
|
||||||
.Where(x => x)
|
.Where(x => x)
|
||||||
|
@ -357,6 +361,7 @@ namespace Coffee.UIExtensions
|
||||||
s_Streams.Clear();
|
s_Streams.Clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool IsBuiltInObject(Object obj)
|
private bool IsBuiltInObject(Object obj)
|
||||||
|
@ -365,6 +370,7 @@ namespace Coffee.UIExtensions
|
||||||
&& Regex.IsMatch(guid, "^0{16}.0{15}$", RegexOptions.Compiled);
|
&& Regex.IsMatch(guid, "^0{16}.0{15}$", RegexOptions.Compiled);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if UNITY_2018 || UNITY_2019
|
||||||
private static int GetUsedComponentCount(ParticleSystemVertexStream s)
|
private static int GetUsedComponentCount(ParticleSystemVertexStream s)
|
||||||
{
|
{
|
||||||
switch (s)
|
switch (s)
|
||||||
|
@ -423,6 +429,7 @@ namespace Coffee.UIExtensions
|
||||||
|
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
private static bool DrawMeshSharing(SerializedProperty spMeshSharing, SerializedProperty spGroupId,
|
private static bool DrawMeshSharing(SerializedProperty spMeshSharing, SerializedProperty spGroupId,
|
||||||
SerializedProperty spGroupMaxId, bool showMax)
|
SerializedProperty spGroupMaxId, bool showMax)
|
||||||
|
@ -482,12 +489,16 @@ namespace Coffee.UIExtensions
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void WindowFunction(Object target, SceneView sceneView)
|
#if UNITY_2021_2_OR_NEWER
|
||||||
|
private static void WindowFunction()
|
||||||
|
#else
|
||||||
|
private static void WindowFunction(Object _, SceneView __)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (s_SerializedObject == null || !s_SerializedObject.targetObject) return;
|
if (s_SerializedObject == null || !s_SerializedObject.targetObject) return;
|
||||||
var uiParticles = s_SerializedObject.targetObjects.OfType<UIParticle>();
|
var uiParticles = s_SerializedObject.targetObjects.OfType<UIParticle>().ToArray();
|
||||||
if (uiParticles.Any(x => !x || !x.canvas)) return;
|
if (uiParticles.Any(x => !x || !x.canvas)) return;
|
||||||
|
|
||||||
s_SerializedObject.Update();
|
s_SerializedObject.Update();
|
||||||
|
@ -523,7 +534,7 @@ namespace Coffee.UIExtensions
|
||||||
if (stage != null && stage.scene.isLoaded)
|
if (stage != null && stage.scene.isLoaded)
|
||||||
{
|
{
|
||||||
#if UNITY_2020_1_OR_NEWER
|
#if UNITY_2020_1_OR_NEWER
|
||||||
string prefabAssetPath = stage.assetPath;
|
var prefabAssetPath = stage.assetPath;
|
||||||
#else
|
#else
|
||||||
var prefabAssetPath = stage.prefabAssetPath;
|
var prefabAssetPath = stage.prefabAssetPath;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,4 +1,10 @@
|
||||||
using System;
|
#if UNITY_2022_3_0 || UNITY_2022_3_1 || UNITY_2022_3_2 || UNITY_2022_3_3 || UNITY_2022_3_4 || UNITY_2022_3_5 || UNITY_2022_3_6 || UNITY_2022_3_7 || UNITY_2022_3_8 || UNITY_2022_3_9 || UNITY_2022_3_10
|
||||||
|
#elif UNITY_2023_1_0 || UNITY_2023_1_1 || UNITY_2023_1_2 || UNITY_2023_1_3 || UNITY_2023_1_4 || UNITY_2023_1_5 || UNITY_2023_1_6 || UNITY_2023_1_7 || UNITY_2023_1_8 || UNITY_2023_1_9
|
||||||
|
#elif UNITY_2023_1_10 || UNITY_2023_1_11 || UNITY_2023_1_12 || UNITY_2023_1_13 || UNITY_2023_1_14 || UNITY_2023_1_15 || UNITY_2023_1_16
|
||||||
|
#elif UNITY_2022_3_OR_NEWER
|
||||||
|
#define PS_BAKE_API_V2
|
||||||
|
#endif
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Coffee.UIParticleExtensions;
|
using Coffee.UIParticleExtensions;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
|
@ -333,11 +339,19 @@ namespace Coffee.UIExtensions
|
||||||
Profiler.BeginSample("[UIParticleRenderer] Bake Mesh");
|
Profiler.BeginSample("[UIParticleRenderer] Bake Mesh");
|
||||||
if (_isTrail && _parent.canSimulate && 0 < s_CombineInstances[0].mesh.vertexCount)
|
if (_isTrail && _parent.canSimulate && 0 < s_CombineInstances[0].mesh.vertexCount)
|
||||||
{
|
{
|
||||||
|
#if PS_BAKE_API_V2
|
||||||
|
_renderer.BakeTrailsMesh(s_CombineInstances[0].mesh, bakeCamera, ParticleSystemBakeMeshOptions.BakeRotationAndScale);
|
||||||
|
#else
|
||||||
_renderer.BakeTrailsMesh(s_CombineInstances[0].mesh, bakeCamera, true);
|
_renderer.BakeTrailsMesh(s_CombineInstances[0].mesh, bakeCamera, true);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else if (_renderer.CanBakeMesh())
|
else if (_renderer.CanBakeMesh())
|
||||||
{
|
{
|
||||||
|
#if PS_BAKE_API_V2
|
||||||
|
_renderer.BakeMesh(s_CombineInstances[0].mesh, bakeCamera, ParticleSystemBakeMeshOptions.BakeRotationAndScale);
|
||||||
|
#else
|
||||||
_renderer.BakeMesh(s_CombineInstances[0].mesh, bakeCamera, true);
|
_renderer.BakeMesh(s_CombineInstances[0].mesh, bakeCamera, true);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue