diff --git a/Assets/DissolveEffectForUGUI/Demo/Dissolve.controller b/Assets/DissolveEffectForUGUI/Demo/Dissolve.controller
index ee740f7..9b9fa6d 100644
--- a/Assets/DissolveEffectForUGUI/Demo/Dissolve.controller
+++ b/Assets/DissolveEffectForUGUI/Demo/Dissolve.controller
@@ -34,7 +34,7 @@ AnimationClip:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
- attribute: m_Location
+ attribute: m_DissolveFactor
path: A
classID: 114
script: {fileID: 11500000, guid: 7f9a4349581d64dcabe67c494ee1d531, type: 3}
@@ -56,7 +56,7 @@ AnimationClip:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
- attribute: m_Location
+ attribute: m_DissolveFactor
path: B
classID: 114
script: {fileID: 11500000, guid: 7f9a4349581d64dcabe67c494ee1d531, type: 3}
@@ -78,7 +78,7 @@ AnimationClip:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
- attribute: m_Location
+ attribute: m_DissolveFactor
path: C
classID: 114
script: {fileID: 11500000, guid: 7f9a4349581d64dcabe67c494ee1d531, type: 3}
@@ -100,7 +100,7 @@ AnimationClip:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
- attribute: m_Location
+ attribute: m_DissolveFactor
path: D
classID: 114
script: {fileID: 11500000, guid: 7f9a4349581d64dcabe67c494ee1d531, type: 3}
@@ -176,7 +176,7 @@ AnimationClip:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
- attribute: m_Location
+ attribute: m_DissolveFactor
path: A
classID: 114
script: {fileID: 11500000, guid: 7f9a4349581d64dcabe67c494ee1d531, type: 3}
@@ -198,7 +198,7 @@ AnimationClip:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
- attribute: m_Location
+ attribute: m_DissolveFactor
path: B
classID: 114
script: {fileID: 11500000, guid: 7f9a4349581d64dcabe67c494ee1d531, type: 3}
@@ -220,7 +220,7 @@ AnimationClip:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
- attribute: m_Location
+ attribute: m_DissolveFactor
path: C
classID: 114
script: {fileID: 11500000, guid: 7f9a4349581d64dcabe67c494ee1d531, type: 3}
@@ -242,7 +242,7 @@ AnimationClip:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
- attribute: m_Location
+ attribute: m_DissolveFactor
path: D
classID: 114
script: {fileID: 11500000, guid: 7f9a4349581d64dcabe67c494ee1d531, type: 3}
diff --git a/Assets/DissolveEffectForUGUI/UIDissolve.cs b/Assets/DissolveEffectForUGUI/UIDissolve.cs
index 2bc1199..ef47a8b 100644
--- a/Assets/DissolveEffectForUGUI/UIDissolve.cs
+++ b/Assets/DissolveEffectForUGUI/UIDissolve.cs
@@ -30,7 +30,7 @@ public class UIDissolve : BaseMeshEffect
//################################
// Serialize Members.
//################################
- [SerializeField] [Range(0, 1)] float m_Location = 0;
+ [SerializeField] [Range(0, 1)] float m_DissolveFactor = 0;
[SerializeField] Material m_EffectMaterial;
@@ -45,7 +45,7 @@ public class UIDissolve : BaseMeshEffect
///
/// Location for effect.
///
- public float location { get { return m_Location; } set { m_Location = Mathf.Clamp(value, 0, 1); _SetDirty(); } }
+ public float dissolveFactor { get { return m_DissolveFactor; } set { m_DissolveFactor = Mathf.Clamp(value, 0, 1); _SetDirty(); } }
///
/// Effect material.
@@ -114,9 +114,14 @@ public static Material GetMaterial(string shaderName)
///
public override void ModifyMesh(VertexHelper vh)
{
+ if (!IsActive() || dissolveFactor <= 0)
+ return;
- if (!IsActive())
+ // Skip process.
+ if (1 <= dissolveFactor) {
+ vh.Clear ();
return;
+ }
// rect.
Rect rect = graphic.rectTransform.rect;
@@ -129,7 +134,7 @@ public override void ModifyMesh(VertexHelper vh)
var x = Mathf.Clamp01 (vertex.position.x / rect.width + 0.5f);
var y = Mathf.Clamp01 (vertex.position.y / rect.height + 0.5f);
- vertex.uv1 = new Vector2 (_PackToFloat (x, y, location), 0);
+ vertex.uv1 = new Vector2 (_PackToFloat (x, y, dissolveFactor), 0);
vh.SetUIVertex(vertex, i);
}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ffc75f1..e30ceda 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,15 @@
# Changelog
-## [v0.2.0](https://github.com/mob-sakai/DissolveEffectForUGUI/tree/v0.2.0) (2018-04-24)
+## [v0.3.0](https://github.com/mob-sakai/DissolveEffectForUGUI/tree/v0.3.0) (2018-04-24)
+
+[Full Changelog](https://github.com/mob-sakai/DissolveEffectForUGUI/compare/v0.2.0...v0.3.0)
+
+**Implemented enhancements:**
+
+- Feature: Skip process when dissolve factor equal 1 [\#5](https://github.com/mob-sakai/DissolveEffectForUGUI/issues/5)
+- Feature: Skip process when dissolve factor equal 0 [\#4](https://github.com/mob-sakai/DissolveEffectForUGUI/issues/4)
+
+## [v0.2.0](https://github.com/mob-sakai/DissolveEffectForUGUI/tree/v0.2.0) (2018-04-23)
[Full Changelog](https://github.com/mob-sakai/DissolveEffectForUGUI/compare/v0.1.0...v0.2.0)
diff --git a/README.md b/README.md
index a34a463..2226f3c 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,8 @@ DissolveEffectForUGUI
### NOTE: This project *will* be merged to [UIEffect](https://github.com/mob-sakai/UIEffect).
A dissolve effect for uGUI, without material instancing.
-
+
+
[](https://github.com/mob-sakai/DissolveEffectForUGUI/release)
[](https://github.com/mob-sakai/DissolveEffectForUGUI/releases)
@@ -22,13 +23,17 @@ A dissolve effect for uGUI, without material instancing.
## Description
+
+
DissolveEffectForUGUI applies _dissolve-effect_ to uGUI element (Image, RawImage, Text, etc...) **WITHOUT material instancing**.
This will suppress extra draw calls and improve performance.
-* Noise pattern image
-* Edge width
-* Outer/inner edge color
-* Outer/inner edge softness
+* Parameters
+ * Dissolve factor
+ * Noise pattern image (in material)
+ * Edge width (in material)
+ * Outer/inner edge color (in material)
+ * Outer/inner edge softness (in material)

@@ -38,7 +43,7 @@ This will suppress extra draw calls and improve performance.
## Demo
* 
- * Only 1 draw call!
+ * Just 1 draw call!
diff --git a/package.json b/package.json
index b884c4f..adafef1 100644
--- a/package.json
+++ b/package.json
@@ -1,10 +1,11 @@
{
"name": "DissolveEffectForUGUI",
- "version": "0.1.0",
+ "version": "0.3.0",
"repository": {
"type": "git",
"url": "git+https://github.com/mob-sakai/DissolveEffectForUGUI.git"
},
"src": "Assets/DissolveEffectForUGUI",
+ "unity": "/Applications/Unity5.5.0p4/Unity5.5.0p4.app/Contents/MacOS/Unity",
"license": "MIT"
}
diff --git a/release.sh b/release.sh
index 99a1507..c72b21e 100755
--- a/release.sh
+++ b/release.sh
@@ -1,5 +1,8 @@
#!/bin/bash -e
+# NOTE: Set an environment variable `CHANGELOG_GITHUB_TOKEN` by running the following command at the prompt, or by adding it to your shell profile (e.g., ~/.bash_profile or ~/.zshrc):
+# export CHANGELOG_GITHUB_TOKEN="«your-40-digit-github-token»"
+
# Release the project with the following steps:
# 1. Update the release version in package.json.
# 2. Update "CHANGELOG.md" using "github_changelog_generator-1.15.0.pre.rc".
@@ -7,17 +10,16 @@
# 4. Merge into master branch.
# 5. Export unitypackage.
# 6. Release using "gh-release-3.2.0". (Upload unitypackage)
-UNITY_PATH=/Applications/Unity5.5.0p4/Unity5.5.0p4.app/Contents/MacOS/Unity
-# input version
+# input release version
PACKAGE_NAME=`node -pe 'require("./package.json").name'`
echo Github Release: $PACKAGE_NAME
read -p "[? release version (for example: 1.0.0): " RELEASE_VERSION
[ -z "$RELEASE_VERSION" ] && exit
-# update version
+# update version in package.json
git checkout -B release develop
sed -i -e "s/\"version\": \(.*\)/\"version\": \"${RELEASE_VERSION}\",/g" package.json
@@ -36,6 +38,12 @@ read -p "[? continue? (y/N):" yn
case "$yn" in [yY]*) ;; *) exit ;; esac
+# export unitypackage
+UNITY_EDITOR=`node -pe 'require("./package.json").unity'`
+PACKAGE_SRC=`node -pe 'require("./package.json").src'`
+"$UNITY_EDITOR" -quit -batchmode -projectPath "`pwd`" -exportpackage "$PACKAGE_SRC" "$PACKAGE_NAME.unitypackage"
+
+
# commit files
git add CHANGELOG.md -f
git add package.json -f
@@ -49,10 +57,8 @@ git branch -D release
git push origin master
-# export .unitypackage and release on Github
-PACKAGE_SRC=`node -pe 'require("./package.json").src'`
-$UNITY_PATH -quit -batchmode -projectPath "`pwd`" -exportpackage $PACKAGE_SRC $PACKAGE_NAME.unitypackage
-gh-release --draft --assets $PACKAGE_NAME.unitypackage
+# upload unitypackage and release on Github
+gh-release --draft --assets "$PACKAGE_NAME.unitypackage"
echo "\n\n$PACKAGE_NAME v$RELEASE_VERSION has been successfully released!\n"