diff --git a/CHANGELOG.md b/CHANGELOG.md
index 37f6bd2..880194d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,10 @@
+# [3.0.0-preview.6](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v3.0.0-preview.5...v3.0.0-preview.6) (2020-02-21)
+
+
+### Bug Fixes
+
+* sample version ([ed18032](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/ed18032be43397debbd538cae258c226ebeeb2e9))
+
# [3.0.0-preview.5](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v3.0.0-preview.4...v3.0.0-preview.5) (2020-02-21)
diff --git a/README.md b/README.md
index 16b643f..6189706 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
ParticleEffectForUGUI
===
-This plugin provide a component to render particle effect for uGUI in Unity 2018.2+.
+This plugin provide a component to render particle effect for uGUI in Unity 2018.2 or later.
The particle rendering is maskable and sortable, without Camera, RenderTexture or Canvas.
[](https://openupm.com/packages/com.coffee.ui-particle/)
@@ -34,7 +34,7 @@ Compares this "Baking mesh" approach with the conventional approach:
|Approach|Good|Bad|Screenshot|
|-|-|-|-|
-|Baking mesh
**\(UIParticle\)**|Rendered as is.
Maskable.
Sortable.
Less objects.|**Requires Unity 2018.2+.**
Requires UI shaders to use Mask.|
|
+|Baking mesh
**\(UIParticle\)**|Rendered as is.
Maskable.
Sortable.
Less objects.|**Requires Unity 2018.2 or later.**
Requires UI shaders to use Mask.|
|
|Do nothing|Rendered as is.|**Looks like a glitch.**
Not maskable.
Not sortable.|
|
|Convert particle to UIVertex
[\(UIParticleSystem\)](https://forum.unity.com/threads/free-script-particle-systems-in-ui-screen-space-overlay.406862/)|Maskable.
Sortable.
Less objects.|**Adjustment is difficult.**
Requires UI shaders.
Difficult to adjust scale.
Force hierarchy scalling.
Simulation results are incorrect.
Trail, rotation of transform, time scaling are not supported.
Generate heavy GC every frame.|
|
|Use Canvas to sort|Rendered as is.
Sortable.|**You must to manage sorting orders.**
Not maskable.
More batches.|
|
@@ -99,7 +99,7 @@ Find the manifest.json file in the Packages folder of your project and edit it t
To update the package, change suffix `#{version}` to the target version.
-* e.g. `"com.coffee.open-sesame-compiler": "https://github.com/mob-sakai/OpenSesameCompilerForUnity.git#1.0.0",`
+* e.g. `"com.coffee.ui-particle": "https://github.com/mob-sakai/ParticleEffectForUGUI.git#3.0.0",`
Or, use [UpmGitExtension](https://github.com/mob-sakai/UpmGitExtension) to install and update the package.
diff --git a/Scripts/Editor/UIParticleMenu.cs b/Scripts/Editor/UIParticleMenu.cs
index 8b12fbb..286614c 100644
--- a/Scripts/Editor/UIParticleMenu.cs
+++ b/Scripts/Editor/UIParticleMenu.cs
@@ -1,5 +1,7 @@
#if IGNORE_ACCESS_CHECKS // [ASMDEFEX] DO NOT REMOVE THIS LINE MANUALLY.
#if !UNITY_2019_1_OR_NEWER
+using System.IO;
+using System.Text.RegularExpressions;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
@@ -12,13 +14,27 @@ namespace Coffee.UIExtensions
[MenuItem("Assets/Samples/Import UIParticle Sample")]
static void ImportSample()
{
- const string src = "Packages/com.coffee.ui-particle/Samples~/Demo";
- const string dst = "Assets/Samples/UI Particle/3.0.0/Demo";
+ const string sampleGuid = "dc0fe9e7fe61947fab1522ab29e2fc88";
+ const string jsonGuid = "823dc693d087a4b559c7e1547274cc7d";
+ const string SAMPLE_NAME = "Demo";
- if (FileUtil.PathExists(dst))
- FileUtil.DeleteFileOrDirectory(dst);
+ string jsonPath = AssetDatabase.GUIDToAssetPath(jsonGuid);
+ string json = File.ReadAllText(jsonPath);
+ string version = Regex.Match(json, "\"version\"\\s*:\\s*\"([^\"]+)\"").Groups[1].Value;
+ string displayName = Regex.Match(json, "\"displayName\"\\s*:\\s*\"([^\"]+)\"").Groups[1].Value;
+ string src = Path.GetDirectoryName(jsonPath) + "/Samples~/" + SAMPLE_NAME;
+ string dst = string.Format("Assets/Samples/{0}/{1}/{2}",displayName, version, SAMPLE_NAME);
+
+ // Remove old samples
+ string samplePath = AssetDatabase.GUIDToAssetPath(sampleGuid);
+ if (samplePath.StartsWith("Assets/") && FileUtil.PathExists(samplePath))
+ {
+ FileUtil.DeleteFileOrDirectory(samplePath);
+ FileUtil.DeleteFileOrDirectory(samplePath + ".meta");
+ }
FileUtil.CopyDirectoryRecursive(src, dst);
+ FileUtil.CopyFileOrDirectory(src + ".meta", dst + ".meta");
AssetDatabase.ImportAsset(dst, ImportAssetOptions.ImportRecursive);
}
}
diff --git a/package.json b/package.json
index a12bc82..ed8e0d2 100644
--- a/package.json
+++ b/package.json
@@ -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.0.0-preview.5",
+ "version": "3.0.0-preview.6",
"unity": "2018.2",
"license": "MIT",
"repository": {