You've already forked ParticleEffectForUGUI
mirror of
https://github.com/mob-sakai/ParticleEffectForUGUI.git
synced 2026-06-09 20:23:46 +00:00
@@ -78,10 +78,19 @@ namespace Coffee.UIExtensions
|
||||
var mat = mats[j];
|
||||
if (mat == null || mat.shader == null) continue;
|
||||
|
||||
#if UNITY_6000_5_OR_NEWER
|
||||
for (var i = 0; i < mat.shader.GetPropertyCount(); i++)
|
||||
#else
|
||||
for (var i = 0; i < ShaderUtil.GetPropertyCount(mat.shader); i++)
|
||||
#endif
|
||||
{
|
||||
#if UNITY_6000_5_OR_NEWER
|
||||
var name = mat.shader.GetPropertyName(i);
|
||||
var type = (AnimatableProperty.ShaderPropertyType)mat.shader.GetPropertyType(i);
|
||||
#else
|
||||
var name = ShaderUtil.GetPropertyName(mat.shader, i);
|
||||
var type = (AnimatableProperty.ShaderPropertyType)ShaderUtil.GetPropertyType(mat.shader, i);
|
||||
#endif
|
||||
if (!s_Names.Add(name)) continue;
|
||||
|
||||
AddMenu(gm, sp, new ShaderProperty(name, type), true);
|
||||
|
||||
@@ -20,7 +20,9 @@ namespace Coffee.UIParticleInternal
|
||||
{
|
||||
public static T[] FindObjectsOfType<T>() where T : Object
|
||||
{
|
||||
#if UNITY_2023_1_OR_NEWER
|
||||
#if UNITY_6000_5_OR_NEWER
|
||||
return Object.FindObjectsByType<T>(FindObjectsInactive.Include);
|
||||
#elif UNITY_2023_1_OR_NEWER
|
||||
return Object.FindObjectsByType<T>(FindObjectsInactive.Include, FindObjectsSortMode.None);
|
||||
#else
|
||||
return Object.FindObjectsOfType<T>();
|
||||
|
||||
@@ -130,7 +130,7 @@ namespace Coffee.UIParticleInternal
|
||||
newEntry.hash = hash;
|
||||
newEntry.reference = 1;
|
||||
_cache[hash] = newEntry;
|
||||
_objectKey[newObject.GetInstanceID()] = hash;
|
||||
_objectKey[newObject.GetHashCode()] = hash;
|
||||
Logging.Log(_name, $"<color=#03c700>Add</color>(total#{count}): {newEntry}");
|
||||
Release(ref obj);
|
||||
obj = newObject;
|
||||
@@ -146,7 +146,7 @@ namespace Coffee.UIParticleInternal
|
||||
|
||||
// Find and release the entry.
|
||||
Profiler.BeginSample("(COF)[ObjectRepository] Release");
|
||||
var id = obj.GetInstanceID();
|
||||
var id = obj.GetHashCode();
|
||||
if (_objectKey.TryGetValue(id, out var hash)
|
||||
&& _cache.TryGetValue(hash, out var entry))
|
||||
{
|
||||
@@ -175,7 +175,7 @@ namespace Coffee.UIParticleInternal
|
||||
|
||||
Profiler.BeginSample("(COF)[ObjectRepository] Remove");
|
||||
_cache.Remove(entry.hash);
|
||||
_objectKey.Remove(entry.storedObject.GetInstanceID());
|
||||
_objectKey.Remove(entry.storedObject.GetHashCode());
|
||||
_pool.Push(entry);
|
||||
entry.reference = 0;
|
||||
Logging.Log(_name, $"<color=#f29e03>Remove</color>(total#{_cache.Count}): {entry}");
|
||||
|
||||
@@ -206,9 +206,9 @@ namespace Coffee.UIExtensions
|
||||
}
|
||||
|
||||
var hash = new Hash128(
|
||||
modifiedMaterial ? (uint)modifiedMaterial.GetInstanceID() : 0,
|
||||
texture ? (uint)texture.GetInstanceID() : 0,
|
||||
0 < _parent.m_AnimatableProperties.Length ? (uint)GetInstanceID() : 0,
|
||||
modifiedMaterial ? (uint)modifiedMaterial.GetHashCode() : 0,
|
||||
texture ? (uint)texture.GetHashCode() : 0,
|
||||
0 < _parent.m_AnimatableProperties.Length ? (uint)GetHashCode() : 0,
|
||||
#if UNITY_EDITOR
|
||||
(uint)EditorJsonUtility.ToJson(modifiedMaterial).GetHashCode()
|
||||
#else
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace Coffee.UIParticleInternal
|
||||
|
||||
if (sortByMaterial)
|
||||
{
|
||||
return aMat.GetInstanceID() - bMat.GetInstanceID();
|
||||
return aMat.GetHashCode() - bMat.GetHashCode();
|
||||
}
|
||||
|
||||
if (aMat.renderQueue != bMat.renderQueue)
|
||||
@@ -131,7 +131,7 @@ namespace Coffee.UIParticleInternal
|
||||
{
|
||||
for (var i = 0; i < list.Count; i++)
|
||||
{
|
||||
if (list[i].GetInstanceID() == ps.GetInstanceID())
|
||||
if (list[i].GetHashCode() == ps.GetHashCode())
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user