Compare commits

...

7 Commits
3.3.7 ... 3.3.9

Author SHA1 Message Date
semantic-release-bot
2e4d80bc1c chore(release): 3.3.9 [skip ci]
## [3.3.9](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/3.3.8...3.3.9) (2021-08-02)

### Bug Fixes

* fix for warning CS0618 ([61760d9](61760d940c))
2021-08-02 17:49:09 +00:00
shadeAlex
6b87db7ac7 style: tab to space 2021-08-03 02:48:12 +09:00
shadeAlex
61760d940c fix: fix for warning CS0618 2021-08-03 02:48:12 +09:00
semantic-release-bot
f43d4c38ea chore(release): 3.3.8 [skip ci]
## [3.3.8](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/3.3.7...3.3.8) (2021-06-08)

### Bug Fixes

* improve performance ([e352d15](e352d153ce))
2021-06-08 17:28:36 +00:00
mob-sakai
ccb8386672 refactor: fix warning 2021-06-09 02:25:41 +09:00
mob-sakai
e15319a46e change: remove color space modifier 2021-06-09 02:25:41 +09:00
mob-sakai
e352d153ce fix: improve performance 2021-06-09 02:25:41 +09:00
5 changed files with 52 additions and 24 deletions

View File

@@ -1,3 +1,17 @@
## [3.3.9](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/3.3.8...3.3.9) (2021-08-02)
### Bug Fixes
* fix for warning CS0618 ([61760d9](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/61760d940cdd4baacaa196ac1631a0a1a40b7204))
## [3.3.8](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/3.3.7...3.3.8) (2021-06-08)
### Bug Fixes
* improve performance ([e352d15](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/e352d153cef8c1efb2792e35010d7eed1e31a040))
## [3.3.7](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/3.3.6...3.3.7) (2021-06-02)

View File

@@ -22,8 +22,6 @@ namespace Coffee.UIExtensions
private static readonly GUIContent s_ContentTrailMaterial = new GUIContent("Trail Material");
private static readonly GUIContent s_Content3D = new GUIContent("3D");
private static readonly GUIContent s_ContentScale = new GUIContent("Scale");
private static readonly List<UIParticle> s_TempParents = new List<UIParticle>();
private static readonly List<UIParticle> s_TempChildren = new List<UIParticle>();
private SerializedProperty _spMaskable;
private SerializedProperty _spScale;
@@ -218,7 +216,12 @@ namespace Coffee.UIExtensions
var stage = UnityEditor.Experimental.SceneManagement.PrefabStageUtility.GetCurrentPrefabStage();
if (stage != null && stage.scene.isLoaded)
{
PrefabUtility.SaveAsPrefabAsset(stage.prefabContentsRoot, stage.prefabAssetPath);
#if UNITY_2020_1_OR_NEWER
string prefabAssetPath = stage.assetPath;
#else
string prefabAssetPath = stage.prefabAssetPath;
#endif
PrefabUtility.SaveAsPrefabAsset(stage.prefabContentsRoot, prefabAssetPath);
}
#endif
}

View File

@@ -74,12 +74,12 @@ namespace Coffee.UIExtensions
BakeMesh(particle);
Profiler.EndSample();
if (QualitySettings.activeColorSpace == ColorSpace.Linear)
{
Profiler.BeginSample("[UIParticle] Modify color space to linear");
particle.bakedMesh.ModifyColorSpaceToLinear();
Profiler.EndSample();
}
// if (QualitySettings.activeColorSpace == ColorSpace.Linear)
// {
// Profiler.BeginSample("[UIParticle] Modify color space to linear");
// particle.bakedMesh.ModifyColorSpaceToLinear();
// Profiler.EndSample();
// }
Profiler.BeginSample("[UIParticle] Set mesh to CanvasRenderer");
particle.canvasRenderer.SetMesh(particle.bakedMesh);

View File

@@ -79,18 +79,18 @@ namespace Coffee.UIParticleExtensions
internal static class MeshExtensions
{
static readonly List<Color32> s_Colors = new List<Color32>();
// static readonly List<Color32> s_Colors = new List<Color32>();
public static void ModifyColorSpaceToLinear(this Mesh self)
{
self.GetColors(s_Colors);
for (var i = 0; i < s_Colors.Count; i++)
s_Colors[i] = ((Color) s_Colors[i]).gamma;
self.SetColors(s_Colors);
s_Colors.Clear();
}
// public static void ModifyColorSpaceToLinear(this Mesh self)
// {
// self.GetColors(s_Colors);
//
// for (var i = 0; i < s_Colors.Count; i++)
// s_Colors[i] = ((Color) s_Colors[i]).gamma;
//
// self.SetColors(s_Colors);
// s_Colors.Clear();
// }
public static void Clear(this CombineInstance[] self)
{
@@ -104,7 +104,8 @@ namespace Coffee.UIParticleExtensions
internal static class MeshPool
{
private static readonly Stack<Mesh> s_Pool = new Stack<Mesh>();
private static readonly Stack<Mesh> s_Pool = new Stack<Mesh>(32);
private static readonly HashSet<int> s_HashPool = new HashSet<int>();
public static void Init()
{
@@ -117,6 +118,7 @@ namespace Coffee.UIParticleExtensions
var m = new Mesh();
m.MarkDynamic();
s_Pool.Push(m);
s_HashPool.Add(m.GetInstanceID());
}
}
@@ -126,7 +128,11 @@ namespace Coffee.UIParticleExtensions
while (0 < s_Pool.Count)
{
m = s_Pool.Pop();
if (m) return m;
if (m)
{
s_HashPool.Remove(m.GetInstanceID());
return m;
}
}
m = new Mesh();
@@ -136,9 +142,14 @@ namespace Coffee.UIParticleExtensions
public static void Return(Mesh mesh)
{
if (!mesh || s_Pool.Contains(mesh)) return;
if (!mesh) return;
var id = mesh.GetInstanceID();
if (s_HashPool.Contains(id)) return;
mesh.Clear(false);
s_Pool.Push(mesh);
s_HashPool.Add(id);
}
}

View File

@@ -2,7 +2,7 @@
"name": "com.coffee.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.",
"version": "3.3.7",
"version": "3.3.9",
"unity": "2018.2",
"license": "MIT",
"repository": {