Compare commits

..

3 Commits

Author SHA1 Message Date
Takashi Sakai 046ec7aadc Update README for performance test 2017-03-01 15:46:37 +09:00
Takashi Sakai c9e2328e43 ver 1.0.0 2017-02-28 14:48:22 +09:00
酒井 峰志 a9c4ec4e72 Initial commit 2017-02-27 22:49:29 +09:00
145 changed files with 18966 additions and 81222 deletions
-12
View File
@@ -1,12 +0,0 @@
# These are supported funding model platforms
github: mob-sakai # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: mob_sakai # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
-35
View File
@@ -1,35 +0,0 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: mob-sakai
---
NOTE: Your issue may already be reported! Please search on the [issue tracker](../) before creating one.
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Environment (please complete the following information):**
- Version [e.g. 4.0.0]
- Platform: [e.g. Editor(Windows/Mac), Standalone(Windows/Mac), iOS, Android, WebGL]
- Unity version: [e.g. 2018.2.8f1]
- Build options: [e.g. IL2CPP, .Net 4.x, LWRP]
**Additional context**
Add any other context about the problem here.
-22
View File
@@ -1,22 +0,0 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: mob-sakai
---
NOTE: Your issue may already be reported! Please search on the [issue tracker](../) before creating one.
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
-25
View File
@@ -1,25 +0,0 @@
---
name: Question
about: Ask a question about this project
title: ''
labels: question
assignees: mob-sakai
---
NOTE: Your issue may already be reported! Please search on the [issue tracker](../) before creating one.
**Describe what help do you need**
A description of the question.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Environment (please complete the following information):**
- Version [e.g. 4.0.0]
- Platform: [e.g. Editor(Windows/Mac), Standalone(Windows/Mac), iOS, Android, WebGL]
- Unity version: [e.g. 2018.2.8f1]
- Build options: [e.g. IL2CPP, .Net 4.x, LWRP]
**Additional context**
Add any other context or screenshots about the question here.
+33
View File
@@ -0,0 +1,33 @@
[Ll]ibrary/
[Tt]emp/
[Oo]bj/
[Bb]uild/
/[Bb]uilds/
/Assets/AssetStoreTools*
# Autogenerated VS/MD solution and project files
ExportedObj/
*.csproj
*.unityproj
*.sln
*.suo
*.tmp
*.user
*.userprefs
*.pidb
*.booproj
*.svd
# Unity3D generated meta files
*.pidb.meta
# Unity3D Generated File On Crash Reports
sysinfo.txt
# Mac
*.DS_Store
# Builds
*.apk
*.unitypackage
View File
+2 -2
View File
@@ -1,7 +1,7 @@
fileFormatVersion: 2
guid: 04feaefc7cdee4c13abcd553a1a6e3a9
guid: 96837540e9d9b4d199c332f11ef9047a
folderAsset: yes
timeCreated: 1528368324
timeCreated: 1487124681
licenseType: Pro
DefaultImporter:
userData:
@@ -1,8 +1,9 @@
fileFormatVersion: 2
guid: a1b972071582443e2845278a859a1533
guid: ffab53058751f4155925f66ab787ed95
folderAsset: yes
timeCreated: 1488188301
licenseType: Pro
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+180
View File
@@ -0,0 +1,180 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Blur
serializedVersion: 5
m_AnimatorParameters:
- m_Name: New Bool
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
m_StateMachine: {fileID: 110755890}
m_Mask: {fileID: 0}
m_Motions: []
m_Behaviours: []
m_BlendingMode: 0
m_SyncedLayerIndex: -1
m_DefaultWeight: 0
m_IKPass: 0
m_SyncedLayerAffectsTiming: 0
m_Controller: {fileID: 9100000}
--- !u!1107 &110755890
AnimatorStateMachine:
serializedVersion: 5
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Base Layer
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: 1102000011617540674}
m_Position: {x: 240, y: 120, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
m_StateMachineTransitions: {}
m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 48, y: 72, z: 0}
m_EntryPosition: {x: 50, y: 120, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: 1102000011617540674}
--- !u!74 &74000012801063138
AnimationClip:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Animation
serializedVersion: 6
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves:
- curve:
serializedVersion: 2
m_Curve:
- time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 1
value: 1.5
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 2
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Blur
path:
classID: 114
script: {fileID: 11500000, guid: f8b2ed11d675446c5a49da1ea296d490, type: 3}
m_PPtrCurves: []
m_SampleRate: 12
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- path: 0
attribute: 595122796
script: {fileID: 11500000, guid: f8b2ed11d675446c5a49da1ea296d490, type: 3}
classID: 114
customType: 0
isPPtrCurve: 0
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 2
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 1
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves:
- curve:
serializedVersion: 2
m_Curve:
- time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 1
value: 1.5
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 2
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Blur
path:
classID: 114
script: {fileID: 11500000, guid: f8b2ed11d675446c5a49da1ea296d490, type: 3}
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_GenerateMotionCurves: 0
m_Events: []
--- !u!1102 &1102000011617540674
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Animation
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_Motion: {fileID: 74000012801063138}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
@@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: 6407849c9ce4141a9b34a33fbfef3d78
timeCreated: 1502936794
guid: 151a521e1127048568ae9c062c53bd05
timeCreated: 1488199687
licenseType: Pro
NativeFormatImporter:
userData:
+534
View File
@@ -0,0 +1,534 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Color
serializedVersion: 5
m_AnimatorParameters:
- m_Name: New Bool
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
m_StateMachine: {fileID: 110755890}
m_Mask: {fileID: 0}
m_Motions: []
m_Behaviours: []
m_BlendingMode: 0
m_SyncedLayerIndex: -1
m_DefaultWeight: 0
m_IKPass: 0
m_SyncedLayerAffectsTiming: 0
m_Controller: {fileID: 9100000}
--- !u!1107 &110755890
AnimatorStateMachine:
serializedVersion: 5
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Base Layer
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: 1102000012127059312}
m_Position: {x: 240, y: 120, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
m_StateMachineTransitions: {}
m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 48, y: 72, z: 0}
m_EntryPosition: {x: 50, y: 120, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: 1102000012127059312}
--- !u!74 &74000013119299284
AnimationClip:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Animation
serializedVersion: 6
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves:
- curve:
serializedVersion: 2
m_Curve:
- time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 1
value: 1
inSlope: 0
outSlope: 0
tangentMode: 10
- time: 2
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 3
value: 1
inSlope: 0
outSlope: 0
tangentMode: 10
- time: 4
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 5
value: 1
inSlope: 0
outSlope: 0
tangentMode: 10
- time: 6
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 7
value: 1
inSlope: 0
outSlope: 0
tangentMode: 10
- time: 8
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 8.833333
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 9
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.r
path:
classID: 114
script: {fileID: 11500000, guid: f8b2ed11d675446c5a49da1ea296d490, type: 3}
- curve:
serializedVersion: 2
m_Curve:
- time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 1.3333334
value: 1
inSlope: -0.025000036
outSlope: -0.025000036
tangentMode: 10
- time: 2.5833333
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 3.8333333
value: 1
inSlope: 0.024999976
outSlope: 0.024999976
tangentMode: 10
- time: 5.1666665
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 6.6666665
value: 1
inSlope: -0.041666627
outSlope: -0.041666627
tangentMode: 10
- time: 8
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 8.833333
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 9
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.g
path:
classID: 114
script: {fileID: 11500000, guid: f8b2ed11d675446c5a49da1ea296d490, type: 3}
- curve:
serializedVersion: 2
m_Curve:
- time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 2
value: 1
inSlope: 0.027777776
outSlope: 0.027777776
tangentMode: 10
- time: 4.25
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 6.25
value: 1
inSlope: -0.0357143
outSlope: -0.0357143
tangentMode: 10
- time: 8
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 8.833333
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 9
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.b
path:
classID: 114
script: {fileID: 11500000, guid: f8b2ed11d675446c5a49da1ea296d490, type: 3}
- curve:
serializedVersion: 2
m_Curve:
- time: 0
value: 0.5
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 4.25
value: 1
inSlope: -0.0078431405
outSlope: -0.0078431405
tangentMode: 10
- time: 8
value: 0.5
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 8.5
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 8.833333
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 9
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.a
path:
classID: 114
script: {fileID: 11500000, guid: f8b2ed11d675446c5a49da1ea296d490, type: 3}
m_PPtrCurves: []
m_SampleRate: 12
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings: []
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 9
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 1
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves:
- curve:
serializedVersion: 2
m_Curve:
- time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 1
value: 1
inSlope: 0
outSlope: 0
tangentMode: 10
- time: 2
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 3
value: 1
inSlope: 0
outSlope: 0
tangentMode: 10
- time: 4
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 5
value: 1
inSlope: 0
outSlope: 0
tangentMode: 10
- time: 6
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 7
value: 1
inSlope: 0
outSlope: 0
tangentMode: 10
- time: 8
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 8.833333
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 9
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.r
path:
classID: 114
script: {fileID: 11500000, guid: f8b2ed11d675446c5a49da1ea296d490, type: 3}
- curve:
serializedVersion: 2
m_Curve:
- time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 1.3333334
value: 1
inSlope: -0.025000036
outSlope: -0.025000036
tangentMode: 10
- time: 2.5833333
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 3.8333333
value: 1
inSlope: 0.024999976
outSlope: 0.024999976
tangentMode: 10
- time: 5.1666665
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 6.6666665
value: 1
inSlope: -0.041666627
outSlope: -0.041666627
tangentMode: 10
- time: 8
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 8.833333
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 9
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.g
path:
classID: 114
script: {fileID: 11500000, guid: f8b2ed11d675446c5a49da1ea296d490, type: 3}
- curve:
serializedVersion: 2
m_Curve:
- time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 2
value: 1
inSlope: 0.027777776
outSlope: 0.027777776
tangentMode: 10
- time: 4.25
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 6.25
value: 1
inSlope: -0.0357143
outSlope: -0.0357143
tangentMode: 10
- time: 8
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 8.833333
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 9
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.b
path:
classID: 114
script: {fileID: 11500000, guid: f8b2ed11d675446c5a49da1ea296d490, type: 3}
- curve:
serializedVersion: 2
m_Curve:
- time: 0
value: 0.5
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 4.25
value: 1
inSlope: -0.0078431405
outSlope: -0.0078431405
tangentMode: 10
- time: 8
value: 0.5
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 8.5
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 8.833333
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 9
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.a
path:
classID: 114
script: {fileID: 11500000, guid: f8b2ed11d675446c5a49da1ea296d490, type: 3}
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_GenerateMotionCurves: 0
m_Events: []
--- !u!1102 &1102000012127059312
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Animation
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_Motion: {fileID: 74000013119299284}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
@@ -1,7 +1,7 @@
fileFormatVersion: 2
guid: e3cb99c58283f294a9e51c0c30046b18
timeCreated: 1515075779
licenseType: Free
guid: c5d9ba160f4f94fc7b37041671ac013d
timeCreated: 1488199687
licenseType: Pro
NativeFormatImporter:
userData:
assetBundleName:
File diff suppressed because it is too large Load Diff
@@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: 1fe75f65a37454bf5aa2dab183b4305a
timeCreated: 1522651812
guid: 67e572a00c48842ae88b291d09d41b72
timeCreated: 1488188288
licenseType: Pro
DefaultImporter:
userData:
+292
View File
@@ -0,0 +1,292 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Shadow
serializedVersion: 5
m_AnimatorParameters:
- m_Name: New Bool
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
m_StateMachine: {fileID: 110755890}
m_Mask: {fileID: 0}
m_Motions: []
m_Behaviours: []
m_BlendingMode: 0
m_SyncedLayerIndex: -1
m_DefaultWeight: 0
m_IKPass: 0
m_SyncedLayerAffectsTiming: 0
m_Controller: {fileID: 9100000}
--- !u!1107 &110755890
AnimatorStateMachine:
serializedVersion: 5
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Base Layer
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: 1102000012968244592}
m_Position: {x: 240, y: 120, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
m_StateMachineTransitions: {}
m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 48, y: 72, z: 0}
m_EntryPosition: {x: 50, y: 120, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: 1102000012968244592}
--- !u!74 &74000011120282542
AnimationClip:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Animation
serializedVersion: 6
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves:
- curve:
serializedVersion: 2
m_Curve:
- time: 0
value: 0
inSlope: 5
outSlope: 5
tangentMode: 10
- time: 1
value: 5
inSlope: 0
outSlope: 0
tangentMode: 10
- time: 2
value: 0
inSlope: -5
outSlope: -5
tangentMode: 10
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_EffectDistance.x
path:
classID: 114
script: {fileID: 11500000, guid: f8b2ed11d675446c5a49da1ea296d490, type: 3}
- curve:
serializedVersion: 2
m_Curve:
- time: 0
value: 0
inSlope: 5
outSlope: 5
tangentMode: 10
- time: 1
value: 5
inSlope: 0
outSlope: 0
tangentMode: 10
- time: 2
value: 0
inSlope: -5
outSlope: -5
tangentMode: 10
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_EffectDistance.y
path:
classID: 114
script: {fileID: 11500000, guid: f8b2ed11d675446c5a49da1ea296d490, type: 3}
- curve:
serializedVersion: 2
m_Curve:
- time: 0
value: 0
inSlope: 1.5
outSlope: 1.5
tangentMode: 10
- time: 1
value: 1.5
inSlope: 0
outSlope: 0
tangentMode: 10
- time: 2
value: 0
inSlope: -1.5
outSlope: -1.5
tangentMode: 10
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_ShadowBlur
path:
classID: 114
script: {fileID: 11500000, guid: f8b2ed11d675446c5a49da1ea296d490, type: 3}
m_PPtrCurves: []
m_SampleRate: 12
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- path: 0
attribute: 929876405
script: {fileID: 11500000, guid: f8b2ed11d675446c5a49da1ea296d490, type: 3}
classID: 114
customType: 0
isPPtrCurve: 0
- path: 0
attribute: 1080817955
script: {fileID: 11500000, guid: f8b2ed11d675446c5a49da1ea296d490, type: 3}
classID: 114
customType: 0
isPPtrCurve: 0
- path: 0
attribute: 3733842510
script: {fileID: 11500000, guid: f8b2ed11d675446c5a49da1ea296d490, type: 3}
classID: 114
customType: 0
isPPtrCurve: 0
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 2
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 1
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves:
- curve:
serializedVersion: 2
m_Curve:
- time: 0
value: 0
inSlope: 5
outSlope: 5
tangentMode: 10
- time: 1
value: 5
inSlope: 0
outSlope: 0
tangentMode: 10
- time: 2
value: 0
inSlope: -5
outSlope: -5
tangentMode: 10
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_EffectDistance.x
path:
classID: 114
script: {fileID: 11500000, guid: f8b2ed11d675446c5a49da1ea296d490, type: 3}
- curve:
serializedVersion: 2
m_Curve:
- time: 0
value: 0
inSlope: 5
outSlope: 5
tangentMode: 10
- time: 1
value: 5
inSlope: 0
outSlope: 0
tangentMode: 10
- time: 2
value: 0
inSlope: -5
outSlope: -5
tangentMode: 10
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_EffectDistance.y
path:
classID: 114
script: {fileID: 11500000, guid: f8b2ed11d675446c5a49da1ea296d490, type: 3}
- curve:
serializedVersion: 2
m_Curve:
- time: 0
value: 0
inSlope: 1.5
outSlope: 1.5
tangentMode: 10
- time: 1
value: 1.5
inSlope: 0
outSlope: 0
tangentMode: 10
- time: 2
value: 0
inSlope: -1.5
outSlope: -1.5
tangentMode: 10
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_ShadowBlur
path:
classID: 114
script: {fileID: 11500000, guid: f8b2ed11d675446c5a49da1ea296d490, type: 3}
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_GenerateMotionCurves: 0
m_Events: []
--- !u!1102 &1102000012968244592
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Animation
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_Motion: {fileID: 74000011120282542}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
@@ -1,8 +1,8 @@
fileFormatVersion: 2
guid: ddc08462bf3e14c82929e462ff7823e7
timeCreated: 1502939317
guid: bc01d71324cc548bf958c751cbb0d693
timeCreated: 1488199687
licenseType: Pro
DefaultImporter:
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
+174
View File
@@ -0,0 +1,174 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: ToneLevel
serializedVersion: 5
m_AnimatorParameters:
- m_Name: New Bool
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
m_StateMachine: {fileID: 110755890}
m_Mask: {fileID: 0}
m_Motions: []
m_Behaviours: []
m_BlendingMode: 0
m_SyncedLayerIndex: -1
m_DefaultWeight: 0
m_IKPass: 0
m_SyncedLayerAffectsTiming: 0
m_Controller: {fileID: 9100000}
--- !u!1107 &110755890
AnimatorStateMachine:
serializedVersion: 5
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Base Layer
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: 1102000010030447406}
m_Position: {x: 240, y: 120, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
m_StateMachineTransitions: {}
m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 48, y: 72, z: 0}
m_EntryPosition: {x: 50, y: 120, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: 1102000010030447406}
--- !u!74 &74000012725545464
AnimationClip:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Animation
serializedVersion: 6
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves:
- curve:
serializedVersion: 2
m_Curve:
- time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 1
value: 1
inSlope: 0
outSlope: 0
tangentMode: 10
- time: 2
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_ToneLevel
path:
classID: 114
script: {fileID: 11500000, guid: f8b2ed11d675446c5a49da1ea296d490, type: 3}
m_PPtrCurves: []
m_SampleRate: 12
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings: []
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 2
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 1
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves:
- curve:
serializedVersion: 2
m_Curve:
- time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 1
value: 1
inSlope: 0
outSlope: 0
tangentMode: 10
- time: 2
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_ToneLevel
path:
classID: 114
script: {fileID: 11500000, guid: f8b2ed11d675446c5a49da1ea296d490, type: 3}
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_GenerateMotionCurves: 0
m_Events: []
--- !u!1102 &1102000010030447406
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Animation
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_Motion: {fileID: 74000012725545464}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1edb2b7979e364afba561a955f4708ba
timeCreated: 1488199687
licenseType: Pro
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

+57
View File
@@ -0,0 +1,57 @@
fileFormatVersion: 2
guid: 925f66fdcc9764b579413b7408c718f2
timeCreated: 1488188399
licenseType: Pro
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 7
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: 16
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 8
buildTargetSettings: []
spriteSheet:
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
@@ -1,8 +1,9 @@
fileFormatVersion: 2
guid: ee1bfc8c299e6482cb7175ba2f94495a
folderAsset: yes
timeCreated: 1487152270
licenseType: Pro
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+104
View File
@@ -0,0 +1,104 @@
using UnityEngine.UI;
using UnityEditor;
namespace UnityEditor.UI
{
/// <summary>
/// UIEffect editor.
/// </summary>
[CustomEditor(typeof(UIEffect))]
[CanEditMultipleObjects]
public class UIEffectEditor : Editor
{
/// <summary>
/// Implement this function to make a custom inspector.
/// </summary>
public override void OnInspectorGUI()
{
//
serializedObject.Update();
UIEffect current = target as UIEffect;
var spToneMode = serializedObject.FindProperty("m_ToneMode");
var spColorMode = serializedObject.FindProperty("m_ColorMode");
var spBlurMode = serializedObject.FindProperty("m_BlurMode");
var spShadowMode = serializedObject.FindProperty("m_ShadowMode");
//================
// Only the main effect can change effect modes.
// They change shader keywords of the material.
//================
if (current.mainEffect == current)
{
// Tone setting.
EditorGUILayout.PropertyField(spToneMode);
// If tone is enable, show parameters.
if (spToneMode.intValue != (int)UIEffect.ToneMode.None)
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(serializedObject.FindProperty("m_ToneLevel"));
EditorGUI.indentLevel--;
}
// Color setting.
EditorGUILayout.PropertyField(spColorMode);
// If color is enable, show parameters.
if (spColorMode.intValue != (int)UIEffect.ColorMode.None)
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(serializedObject.FindProperty("m_Color"));
EditorGUI.indentLevel--;
}
}
// Set effect mode from main effect.
else
{
spToneMode.intValue = (int)current.mainEffect.toneMode;
spColorMode.intValue = (int)current.mainEffect.colorMode;
spBlurMode.intValue = (int)current.mainEffect.blurMode;
}
//================
// Shadow setting.
//================
EditorGUILayout.PropertyField(spShadowMode);
// If shadow is enable, show parameters.
if (spShadowMode.intValue != (int)UIEffect.ShadowMode.None)
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(serializedObject.FindProperty("m_EffectDistance"));
EditorGUILayout.PropertyField(serializedObject.FindProperty("m_ShadowColor"));
EditorGUILayout.PropertyField(serializedObject.FindProperty("m_UseGraphicAlpha"));
EditorGUI.indentLevel--;
}
//================
// Blur setting.
//================
EditorGUILayout.PropertyField(spBlurMode);
// If blur is enable, show parameters.
if (spBlurMode.intValue != (int)UIEffect.BlurMode.None)
{
EditorGUI.indentLevel++;
// Blur parameter.
EditorGUILayout.PropertyField(serializedObject.FindProperty("m_Blur"));
// Shadow blur parameter.
if (spShadowMode.intValue != (int)UIEffect.ShadowMode.None)
{
EditorGUILayout.PropertyField(serializedObject.FindProperty("m_ShadowBlur"));
}
EditorGUI.indentLevel--;
}
//
serializedObject.ApplyModifiedProperties();
}
}
}
+66
View File
@@ -0,0 +1,66 @@
UIEffect
===
Composite Effect for uGUI.
![](http://mob-sakai.github.io/UIEffect/images/demo.gif)
![](http://mob-sakai.github.io/UIEffect/images/inspector.png)
## Requirement
* Unity 5.3+
* No other SDK are required.
## Usage
1. Download the package from [releases](https://github.com/mob-sakai/UIEffect/releases).
1. Import the package into your Unity project. Select `Import Package > Custom Package` from the `Assets` menu.
1. Add `UIEffect` component to UI element (Image, RawImage, Text, etc...) from `Add Component` in inspector.
1. Enjoy!
## Demo
[WebGL Demo](https://mob-sakai.github.io/UIEffect/demo/)
[WebGL Performance Test](https://mob-sakai.github.io/UIEffect/performance_test/)
## Release Notes
### ver.1.0.0
* Feature: Shader supports pre-processer macros (for example UNITY_VERTEX_OUTPUT_STEREO) for Unity 5.3.x, 5.4.x and 5.5.x.
* Feature: Supports changing value from animation (for Unity 5.4+).
* Feature: Supports Tone effect.
* grayscale
* sepia
* nega
* Feature: Supports Color effect.
* set
* add
* sub
* Feature: Supports Blur effect.
* fast
* detail
* Fix: Color effect will not be properly when it was rotated.
* Performance: Shader supports multi-compile for performance.
* Performance: Cache same effect materials to reduce draw calls.
* Improve: Supports mobile devices.
* Improve: Simplify component & inspector.
## License
MIT
## Author
[mob-sakai](https://github.com/mob-sakai)
@@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: 546af75b6221c4768be79d67c9cea1fb
timeCreated: 1547605752
guid: 2073fb2b473bd410290c57f17e417e80
timeCreated: 1487921217
licenseType: Pro
TextScriptImporter:
userData:
+159
View File
@@ -0,0 +1,159 @@
#ifndef UI_EFFECT_INCLUDED
#define UI_EFFECT_INCLUDED
//################################
// Define
//################################
#define PACKER_STEP 64
#if UI_TONE_GRAYSCALE | UI_TONE_SEPIA | UI_TONE_NEGA
#define UI_TONE
#endif
#if UI_COLOR_ADD | UI_COLOR_SUB | UI_COLOR_SET
#define UI_COLOR
#endif
#if UI_BLUR_FAST | UI_BLUR_DETAIL
#define UI_BLUR
#endif
//################################
// Unpacker to vector
//################################
#if defined (UI_COLOR)
// Unpack float to low-precision [0-1] fixed4.
fixed4 UnpackToVec4(float value)
{
const int PRECISION = PACKER_STEP - 1;
fixed4 color;
color.r = (value % PACKER_STEP) / PRECISION;
value = floor(value / PACKER_STEP);
color.g = (value % PACKER_STEP) / PRECISION;
value = floor(value / PACKER_STEP);
color.b = (value % PACKER_STEP) / PRECISION;
value = floor(value / PACKER_STEP);
color.a = (value % PACKER_STEP) / PRECISION;
return color;
}
#endif
#if defined (UI_TONE) || defined (UI_BLUR)
// Unpack float to low-precision [0-1] half3.
// The z value is a little high precision.
half3 UnpackToVec3(float value)
{
const int PRECISION = PACKER_STEP - 1;
const int PACKER_STEP_HIGH = PACKER_STEP * PACKER_STEP;
const int PRECISION_HIGH = PACKER_STEP_HIGH - 1;
half3 color;
color.x = (value % PACKER_STEP) / PRECISION;
value = floor(value / PACKER_STEP);
color.y = (value % PACKER_STEP) / PRECISION;
value = floor(value / PACKER_STEP);
color.z = (value % PACKER_STEP_HIGH) / (PRECISION_HIGH - 1);
return color;
}
#endif
//################################
// Blur effect
//################################
#if defined (UI_BLUR)
// Calculate blur effect.
// Sample texture by blured uv, with bias.
fixed4 Blur(sampler2D tex, half2 uv, half2 addUv, half bias)
{
half4 color = tex2D( tex, uv + addUv);
color += tex2D( tex, uv - addUv);
addUv.x *= -1;
color += tex2D( tex, uv + addUv);
color += tex2D( tex, uv - addUv);
return color * bias;
}
// Sample texture with blurring.
// * Fast: Sample texture with 3x4 blurring.
// * Detail: Sample texture with 6x4 blurring.
fixed4 Tex2DBlurring(sampler2D tex, half2 uv, fixed blurring)
{
half4 color = tex2D(tex, uv);
half2 dir = half2( blurring, blurring);
fixed4 blurring_color;
#if UI_BLUR_FAST // Blur(Fast)
const half originalBias = 0.41511;
blurring_color
= Blur( tex, uv, dir * 3, 0.12924 )
+ Blur( tex, uv, dir * 5, 0.01343 )
+ Blur( tex, uv, dir * 6, 0.00353 );
#elif UI_BLUR_DETAIL // Blur(Detail)
const half originalBias = 0.14387;
blurring_color
= Blur( tex, uv, dir * 1, 0.06781 )
+ Blur( tex, uv, dir * 2, 0.05791 )
+ Blur( tex, uv, dir * 3, 0.04360 )
+ Blur( tex, uv, dir * 4, 0.02773 )
+ Blur( tex, uv, dir * 5, 0.01343 )
+ Blur( tex, uv, dir * 6, 0.00353 );
#endif
return color * originalBias + blurring_color;
}
#endif
//################################
// Tone effect
//################################
#if defined (UI_TONE)
// Apply tone effect.
fixed4 ApplyToneEffect(fixed4 color, fixed factor)
{
#ifdef UI_TONE_GRAYSCALE // Grayscale
color.rgb = lerp(color.rgb, Luminance(color.rgb), factor);
#elif UI_TONE_SEPIA // Sepia
color.rgb = lerp(color.rgb, Luminance(color.rgb) * half3(1.07, 0.74, 0.43), factor);
#elif UI_TONE_NEGA // Nega
color.rgb = lerp(color.rgb, 1 - color.rgb, factor);
#endif
return color;
}
#endif
//################################
// Color effect
//################################
#if defined (UI_COLOR)
// Apply color effect.
fixed4 ApplyColorEffect(fixed4 color, fixed4 factor)
{
#ifdef UI_COLOR_SET // Set
color.rgb = lerp(color.rgb, factor.rgb, factor.a);
#elif UI_COLOR_ADD // Add
color.rgb += factor.rgb * factor.a;
#elif UI_COLOR_SUB // Sub
color.rgb -= factor.rgb * factor.a;
#endif
return color;
}
#endif
#endif // UI_EFFECT_INCLUDED
+180
View File
@@ -0,0 +1,180 @@
Shader "UI/Hidden/UIEffect"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255
_ColorMask ("Color Mask", Float) = 15
[Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0
}
SubShader
{
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
"PreviewType"="Plane"
"CanUseSpriteAtlas"="True"
}
Stencil
{
Ref [_Stencil]
Comp [_StencilComp]
Pass [_StencilOp]
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
}
Cull Off
Lighting Off
ZWrite Off
ZTest [unity_GUIZTestMode]
Blend SrcAlpha OneMinusSrcAlpha
ColorMask [_ColorMask]
Pass
{
Name "Default"
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#if UNITY_VERSION >= 540
#pragma target 2.0
#endif
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#pragma multi_compile __ UNITY_UI_ALPHACLIP
// vvvv [For UIEffect] vvvv : Define keyword and include.
#pragma multi_compile __ UI_TONE_GRAYSCALE UI_TONE_SEPIA UI_TONE_NEGA
#pragma multi_compile __ UI_COLOR_ADD UI_COLOR_SUB UI_COLOR_SET
#pragma multi_compile __ UI_BLUR_FAST UI_BLUR_DETAIL
#include "UI-Effect.cginc"
// ^^^^ [For UIEffect] ^^^^
struct appdata_t
{
float4 vertex : POSITION;
float4 color : COLOR;
float2 texcoord : TEXCOORD0;
#ifdef UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_INPUT_INSTANCE_ID
#endif
// vvvv [For UIEffect] vvvv
float2 uv1 : TEXCOORD1;
// ^^^^ [For UIEffect] ^^^^
};
struct v2f
{
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
float4 worldPosition : TEXCOORD1;
#ifdef UNITY_VERTEX_OUTPUT_STEREO
UNITY_VERTEX_OUTPUT_STEREO
#endif
// vvvv [For UIEffect] vvvv
#if defined (UI_COLOR) // Add color effect factor.
fixed4 colorFactor : COLOR1;
#endif
#if defined (UI_TONE) || defined (UI_BLUR) // Add other effect factor.
half3 effectFactor : TEXCOORD2;
#endif
// ^^^^ [For UIEffect] ^^^^
};
fixed4 _Color;
fixed4 _TextureSampleAdd;
float4 _ClipRect;
v2f vert(appdata_t IN)
{
v2f OUT;
#ifdef UNITY_SETUP_INSTANCE_ID
UNITY_SETUP_INSTANCE_ID(IN);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT);
#endif
OUT.worldPosition = IN.vertex;
#if UNITY_VERSION >= 540
OUT.vertex = UnityObjectToClipPos(OUT.worldPosition);
#else
OUT.vertex = mul(UNITY_MATRIX_MVP, OUT.worldPosition);
#endif
OUT.texcoord = IN.texcoord;
#if defined (UNITY_HALF_TEXEL_OFFSET) && UNITY_VERSION < 550
#if UNITY_VERSION >= 540
OUT.vertex.xy += (_ScreenParams.zw-1.0) * float2(-1,1) * OUT.vertex.w;
#else
OUT.vertex.xy += (_ScreenParams.zw-1.0)*float2(-1,1);
#endif
#endif
OUT.color = IN.color * _Color;
// vvvv [For UIEffect] vvvv : Calculate effect parameter.
#if defined (UI_TONE) || defined (UI_BLUR)
OUT.effectFactor = UnpackToVec3(IN.uv1.x);
OUT.effectFactor.y = OUT.effectFactor.z / 4;
#endif
#if defined (UI_COLOR)
OUT.colorFactor = UnpackToVec4(IN.uv1.y);
#endif
// ^^^^ [For UIEffect] ^^^^
return OUT;
}
sampler2D _MainTex;
fixed4 frag(v2f IN) : SV_Target
{
// vvvv [For UIEffect] vvvv : Sample texture with blurring.
#if defined (UI_BLUR)
half4 color = (Tex2DBlurring(_MainTex, IN.texcoord, IN.effectFactor.y) + _TextureSampleAdd) * IN.color;
#else
half4 color = (tex2D(_MainTex, IN.texcoord) + _TextureSampleAdd) * IN.color;
#endif
// ^^^^ [For UIEffect] ^^^^
color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect);
#ifdef UNITY_UI_ALPHACLIP
clip (color.a - 0.001);
#endif
// vvvv [For UIEffect] vvvv : Apply tone and color effect.
#if defined (UI_TONE)
color = ApplyToneEffect(color, IN.effectFactor.x); // Tone effect.
#endif
#if defined (UI_COLOR)
color = ApplyColorEffect(color, IN.colorFactor); // Color effect.
#endif
// ^^^^ [For UIEffect] ^^^^
return color;
}
ENDCG
}
}
}
+478
View File
@@ -0,0 +1,478 @@
using UnityEngine;
using System.Collections.Generic;
using System.Linq;
namespace UnityEngine.UI
{
/// <summary>
/// UIEffect.
/// </summary>
[ExecuteInEditMode]
[RequireComponent(typeof(Graphic))]
public class UIEffect : MonoBehaviour, IMeshModifier
{
//################################
// Constant Members.
//################################
/// <summary>
/// Precision shift. Each value has 6 bits.
/// </summary>
const int PACKER_SHIFT_1 = 6;
const int PACKER_SHIFT_2 = PACKER_SHIFT_1 * 2;
const int PACKER_SHIFT_3 = PACKER_SHIFT_1 * 3;
/// <summary>
/// Precision bits. Each value [0-1] has 64 steps.
/// </summary>
const int PACKER_PRECISION = (1 << PACKER_SHIFT_1) - 1;
/// <summary>
/// Effect shader name.
/// </summary>
const string ShaderName = "UI/Hidden/UIEffect";
/// <summary>
/// Tone effect mode.
/// </summary>
public enum ToneMode
{
None = 0,
Grayscale,
Sepia,
Nega,
}
/// <summary>
/// Color effect mode.
/// </summary>
public enum ColorMode
{
None = 0,
Set,
Add,
Sub,
}
/// <summary>
/// Shadow effect mode.
/// </summary>
public enum ShadowMode
{
None = 0,
Shadow,
Outline,
Outline8,
}
/// <summary>
/// Blur effect mode.
/// </summary>
public enum BlurMode
{
None = 0,
Fast,
Detail,
}
//################################
// Static Members.
//################################
static readonly List<UIVertex> s_Verts = new List<UIVertex>();
static readonly List<UIEffect> s_UIEffects = new List<UIEffect>();
static readonly Material[] s_SharedMaterials = new Material[128];
//################################
// Public or Serialize Members.
//################################
/// <summary>
/// Tone effect level between 0(no effect) and 1(complete effect).
/// </summary>
public float toneLevel{ get { return m_ToneLevel; } set { m_ToneLevel = Mathf.Clamp(value, 0, 1); SetDirty(); } }
[SerializeField][Range(0, 1)]protected float m_ToneLevel = 1;
/// <summary>
/// How far is the blurring from the graphic.
/// </summary>
public float blur { get { return m_Blur; } set { m_Blur = Mathf.Clamp(value, 0, 4); SetDirty(); } }
[SerializeField][Range(0, 4)]protected float m_Blur = 0;
/// <summary>
/// How far is the blurring shadow from the graphic.
/// </summary>
public float shadowBlur { get { return m_ShadowBlur; } set { m_ShadowBlur = Mathf.Clamp(value, 0, 4); SetDirty(); } }
[SerializeField][Range(0, 4)]protected float m_ShadowBlur = 0;
/// <summary>
/// Shadow effect mode.
/// </summary>
public ShadowMode shadowMode { get { return m_ShadowMode; } set { m_ShadowMode = value; SetDirty(); } }
[SerializeField] ShadowMode m_ShadowMode;
/// <summary>
/// Tone effect mode.
/// </summary>
public ToneMode toneMode { get { return m_ToneMode; } set { m_ToneMode = value; SetDirty(true); } }
[SerializeField] ToneMode m_ToneMode;
/// <summary>
/// Color effect mode.
/// </summary>
public ColorMode colorMode { get { return m_ColorMode; } set { m_ColorMode = value; SetDirty(true); } }
[SerializeField] ColorMode m_ColorMode;
/// <summary>
/// Blur effect mode.
/// </summary>
public BlurMode blurMode { get { return m_BlurMode; } set { m_BlurMode = value; SetDirty(true); } }
[SerializeField] BlurMode m_BlurMode;
/// <summary>
/// Color for the shadow effect.
/// </summary>
public Color shadowColor { get { return m_ShadowColor; } set { m_ShadowColor = value; SetDirty(); } }
[SerializeField] Color m_ShadowColor = Color.white;
/// <summary>
/// How far is the shadow from the graphic.
/// </summary>
public Vector2 effectDistance { get { return m_EffectDistance; } set { m_EffectDistance = value; SetDirty(); } }
[SerializeField] Vector2 m_EffectDistance = new Vector2(1f, -1f);
/// <summary>
/// Should the shadow inherit the alpha from the graphic?
/// </summary>
public bool useGraphicAlpha { get { return m_UseGraphicAlpha; } set { m_UseGraphicAlpha = value; SetDirty(); } }
[SerializeField] bool m_UseGraphicAlpha = true;
/// <summary>
/// Color for the color effect.
/// </summary>
public Color color { get { return m_Color; } set { m_Color = value; SetDirty(); } }
[SerializeField] Color m_Color = Color.white;
/// <summary>
/// Effect shader.
/// </summary>
public virtual Shader shader { get { if (m_Shader == null) m_Shader = Shader.Find(ShaderName); return m_Shader; } }
[SerializeField] Shader m_Shader;
/// <summary>
/// Graphic affected by the UIEffect.
/// </summary>
public Graphic graphic { get { if (m_Graphic == null) m_Graphic = GetComponent<Graphic>(); return m_Graphic; } }
Graphic m_Graphic;
/// <summary>
/// Main effect in the gameobject.
/// * It is top most UIEffect component in inspector.
/// </summary>
public UIEffect mainEffect{ get; private set; }
//################################
// MonoBehaior Callbacks.
//################################
/// <summary>
/// This function is called when the object becomes enabled and active.
/// </summary>
protected virtual void OnEnable()
{
SetDirty(this);
}
/// <summary>
/// This function is called when the behaviour becomes disabled () or inactive.
/// </summary>
protected virtual void OnDisable()
{
// When all effect modes are disable, graphic uses default material.
GetComponents<UIEffect>(s_UIEffects);
if (s_UIEffects.All(effect => !effect.enabled))
{
graphic.material = null;
graphic.SetVerticesDirty();
}
s_UIEffects.Clear();
SetDirty();
}
/// <summary>
/// Callback for when properties have been changed by animation.
/// </summary>
protected virtual void OnDidApplyAnimationProperties()
{
SetDirty(true);
}
/// <summary>
/// Modifies the mesh.
/// </summary>
public virtual void ModifyMesh(VertexHelper vh)
{
if (!isActiveAndEnabled)
{
return;
}
UIVertex vt;
vh.GetUIVertexStream(s_Verts);
//================================
// Only main effect modify original vertices.
//================================
if (mainEffect == this)
{
// Calcurate bluring uv from blur factor and texture size.
float blurringUv = m_Blur / graphic.mainTexture.width;
// Pack some effect factors to 1 float.
Vector2 factor = new Vector2(
PackToFloat(m_ToneLevel, 0, blurringUv * 4),
PackToFloat(m_Color.r, m_Color.g, m_Color.b, m_Color.a)
);
for (int i = 0; i < s_Verts.Count; i++)
{
vt = s_Verts[i];
// Set UIEffect prameters to vertex.
vt.uv1 = factor;
s_Verts[i] = vt;
}
}
//================================
// Append shadow vertices.
//================================
if (ShadowMode.Shadow <= m_ShadowMode)
{
var inputVertCount = s_Verts.Count;
var start = 0;
var end = inputVertCount;
// Calcurate bluring uv from blur factor and texture size.
float blurringUv = m_ShadowBlur / graphic.mainTexture.width;
// Pack some effect factors to 1 float.
Vector2 factor = new Vector2(
PackToFloat(m_ToneLevel, 0, blurringUv * 4),
PackToFloat(m_ShadowColor.r, m_ShadowColor.g, m_ShadowColor.b, 1)
);
ApplyShadowZeroAlloc(s_Verts, ref start, ref end, m_EffectDistance.x, m_EffectDistance.y, factor);
// Append shadow for Outline.
if (ShadowMode.Outline <= m_ShadowMode)
{
ApplyShadowZeroAlloc(s_Verts, ref start, ref end, m_EffectDistance.x, -m_EffectDistance.y, factor);
ApplyShadowZeroAlloc(s_Verts, ref start, ref end, -m_EffectDistance.x, m_EffectDistance.y, factor);
ApplyShadowZeroAlloc(s_Verts, ref start, ref end, -m_EffectDistance.x, -m_EffectDistance.y, factor);
}
// Append shadow for Outline8.
if (ShadowMode.Outline8 <= m_ShadowMode)
{
ApplyShadowZeroAlloc(s_Verts, ref start, ref end, -m_EffectDistance.x, 0, factor);
ApplyShadowZeroAlloc(s_Verts, ref start, ref end, 0, -m_EffectDistance.y, factor);
ApplyShadowZeroAlloc(s_Verts, ref start, ref end, m_EffectDistance.x, 0, factor);
ApplyShadowZeroAlloc(s_Verts, ref start, ref end, 0, m_EffectDistance.y, factor);
}
}
vh.Clear();
vh.AddUIVertexTriangleStream(s_Verts);
s_Verts.Clear();
}
/// <summary>
/// Modifies the mesh.
/// </summary>
[System.Obsolete("use IMeshModifier.ModifyMesh (VertexHelper verts) instead")]
public void ModifyMesh(Mesh mesh)
{
}
#if UNITY_EDITOR
/// <summary>
/// This function is called when the script is loaded or a value is changed in the inspector (Called in the editor only).
/// </summary>
protected virtual void OnValidate()
{
SetDirty(this);
}
#endif
//################################
// Internal Method.
//################################
/// <summary>
/// Append shadow vertices.
/// * It is similar to Shadow component implementation.
/// </summary>
protected void ApplyShadowZeroAlloc(List<UIVertex> verts, ref int start, ref int end, float x, float y, Vector2 factor)
{
// Check list capacity.
var neededCapacity = verts.Count + end - start;
if (verts.Capacity < neededCapacity)
verts.Capacity = neededCapacity;
// Append shadow vertices to the front of list.
// * The original vertex is pushed backward.
UIVertex vt;
for (int i = start; i < end; ++i)
{
vt = verts[i];
verts.Add(vt);
Vector3 v = vt.position;
vt.position.Set(v.x + x, v.y + y, v.z);
Color vertColor = m_ShadowColor;
vertColor.a = m_UseGraphicAlpha ? m_ShadowColor.a * vt.color.a / 255 : m_ShadowColor.a;
vt.color = vertColor;
// Set UIEffect prameters to vertex.
vt.uv1 = factor;
verts[i] = vt;
}
// Update next shadow offset.
start = end;
end = verts.Count;
}
/// <summary>
/// Mark the UIEffect as dirty.
/// </summary>
/// <param name="isMaterialDirty">If set to true material dirty.</param>
void SetDirty(bool isMaterialDirty = false)
{
//
if (!mainEffect)
{
mainEffect = GetComponent<UIEffect>();
}
// Only main effect update material.
if (mainEffect != this)
{
m_ToneMode = mainEffect.m_ToneMode;
m_ColorMode = mainEffect.m_ColorMode;
m_BlurMode = mainEffect.m_BlurMode;
return;
}
// Update material if needed.
if (isMaterialDirty && mainEffect == this)
{
const int TONE_SHIFT = 0;
const int TONE_GRAYSCALE = (int)ToneMode.Grayscale;
const int TONE_SEPIA = (int)ToneMode.Sepia;
const int TONE_NEGA = (int)ToneMode.Nega;
const int COLOR_SHIFT = 2;
const int COLOR_SET = (int)ColorMode.Set;
const int COLOR_ADD = (int)ColorMode.Add;
const int COLOR_SUB = (int)ColorMode.Sub;
const int BLUR_SHIFT = 4;
const int BLUR_FAST = (int)BlurMode.Fast;
const int BLUR_DETAIL = (int)BlurMode.Detail;
// Calculate shader keyword identifier from effect modes.
int identifier = ((int)m_ToneMode << TONE_SHIFT) | ((int)m_ColorMode << COLOR_SHIFT) | ((int)m_BlurMode << BLUR_SHIFT);
// When all effect modes are disable(None), graphic uses default material.
if (identifier == 0)
{
graphic.material = null;
graphic.SetVerticesDirty();
return;
}
// Generate and cache new material by given identifier.
if (!s_SharedMaterials[identifier])
{
if (!s_SharedMaterials[0])
{
s_SharedMaterials[0] = new Material(shader);
}
Material mat = new Material(s_SharedMaterials[0]);
// Bits for tone effect.
int toneBits = identifier >> TONE_SHIFT;
mat.EnableKeyword(
TONE_NEGA == (toneBits & TONE_NEGA) ? "UI_TONE_NEGA"
: TONE_SEPIA == (toneBits & TONE_SEPIA) ? "UI_TONE_SEPIA"
: TONE_GRAYSCALE == (toneBits & TONE_GRAYSCALE) ? "UI_TONE_GRAYSCALE"
: "UI_TONE_OFF"
);
// Bits for color effect.
int colorBits = identifier >> COLOR_SHIFT;
mat.EnableKeyword(
COLOR_SUB == (colorBits & COLOR_SUB) ? "UI_COLOR_SUB"
: COLOR_ADD == (colorBits & COLOR_ADD) ? "UI_COLOR_ADD"
: COLOR_SET == (colorBits & COLOR_SET) ? "UI_COLOR_SET"
: "UI_COLOR_OFF"
);
// Bits for blur effect.
int blurBits = identifier >> BLUR_SHIFT;
mat.EnableKeyword(
BLUR_DETAIL == (blurBits & BLUR_DETAIL) ? "UI_BLUR_DETAIL"
: BLUR_FAST == (blurBits & BLUR_FAST) ? "UI_BLUR_FAST"
: "UI_BLUR_OFF"
);
mat.name += identifier.ToString();
s_SharedMaterials[identifier] = mat;
}
graphic.material = s_SharedMaterials[identifier];
}
graphic.SetVerticesDirty();
}
/// <summary>
/// Pack 4 low-precision [0-1] floats values to a float.
/// </summary>
static float PackToFloat(float x, float y, float z, float w)
{
return (Mathf.FloorToInt(w * PACKER_PRECISION) << PACKER_SHIFT_3)
+ (Mathf.FloorToInt(z * PACKER_PRECISION) << PACKER_SHIFT_2)
+ (Mathf.FloorToInt(y * PACKER_PRECISION) << PACKER_SHIFT_1)
+ Mathf.FloorToInt(x * PACKER_PRECISION);
}
/// <summary>
/// Pack 3 low-precision [0-1] floats values to a float.
/// The z value is a little high precision(12 bits).
/// </summary>
static float PackToFloat(float x, float y, float z)
{
const int PRECISION_BITS_HIGH = (1 << PACKER_SHIFT_2) - 1;
return (Mathf.FloorToInt(z * PRECISION_BITS_HIGH) << PACKER_SHIFT_2)
+ (Mathf.FloorToInt(y * PACKER_PRECISION) << PACKER_SHIFT_1)
+ Mathf.FloorToInt(x * PACKER_PRECISION);
}
}
}
-608
View File
@@ -1,608 +0,0 @@
# [4.0.0-preview.10](https://github.com/mob-sakai/UIEffect/compare/v4.0.0-preview.9...v4.0.0-preview.10) (2023-11-09)
### Bug Fixes
* ExecuteInEditMode to ExecuteAlways ([c750810](https://github.com/mob-sakai/UIEffect/commit/c75081095f580b12730b06f9a668a991bb5e8fe6))
# [4.0.0-preview.9](https://github.com/mob-sakai/UIEffect/compare/v4.0.0-preview.8...v4.0.0-preview.9) (2020-06-09)
### Features
* add a new property to access EffectPlayer at runtime ([d92efa9](https://github.com/mob-sakai/UIEffect/commit/d92efa98a1fc7b78d3421d9ee0b4bdaa74511bdc)), closes [#214](https://github.com/mob-sakai/UIEffect/issues/214) [#215](https://github.com/mob-sakai/UIEffect/issues/215)
# [4.0.0-preview.8](https://github.com/mob-sakai/UIEffect/compare/v4.0.0-preview.7...v4.0.0-preview.8) (2020-06-04)
### change
* change namespace ([7f4190c](https://github.com/mob-sakai/UIEffect/commit/7f4190c8c6f294e90869767a96194ec5ac4ba57f))
### Features
* modify EffectPlayer at runtime ([8483ba6](https://github.com/mob-sakai/UIEffect/commit/8483ba63cb546ca032915c166c0333fa5fd7aa76)), closes [#214](https://github.com/mob-sakai/UIEffect/issues/214) [#215](https://github.com/mob-sakai/UIEffect/issues/215)
### BREAKING CHANGES
* If your code contained the UIEffect API, it would fail to compile. Please change the namespace from `Coffee.UIExtensions` to `Coffee.UIEffects`.
# [4.0.0-preview.7](https://github.com/mob-sakai/UIEffect/compare/v4.0.0-preview.6...v4.0.0-preview.7) (2020-05-11)
### Bug Fixes
* not working on PS4 ([0f595eb](https://github.com/mob-sakai/UIEffect/commit/0f595eb79197433e166bf74d736d9841b4117011)), closes [#211](https://github.com/mob-sakai/UIEffect/issues/211)
* Shaders.meta file should be removed ([e9cc165](https://github.com/mob-sakai/UIEffect/commit/e9cc165e2edba572d868d224e42df31666fd4002)), closes [#210](https://github.com/mob-sakai/UIEffect/issues/210)
# [4.0.0-preview.6](https://github.com/mob-sakai/UIEffect/compare/v4.0.0-preview.5...v4.0.0-preview.6) (2020-04-14)
### Bug Fixes
* can't import samples in Unity2019.1 or later ([13a8538](https://github.com/mob-sakai/UIEffect/commit/13a853887e87b7ecc12e937e92498af945bbeb8a)), closes [#209](https://github.com/mob-sakai/UIEffect/issues/209)
# [4.0.0-preview.5](https://github.com/mob-sakai/UIEffect/compare/v4.0.0-preview.4...v4.0.0-preview.5) (2020-04-13)
### Bug Fixes
* move shaders to resources directory ([bc7310d](https://github.com/mob-sakai/UIEffect/commit/bc7310df96977ef48328675e9465b295b40a1418))
# [4.0.0-preview.4](https://github.com/mob-sakai/UIEffect/compare/v4.0.0-preview.3...v4.0.0-preview.4) (2020-04-13)
### Bug Fixes
* remove unused property ([d20ed3c](https://github.com/mob-sakai/UIEffect/commit/d20ed3c96c63ecefac6ff6eec7764e01a97a74fb))
# [4.0.0-preview.3](https://github.com/mob-sakai/UIEffect/compare/v4.0.0-preview.2...v4.0.0-preview.3) (2020-04-10)
### Bug Fixes
* fix sample importer ([ea7d073](https://github.com/mob-sakai/UIEffect/commit/ea7d073c53c2f1c964a209c03e78b744fd551cfc))
* fix supported version ([09363dd](https://github.com/mob-sakai/UIEffect/commit/09363dd3f6906c9bb7f720db66baddb8b1b2029b))
* Reduce resource file size ([4df8e3c](https://github.com/mob-sakai/UIEffect/commit/4df8e3c2dcf85ad8756f920cb2493a46e38dea6a))
# [4.0.0-preview.2](https://github.com/mob-sakai/UIEffect/compare/v4.0.0-preview.1...v4.0.0-preview.2) (2020-04-10)
### Bug Fixes
* compilation fails on build ([f34ae2c](https://github.com/mob-sakai/UIEffect/commit/f34ae2ce0f834eeb47927f2c0f8d6384adfe79da))
* fix project settings ([8685165](https://github.com/mob-sakai/UIEffect/commit/8685165f41ec0a97c6647689a5596a2d014d563a)), closes [#198](https://github.com/mob-sakai/UIEffect/issues/198) [#195](https://github.com/mob-sakai/UIEffect/issues/195) [#189](https://github.com/mob-sakai/UIEffect/issues/189) [#173](https://github.com/mob-sakai/UIEffect/issues/173) [#104](https://github.com/mob-sakai/UIEffect/issues/104) [#158](https://github.com/mob-sakai/UIEffect/issues/158) [#143](https://github.com/mob-sakai/UIEffect/issues/143)
# [4.0.0-preview.1](https://github.com/mob-sakai/UIEffect/compare/v3.2.0...v4.0.0-preview.1) (2020-04-10)
### Bug Fixes
* adjusting the brightness of the shiny shader ([29b4dad](https://github.com/mob-sakai/UIEffect/commit/29b4dad9296f22b00687a27c6103820b58cbd890))
* the effect is kept even if the component is disabled (UIFlip, UIGradient) ([6124214](https://github.com/mob-sakai/UIEffect/commit/612421432defaf4e38fa97e12392021e9954027f))
### Features
* add asmdef files ([24710fc](https://github.com/mob-sakai/UIEffect/commit/24710fc892265c16a635ebad0940f779e0c9cdcd))
* new effect that synchronize with another effect ([7a2a97c](https://github.com/mob-sakai/UIEffect/commit/7a2a97c89e90cc94c14fb614544f248824e93f3f)), closes [#159](https://github.com/mob-sakai/UIEffect/issues/159) [#158](https://github.com/mob-sakai/UIEffect/issues/158) [#143](https://github.com/mob-sakai/UIEffect/issues/143)
* transfer TextMeshPro support to another package ([be90210](https://github.com/mob-sakai/UIEffect/commit/be90210e6cbf39133bd829e4bf08b9005dd925f4))
* transfer UIEffectCapturedImage support to another package ([c2a2320](https://github.com/mob-sakai/UIEffect/commit/c2a23202e18d103d58d8ebf56851e693f5ac1bb7))
* update docs to support Unity Package Manager ([bdc891a](https://github.com/mob-sakai/UIEffect/commit/bdc891a88ea2b9456276cfe99286c2e799e9c36b)), closes [#141](https://github.com/mob-sakai/UIEffect/issues/141)
* update the effect architecture ([4c08c8c](https://github.com/mob-sakai/UIEffect/commit/4c08c8c1621cc8d3a1f5d834c77d925b51331cd5)), closes [#202](https://github.com/mob-sakai/UIEffect/issues/202) [#198](https://github.com/mob-sakai/UIEffect/issues/198) [#195](https://github.com/mob-sakai/UIEffect/issues/195) [#189](https://github.com/mob-sakai/UIEffect/issues/189) [#173](https://github.com/mob-sakai/UIEffect/issues/173) [#104](https://github.com/mob-sakai/UIEffect/issues/104)
* update the structure of shaders ([db06e68](https://github.com/mob-sakai/UIEffect/commit/db06e68cfbe3a89e7de9d6ceef841f29f99611a5))
* updated the Unity version used for development to 2018.3 ([c5f22c1](https://github.com/mob-sakai/UIEffect/commit/c5f22c1a3915dd9935b983af1971fa6018f2f320)), closes [#169](https://github.com/mob-sakai/UIEffect/issues/169)
### BREAKING CHANGES
* Scenes, prefabs and scripts using UIEffect v3.x may not work properly.
* The recommended Unity version is 2018.1 or later; it will work with Unity 2017.1, but it is not guaranteed to be supported.
* UIEffectCapturedImage will be supported by another package.
* TextMeshPro support has been removed from this package. It will be supported by another package.
<br><br><br><br>
# Changelog before version 4.0.0
## [v3.2.0](https://github.com/mob-sakai/UIEffect/tree/v3.2.0) (2019-07-17)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v3.1.0...v3.2.0)
**Breaking changes:**
- UICapturedImage: Immediate capturing option is removed as it does not work on many platforms [\#161](https://github.com/mob-sakai/UIEffect/issues/161)
**Implemented enhancements:**
- Add demo for Unity 2018+ and TMPro 1.2+ [\#166](https://github.com/mob-sakai/UIEffect/issues/166)
**Fixed bugs:**
- UIDissolve's "Reverse Play" option works only in OnEnable [\#183](https://github.com/mob-sakai/UIEffect/issues/183)
- CanvasGroup.alpha does not affect [\#180](https://github.com/mob-sakai/UIEffect/issues/180)
- UIShiny effect remain on screen after calling Stop\(\) [\#165](https://github.com/mob-sakai/UIEffect/issues/165)
- Material caching is not working properly [\#163](https://github.com/mob-sakai/UIEffect/issues/163)
- Add a null check to TMPro sprite asset material checking [\#176](https://github.com/mob-sakai/UIEffect/pull/176) ([Oskiii](https://github.com/Oskiii))
## [v3.1.0](https://github.com/mob-sakai/UIEffect/tree/v3.1.0) (2019-03-10)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v3.0.4...v3.1.0)
## Support TextMeshPro!
* All components are supported
* Advanced blur is supported for Unity 2017.1+
![](https://user-images.githubusercontent.com/12690315/53533025-8495d800-3b3c-11e9-9e94-320f3ec7ad74.png)
For details to use, see [Usage with TextMeshPro](https://github.com/mob-sakai/UIEffect#usage-with-textmeshpro)
**NOTE: Unity 5.x will not be supported in the near future**
**Implemented enhancements:**
- Support TextMeshPro [\#137](https://github.com/mob-sakai/UIEffect/issues/137)
- add reverse animation option to UIDissolve [\#153](https://github.com/mob-sakai/UIEffect/pull/153) ([antpaw](https://github.com/antpaw))
## [v3.0.4](https://github.com/mob-sakai/UIEffect/tree/v3.0.4) (2019-02-15)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v3.0.3...v3.0.4)
**Implemented enhancements:**
- add initial play animation delay option to UIShiny [\#147](https://github.com/mob-sakai/UIEffect/pull/147) ([antpaw](https://github.com/antpaw))
**Fixed bugs:**
- UIEffectCapturedImage.effectColor does not work as expected [\#148](https://github.com/mob-sakai/UIEffect/issues/148)
- fix warnings [\#146](https://github.com/mob-sakai/UIEffect/pull/146) ([antpaw](https://github.com/antpaw))
## [v3.0.3](https://github.com/mob-sakai/UIEffect/tree/v3.0.3) (2019-01-21)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v3.0.2...v3.0.3)
**Fixed bugs:**
- UIHsvModifier works only on gamma-space [\#145](https://github.com/mob-sakai/UIEffect/issues/145)
## [v3.0.2](https://github.com/mob-sakai/UIEffect/tree/v3.0.2) (2019-01-15)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v3.0.1...v3.0.2)
**Fixed bugs:**
- UIEffect & UIHsvModifier & UITransitionEffect Strange action [\#144](https://github.com/mob-sakai/UIEffect/issues/144)
## [v3.0.1](https://github.com/mob-sakai/UIEffect/tree/v3.0.1) (2018-11-07)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v3.0.0...v3.0.1)
**Fixed bugs:**
- Compile error in 2018.3 [\#139](https://github.com/mob-sakai/UIEffect/issues/139)
## [v3.0.0](https://github.com/mob-sakai/UIEffect/tree/v3.0.0) (2018-10-09)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v2.8.3...v3.0.0)
### New architecture: easier, faster and more beautiful.
* Simple & easy-to-use
* 20% faster
* High precision parameter
### Immediate capturing (UIEffectCapturedImage option)
* Capture the previous frame immediately without any camera.
* You no longer have to wait one frame to capture!
* *NOTE: LWRP, WebGL and Unity 5.x for iOS/Mac are not supported.*
### Advanced blur (UIEffect option)
* Remove common artifacts in the blur effect for uGUI.
![](https://user-images.githubusercontent.com/12690315/42547121-80134788-84fb-11e8-97a0-048bba9634ea.png)
* It is effective for small padding size atlases, including dynamic fonts!
**Breaking changes:**
- UIEffectCapturedImage: Remove 'TargetTexture' feature [\#136](https://github.com/mob-sakai/UIEffect/issues/136)
- Remove 'additional shadow' in UIShadow component [\#110](https://github.com/mob-sakai/UIEffect/issues/110)
- Remove 'custom effect' feature in UIEffect component [\#98](https://github.com/mob-sakai/UIEffect/issues/98)
- Remove 'shadow effect' feature in UIEffect component [\#97](https://github.com/mob-sakai/UIEffect/issues/97)
- Remove 'hue effect' in UIEffect component [\#91](https://github.com/mob-sakai/UIEffect/issues/91)
- Remove 'cutoff' and 'mono' effect in UIEffect component [\#78](https://github.com/mob-sakai/UIEffect/issues/78)
- New architecture: Shared texture for effect parameter [\#63](https://github.com/mob-sakai/UIEffect/issues/63)
- Change: Change `ToneMode` to `EffectMode` [\#61](https://github.com/mob-sakai/UIEffect/issues/61)
- Separate shadow effect to other component [\#52](https://github.com/mob-sakai/UIEffect/issues/52)
- Use the graphic color as effect color, to reduce parameters [\#50](https://github.com/mob-sakai/UIEffect/issues/50)
**Implemented enhancements:**
- UITransitionEffect: "Pass ray on hidden" option [\#135](https://github.com/mob-sakai/UIEffect/issues/135)
- Add component menu in editor [\#133](https://github.com/mob-sakai/UIEffect/issues/133)
- UITransitionEffect: Add Show/Hide method [\#132](https://github.com/mob-sakai/UIEffect/issues/132)
- UIEffectCapturedImage: Immediate capturing [\#130](https://github.com/mob-sakai/UIEffect/issues/130)
- Improve blurring for atlas [\#95](https://github.com/mob-sakai/UIEffect/issues/95)
- Use Canvas.willRenderCanvases event instead of Update method [\#87](https://github.com/mob-sakai/UIEffect/issues/87)
**Closed issues:**
- Add tooltip [\#92](https://github.com/mob-sakai/UIEffect/issues/92)
- UIShiny: change parameter name `highlight` to `gloss` [\#93](https://github.com/mob-sakai/UIEffect/issues/93)
## [v2.8.3](https://github.com/mob-sakai/UIEffect/tree/v2.8.3) (2018-09-29)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v2.8.2...v2.8.3)
**Fixed bugs:**
- UIEffectCapturedImage: Black screen with Unity 2018.1+ editor on Windows [\#131](https://github.com/mob-sakai/UIEffect/issues/131)
## [v2.8.2](https://github.com/mob-sakai/UIEffect/tree/v2.8.2) (2018-09-26)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v2.8.1...v2.8.2)
**Fixed bugs:**
- UICapturedEffectImage does not work with 'ScreenSpace - Overlay' in edit mode [\#128](https://github.com/mob-sakai/UIEffect/issues/128)
- The UIEffectCapturedImage is upside down with 'ScreenSpace - Overlay' mode [\#127](https://github.com/mob-sakai/UIEffect/issues/127)
- When "UI-Effect.mat" is created automatically, Unity hangs up. [\#126](https://github.com/mob-sakai/UIEffect/issues/126)
- UICapturedEffectImage does not work with Lightweight Render Pipeline LWRP [\#125](https://github.com/mob-sakai/UIEffect/issues/125)
## [v2.8.1](https://github.com/mob-sakai/UIEffect/tree/v2.8.1) (2018-08-17)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v2.8.0...v2.8.1)
**Fixed bugs:**
- \(Demo\) "Transition capture & dissolve" is incorrect [\#119](https://github.com/mob-sakai/UIEffect/issues/119)
## [v2.8.0](https://github.com/mob-sakai/UIEffect/tree/v2.8.0) (2018-08-14)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v2.7.1...v2.8.0)
* Create a screen transition!
![8 -08-2018 19-29-38](https://user-images.githubusercontent.com/12690315/43832265-dbdecc98-9b41-11e8-8ab5-9f49420a6a16.gif)
* Some updates make UIEffectCapturedImage easier to use!
**Implemented enhancements:**
- UIEffectCapturedImage: Supports 'ScreenSpace - Overlay' [\#115](https://github.com/mob-sakai/UIEffect/issues/115)
- UIEffectCapturedImage: Keep aspect ratio [\#114](https://github.com/mob-sakai/UIEffect/issues/114)
- UIEffectCapturedImage: 'Capture on enable' option [\#113](https://github.com/mob-sakai/UIEffect/issues/113)
- UITransitionEffect: Change transition texture [\#111](https://github.com/mob-sakai/UIEffect/issues/111)
**Closed issues:**
- UIEffectCapturedImage: change parameter name `keepCanvasSize` to `fitToScreen` [\#116](https://github.com/mob-sakai/UIEffect/issues/116)
## [v2.7.1](https://github.com/mob-sakai/UIEffect/tree/v2.7.1) (2018-08-06)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v2.7.0...v2.7.1)
**Fixed bugs:**
- In v2.7.0, UIEffectCapturedImage is flipped vertically on Windows [\#112](https://github.com/mob-sakai/UIEffect/issues/112)
## [v2.7.0](https://github.com/mob-sakai/UIEffect/tree/v2.7.0) (2018-07-26)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v2.6.2...v2.7.0)
UIHsvModifier: Modify hue, saturation, and value as you like!
![](https://user-images.githubusercontent.com/12690315/43200006-d6e2bf54-904e-11e8-9f22-0c0f9ce5912f.gif)
* Note: `Hue` mode in UIEffect component will be obsolete in the near future. Please use UIHsvModifier component instead.
* Note: `Cutoff` and `Mono` mode in UIEffect component will be obsolete in the near future. Please use UITransitionEffect component instead.
**Implemented enhancements:**
- UIEffectCapturedImage: Support target RenderTexture to use external component [\#108](https://github.com/mob-sakai/UIEffect/issues/108)
- Transition effect as other component [\#105](https://github.com/mob-sakai/UIEffect/issues/105)
- Use multi-pass blurring to capture screenshot [\#96](https://github.com/mob-sakai/UIEffect/issues/96)
- Feature: HSV modifier [\#44](https://github.com/mob-sakai/UIEffect/issues/44)
**Fixed bugs:**
- UIEffectCapturedImage: ColorMode is not working [\#109](https://github.com/mob-sakai/UIEffect/issues/109)
- UIDissolve is not maskable [\#101](https://github.com/mob-sakai/UIEffect/issues/101)
## [v2.6.2](https://github.com/mob-sakai/UIEffect/tree/v2.6.2) (2018-07-18)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v2.6.1...v2.6.2)
**Fixed bugs:**
- Shader has compile errors in D3D9 or D3D11\_9X\(WSA\) [\#99](https://github.com/mob-sakai/UIEffect/issues/99)
## [v2.6.1](https://github.com/mob-sakai/UIEffect/tree/v2.6.1) (2018-06-14)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v2.6.0...v2.6.1)
**Fixed bugs:**
- Errors occurred on build \(v2.6.0\) [\#90](https://github.com/mob-sakai/UIEffect/issues/90)
## [v2.6.0](https://github.com/mob-sakai/UIEffect/tree/v2.6.0) (2018-06-14)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v2.5.2...v2.6.0)
Blurring effect has been improved about 6 times faster!
![](https://user-images.githubusercontent.com/12690315/41393724-08420b1e-6fe2-11e8-8741-721789c2d029.png)
You can change noise texture for dissolve effect from inspector or script!
![](https://user-images.githubusercontent.com/12690315/41397570-99bda636-6fef-11e8-827b-932d7a8e74c1.gif)
**Implemented enhancements:**
- Improve blurring performance [\#88](https://github.com/mob-sakai/UIEffect/issues/88)
- Separate the effect with a character [\#86](https://github.com/mob-sakai/UIEffect/issues/86)
- Change dissolve texture [\#75](https://github.com/mob-sakai/UIEffect/issues/75)
**Closed issues:**
- Change BlurMode correctly [\#84](https://github.com/mob-sakai/UIEffect/issues/84)
- Refactoring to prepare v3.0.0 [\#83](https://github.com/mob-sakai/UIEffect/issues/83)
- Change ColorMode correctly [\#51](https://github.com/mob-sakai/UIEffect/issues/51)
## [v2.5.2](https://github.com/mob-sakai/UIEffect/tree/v2.5.2) (2018-06-07)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v2.5.1...v2.5.2)
**Fixed bugs:**
- When `UIEFFECT\_SEPARATE` symbol is defined, UIDissolve does not work well [\#85](https://github.com/mob-sakai/UIEffect/issues/85)
## [v2.5.1](https://github.com/mob-sakai/UIEffect/tree/v2.5.1) (2018-05-31)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v2.5.0...v2.5.1)
**Fixed bugs:**
- Fix demo [\#82](https://github.com/mob-sakai/UIEffect/issues/82)
## [v2.5.0](https://github.com/mob-sakai/UIEffect/tree/v2.5.0) (2018-05-31)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v2.4.1...v2.5.0)
Shiny effect has been update!
![v2.5.0](https://user-images.githubusercontent.com/12690315/40654533-8877c99c-6379-11e8-8ae7-b91995fc230b.gif)
* NOTE: `UIEffect.shadow***` will be obsolete in the near future. Please use `UIShadow` component instead.
* NOTE: `UIEffect.custom***` will be obsolete in the near future. Please use `UICustomEffect` component (experimental) instead.
**Implemented enhancements:**
- UIDissolve: Play effect from script/inspector [\#81](https://github.com/mob-sakai/UIEffect/issues/81)
- UIShiny: Play effect from script/inspector [\#80](https://github.com/mob-sakai/UIEffect/issues/80)
- During play mode, you can change the effect type, color type, and blur type \(in Editor\) [\#73](https://github.com/mob-sakai/UIEffect/issues/73)
- Add shadow effect as other component [\#72](https://github.com/mob-sakai/UIEffect/issues/72)
- UIShiny : Visual update [\#68](https://github.com/mob-sakai/UIEffect/issues/68)
- Add Custom effect as other component [\#60](https://github.com/mob-sakai/UIEffect/issues/60)
**Fixed bugs:**
- UIDissolve: When width=1 and location=0, image is lacked [\#79](https://github.com/mob-sakai/UIEffect/issues/79)
**Closed issues:**
- UIEffect inherit UIEffectBase [\#74](https://github.com/mob-sakai/UIEffect/issues/74)
- Change directory structure [\#56](https://github.com/mob-sakai/UIEffect/issues/56)
## [v2.4.1](https://github.com/mob-sakai/UIEffect/tree/v2.4.1) (2018-05-29)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v2.4.0...v2.4.1)
**Fixed bugs:**
- UIEffectCapturedImage: The result image is flipped vertically [\#69](https://github.com/mob-sakai/UIEffect/issues/69)
## [v2.4.0](https://github.com/mob-sakai/UIEffect/tree/v2.4.0) (2018-05-21)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v2.3.2...v2.4.0)
UIDissolve has been updated!
![v2.4.0](https://user-images.githubusercontent.com/12690315/40294019-a0bfb8aa-5d0e-11e8-8451-873502db6a99.gif)
![editor](https://user-images.githubusercontent.com/12690315/40294212-9e1b1ce2-5d0f-11e8-88ce-78a8c0523dc2.png)
**Implemented enhancements:**
- UIDissolve: Add color mode option. [\#64](https://github.com/mob-sakai/UIEffect/issues/64)
## [v2.3.2](https://github.com/mob-sakai/UIEffect/tree/v2.3.2) (2018-05-21)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v2.3.1...v2.3.2)
**Closed issues:**
- Fixed: UIEffectCapturedImage: When iteration count is even. the result image is flipped vertically \(other method\) [\#65](https://github.com/mob-sakai/UIEffect/issues/65)
## [v2.3.1](https://github.com/mob-sakai/UIEffect/tree/v2.3.1) (2018-05-10)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v2.3.0...v2.3.1)
**Fixed bugs:**
- UIEffectCapturedImage: When iteration count is even. the result image is flipped vertically \(on Windows\) [\#62](https://github.com/mob-sakai/UIEffect/issues/62)
## [v2.3.0](https://github.com/mob-sakai/UIEffect/tree/v2.3.0) (2018-05-08)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v2.2.0...v2.3.0)
New components has been available!
* **UIShiny** : Shiny effect WITHOUT Mask component. This will suppress extra draw calls and improve performance.
* **UIDissolve** : Dissolve effect WITHOUT material instancing. This will suppress extra draw calls and improve performance.
* **UIFlip** : Flip graphic horizontal/vertical.
![v2.3.0](https://user-images.githubusercontent.com/12690315/40706142-cb98d2d0-6427-11e8-96fc-5cc5fd9c553a.gif)
**Implemented enhancements:**
- Feature: Flip horizontal/vertical [\#47](https://github.com/mob-sakai/UIEffect/issues/47)
- Feature: Dissolve [\#45](https://github.com/mob-sakai/UIEffect/issues/45)
- Feature: Shining effect [\#9](https://github.com/mob-sakai/UIEffect/issues/9)
## [v2.2.0](https://github.com/mob-sakai/UIEffect/tree/v2.2.0) (2018-04-12)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v2.1.0...v2.2.0)
**Implemented enhancements:**
- Feature: Customize shader/material. You can create a custom ui shader and control it with UIEffct. [\#46](https://github.com/mob-sakai/UIEffect/issues/46)
- Feature: UIEffectCapturedImage supports keep canvas size. [\#54](https://github.com/mob-sakai/UIEffect/issues/54)
- Feature: UIEffectCapturedImage supports `Quality Type` to easy setup. [\#53](https://github.com/mob-sakai/UIEffect/issues/53)
**Fixed bugs:**
- Bug: Color effect on shadow is incorrect. [\#55](https://github.com/mob-sakai/UIEffect/issues/55)
**Closed issues:**
- Change: Reduce the pixelation effect when tone level = 1. [\#57](https://github.com/mob-sakai/UIEffect/issues/57)
## [v2.1.0](https://github.com/mob-sakai/UIEffect/tree/v2.1.0) (2018-04-04)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v2.0.0...v2.1.0)
**Implemented enhancements:**
- Feature: UIEffectCapturedImage support iterative operation [\#48](https://github.com/mob-sakai/UIEffect/issues/48)
## [v2.0.0](https://github.com/mob-sakai/UIEffect/tree/v2.0.0) (2018-01-25)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v1.6.1...v2.0.0)
**Breaking changes:**
- Important: Unity 5.3.x & 5.4.x are no longer supported. [\#40](https://github.com/mob-sakai/UIEffect/issues/40)
**Implemented enhancements:**
- Improve: Reduce the materials. Too many effect materials are exist. [\#15](https://github.com/mob-sakai/UIEffect/issues/15)
**Closed issues:**
- Change: Change namespace to Coffee.UIExtensions [\#6](https://github.com/mob-sakai/UIEffect/issues/6)
## [v1.6.1](https://github.com/mob-sakai/UIEffect/tree/v1.6.1) (2018-01-25)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v1.6.0...v1.6.1)
**Fixed bugs:**
- Bug: Cannot access protected member `UnityEngine.UI.BaseMeshEffect.graphic` [\#41](https://github.com/mob-sakai/UIEffect/issues/41)
## [v1.6.0](https://github.com/mob-sakai/UIEffect/tree/v1.6.0) (2018-01-18)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v1.5.1...v1.6.0)
**Fixed bugs:**
- Bug: Pixelization is incorrect. [\#34](https://github.com/mob-sakai/UIEffect/issues/34)
**Closed issues:**
- Change: UIEffect inherit BaseMeshEffect. [\#35](https://github.com/mob-sakai/UIEffect/issues/35)
- Change: Blur level range to \[0-1\] [\#32](https://github.com/mob-sakai/UIEffect/issues/32)
- Change: ShadowMode -\> ShadowStyle [\#18](https://github.com/mob-sakai/UIEffect/issues/18)
## [v1.5.1](https://github.com/mob-sakai/UIEffect/tree/v1.5.1) (2018-01-18)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v1.5.0...v1.5.1)
**Fixed bugs:**
- Bug: An error occurs when no effect is specified for UICapturedImage. [\#36](https://github.com/mob-sakai/UIEffect/issues/36)
## [v1.5.0](https://github.com/mob-sakai/UIEffect/tree/v1.5.0) (2018-01-16)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v1.4.4...v1.5.0)
**Implemented enhancements:**
- Feature: ShadowMode 'Shadow 3' [\#11](https://github.com/mob-sakai/UIEffect/issues/11)
- Feature: Hue [\#8](https://github.com/mob-sakai/UIEffect/issues/8)
- Feature: Gradient [\#7](https://github.com/mob-sakai/UIEffect/issues/7)
## [v1.4.4](https://github.com/mob-sakai/UIEffect/tree/v1.4.4) (2018-01-16)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v1.4.3...v1.4.4)
**Fixed bugs:**
- Bug: Error has occur on edit prefab. [\#27](https://github.com/mob-sakai/UIEffect/issues/27)
## [v1.4.3](https://github.com/mob-sakai/UIEffect/tree/v1.4.3) (2018-01-15)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v1.4.2...v1.4.3)
**Fixed bugs:**
- Bug: Color effect is incorrect. [\#19](https://github.com/mob-sakai/UIEffect/issues/19)
## [v1.4.2](https://github.com/mob-sakai/UIEffect/tree/v1.4.2) (2018-01-14)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v1.4.1...v1.4.2)
**Implemented enhancements:**
- Feature: ColorMode `Override` [\#12](https://github.com/mob-sakai/UIEffect/issues/12)
**Fixed bugs:**
- Bug: Error has occur OnAfterDeserialize in editor. [\#16](https://github.com/mob-sakai/UIEffect/issues/16)
## [v1.4.1](https://github.com/mob-sakai/UIEffect/tree/v1.4.1) (2018-01-10)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v1.4.0...v1.4.1)
## [v1.4.0](https://github.com/mob-sakai/UIEffect/tree/v1.4.0) (2018-01-07)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v1.3.0...v1.4.0)
**Implemented enhancements:**
- Feature: Exclude unused shader variants from build. [\#5](https://github.com/mob-sakai/UIEffect/issues/5)
## [v1.3.0](https://github.com/mob-sakai/UIEffect/tree/v1.3.0) (2018-01-06)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v1.2.0...v1.3.0)
## [v1.2.0](https://github.com/mob-sakai/UIEffect/tree/v1.2.0) (2018-01-05)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v1.1.0...v1.2.0)
**Implemented enhancements:**
- Feature: Fast multiple shadow effect. [\#2](https://github.com/mob-sakai/UIEffect/issues/2)
**Fixed bugs:**
- Pixelaration shifts to the lower right. [\#4](https://github.com/mob-sakai/UIEffect/issues/4)
## [v1.1.0](https://github.com/mob-sakai/UIEffect/tree/v1.1.0) (2017-08-17)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v1.0.0...v1.1.0)
**Implemented enhancements:**
- Feature: Pixelization effect [\#1](https://github.com/mob-sakai/UIEffect/issues/1)
## [v1.0.0](https://github.com/mob-sakai/UIEffect/tree/v1.0.0) (2017-03-01)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/a9c4ec4e72a055ca5e5c24f6a75c6720f0f6fd7f...v1.0.0)
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
-8
View File
@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 5c8ea34522dd786479be28b1347542b7
timeCreated: 1515125149
licenseType: Free
TextScriptImporter:
userData:
assetBundleName:
assetBundleVariant:
+1 -1
View File
@@ -1,4 +1,4 @@
Copyright 2017-2020 mob-sakai
Copyright 2017 mob-sakai
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+43 -186
View File
@@ -1,209 +1,66 @@
UIEffect
===
UIEffect provides visual effect components for Unity UI.
Composite Effect for uGUI.
[![](https://img.shields.io/npm/v/com.coffee.ui-effect?label=openupm&registry_uri=https://package.openupm.com)](https://openupm.com/packages/com.coffee.ui-effect/)
[![](https://img.shields.io/github/v/release/mob-sakai/UIEffect?include_prereleases)](https://github.com/mob-sakai/UIEffect/releases)
[![](https://img.shields.io/github/release-date/mob-sakai/UIEffect.svg)](https://github.com/mob-sakai/UIEffect/releases)
![](https://img.shields.io/badge/unity-2017.1%20or%20later-green.svg)
[![](https://img.shields.io/github/license/mob-sakai/UIEffect.svg)](https://github.com/mob-sakai/UIEffect/blob/master/LICENSE.txt)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-orange.svg)](http://makeapullrequest.com)
[![](https://img.shields.io/github/watchers/mob-sakai/UIEffect.svg?style=social&label=Watch)](https://github.com/mob-sakai/UIEffect/subscription)
[![](https://img.shields.io/twitter/follow/mob_sakai.svg?label=Follow&style=social)](https://twitter.com/intent/follow?screen_name=mob_sakai)
![](http://mob-sakai.github.io/UIEffect/images/demo.gif)
<< [Description](#Description) | [WebGL Demo](#demo) | [Installation](#installation) | [Usage](#usage) | [Example of using](#example-of-using) | [Change log](https://github.com/mob-sakai/UIEffect/blob/upm/CHANGELOG.md) | [Support](#support) >>
![](http://mob-sakai.github.io/UIEffect/images/inspector.png)
## Requirement
* Unity 5.3+
* No other SDK are required.
<br><br><br><br>
## Description
Let's decorate your UI with effects!
You can control parameters as you like from the script as well as inspector.
AnimationClip is supported as a matter of course!
![thumbnail](https://user-images.githubusercontent.com/12690315/41398364-155cf5a6-6ff2-11e8-8124-9d16ef6ca267.gif)
![image](https://user-images.githubusercontent.com/12690315/38594668-636dd3ac-3d82-11e8-9951-820964a6a95f.gif)
<br><br>
#### Available effects
| Component | Features | Screenshot |
| -- | -- | -- |
| **UIEffect** | Combine some visual effects.<br><br>**Effect Mode:** Grayscale, Sepia, Nega, Pixelation<br>**Color Mode:** Multiply, Fill, Additive, Subtract<br>**Blur Mode:** Fast, Medium, Detail<br>**Advanced Blur:** Enable more beautiful blurring. | ![][eff1] |
| **UIShiny** | Apply shining effect to a graphic.<br>The effect does not require Mask component or normal map.<br><br>**Parameters:** Effect factor, Width, Rotation, Softness, Brightness, Gloss | ![][eff2] |
| **UIDissolve** | Apply dissolve effect to a graphic.<br><br>**Color Mode for edge:** Multiply, Fill, Additive, Subtract<br>**Parameters:** Effect factor, Width, Rotation, Softness, Edge color<br>**Options:** Effect area, Keep effect aspect ratio | ![][eff3] |
| **UIHsvModifier** | Modify HSV for graphic.<br><br>**Target:** Color, Range<br>**Adjustment:** Hue, Saturation, Value | ![][eff4] |
| **UITransition Effect** | Apply transition effect with a single channel texture.<br><br>**Effect Mode:** Cutoff, Fade, Dissolve<br>**Options:** Effect area, Keep effect aspect ratio, transition texture<br>**Pass Ray On Hidden:** Disable the graphic's raycastTarget on hidden. | ![][eff5] |
[eff1]:https://user-images.githubusercontent.com/12690315/46639603-258df180-cba2-11e8-8f50-9e93bdc4c96e.png
[eff2]:https://user-images.githubusercontent.com/12690315/46639689-b1078280-cba2-11e8-8716-cbc634af7293.gif
[eff3]:https://user-images.githubusercontent.com/12690315/46639690-b1078280-cba2-11e8-8aa9-1d2650fe9a62.gif
[eff4]:https://user-images.githubusercontent.com/12690315/43200006-d6e2bf54-904e-11e8-9f22-0c0f9ce5912f.gif
[eff5]:https://user-images.githubusercontent.com/12690315/46639688-b1078280-cba2-11e8-8bbb-16b8498bca5f.gif
<br><br>
##### The following effects can be used with the above components.
| Component | Features | Screenshot |
| -- | -- | -- |
| **UIShadow** | Add shadow/outline to a graphic.<br>The performance is better than the default Shadow/Outline component.<br><br>**ShadowStyle:** Shadow, Shadow3, Outline, Outline8 | ![][meff1] |
| **UIGradient** | Change vertex color as gradient with angle and offset.<br><br>**Direction:** Horizontal, Vertical, Angle, Diagonal<br>**Options:** Offset, Color space | ![][meff2] |
| **UIFlip** | Flip a graphic.<br><br>**Direction:** Horizontal, Vertical, Both | ![][meff3] |
[meff1]:https://user-images.githubusercontent.com/12690315/46639604-258df180-cba2-11e8-98a9-aa31f04c695d.png
[meff2]:https://user-images.githubusercontent.com/12690315/40716995-ca87665e-6445-11e8-8233-ec2e21fefd6b.png
[meff3]:https://user-images.githubusercontent.com/12690315/40716996-cab1fd7e-6445-11e8-9753-962d23991d86.png
<br><br><br><br>
## Demo
[WebGL Demo](http://mob-sakai.github.io/UIEffect)
<br><br><br><br>
## Installation
#### Requirement
* Unity 2017.1 or later
* No other SDK are required
#### Using OpenUPM (for Unity 2018.3 or later)
This package is available on [OpenUPM](https://openupm.com).
You can install it via [openupm-cli](https://github.com/openupm/openupm-cli).
```
openupm add com.coffee.ui-effect
```
#### Using Git (for Unity 2018.3 or later)
Find the manifest.json file in the Packages folder of your project and edit it to look like this:
```js
{
"dependencies": {
"com.coffee.ui-effect": "https://github.com/mob-sakai/UIEffect.git",
...
},
}
```
To update the package, change suffix `#{version}` to the target version.
* e.g. `"com.coffee.ui-effect": "https://github.com/mob-sakai/UIEffect.git#4.0.0",`
Or, use [UpmGitExtension](https://github.com/mob-sakai/UpmGitExtension) to install and update the package.
#### For Unity 2018.2 or earlier
1. Download a source code zip file from [Releases](https://github.com/mob-sakai/UIEffect/releases) page
2. Extract it
3. Import it into the following directory in your Unity project
- `Packages` (It works as an embedded package. For Unity 2018.1 or later)
- `Assets` (Legacy way. For Unity 2017.1 or later)
<br><br><br><br>
## How to play demo
- For Unity 2019.1 or later
- Open `Package Manager` window and select `UI Effect` package in package list and click `Demo > Import in project` button
- For Unity 2018.4 or earlier
- Click `Assets/Samples/UIEffect/Import Demo` from menu
The assets will be imported into `Assets/Samples/UI Effect/{version}/Demo`.
Open `
<br><br><br><br>
## Usage
1. Add any effect component to UI element (Image, RawImage, Text, etc...) from `Add Component` in inspector or `Component > UI > UIEffect > ...` menu.
![](https://user-images.githubusercontent.com/12690315/78853708-811c9200-7a5a-11ea-9826-0606046525b6.png)
2. Adjust the parameters of the effect as you like, in inspector.
![](https://user-images.githubusercontent.com/12690315/38594668-636dd3ac-3d82-11e8-9951-820964a6a95f.gif)
3. You can add or modify effects from the script.
```cs
var uieffect = gameObject.AddComponent<UIEffect>();
uieffect.effectMode = EffectMode.Grayscale;
uieffect.effectFactor = 0.85f;
uieffect.colorMode = ColorMode.Add;
uieffect.effectColor = Color.white;
uieffect.colorFactor = 0.1f;
uieffect.blurMode = BlurMode.FastBlur;
uieffect.blurFactor = 1;
```
![](https://user-images.githubusercontent.com/12690315/78853467-e4f28b00-7a59-11ea-82fa-3235aa95e993.png)
4. Enjoy!
1. Download the package from [releases](https://github.com/mob-sakai/UIEffect/releases).
1. Import the package into your Unity project. Select `Import Package > Custom Package` from the `Assets` menu.
1. Add `UIEffect` component to UI element (Image, RawImage, Text, etc...) from `Add Component` in inspector.
1. Enjoy!
<br><br><br><br>
## Example of using
## Demo
UIEffect can easily be used in a variety of cases in the game.
[WebGL Demo](https://mob-sakai.github.io/UIEffect/demo/)
| Case | Description | Screenshot |
| -- | -- | -- |
| Lock/unlock contents | Use UIEffect to apply grayscale.<br>Indicate to user that the content is unavailable. | ![][ex1] |
| Silhouette | Use UIEffect for filling color. | ![][ex2] |
| Soft shadow/<br>Outer glow | Use UIEffect and UIShadow to blur the shadow. | ![][ex3] |
| Colored shadow | Use UIEffect and UIShadow to fill shadow with color. | ![][ex4] |
| Blurred dynamic font | Use UIEffect to blur text.<br>To blur dynamic font cleanly, enable `Advanced Blur` option. | ![][ex5] |
| Text with outline & shadow | Use two UIShadows to add outline and shadow.<br>There is less overdraw than default Outline/Shadow. | ![][ex6] |
| Shining button | Use UIShiny for shining button.<br>Indicate to user that you can press the button. | ![][ex7] |
| Screen transition | Use UITransitionEffect to transition the screen with any transition texture. | ![][ex8] |
[ex1]:https://user-images.githubusercontent.com/12690315/46563469-aba8fe80-c93c-11e8-850f-949f6f8da742.png
[ex2]:https://user-images.githubusercontent.com/12690315/46563576-3db10700-c93d-11e8-960e-4336ff3ce481.png
[ex3]:https://user-images.githubusercontent.com/12690315/46566001-452edb00-c952-11e8-9cc4-6098a9eb67f3.png
[ex4]:https://user-images.githubusercontent.com/12690315/46566000-452edb00-c952-11e8-8d20-6ccc3fa92ae4.png
[ex5]:https://user-images.githubusercontent.com/12690315/46566002-45c77180-c952-11e8-87cb-4d915e0614be.png
[ex6]:https://user-images.githubusercontent.com/12690315/46566003-45c77180-c952-11e8-9b47-7bf563ffbaa7.png
[ex7]:https://user-images.githubusercontent.com/12690315/46563539-fb87c580-c93c-11e8-8c08-0f21872c47d4.gif
[ex8]:https://user-images.githubusercontent.com/12690315/46565182-dfd5ec80-c947-11e8-834f-a2ef67ad0d95.gif
[WebGL Performance Test](https://mob-sakai.github.io/UIEffect/performance_test/)
## Release Notes
### ver.1.0.0
* Feature: Shader supports pre-processer macros (for example UNITY_VERTEX_OUTPUT_STEREO) for Unity 5.3.x, 5.4.x and 5.5.x.
* Feature: Supports changing value from animation (for Unity 5.4+).
* Feature: Supports Tone effect.
* grayscale
* sepia
* nega
* Feature: Supports Color effect.
* set
* add
* sub
* Feature: Supports Blur effect.
* fast
* detail
* Fix: Color effect will not be properly when it was rotated.
* Performance: Shader supports multi-compile for performance.
* Performance: Cache same effect materials to reduce draw calls.
* Improve: Supports mobile devices.
* Improve: Simplify component & inspector.
<br><br><br><br>
## License
* MIT
* © UTJ/UCL
<br><br><br><br>
## Support
This is an open-source project that I am developing in my free time.
If you like it, you can support me.
By supporting, you let me spend more time working on better tools that you can use for free. :)
[![become_a_patron_on_patreon](https://user-images.githubusercontent.com/12690315/50731629-3b18b480-11ad-11e9-8fad-4b13f27969c1.png)](https://www.patreon.com/join/2343451?)
[![become_a_sponsor_on_github](https://user-images.githubusercontent.com/12690315/66942881-03686280-f085-11e9-9586-fc0b6011029f.png)](https://github.com/users/mob-sakai/sponsorship)
MIT
## Author
[mob-sakai](https://github.com/mob-sakai)
[![](https://img.shields.io/twitter/follow/mob_sakai.svg?label=Follow&style=social)](https://twitter.com/intent/follow?screen_name=mob_sakai)
## See Also
* GitHub page : https://github.com/mob-sakai/UIEffect
* Releases : https://github.com/mob-sakai/UIEffect/releases
* Issue tracker : https://github.com/mob-sakai/UIEffect/issues
* Change log : https://github.com/mob-sakai/UIEffect/blob/upm/CHANGELOG.md
[mob-sakai](https://github.com/mob-sakai)
-8
View File
@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: f38c4e6372f684b60a94e0d0b902a98a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

-100
View File
@@ -1,100 +0,0 @@
fileFormatVersion: 2
guid: 3e04c247fb2604af186173fce0bc62de
timeCreated: 1524468976
licenseType: Pro
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
filterMode: 1
aniso: -1
mipBias: -1
wrapMode: 1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 2
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 10
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 256
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Standalone
maxTextureSize: 256
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: iPhone
maxTextureSize: 256
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Android
maxTextureSize: 256
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: WebGL
maxTextureSize: 256
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
-87
View File
@@ -1,87 +0,0 @@
Shader "Hidden/UI/Default (UIDissolve)"
{
Properties
{
[PerRendererData] _MainTex ("Main Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255
_ColorMask ("Color Mask", Float) = 15
[Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0
[Header(Dissolve)]
_TransitionTex ("Transition Texture (A)", 2D) = "white" {}
_ParamTex ("Parameter Texture", 2D) = "white" {}
}
SubShader
{
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
"PreviewType"="Plane"
"CanUseSpriteAtlas"="True"
}
Stencil
{
Ref [_Stencil]
Comp [_StencilComp]
Pass [_StencilOp]
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
}
Cull Off
Lighting Off
ZWrite Off
ZTest [unity_GUIZTestMode]
Blend SrcAlpha OneMinusSrcAlpha
ColorMask [_ColorMask]
Pass
{
Name "Default"
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma target 2.0
#define DISSOLVE 1
#pragma multi_compile __ UNITY_UI_ALPHACLIP
#pragma multi_compile __ ADD SUBTRACT FILL
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#define UI_DISSOLVE 1
#include "UIEffect.cginc"
#include "UIEffectSprite.cginc"
fixed4 frag(v2f IN) : SV_Target
{
half4 color = (tex2D(_MainTex, IN.texcoord) + _TextureSampleAdd) * IN.color;
color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect);
// Dissolve
color = ApplyTransitionEffect(color, IN.eParam);
#ifdef UNITY_UI_ALPHACLIP
clip (color.a - 0.001);
#endif
return color;
}
ENDCG
}
}
}
-12
View File
@@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: e1b48dc831eb147e9886c049033213bf
ShaderImporter:
externalObjects: {}
defaultTextures:
- _MainTex: {instanceID: 0}
- _TransitionTex: {instanceID: 0}
- _ParamTex: {instanceID: 0}
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
-309
View File
@@ -1,309 +0,0 @@
#ifndef UI_EFFECT_INCLUDED
#define UI_EFFECT_INCLUDED
sampler2D _TransitionTex;
sampler2D _ParamTex;
#if GRAYSCALE | SEPIA | NEGA | PIXEL | MONO | CUTOFF | HUE
#define UI_TONE
#endif
#if ADD | SUBTRACT | FILL
#define UI_COLOR
#endif
#if FASTBLUR | MEDIUMBLUR | DETAILBLUR
#define UI_BLUR
#endif
// Unpack float to low-precision [0-1] fixed4.
fixed4 UnpackToVec4(float value)
{
const int PACKER_STEP = 64;
const int PRECISION = PACKER_STEP - 1;
fixed4 unpacked;
unpacked.x = (value % PACKER_STEP) / PRECISION;
value = floor(value / PACKER_STEP);
unpacked.y = (value % PACKER_STEP) / PRECISION;
value = floor(value / PACKER_STEP);
unpacked.z = (value % PACKER_STEP) / PRECISION;
value = floor(value / PACKER_STEP);
unpacked.w = (value % PACKER_STEP) / PRECISION;
return unpacked;
}
// Unpack float to low-precision [0-1] fixed3.
fixed3 UnpackToVec3(float value)
{
const int PACKER_STEP = 256;
const int PRECISION = PACKER_STEP - 1;
fixed3 unpacked;
unpacked.x = (value % (PACKER_STEP)) / (PACKER_STEP - 1);
value = floor(value / (PACKER_STEP));
unpacked.y = (value % PACKER_STEP) / (PACKER_STEP - 1);
value = floor(value / PACKER_STEP);
unpacked.z = (value % PACKER_STEP) / (PACKER_STEP - 1);
return unpacked;
}
// Unpack float to low-precision [0-1] half2.
half2 UnpackToVec2(float value)
{
const int PACKER_STEP = 4096;
const int PRECISION = PACKER_STEP - 1;
half2 unpacked;
unpacked.x = (value % (PACKER_STEP)) / (PACKER_STEP - 1);
value = floor(value / (PACKER_STEP));
unpacked.y = (value % PACKER_STEP) / (PACKER_STEP - 1);
return unpacked;
}
// Sample texture with blurring.
// * Fast: Sample texture with 3x3 kernel.
// * Medium: Sample texture with 5x5 kernel.
// * Detail: Sample texture with 7x7 kernel.
fixed4 Tex2DBlurring (sampler2D tex, half2 texcood, half2 blur, half4 mask)
{
#if FASTBLUR && EX
const int KERNEL_SIZE = 5;
const float KERNEL_[5] = { 0.2486, 0.7046, 1.0, 0.7046, 0.2486};
#elif MEDIUMBLUR && EX
const int KERNEL_SIZE = 9;
const float KERNEL_[9] = { 0.0438, 0.1719, 0.4566, 0.8204, 1.0, 0.8204, 0.4566, 0.1719, 0.0438};
#elif DETAILBLUR && EX
const int KERNEL_SIZE = 13;
const float KERNEL_[13] = { 0.0438, 0.1138, 0.2486, 0.4566, 0.7046, 0.9141, 1.0, 0.9141, 0.7046, 0.4566, 0.2486, 0.1138, 0.0438};
#elif FASTBLUR
const int KERNEL_SIZE = 3;
const float KERNEL_[3] = { 0.4566, 1.0, 0.4566};
#elif MEDIUMBLUR
const int KERNEL_SIZE = 5;
const float KERNEL_[5] = { 0.2486, 0.7046, 1.0, 0.7046, 0.2486};
#elif DETAILBLUR
const int KERNEL_SIZE = 7;
const float KERNEL_[7] = { 0.1719, 0.4566, 0.8204, 1.0, 0.8204, 0.4566, 0.1719};
#else
const int KERNEL_SIZE = 1;
const float KERNEL_[1] = { 1.0 };
#endif
float4 o = 0;
float sum = 0;
float2 shift = 0;
for(int x = 0; x < KERNEL_SIZE; x++)
{
shift.x = blur.x * (float(x) - KERNEL_SIZE/2);
for(int y = 0; y < KERNEL_SIZE; y++)
{
shift.y = blur.y * (float(y) - KERNEL_SIZE/2);
float2 uv = texcood + shift;
float weight = KERNEL_[x] * KERNEL_[y];
sum += weight;
#if EX
fixed masked = min(mask.x <= uv.x, uv.x <= mask.z) * min(mask.y <= uv.y, uv.y <= mask.w);
o += lerp(fixed4(0.5, 0.5, 0.5, 0), tex2D(tex, uv), masked) * weight;
#else
o += tex2D(tex, uv) * weight;
#endif
}
}
return o / sum;
}
// Sample texture with blurring.
// * Fast: Sample texture with 3x3 kernel.
// * Medium: Sample texture with 5x5 kernel.
// * Detail: Sample texture with 7x7 kernel.
fixed4 Tex2DBlurring (sampler2D tex, half2 texcood, half2 blur)
{
return Tex2DBlurring(tex, texcood, blur, half4(0,0,1,1));
}
// Sample texture with blurring.
// * Fast: Sample texture with 3x1 kernel.
// * Medium: Sample texture with 5x1 kernel.
// * Detail: Sample texture with 7x1 kernel.
fixed4 Tex2DBlurring1D (sampler2D tex, half2 uv, half2 blur)
{
#if FASTBLUR
const int KERNEL_SIZE = 3;
#elif MEDIUMBLUR
const int KERNEL_SIZE = 5;
#elif DETAILBLUR
const int KERNEL_SIZE = 7;
#else
const int KERNEL_SIZE = 1;
#endif
float4 o = 0;
float sum = 0;
float weight;
half2 texcood;
for(int i = -KERNEL_SIZE/2; i <= KERNEL_SIZE/2; i++)
{
texcood = uv;
texcood.x += blur.x * i;
texcood.y += blur.y * i;
weight = 1.0/(abs(i)+2);
o += tex2D(tex, texcood)*weight;
sum += weight;
}
return o / sum;
}
fixed3 shift_hue(fixed3 RGB, half VSU, half VSW)
{
fixed3 result;
result.x = (0.299 + 0.701*VSU + 0.168*VSW)*RGB.x
+ (0.587 - 0.587*VSU + 0.330*VSW)*RGB.y
+ (0.114 - 0.114*VSU - 0.497*VSW)*RGB.z;
result.y = (0.299 - 0.299*VSU - 0.328*VSW)*RGB.x
+ (0.587 + 0.413*VSU + 0.035*VSW)*RGB.y
+ (0.114 - 0.114*VSU + 0.292*VSW)*RGB.z;
result.z = (0.299 - 0.3*VSU + 1.25*VSW)*RGB.x
+ (0.587 - 0.588*VSU - 1.05*VSW)*RGB.y
+ (0.114 + 0.886*VSU - 0.203*VSW)*RGB.z;
return result;
}
// Apply tone effect.
fixed4 ApplyToneEffect(fixed4 color, fixed factor)
{
#ifdef GRAYSCALE
color.rgb = lerp(color.rgb, Luminance(color.rgb), factor);
#elif SEPIA
color.rgb = lerp(color.rgb, Luminance(color.rgb) * half3(1.07, 0.74, 0.43), factor);
#elif NEGA
color.rgb = lerp(color.rgb, 1 - color.rgb, factor);
#endif
return color;
}
// Apply color effect.
fixed4 ApplyColorEffect(half4 color, half4 factor)
{
#if FILL
color.rgb = lerp(color.rgb, factor.rgb, factor.a);
#elif ADD
color.rgb += factor.rgb * factor.a;
#elif SUBTRACT
color.rgb -= factor.rgb * factor.a;
#else
color.rgb = lerp(color.rgb, color.rgb * factor.rgb, factor.a);
#endif
#if CUTOFF
color.a = factor.a;
#endif
return color;
}
// Apply transition effect.
fixed4 ApplyTransitionEffect(half4 color, half3 transParam)
{
fixed4 param = tex2D(_ParamTex, float2(0.25, transParam.z));
float alpha = tex2D(_TransitionTex, transParam.xy).a;
#if REVERSE
fixed effectFactor = 1 - param.x;
#else
fixed effectFactor = param.x;
#endif
#if FADE
color.a *= saturate(alpha + (1 - effectFactor * 2));
#elif CUTOFF
color.a *= step(0.001, color.a * alpha - effectFactor);
#elif DISSOLVE
fixed width = param.y/4;
fixed softness = param.z;
fixed3 dissolveColor = tex2D(_ParamTex, float2(0.75, transParam.z)).rgb;
float factor = alpha - effectFactor * ( 1 + width ) + width;
fixed edgeLerp = step(factor, color.a) * saturate((width - factor)*16/ softness);
color = ApplyColorEffect(color, fixed4(dissolveColor, edgeLerp));
color.a *= saturate((factor)*32/ softness);
#endif
return color;
}
// Apply shiny effect.
half4 ApplyShinyEffect(half4 color, half2 shinyParam)
{
fixed nomalizedPos = shinyParam.x;
fixed4 param1 = tex2D(_ParamTex, float2(0.25, shinyParam.y));
fixed4 param2 = tex2D(_ParamTex, float2(0.75, shinyParam.y));
half location = param1.x * 2 - 0.5;
fixed width = param1.y;
fixed soft = param1.z;
fixed brightness = param1.w;
fixed gloss = param2.x;
half normalized = 1 - saturate(abs((nomalizedPos - location) / width));
half shinePower = smoothstep(0, soft, normalized);
half3 reflectColor = lerp(fixed3(1,1,1), color.rgb * 7, gloss);
color.rgb += color.a * (shinePower / 2) * brightness * reflectColor;
return color;
}
half3 RgbToHsv(half3 c) {
half4 K = half4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
half4 p = lerp(half4(c.bg, K.wz), half4(c.gb, K.xy), step(c.b, c.g));
half4 q = lerp(half4(p.xyw, c.r), half4(c.r, p.yzx), step(p.x, c.r));
half d = q.x - min(q.w, q.y);
half e = 1.0e-10;
return half3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
}
half3 HsvToRgb(half3 c) {
c = half3(c.x, clamp(c.yz, 0.0, 1.0));
half4 K = half4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
half3 p = abs(frac(c.xxx + K.xyz) * 6.0 - K.www);
return c.z * lerp(K.xxx, clamp(p.xyz - K.xxx, 0.0, 1.0), c.y);
}
// Apply Hsv effect.
half4 ApplyHsvEffect(half4 color, half param)
{
fixed4 param1 = tex2D(_ParamTex, float2(0.25, param));
fixed4 param2 = tex2D(_ParamTex, float2(0.75, param));
fixed3 targetHsv = param1.rgb;
fixed3 targetRange = param1.w;
fixed3 hsvShift = param2.xyz - 0.5;
half3 hsv = RgbToHsv(color.rgb);
half3 range = abs(hsv - targetHsv);
half diff = max(max(min(1-range.x, range.x), min(1-range.y, range.y)/10), min(1-range.z, range.z)/10);
fixed masked = step(diff, targetRange);
color.rgb = HsvToRgb(hsv + hsvShift * masked);
return color;
}
#endif // UI_EFFECT_INCLUDED
-113
View File
@@ -1,113 +0,0 @@
Shader "Hidden/UI/Default (UIEffect)"
{
Properties
{
[PerRendererData] _MainTex ("Main Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255
_ColorMask ("Color Mask", Float) = 15
[Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0
_ParamTex ("Parameter Texture", 2D) = "white" {}
}
SubShader
{
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
"PreviewType"="Plane"
"CanUseSpriteAtlas"="True"
}
Stencil
{
Ref [_Stencil]
Comp [_StencilComp]
Pass [_StencilOp]
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
}
Cull Off
Lighting Off
ZWrite Off
ZTest [unity_GUIZTestMode]
Blend SrcAlpha OneMinusSrcAlpha
ColorMask [_ColorMask]
Pass
{
Name "Default"
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#if !defined(SHADER_API_D3D11_9X) && !defined(SHADER_API_D3D9)
#pragma target 2.0
#else
#pragma target 3.0
#endif
#pragma multi_compile __ UNITY_UI_ALPHACLIP
#pragma multi_compile __ GRAYSCALE SEPIA NEGA PIXEL
#pragma multi_compile __ ADD SUBTRACT FILL
#pragma multi_compile __ FASTBLUR MEDIUMBLUR DETAILBLUR
#pragma multi_compile __ EX
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#define UI_EFFECT 1
#include "UIEffect.cginc"
#include "UIEffectSprite.cginc"
fixed4 frag(v2f IN) : SV_Target
{
fixed4 param = tex2D(_ParamTex, float2(0.25, IN.eParam));
fixed effectFactor = param.x;
fixed colorFactor = param.y;
fixed blurFactor = param.z;
#if PIXEL
half2 pixelSize = max(2, (1-effectFactor*0.95) * _MainTex_TexelSize.zw);
IN.texcoord = round(IN.texcoord * pixelSize) / pixelSize;
#endif
#if defined(UI_BLUR) && EX
half4 color = (Tex2DBlurring(_MainTex, IN.texcoord, blurFactor * _MainTex_TexelSize.xy * 2, IN.uvMask) + _TextureSampleAdd);
#elif defined(UI_BLUR)
half4 color = (Tex2DBlurring(_MainTex, IN.texcoord, blurFactor * _MainTex_TexelSize.xy * 2) + _TextureSampleAdd);
#else
half4 color = (tex2D(_MainTex, IN.texcoord) + _TextureSampleAdd);
#endif
color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect);
#if UNITY_UI_ALPHACLIP
clip (color.a - 0.001);
#endif
#if defined (UI_TONE)
color = ApplyToneEffect(color, effectFactor);
#endif
color = ApplyColorEffect(color, fixed4(IN.color.rgb, colorFactor));
color.a *= IN.color.a;
return color;
}
ENDCG
}
}
}
-75
View File
@@ -1,75 +0,0 @@
#ifndef UI_EFFECT_SPRITE_INCLUDED
#define UI_EFFECT_SPRITE_INCLUDED
fixed4 _Color;
fixed4 _TextureSampleAdd;
float4 _ClipRect;
sampler2D _MainTex;
float4 _MainTex_TexelSize;
struct appdata_t
{
float4 vertex : POSITION;
float4 color : COLOR;
float2 texcoord : TEXCOORD0;
#if EX
float2 uvMask : TEXCOORD1;
#endif
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f
{
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
half2 texcoord : TEXCOORD0;
float4 worldPosition : TEXCOORD1;
#if UI_DISSOLVE || UI_TRANSITION
half3 eParam : TEXCOORD2;
#elif UI_SHINY
half2 eParam : TEXCOORD2;
#else
half eParam : TEXCOORD2;
#endif
#if EX
half4 uvMask : TEXCOORD3;
#endif
UNITY_VERTEX_OUTPUT_STEREO
};
v2f vert(appdata_t IN)
{
v2f OUT;
UNITY_SETUP_INSTANCE_ID(IN);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT);
OUT.worldPosition = IN.vertex;
OUT.vertex = UnityObjectToClipPos(OUT.worldPosition);
#if UI_EFFECT
OUT.texcoord = UnpackToVec2(IN.texcoord.x) * 2 - 0.5;
#else
OUT.texcoord = UnpackToVec2(IN.texcoord.x);
#endif
#ifdef UNITY_HALF_TEXEL_OFFSET
OUT.vertex.xy += (_ScreenParams.zw-1.0)*float2(-1,1);
#endif
OUT.color = IN.color * _Color;
#if UI_DISSOLVE || UI_TRANSITION
OUT.eParam = UnpackToVec3(IN.texcoord.y);
#elif UI_SHINY
OUT.eParam = UnpackToVec2(IN.texcoord.y);
#else
OUT.eParam = IN.texcoord.y;
#endif
#if EX
OUT.uvMask = half4(UnpackToVec2(IN.uvMask.x), UnpackToVec2(IN.uvMask.y));
#endif
return OUT;
}
#endif // UI_EFFECT_SPRITE_INCLUDED
-9
View File
@@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: dd60a36b172cf49e2b82258a68799ce3
timeCreated: 1487915863
licenseType: Pro
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
-79
View File
@@ -1,79 +0,0 @@
Shader "Hidden/UI/Default (UIHsvModifier)"
{
Properties
{
[PerRendererData] _MainTex ("Main Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255
_ColorMask ("Color Mask", Float) = 15
[Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0
_ParamTex ("Parameter Texture", 2D) = "white" {}
}
SubShader
{
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
"PreviewType"="Plane"
"CanUseSpriteAtlas"="True"
}
Stencil
{
Ref [_Stencil]
Comp [_StencilComp]
Pass [_StencilOp]
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
}
Cull Off
Lighting Off
ZWrite Off
ZTest [unity_GUIZTestMode]
Blend SrcAlpha OneMinusSrcAlpha
ColorMask [_ColorMask]
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile __ UNITY_UI_ALPHACLIP
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#define UI_HSV_MODIFIER 1
#include "UIEffect.cginc"
#include "UIEffectSprite.cginc"
fixed4 frag(v2f IN) : COLOR
{
half4 color = tex2D(_MainTex, IN.texcoord);// + _TextureSampleAdd) * IN.color;
color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect);
#ifdef UNITY_UI_ALPHACLIP
clip (color.a - 0.001);
#endif
color = ApplyHsvEffect(color, IN.eParam);
return (color + _TextureSampleAdd) * IN.color;
}
ENDCG
}
}
}
-9
View File
@@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 7fc74090480c84f8b977cfcd55cdfe82
timeCreated: 1531882595
licenseType: Pro
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
-82
View File
@@ -1,82 +0,0 @@
Shader "Hidden/UI/Default (UIShiny)"
{
Properties
{
[PerRendererData] _MainTex ("Main Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255
_ColorMask ("Color Mask", Float) = 15
[Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0
_ParamTex ("Parameter Texture", 2D) = "white" {}
}
SubShader
{
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
"PreviewType"="Plane"
"CanUseSpriteAtlas"="True"
}
Stencil
{
Ref [_Stencil]
Comp [_StencilComp]
Pass [_StencilOp]
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
}
Cull Off
Lighting Off
ZWrite Off
ZTest [unity_GUIZTestMode]
Blend SrcAlpha OneMinusSrcAlpha
ColorMask [_ColorMask]
Pass
{
Name "Default"
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma target 2.0
#pragma multi_compile __ UNITY_UI_ALPHACLIP
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#define UI_SHINY 1
#include "UIEffect.cginc"
#include "UIEffectSprite.cginc"
fixed4 frag(v2f IN) : SV_Target
{
half4 color = (tex2D(_MainTex, IN.texcoord) + _TextureSampleAdd) * IN.color;
color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect);
color = ApplyShinyEffect(color, IN.eParam);
#ifdef UNITY_UI_ALPHACLIP
clip (color.a - 0.001);
#endif
return color;
}
ENDCG
}
}
}
-9
View File
@@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 20ffe76c2439c403aabdd25bd94bf011
timeCreated: 1523859834
licenseType: Pro
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
-87
View File
@@ -1,87 +0,0 @@
Shader "Hidden/UI/Default (UITransition)"
{
Properties
{
[PerRendererData] _MainTex ("Main Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255
_ColorMask ("Color Mask", Float) = 15
[Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0
[Header(Transition)]
_TransitionTex ("Transition Texture (A)", 2D) = "white" {}
_ParamTex ("Parameter Texture", 2D) = "white" {}
}
SubShader
{
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
"PreviewType"="Plane"
"CanUseSpriteAtlas"="True"
}
Stencil
{
Ref [_Stencil]
Comp [_StencilComp]
Pass [_StencilOp]
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
}
Cull Off
Lighting Off
ZWrite Off
ZTest [unity_GUIZTestMode]
Blend SrcAlpha OneMinusSrcAlpha
ColorMask [_ColorMask]
Pass
{
Name "Default"
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma target 2.0
#define REVERSE 1
#define ADD 1
#pragma multi_compile __ UNITY_UI_ALPHACLIP
#pragma multi_compile __ FADE CUTOFF DISSOLVE
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#define UI_TRANSITION 1
#include "UIEffect.cginc"
#include "UIEffectSprite.cginc"
fixed4 frag(v2f IN) : SV_Target
{
half4 color = (tex2D(_MainTex, IN.texcoord) + _TextureSampleAdd);
color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect);
color = ApplyTransitionEffect(color, IN.eParam) * IN.color;
#if UNITY_UI_ALPHACLIP
clip (color.a - 0.001);
#endif
return color;
}
ENDCG
}
}
}
-12
View File
@@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: 85ad24dd0759947ddb117625e108d49c
timeCreated: 1548078121
licenseType: Pro
ShaderImporter:
defaultTextures:
- _MainTex: {instanceID: 0}
- _NoiseTex: {fileID: 2800000, guid: 3e04c247fb2604af186173fce0bc62de, type: 3}
- _ParamTex: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
-14
View File
@@ -1,14 +0,0 @@
{
"name": "UIEffect_Demo",
"references": [
"UIEffect"
],
"optionalUnityReferences": [],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": false,
"defineConstraints": []
}
-7
View File
@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 3ef9215e2eb5a49b997be297ae25152e
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
-68
View File
@@ -1,68 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace Coffee.UIEffects
{
public class UIEffect_Demo : MonoBehaviour
{
// Use this for initialization
void Start()
{
GetComponentInChildren<RectMask2D>().enabled = true;
}
public void SetTimeScale(float scale)
{
Time.timeScale = scale;
}
public void Open(Animator anim)
{
// anim.GetComponentInChildren<UIEffectCapturedImage>().Capture();
anim.gameObject.SetActive(true);
anim.SetTrigger("Open");
}
public void Close(Animator anim)
{
anim.SetTrigger("Close");
}
public void Capture(Animator anim)
{
// anim.GetComponentInChildren<UIEffectCapturedImage>().Capture();
anim.SetTrigger("Capture");
}
public void SetCanvasOverlay(bool isOverlay)
{
GetComponent<Canvas>().renderMode =
isOverlay ? RenderMode.ScreenSpaceOverlay : RenderMode.ScreenSpaceCamera;
}
public void SetRenderMode(int mode)
{
var canvas = GetComponent<Canvas>();
var cam = canvas.worldCamera;
var pos = new Vector3(0, 0, -25);
var rot = new Vector3(0, 0, 0);
if ((RenderMode) mode == RenderMode.WorldSpace)
{
SetRenderMode((int) RenderMode.ScreenSpaceCamera);
canvas.renderMode = RenderMode.WorldSpace;
pos.x = 45;
rot.y = -20;
}
else
{
canvas.renderMode = (RenderMode) mode;
}
cam.transform.SetPositionAndRotation(pos, Quaternion.Euler(rot));
}
}
}
-12
View File
@@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: e94f1a0bc56a14944aadc5064f5f485a
timeCreated: 1525599611
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
File diff suppressed because it is too large Load Diff
-7
View File
@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: a96de44a548454578a545a818eb14344
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

Before

Width:  |  Height:  |  Size: 143 KiB

-185
View File
@@ -1,185 +0,0 @@
fileFormatVersion: 2
guid: 975570a90d56c477582e12d440dc9931
timeCreated: 1528964000
licenseType: Pro
TextureImporter:
fileIDToRecycleName:
21300000: old_detail
21300002: old_fast
21300004: old_medium
21300006: UIEffect_Demo_Dark_Silhouette
21300008: UIEffect_Demo_Pattern
21300010: UIEffect_Demo_red
21300012: UIEffect_Demo_Unity-chan
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
filterMode: 0
aniso: -1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 2
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Standalone
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: iPhone
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Android
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: WebGL
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
spriteSheet:
serializedVersion: 2
sprites:
- serializedVersion: 2
name: old_detail
rect:
serializedVersion: 2
x: 0
y: 192
width: 106
height: 159
alignment: 0
pivot: {x: 53, y: 79.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
tessellationDetail: -1
- serializedVersion: 2
name: old_fast
rect:
serializedVersion: 2
x: 116
y: 125
width: 106
height: 159
alignment: 0
pivot: {x: 53, y: 79.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
tessellationDetail: -1
- serializedVersion: 2
name: old_medium
rect:
serializedVersion: 2
x: 116
y: 288
width: 106
height: 159
alignment: 0
pivot: {x: 53, y: 79.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
tessellationDetail: -1
- serializedVersion: 2
name: UIEffect_Demo_Dark_Silhouette
rect:
serializedVersion: 2
x: 116
y: 0
width: 140
height: 121
alignment: 0
pivot: {x: 70, y: 60.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
tessellationDetail: -1
- serializedVersion: 2
name: UIEffect_Demo_red
rect:
serializedVersion: 2
x: 0
y: 355
width: 100
height: 100
alignment: 0
pivot: {x: 50, y: 50}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
tessellationDetail: -1
- serializedVersion: 2
name: UIEffect_Demo_Unity-chan
rect:
serializedVersion: 2
x: 0
y: 0
width: 112
height: 188
alignment: 0
pivot: {x: 56, y: 94}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
tessellationDetail: -1
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
@@ -1,50 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;
public class UIEffect_Demo_ColorControl : MonoBehaviour
{
[SerializeField] private Color m_Color;
[SerializeField] private ColorEvent m_ColorEvent = new ColorEvent();
[System.Serializable]
public class ColorEvent : UnityEvent<Color>
{
}
private void Start()
{
var sliders = GetComponentsInChildren<Slider>();
for (var i = 0; i < sliders.Length; i++)
{
var channel = i;
if (channel == 0)
sliders[channel].value = m_Color.r;
else if (channel == 1)
sliders[channel].value = m_Color.g;
else if (channel == 2)
sliders[channel].value = m_Color.b;
else
sliders[channel].value = m_Color.a;
sliders[i].onValueChanged.AddListener(value => ChangeColor(channel, value));
}
}
private void ChangeColor(int channel, float value)
{
var old = m_Color;
if (channel == 0)
m_Color.r = value;
else if (channel == 1)
m_Color.g = value;
else if (channel == 2)
m_Color.b = value;
else
m_Color.a = value;
if (old != m_Color)
m_ColorEvent.Invoke(m_Color);
}
}
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: e9ed27cb508874b4a8f71e05c9119c52
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
File diff suppressed because it is too large Load Diff
Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

@@ -1,100 +0,0 @@
fileFormatVersion: 2
guid: 529a51ce456fc487db93a64ec7937211
timeCreated: 1502934796
licenseType: Pro
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 1
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: -3
maxTextureSize: 512
textureSettings:
filterMode: 1
aniso: -1
mipBias: -1
wrapMode: 1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 2
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 256
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Standalone
maxTextureSize: 256
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: iPhone
maxTextureSize: 256
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Android
maxTextureSize: 256
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: WebGL
maxTextureSize: 256
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
@@ -1,25 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;
public class UIEffect_Demo_PropertyControl : MonoBehaviour
{
[SerializeField] private string m_PropertyName;
[SerializeField] private Object[] m_Objects;
public void ChangeValue(int value)
{
foreach (var o in m_Objects)
{
if (!o) continue;
var p = o.GetType().GetProperty(m_PropertyName);
Debug.LogFormat("{0} {1} {2}", o.GetType(), m_PropertyName, p);
if (p == null) continue;
p.SetValue(o, value, new object[0]);
}
}
}
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 266ce43ae60024ca1844de5ee2a04ea7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
File diff suppressed because it is too large Load Diff
Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

-100
View File
@@ -1,100 +0,0 @@
fileFormatVersion: 2
guid: a74d3d4a498866d44b094d3d3717604d
timeCreated: 1533229728
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: 1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 2
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 10
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 512
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Standalone
maxTextureSize: 512
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Android
maxTextureSize: 512
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: WebGL
maxTextureSize: 512
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: iPhone
maxTextureSize: 512
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

Before

Width:  |  Height:  |  Size: 499 KiB

@@ -1,100 +0,0 @@
fileFormatVersion: 2
guid: 04b808c8e7e2f114aa6bce179817e3b6
timeCreated: 1533229821
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 2
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 10
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 512
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Standalone
maxTextureSize: 512
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Android
maxTextureSize: 512
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: WebGL
maxTextureSize: 512
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: iPhone
maxTextureSize: 512
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

@@ -1,100 +0,0 @@
fileFormatVersion: 2
guid: d8f19718cccf14d4b829474ab19e0c7a
timeCreated: 1533229825
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 2
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 10
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 512
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Standalone
maxTextureSize: 512
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Android
maxTextureSize: 512
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: WebGL
maxTextureSize: 512
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: iPhone
maxTextureSize: 512
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

Before

Width:  |  Height:  |  Size: 474 KiB

@@ -1,100 +0,0 @@
fileFormatVersion: 2
guid: 87e2a5102f952174eb7505e5cff15bda
timeCreated: 1533231485
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 2
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 10
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 512
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Standalone
maxTextureSize: 512
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Android
maxTextureSize: 512
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: WebGL
maxTextureSize: 512
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: iPhone
maxTextureSize: 512
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

Before

Width:  |  Height:  |  Size: 554 KiB

@@ -1,100 +0,0 @@
fileFormatVersion: 2
guid: 24f06a4f5c47b464e9762d2887848f04
timeCreated: 1533231480
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 2
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 10
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 512
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Standalone
maxTextureSize: 512
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Android
maxTextureSize: 512
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: WebGL
maxTextureSize: 512
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: iPhone
maxTextureSize: 512
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

-92
View File
@@ -1,92 +0,0 @@
fileFormatVersion: 2
guid: a5e1e56d8affdfc47858b4e7000f1d60
timeCreated: 1533229376
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Standalone
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Android
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: WebGL
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
-8
View File
@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: a75d49073646347b1955a9f9df36cc45
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
-193
View File
@@ -1,193 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using UnityEngine;
using UnityEngine.UI;
namespace Coffee.UIEffects
{
/// <summary>
/// Abstract effect base for UI.
/// </summary>
[DisallowMultipleComponent]
public abstract class BaseMaterialEffect : BaseMeshEffect, IParameterTexture, IMaterialModifier
{
protected static readonly Hash128 k_InvalidHash = new Hash128();
protected static readonly List<UIVertex> s_TempVerts = new List<UIVertex>();
private static readonly StringBuilder s_StringBuilder = new StringBuilder();
Hash128 _effectMaterialHash;
/// <summary>
/// Gets or sets the parameter index.
/// </summary>
public int parameterIndex { get; set; }
/// <summary>
/// Gets the parameter texture.
/// </summary>
public virtual ParameterTexture paramTex
{
get { return null; }
}
/// <summary>
/// Mark the vertices as dirty.
/// </summary>
public void SetMaterialDirty()
{
connector.SetMaterialDirty(graphic);
foreach (var effect in syncEffects)
{
effect.SetMaterialDirty();
}
}
public virtual Hash128 GetMaterialHash(Material baseMaterial)
{
return k_InvalidHash;
}
public Material GetModifiedMaterial(Material baseMaterial)
{
return GetModifiedMaterial(baseMaterial, graphic);
}
public virtual Material GetModifiedMaterial(Material baseMaterial, Graphic graphic)
{
if (!isActiveAndEnabled) return baseMaterial;
var oldHash = _effectMaterialHash;
_effectMaterialHash = GetMaterialHash(baseMaterial);
var modifiedMaterial = baseMaterial;
if (_effectMaterialHash.isValid)
{
modifiedMaterial = MaterialCache.Register(baseMaterial, _effectMaterialHash, ModifyMaterial, graphic);
}
MaterialCache.Unregister(oldHash);
return modifiedMaterial;
}
// protected bool isTMProMobile (Material material)
// {
// return material && material.shader && material.shader.name.StartsWith ("TextMeshPro/Mobile/", StringComparison.Ordinal);
// }
public virtual void ModifyMaterial(Material newMaterial, Graphic graphic)
{
if (isActiveAndEnabled && paramTex != null)
paramTex.RegisterMaterial(newMaterial);
}
protected void SetShaderVariants(Material newMaterial, params object[] variants)
{
// Set shader keywords as variants
var keywords = variants.Where(x => 0 < (int) x)
.Select(x => x.ToString().ToUpper())
.Concat(newMaterial.shaderKeywords)
.Distinct()
.ToArray();
newMaterial.shaderKeywords = keywords;
// Add variant name
s_StringBuilder.Length = 0;
s_StringBuilder.Append(Path.GetFileName(newMaterial.shader.name));
foreach (var keyword in keywords)
{
s_StringBuilder.Append("-");
s_StringBuilder.Append(keyword);
}
newMaterial.name = s_StringBuilder.ToString();
}
#if UNITY_EDITOR
protected override void Reset()
{
if (!isActiveAndEnabled) return;
SetMaterialDirty();
SetVerticesDirty();
SetEffectParamsDirty();
}
protected override void OnValidate()
{
if (!isActiveAndEnabled) return;
SetVerticesDirty();
SetEffectParamsDirty();
}
#endif
/// <summary>
/// This function is called when the object becomes enabled and active.
/// </summary>
protected override void OnEnable()
{
base.OnEnable();
if (paramTex != null)
{
paramTex.Register(this);
}
SetMaterialDirty();
SetEffectParamsDirty();
// foreach (var mr in GetComponentsInChildren<UIEffectMaterialResolver> ())
// {
// mr.GetComponent<Graphic> ().SetMaterialDirty ();
// mr.GetComponent<Graphic> ().SetVerticesDirty ();
// }
}
/// <summary>
/// This function is called when the behaviour becomes disabled () or inactive.
/// </summary>
protected override void OnDisable()
{
base.OnDisable();
SetMaterialDirty();
if (paramTex != null)
{
paramTex.Unregister(this);
}
MaterialCache.Unregister(_effectMaterialHash);
_effectMaterialHash = k_InvalidHash;
}
// protected override void OnDidApplyAnimationProperties()
// {
// SetEffectParamsDirty();
// }
// protected override void OnTextChanged (UnityEngine.Object obj)
// {
// base.OnTextChanged (obj);
//
//
// foreach (var sm in GetComponentsInChildren<TMPro.TMP_SubMeshUI> ())
// {
// if(!sm.GetComponent<UIEffectMaterialResolver>())
// {
// var mr = sm.gameObject.AddComponent<UIEffectMaterialResolver> ();
//
// targetGraphic.SetAllDirty ();
// //targetGraphic.SetVerticesDirty ();
//
// //mr.GetComponent<Graphic> ().SetMaterialDirty ();
// //mr.GetComponent<Graphic> ().SetVerticesDirty ();
//
//
// }
// }
// }
}
}
-12
View File
@@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: e8b7ed62cf1444b4ebfc5e5338bc6682
timeCreated: 1485321967
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
-229
View File
@@ -1,229 +0,0 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
namespace Coffee.UIEffects
{
/// <summary>
/// Base class for effects that modify the generated Mesh.
/// It works well not only for standard Graphic components (Image, RawImage, Text, etc.) but also for TextMeshPro and TextMeshProUGUI.
/// </summary>
[RequireComponent(typeof(Graphic))]
[RequireComponent(typeof(RectTransform))]
[ExecuteAlways]
public abstract class BaseMeshEffect : UIBehaviour, IMeshModifier
{
RectTransform _rectTransform;
Graphic _graphic;
GraphicConnector _connector;
/// <summary>
/// The Graphic attached to this GameObject.
/// </summary>
protected GraphicConnector connector
{
get { return _connector ?? (_connector = GraphicConnector.FindConnector(graphic)); }
}
/// <summary>
/// The Graphic attached to this GameObject.
/// </summary>
public Graphic graphic
{
get { return _graphic ? _graphic : _graphic = GetComponent<Graphic>(); }
}
/// <summary>
/// The RectTransform attached to this GameObject.
/// </summary>
protected RectTransform rectTransform
{
get { return _rectTransform ? _rectTransform : _rectTransform = GetComponent<RectTransform>(); }
}
internal readonly List<UISyncEffect> syncEffects = new List<UISyncEffect>(0);
/// <summary>
/// Call used to modify mesh. (legacy)
/// </summary>
/// <param name="mesh">Mesh.</param>
public virtual void ModifyMesh(Mesh mesh)
{
}
/// <summary>
/// Call used to modify mesh.
/// </summary>
/// <param name="vh">VertexHelper.</param>
public virtual void ModifyMesh(VertexHelper vh)
{
ModifyMesh(vh, graphic);
}
public virtual void ModifyMesh(VertexHelper vh, Graphic graphic)
{
}
/// <summary>
/// Mark the vertices as dirty.
/// </summary>
protected virtual void SetVerticesDirty()
{
connector.SetVerticesDirty(graphic);
foreach (var effect in syncEffects)
{
effect.SetVerticesDirty();
}
// #if TMP_PRESENT
// if (textMeshPro)
// {
// foreach (var info in textMeshPro.textInfo.meshInfo)
// {
// var mesh = info.mesh;
// if (mesh)
// {
// mesh.Clear();
// mesh.vertices = info.vertices;
// mesh.uv = info.uvs0;
// mesh.uv2 = info.uvs2;
// mesh.colors32 = info.colors32;
// mesh.normals = info.normals;
// mesh.tangents = info.tangents;
// mesh.triangles = info.triangles;
// }
// }
//
// if (canvasRenderer)
// {
// canvasRenderer.SetMesh(textMeshPro.mesh);
//
// GetComponentsInChildren(false, s_SubMeshUIs);
// foreach (var sm in s_SubMeshUIs)
// {
// sm.canvasRenderer.SetMesh(sm.mesh);
// }
//
// s_SubMeshUIs.Clear();
// }
//
// textMeshPro.havePropertiesChanged = true;
// }
// else
// #endif
// if (graphic)
// {
// graphic.SetVerticesDirty();
// }
}
//################################
// Protected Members.
//################################
/// <summary>
/// Should the effect modify the mesh directly for TMPro?
/// </summary>
// protected virtual bool isLegacyMeshModifier
// {
// get { return false; }
// }
// protected virtual void Initialize()
// {
// if (_initialized) return;
//
// _initialized = true;
// _graphic = _graphic ? _graphic : GetComponent<Graphic>();
//
// _connector = GraphicConnector.FindConnector(_graphic);
//
// // _canvasRenderer = _canvasRenderer ?? GetComponent<CanvasRenderer> ();
// _rectTransform = _rectTransform ? _rectTransform : GetComponent<RectTransform>();
// // #if TMP_PRESENT
// // _textMeshPro = _textMeshPro ?? GetComponent<TMP_Text> ();
// // #endif
// }
/// <summary>
/// This function is called when the object becomes enabled and active.
/// </summary>
protected override void OnEnable()
{
connector.OnEnable(graphic);
SetVerticesDirty();
// SetVerticesDirty();
// #if TMP_PRESENT
// if (textMeshPro)
// {
// TMPro_EventManager.TEXT_CHANGED_EVENT.Add (OnTextChanged);
// }
// #endif
//
// #if UNITY_EDITOR && TMP_PRESENT
// if (graphic && textMeshPro)
// {
// GraphicRebuildTracker.TrackGraphic (graphic);
// }
// #endif
//
// #if UNITY_5_6_OR_NEWER
// if (graphic)
// {
// AdditionalCanvasShaderChannels channels = requiredChannels;
// var canvas = graphic.canvas;
// if (canvas && (canvas.additionalShaderChannels & channels) != channels)
// {
// Debug.LogWarningFormat (this, "Enable {1} of Canvas.additionalShaderChannels to use {0}.", GetType ().Name, channels);
// }
// }
// #endif
}
/// <summary>
/// This function is called when the behaviour becomes disabled () or inactive.
/// </summary>
protected override void OnDisable()
{
connector.OnDisable(graphic);
SetVerticesDirty();
}
/// <summary>
/// Mark the effect parameters as dirty.
/// </summary>
protected virtual void SetEffectParamsDirty()
{
if (!isActiveAndEnabled) return;
SetVerticesDirty();
}
/// <summary>
/// Callback for when properties have been changed by animation.
/// </summary>
protected override void OnDidApplyAnimationProperties()
{
if (!isActiveAndEnabled) return;
SetEffectParamsDirty();
}
#if UNITY_EDITOR
protected override void Reset()
{
if (!isActiveAndEnabled) return;
SetVerticesDirty();
}
/// <summary>
/// This function is called when the script is loaded or a value is changed in the inspector (Called in the editor only).
/// </summary>
protected override void OnValidate()
{
if (!isActiveAndEnabled) return;
SetEffectParamsDirty();
}
#endif
}
}
-11
View File
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 229ee7044e2514b0e9bd9fd40a2baa3a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
-154
View File
@@ -1,154 +0,0 @@
using UnityEngine;
using System;
using System.Collections.Generic;
namespace Coffee.UIEffects
{
/// <summary>
/// Effect player.
/// </summary>
[Serializable]
public class EffectPlayer
{
//################################
// Public Members.
//################################
/// <summary>
/// Gets or sets a value indicating whether is playing.
/// </summary>
[Header("Effect Player")] [Tooltip("Playing.")]
public bool play = false;
/// <summary>
/// Gets or sets the delay before looping.
/// </summary>
[Tooltip("Initial play delay.")] [Range(0f, 10f)]
public float initialPlayDelay = 0;
/// <summary>
/// Gets or sets the duration.
/// </summary>
[Tooltip("Duration.")] [Range(0.01f, 10f)]
public float duration = 1;
/// <summary>
/// Gets or sets a value indicating whether can loop.
/// </summary>
[Tooltip("Loop.")] public bool loop = false;
/// <summary>
/// Gets or sets the delay before looping.
/// </summary>
[Tooltip("Delay before looping.")] [Range(0f, 10f)]
public float loopDelay = 0;
/// <summary>
/// Gets or sets the update mode.
/// </summary>
[Tooltip("Update mode")] public AnimatorUpdateMode updateMode = AnimatorUpdateMode.Normal;
static List<Action> s_UpdateActions;
/// <summary>
/// Register player.
/// </summary>
public void OnEnable(Action<float> callback = null)
{
if (s_UpdateActions == null)
{
s_UpdateActions = new List<Action>();
Canvas.willRenderCanvases += () =>
{
var count = s_UpdateActions.Count;
for (int i = 0; i < count; i++)
{
s_UpdateActions[i].Invoke();
}
};
}
s_UpdateActions.Add(OnWillRenderCanvases);
if (play)
{
_time = -initialPlayDelay;
}
else
{
_time = 0;
}
_callback = callback;
}
/// <summary>
/// Unregister player.
/// </summary>
public void OnDisable()
{
_callback = null;
s_UpdateActions.Remove(OnWillRenderCanvases);
}
/// <summary>
/// Start playing.
/// </summary>
public void Play(bool reset, Action<float> callback = null)
{
if (reset)
{
_time = 0;
}
play = true;
if (callback != null)
{
_callback = callback;
}
}
/// <summary>
/// Stop playing.
/// </summary>
public void Stop(bool reset)
{
if (reset)
{
_time = 0;
if (_callback != null)
{
_callback(_time);
}
}
play = false;
}
//################################
// Private Members.
//################################
float _time = 0;
Action<float> _callback;
void OnWillRenderCanvases()
{
if (!play || !Application.isPlaying || _callback == null)
{
return;
}
_time += updateMode == AnimatorUpdateMode.UnscaledTime
? Time.unscaledDeltaTime
: Time.deltaTime;
var current = _time / duration;
if (duration <= _time)
{
play = loop;
_time = loop ? -loopDelay : 0;
}
_callback(current);
}
}
}
-12
View File
@@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: 1656fb67110cd44298010d95c324e87a
timeCreated: 1528296875
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
-151
View File
@@ -1,151 +0,0 @@
using UnityEngine;
using UnityEngine.UI;
using System;
using System.Collections.Generic;
namespace Coffee.UIEffects
{
public class GraphicConnector
{
private static readonly List<GraphicConnector> s_Connectors = new List<GraphicConnector>();
private static readonly Dictionary<Type, GraphicConnector> s_ConnectorMap =
new Dictionary<Type, GraphicConnector>();
private static readonly GraphicConnector s_EmptyConnector = new GraphicConnector();
#if UNITY_EDITOR
[UnityEditor.InitializeOnLoadMethod]
#endif
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
private static void Init()
{
AddConnector(new GraphicConnector());
}
protected static void AddConnector(GraphicConnector connector)
{
s_Connectors.Add(connector);
s_Connectors.Sort((x, y) => y.priority - x.priority);
}
public static GraphicConnector FindConnector(Graphic graphic)
{
if (!graphic) return s_EmptyConnector;
var type = graphic.GetType();
GraphicConnector connector = null;
if (s_ConnectorMap.TryGetValue(type, out connector)) return connector;
foreach (var c in s_Connectors)
{
if (!c.IsValid(graphic)) continue;
s_ConnectorMap.Add(type, c);
return c;
}
return s_EmptyConnector;
}
/// <summary>
/// Connector priority.
/// </summary>
protected virtual int priority
{
get { return -1; }
}
/// <summary>
/// Extra channel.
/// </summary>
public virtual AdditionalCanvasShaderChannels extraChannel
{
get { return AdditionalCanvasShaderChannels.TexCoord1; }
}
/// <summary>
/// The connector is valid for the component.
/// </summary>
protected virtual bool IsValid(Graphic graphic)
{
return true;
}
/// <summary>
/// Find effect shader.
/// </summary>
public virtual Shader FindShader(string shaderName)
{
return Shader.Find("Hidden/" + shaderName);
}
/// <summary>
/// This function is called when the object becomes enabled and active.
/// </summary>
public virtual void OnEnable(Graphic graphic)
{
}
/// <summary>
/// This function is called when the behaviour becomes disabled () or inactive.
/// </summary>
public virtual void OnDisable(Graphic graphic)
{
}
/// <summary>
/// Mark the vertices as dirty.
/// </summary>
public virtual void SetVerticesDirty(Graphic graphic)
{
if (graphic)
graphic.SetVerticesDirty();
}
/// <summary>
/// Mark the material as dirty.
/// </summary>
public virtual void SetMaterialDirty(Graphic graphic)
{
if (graphic)
graphic.SetMaterialDirty();
}
/// <summary>
/// Gets position factor for area.
/// </summary>
public virtual void GetPositionFactor(EffectArea area, int index, Rect rect, Vector2 position, out float x, out float y)
{
if (area == EffectArea.Fit)
{
x = Mathf.Clamp01((position.x - rect.xMin) / rect.width);
y = Mathf.Clamp01((position.y - rect.yMin) / rect.height);
}
else
{
x = Mathf.Clamp01(position.x / rect.width + 0.5f);
y = Mathf.Clamp01(position.y / rect.height + 0.5f);
}
}
public virtual bool IsText(Graphic graphic)
{
return graphic && graphic is Text;
}
public virtual void SetExtraChannel(ref UIVertex vertex, Vector2 value)
{
vertex.uv1 = value;
}
/// <summary>
/// Normalize vertex position by local matrix.
/// </summary>
public virtual void GetNormalizedFactor(EffectArea area, int index, Matrix2x3 matrix, Vector2 position,
out Vector2 normalizedPos)
{
normalizedPos = matrix * position;
}
}
}
-11
View File
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 66636f82e05e6453781a33c8b7da8b93
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
-77
View File
@@ -1,77 +0,0 @@
using System.Collections.Generic;
using System.Linq;
using System;
using UnityEngine;
using System.Text;
using UnityEngine.UI;
namespace Coffee.UIEffects
{
public class MaterialCache
{
static Dictionary<Hash128, MaterialEntry> materialMap = new Dictionary<Hash128, MaterialEntry>();
private class MaterialEntry
{
public Material material;
public int referenceCount;
public void Release()
{
if (material)
{
UnityEngine.Object.DestroyImmediate(material, false);
}
material = null;
}
}
#if UNITY_EDITOR
[UnityEditor.InitializeOnLoadMethod]
private static void ClearCache()
{
foreach (var entry in materialMap.Values)
{
entry.Release();
}
materialMap.Clear();
}
#endif
public static Material Register(Material baseMaterial, Hash128 hash,
System.Action<Material, Graphic> onModifyMaterial, Graphic graphic)
{
if (!hash.isValid) return null;
MaterialEntry entry;
if (!materialMap.TryGetValue(hash, out entry))
{
entry = new MaterialEntry()
{
material = new Material(baseMaterial)
{
hideFlags = HideFlags.HideAndDontSave,
},
};
onModifyMaterial(entry.material, graphic);
materialMap.Add(hash, entry);
}
entry.referenceCount++;
return entry.material;
}
public static void Unregister(Hash128 hash)
{
MaterialEntry entry;
if (!hash.isValid || !materialMap.TryGetValue(hash, out entry)) return;
if (--entry.referenceCount > 0) return;
entry.Release();
materialMap.Remove(hash);
}
}
}
-12
View File
@@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: 2160d2c55a6100642b6c7ba09df935da
timeCreated: 1528509206
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
-33
View File
@@ -1,33 +0,0 @@
using UnityEngine;
namespace Coffee.UIEffects
{
/// <summary>
/// Matrix2x3.
/// </summary>
public struct Matrix2x3
{
public float m00, m01, m02, m10, m11, m12;
public Matrix2x3(Rect rect, float cos, float sin)
{
const float center = 0.5f;
float dx = -rect.xMin / rect.width - center;
float dy = -rect.yMin / rect.height - center;
m00 = cos / rect.width;
m01 = -sin / rect.height;
m02 = dx * cos - dy * sin + center;
m10 = sin / rect.width;
m11 = cos / rect.height;
m12 = dx * sin + dy * cos + center;
}
public static Vector2 operator *(Matrix2x3 m, Vector2 v)
{
return new Vector2(
(m.m00 * v.x) + (m.m01 * v.y) + m.m02,
(m.m10 * v.x) + (m.m11 * v.y) + m.m12
);
}
}
}
-12
View File
@@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: 5a9b962044ca64867b713425f7e5daab
timeCreated: 1527590245
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
-61
View File
@@ -1,61 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public static class Packer
{
/// <summary>
/// Pack 4 low-precision [0-1] floats values to a float.
/// Each value [0-1] has 64 steps(6 bits).
/// </summary>
public static float ToFloat(float x, float y, float z, float w)
{
x = x < 0 ? 0 : 1 < x ? 1 : x;
y = y < 0 ? 0 : 1 < y ? 1 : y;
z = z < 0 ? 0 : 1 < z ? 1 : z;
w = w < 0 ? 0 : 1 < w ? 1 : w;
const int PRECISION = (1 << 6) - 1;
return (Mathf.FloorToInt(w * PRECISION) << 18)
+ (Mathf.FloorToInt(z * PRECISION) << 12)
+ (Mathf.FloorToInt(y * PRECISION) << 6)
+ Mathf.FloorToInt(x * PRECISION);
}
/// <summary>
/// Pack 4 low-precision [0-1] floats values to a float.
/// Each value [0-1] has 64 steps(6 bits).
/// </summary>
public static float ToFloat(Vector4 factor)
{
return ToFloat(Mathf.Clamp01(factor.x), Mathf.Clamp01(factor.y), Mathf.Clamp01(factor.z),
Mathf.Clamp01(factor.w));
}
/// <summary>
/// Pack 1 middle-precision & 2 low-precision [0-1] floats values to a float.
/// z value [0-1] has 4096 steps(12 bits) and xy value [0-1] has 64 steps(6 bits).
/// </summary>
public static float ToFloat(float x, float y, float z)
{
x = x < 0 ? 0 : 1 < x ? 1 : x;
y = y < 0 ? 0 : 1 < y ? 1 : y;
z = z < 0 ? 0 : 1 < z ? 1 : z;
const int PRECISION = (1 << 8) - 1;
return (Mathf.FloorToInt(z * PRECISION) << 16)
+ (Mathf.FloorToInt(y * PRECISION) << 8)
+ Mathf.FloorToInt(x * PRECISION);
}
/// <summary>
/// Pack 2 low-precision [0-1] floats values to a float.
/// Each value [0-1] has 4096 steps(12 bits).
/// </summary>
public static float ToFloat(float x, float y)
{
x = x < 0 ? 0 : 1 < x ? 1 : x;
y = y < 0 ? 0 : 1 < y ? 1 : y;
const int PRECISION = (1 << 12) - 1;
return (Mathf.FloorToInt(y * PRECISION) << 12)
+ Mathf.FloorToInt(x * PRECISION);
}
}
-12
View File
@@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: b4970b3a69d3b472b8d66c1d92ec7bad
timeCreated: 1527590285
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
-190
View File
@@ -1,190 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
using System;
namespace Coffee.UIEffects
{
public interface IParameterTexture
{
int parameterIndex { get; set; }
ParameterTexture paramTex { get; }
}
/// <summary>
/// Parameter texture.
/// </summary>
[System.Serializable]
public class ParameterTexture
{
//################################
// Public Members.
//################################
/// <summary>
/// Initializes a new instance of the <see cref="Coffee.UIEffects.ParameterTexture"/> class.
/// </summary>
/// <param name="channels">Channels.</param>
/// <param name="instanceLimit">Instance limit.</param>
/// <param name="propertyName">Property name.</param>
public ParameterTexture(int channels, int instanceLimit, string propertyName)
{
_propertyName = propertyName;
_channels = ((channels - 1) / 4 + 1) * 4;
_instanceLimit = ((instanceLimit - 1) / 2 + 1) * 2;
_data = new byte[_channels * _instanceLimit];
_stack = new Stack<int>(_instanceLimit);
for (int i = 1; i < _instanceLimit + 1; i++)
{
_stack.Push(i);
}
}
/// <summary>
/// Register the specified target.
/// </summary>
/// <param name="target">Target.</param>
public void Register(IParameterTexture target)
{
Initialize();
if (target.parameterIndex <= 0 && 0 < _stack.Count)
{
target.parameterIndex = _stack.Pop();
// Debug.LogFormat("<color=green>@@@ Register {0} : {1}</color>", target, target.parameterIndex);
}
}
/// <summary>
/// Unregister the specified target.
/// </summary>
/// <param name="target">Target.</param>
public void Unregister(IParameterTexture target)
{
if (0 < target.parameterIndex)
{
// Debug.LogFormat("<color=red>@@@ Unregister {0} : {1}</color>", target, target.parameterIndex);
_stack.Push(target.parameterIndex);
target.parameterIndex = 0;
}
}
/// <summary>
/// Sets the data.
/// </summary>
/// <param name="target">Target.</param>
/// <param name="channelId">Channel identifier.</param>
/// <param name="value">Value.</param>
public void SetData(IParameterTexture target, int channelId, byte value)
{
int index = (target.parameterIndex - 1) * _channels + channelId;
if (0 < target.parameterIndex && _data[index] != value)
{
_data[index] = value;
_needUpload = true;
}
}
/// <summary>
/// Sets the data.
/// </summary>
/// <param name="target">Target.</param>
/// <param name="channelId">Channel identifier.</param>
/// <param name="value">Value.</param>
public void SetData(IParameterTexture target, int channelId, float value)
{
SetData(target, channelId, (byte) (Mathf.Clamp01(value) * 255));
}
/// <summary>
/// Registers the material.
/// </summary>
/// <param name="mat">Mat.</param>
public void RegisterMaterial(Material mat)
{
if (_propertyId == 0)
{
_propertyId = Shader.PropertyToID(_propertyName);
}
if (mat)
{
mat.SetTexture(_propertyId, _texture);
}
}
/// <summary>
/// Gets the index of the normalized.
/// </summary>
/// <returns>The normalized index.</returns>
/// <param name="target">Target.</param>
public float GetNormalizedIndex(IParameterTexture target)
{
return ((float) target.parameterIndex - 0.5f) / _instanceLimit;
}
//################################
// Private Members.
//################################
Texture2D _texture;
bool _needUpload;
int _propertyId;
readonly string _propertyName;
readonly int _channels;
readonly int _instanceLimit;
readonly byte[] _data;
readonly Stack<int> _stack;
static List<Action> updates;
/// <summary>
/// Initialize this instance.
/// </summary>
void Initialize()
{
#if UNITY_EDITOR
if (!UnityEditor.EditorApplication.isPlaying && UnityEditor.EditorApplication.isPlayingOrWillChangePlaymode)
{
return;
}
#endif
if (updates == null)
{
updates = new List<Action>();
Canvas.willRenderCanvases += () =>
{
var count = updates.Count;
for (int i = 0; i < count; i++)
{
updates[i].Invoke();
}
};
}
if (!_texture)
{
bool isLinear = QualitySettings.activeColorSpace == ColorSpace.Linear;
_texture = new Texture2D(_channels / 4, _instanceLimit, TextureFormat.RGBA32, false, isLinear);
_texture.filterMode = FilterMode.Point;
_texture.wrapMode = TextureWrapMode.Clamp;
updates.Add(UpdateParameterTexture);
_needUpload = true;
}
}
void UpdateParameterTexture()
{
if (_needUpload && _texture)
{
_needUpload = false;
_texture.LoadRawTextureData(_data);
_texture.Apply(false, false);
}
}
}
}
-12
View File
@@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: 65eafa89b3a3a494a99e185423ba6cad
timeCreated: 1533006319
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
-75
View File
@@ -1,75 +0,0 @@
#if !UNITY_2019_1_OR_NEWER
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using UnityEditor;
namespace Coffee.UIEffects
{
public static class ImportSampleMenu
{
private const string jsonGuid = "546af75b6221c4768be79d67c9cea1fb";
[MenuItem("Assets/Samples/UIEffect/Import Demo")]
private static void ImportDemo()
{
ImportSample(jsonGuid, "Demo");
}
private static void ImportSample(string jsonGuid, string sampleName)
{
var jsonPath = AssetDatabase.GUIDToAssetPath(jsonGuid);
var json = File.ReadAllText(jsonPath);
var version = Regex.Match(json, "\"version\"\\s*:\\s*\"([^\"]+)\"").Groups[1].Value;
var displayName = Regex.Match(json, "\"displayName\"\\s*:\\s*\"([^\"]+)\"").Groups[1].Value;
var src = string.Format("{0}/Samples~/{1}", Path.GetDirectoryName(jsonPath), sampleName);
var srcAlt = string.Format("{0}/Samples/{1}", Path.GetDirectoryName(jsonPath), sampleName);
var dst = string.Format("Assets/Samples/{0}/{1}/{2}", displayName, version, sampleName);
var previousPath = GetPreviousSamplePath(displayName, sampleName);
// Remove the previous sample directory.
if (!string.IsNullOrEmpty(previousPath))
{
var msg = "A different version of the sample is already imported at\n\n"
+ previousPath
+ "\n\nIt will be deleted when you update. Are you sure you want to continue?";
if (!EditorUtility.DisplayDialog("Sample Importer", msg, "OK", "Cancel"))
return;
FileUtil.DeleteFileOrDirectory(previousPath);
var metaFile = previousPath + ".meta";
if (File.Exists(metaFile))
FileUtil.DeleteFileOrDirectory(metaFile);
}
if (!Directory.Exists(dst))
FileUtil.DeleteFileOrDirectory(dst);
var dstDir = Path.GetDirectoryName(dst);
if (!Directory.Exists(dstDir))
Directory.CreateDirectory(dstDir);
if (Directory.Exists(src))
FileUtil.CopyFileOrDirectory(src, dst);
else if (Directory.Exists(srcAlt))
FileUtil.CopyFileOrDirectory(srcAlt, dst);
else
throw new DirectoryNotFoundException(src);
AssetDatabase.Refresh(ImportAssetOptions.ImportRecursive);
}
private static string GetPreviousSamplePath(string displayName, string sampleName)
{
var sampleRoot = string.Format("Assets/Samples/{0}", displayName);
var sampleRootInfo = new DirectoryInfo(sampleRoot);
if (!sampleRootInfo.Exists) return null;
return sampleRootInfo.GetDirectories()
.Select(versionDir => Path.Combine(versionDir.ToString(), sampleName))
.FirstOrDefault(Directory.Exists);
}
}
}
#endif
-11
View File
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: f1d002a431e7c4b1ca5db78469cb0d1c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
-33
View File
@@ -1,33 +0,0 @@
using System.Linq;
using UnityEditor;
using UnityEngine;
namespace Coffee.UIEffects.Editors
{
/// <summary>
/// Changes in this scope cause the graphic's material to be dirty.
/// When you change a property, it marks the material as dirty.
/// </summary>
internal class MaterialDirtyScope : EditorGUI.ChangeCheckScope
{
readonly Object[] targets;
public MaterialDirtyScope(Object[] targets)
{
this.targets = targets;
}
protected override void CloseScope()
{
if (changed)
{
foreach (var effect in targets.OfType<BaseMaterialEffect>())
{
effect.SetMaterialDirty();
}
}
base.CloseScope();
}
}
}
-11
View File
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 16857cac7da564347876420ef55a734a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
-121
View File
@@ -1,121 +0,0 @@
using UnityEditor;
using UnityEditorInternal;
using UnityEngine;
using System.Linq;
using System.Collections.Generic;
using UnityEngine.UI;
namespace Coffee.UIEffects.Editors
{
/// <summary>
/// UIEffect editor.
/// </summary>
[CustomEditor(typeof(UIDissolve))]
[CanEditMultipleObjects]
public class UIDissolveEditor : Editor
{
SerializedProperty _spEffectFactor;
SerializedProperty _spWidth;
SerializedProperty _spColor;
SerializedProperty _spSoftness;
SerializedProperty _spColorMode;
SerializedProperty _spTransitionTexture;
SerializedProperty _spEffectArea;
SerializedProperty _spKeepAspectRatio;
SerializedProperty _spReverse;
SerializedProperty _spPlay;
SerializedProperty _spLoop;
SerializedProperty _spLoopDelay;
SerializedProperty _spDuration;
SerializedProperty _spInitialPlayDelay;
SerializedProperty _spUpdateMode;
//################################
// Public/Protected Members.
//################################
/// <summary>
/// This function is called when the object becomes enabled and active.
/// </summary>
protected void OnEnable()
{
_spEffectFactor = serializedObject.FindProperty("m_EffectFactor");
_spEffectArea = serializedObject.FindProperty("m_EffectArea");
_spKeepAspectRatio = serializedObject.FindProperty("m_KeepAspectRatio");
_spWidth = serializedObject.FindProperty("m_Width");
_spColor = serializedObject.FindProperty("m_Color");
_spSoftness = serializedObject.FindProperty("m_Softness");
_spColorMode = serializedObject.FindProperty("m_ColorMode");
_spTransitionTexture = serializedObject.FindProperty("m_TransitionTexture");
_spKeepAspectRatio = serializedObject.FindProperty("m_KeepAspectRatio");
_spReverse = serializedObject.FindProperty("m_Reverse");
var player = serializedObject.FindProperty("m_Player");
_spPlay = player.FindPropertyRelative("play");
_spDuration = player.FindPropertyRelative("duration");
_spInitialPlayDelay = player.FindPropertyRelative("initialPlayDelay");
_spLoop = player.FindPropertyRelative("loop");
_spLoopDelay = player.FindPropertyRelative("loopDelay");
_spUpdateMode = player.FindPropertyRelative("updateMode");
}
/// <summary>
/// Implement this function to make a custom inspector.
/// </summary>
public override void OnInspectorGUI()
{
serializedObject.Update();
//================
// Effect setting.
//================
EditorGUILayout.PropertyField(_spEffectFactor);
EditorGUILayout.PropertyField(_spWidth);
EditorGUILayout.PropertyField(_spSoftness);
EditorGUILayout.PropertyField(_spColor);
using (new MaterialDirtyScope(targets))
{
EditorGUILayout.PropertyField(_spColorMode);
EditorGUILayout.PropertyField(_spTransitionTexture);
}
//================
// Advanced option.
//================
EditorGUILayout.PropertyField(_spEffectArea);
EditorGUILayout.PropertyField(_spKeepAspectRatio);
//================
// Effect player.
//================
EditorGUILayout.PropertyField(_spPlay);
EditorGUILayout.PropertyField(_spDuration);
EditorGUILayout.PropertyField(_spInitialPlayDelay);
EditorGUILayout.PropertyField(_spLoop);
EditorGUILayout.PropertyField(_spLoopDelay);
EditorGUILayout.PropertyField(_spUpdateMode);
EditorGUILayout.PropertyField(_spReverse);
// Debug.
using (new EditorGUI.DisabledGroupScope(!Application.isPlaying))
using (new EditorGUILayout.HorizontalScope(EditorStyles.helpBox))
{
GUILayout.Label("Debug");
if (GUILayout.Button("Play", "ButtonLeft"))
{
(target as UIDissolve).Play();
}
if (GUILayout.Button("Stop", "ButtonRight"))
{
(target as UIDissolve).Stop();
}
}
serializedObject.ApplyModifiedProperties();
}
}
}

Some files were not shown because too many files have changed in this diff Show More