You've already forked ParticleEffectForUGUI
mirror of
https://github.com/mob-sakai/ParticleEffectForUGUI.git
synced 2026-05-16 05:00:07 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
32b93d3eeb | ||
|
|
86de8b6e03 | ||
|
|
b80c3e6c9f | ||
|
|
6a1fef4150 | ||
|
|
3184ba94ae | ||
|
|
6126af9f37 |
15
CHANGELOG.md
15
CHANGELOG.md
@@ -1,3 +1,18 @@
|
|||||||
|
## [4.5.2](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/4.5.1...4.5.2) (2024-01-18)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* (editor) sometimes crashes when entering play mode ([b80c3e6](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/b80c3e6c9fdd2a8fb72ff233edb85df2e3dbba3d))
|
||||||
|
|
||||||
|
## [4.5.1](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/4.5.0...4.5.1) (2023-12-23)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* fix material for mesh sharing group ([6126af9](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/6126af9f376dd4c100a1b9d19d9499bdef7d5566))
|
||||||
|
* the changes made to the material used by the ParticleSystem are not immediately reflected ([3184ba9](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/3184ba94ae08264223c0c71443ad70acc1a1ccb2)), closes [#280](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/280)
|
||||||
|
|
||||||
# [4.5.0](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/4.4.0...4.5.0) (2023-12-23)
|
# [4.5.0](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/4.4.0...4.5.0) (2023-12-23)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,13 +7,13 @@ namespace Coffee.UIParticleExtensions
|
|||||||
{
|
{
|
||||||
private static readonly List<MatEntry> s_Entries = new List<MatEntry>();
|
private static readonly List<MatEntry> s_Entries = new List<MatEntry>();
|
||||||
|
|
||||||
public static Material Add(Material baseMat, Texture texture, int id)
|
public static Material Add(Material baseMat, Texture texture, int id, int props)
|
||||||
{
|
{
|
||||||
MatEntry e;
|
MatEntry e;
|
||||||
for (var i = 0; i < s_Entries.Count; i++)
|
for (var i = 0; i < s_Entries.Count; i++)
|
||||||
{
|
{
|
||||||
e = s_Entries[i];
|
e = s_Entries[i];
|
||||||
if (e.baseMat != baseMat || e.texture != texture || e.id != id) continue;
|
if (e.baseMat != baseMat || e.texture != texture || e.id != id || e.props != props) continue;
|
||||||
++e.count;
|
++e.count;
|
||||||
return e.customMat;
|
return e.customMat;
|
||||||
}
|
}
|
||||||
@@ -24,6 +24,7 @@ namespace Coffee.UIParticleExtensions
|
|||||||
baseMat = baseMat,
|
baseMat = baseMat,
|
||||||
texture = texture,
|
texture = texture,
|
||||||
id = id,
|
id = id,
|
||||||
|
props = props,
|
||||||
customMat = new Material(baseMat)
|
customMat = new Material(baseMat)
|
||||||
{
|
{
|
||||||
name = $"{baseMat.name}_{id}",
|
name = $"{baseMat.name}_{id}",
|
||||||
@@ -64,6 +65,7 @@ namespace Coffee.UIParticleExtensions
|
|||||||
public int count;
|
public int count;
|
||||||
public Material customMat;
|
public Material customMat;
|
||||||
public int id;
|
public int id;
|
||||||
|
public int props;
|
||||||
public Texture texture;
|
public Texture texture;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -378,7 +378,7 @@ namespace Coffee.UIExtensions
|
|||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
EditorApplication.delayCall += () =>
|
EditorApplication.delayCall += () =>
|
||||||
{
|
{
|
||||||
if (!this || !gameObject || !transform) return;
|
if (!this || !gameObject || !transform || Application.isPlaying) return;
|
||||||
transform.localScale = Vector3.one;
|
transform.localScale = Vector3.one;
|
||||||
m_ResetScaleOnEnable = false;
|
m_ResetScaleOnEnable = false;
|
||||||
EditorUtility.SetDirty(this);
|
EditorUtility.SetDirty(this);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Coffee.UIParticleExtensions;
|
using Coffee.UIParticleExtensions;
|
||||||
|
using UnityEditor;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.Profiling;
|
using UnityEngine.Profiling;
|
||||||
using UnityEngine.Rendering;
|
using UnityEngine.Rendering;
|
||||||
@@ -200,7 +201,12 @@ namespace Coffee.UIExtensions
|
|||||||
|
|
||||||
//
|
//
|
||||||
var id = _parent.m_AnimatableProperties.Length == 0 ? 0 : GetInstanceID();
|
var id = _parent.m_AnimatableProperties.Length == 0 ? 0 : GetInstanceID();
|
||||||
modifiedMaterial = ModifiedMaterial.Add(modifiedMaterial, texture, id);
|
#if UNITY_EDITOR
|
||||||
|
var props = EditorJsonUtility.ToJson(modifiedMaterial).GetHashCode();
|
||||||
|
#else
|
||||||
|
var props = 0;
|
||||||
|
#endif
|
||||||
|
modifiedMaterial = ModifiedMaterial.Add(modifiedMaterial, texture, id, props);
|
||||||
ModifiedMaterial.Remove(_modifiedMaterial);
|
ModifiedMaterial.Remove(_modifiedMaterial);
|
||||||
_modifiedMaterial = modifiedMaterial;
|
_modifiedMaterial = modifiedMaterial;
|
||||||
|
|
||||||
@@ -443,8 +449,19 @@ namespace Coffee.UIExtensions
|
|||||||
|
|
||||||
// Update animatable material properties.
|
// Update animatable material properties.
|
||||||
Profiler.BeginSample("[UIParticleRenderer] Update Animatable Material Properties");
|
Profiler.BeginSample("[UIParticleRenderer] Update Animatable Material Properties");
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
if (_modifiedMaterial != material)
|
||||||
|
{
|
||||||
|
_renderer.GetSharedMaterials(s_Materials);
|
||||||
|
material = s_Materials[_isTrail ? 1 : 0];
|
||||||
|
s_Materials.Clear();
|
||||||
|
SetMaterialDirty();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
UpdateMaterialProperties();
|
UpdateMaterialProperties();
|
||||||
if (!_parent.useMeshSharing)
|
if (_parent.useMeshSharing)
|
||||||
{
|
{
|
||||||
if (!_currentMaterialForRendering)
|
if (!_currentMaterialForRendering)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "com.coffee.ui-particle",
|
"name": "com.coffee.ui-particle",
|
||||||
"displayName": "UI Particle",
|
"displayName": "UI Particle",
|
||||||
"description": "This plugin provide a component to render particle effect for uGUI.\nThe particle rendering is maskable and sortable, without Camera, RenderTexture or Canvas.",
|
"description": "This plugin provide a component to render particle effect for uGUI.\nThe particle rendering is maskable and sortable, without Camera, RenderTexture or Canvas.",
|
||||||
"version": "4.5.0",
|
"version": "4.5.2",
|
||||||
"unity": "2018.2",
|
"unity": "2018.2",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
Reference in New Issue
Block a user