Compare commits

..

190 Commits

Author SHA1 Message Date
semantic-release-bot 184967c120 chore(release): 5.8.2 [skip ci]
## [5.8.2](https://github.com/mob-sakai/UIEffect/compare/5.8.1...5.8.2) (2025-04-23)

### Bug Fixes

* `Flip` is ignored when loading a preset ([e1f3abf](https://github.com/mob-sakai/UIEffect/commit/e1f3abf7a65b62718b28e33ac2f7d700c3ae3f5a))
* fix detail color ([90ab16c](https://github.com/mob-sakai/UIEffect/commit/90ab16c3fd46435ebf7c8e47ffb4ec521d2f61c9))
* indicate in the inspector using tooltips and asterisks that `Rotation` and `Keep Aspect Ratio` are shared properties ([2cca822](https://github.com/mob-sakai/UIEffect/commit/2cca822413aa7580e1eb777c3295d1de928cd65f))
2025-04-23 23:24:29 +00:00
mob-sakai 2cca822413 fix: indicate in the inspector using tooltips and asterisks that Rotation and Keep Aspect Ratio are shared properties 2025-04-19 10:22:34 +09:00
mob-sakai 90ab16c3fd fix: fix detail color 2025-04-19 10:22:34 +09:00
mob-sakai e1f3abf7a6 fix: Flip is ignored when loading a preset 2025-04-19 10:21:16 +09:00
mob-sakai 770e61bb12 chore: refactor 2025-04-18 17:32:30 +09:00
mob-sakai a0820bf847 chore: update coffee.internal 2025-04-18 17:14:44 +09:00
semantic-release-bot 1a21464c0e chore(release): 5.8.1 [skip ci]
## [5.8.1](https://github.com/mob-sakai/UIEffect/compare/5.8.0...5.8.1) (2025-04-17)

### Bug Fixes

* built-in presets cannot be used with `UIEffectReplica` ([1106f4b](https://github.com/mob-sakai/UIEffect/commit/1106f4bf4632e1372d44ced9a38e98209a6b55e8))
* New presets ignore `DetailColor` property ([1143fbb](https://github.com/mob-sakai/UIEffect/commit/1143fbb84a1e08817de93f1349ee5cdad0972db5)), closes [#336](https://github.com/mob-sakai/UIEffect/issues/336)
* prevent built-in preset assets from being editable ([0898d73](https://github.com/mob-sakai/UIEffect/commit/0898d730add42970fb74bf2ad8aca9809bf6dd39))
2025-04-17 11:20:54 +00:00
mob-sakai 1143fbb84a fix: New presets ignore DetailColor property
close #336
2025-04-17 20:20:14 +09:00
mob-sakai eff923493a update demo 2025-04-17 18:56:24 +09:00
mob-sakai 0898d730ad fix: prevent built-in preset assets from being editable 2025-04-17 17:48:12 +09:00
mob-sakai 1106f4bf46 fix: built-in presets cannot be used with UIEffectReplica 2025-04-17 17:38:03 +09:00
semantic-release-bot 2861b1ce61 chore(release): 5.8.0 [skip ci]
# [5.8.0](https://github.com/mob-sakai/UIEffect/compare/5.7.0...5.8.0) (2025-04-17)

### Bug Fixes

* `ShadowMode.Mirror` does not flip the effect ([37daad0](https://github.com/mob-sakai/UIEffect/commit/37daad01c4f3f4c259650b1493aeae204e0bd247))
* fix alpha clipping for ShaderGraph ([ae177a8](https://github.com/mob-sakai/UIEffect/commit/ae177a800cba1561b523292279d7986d4eff9f9c))
* unable to add editor presets as runtime presets to project settings ([726bb10](https://github.com/mob-sakai/UIEffect/commit/726bb100a0ad327619634ea73ccdccc36276d0d0)), closes [#330](https://github.com/mob-sakai/UIEffect/issues/330)

### Features

* add `DetailColor` property ([30bf783](https://github.com/mob-sakai/UIEffect/commit/30bf783320398d68b90b09b0dcf93738b4683e00)), closes [#332](https://github.com/mob-sakai/UIEffect/issues/332)
* ScriptableObject based preset system ([f8682f3](https://github.com/mob-sakai/UIEffect/commit/f8682f3c9889fb56ff3cd9010934f998e121553a)), closes [#333](https://github.com/mob-sakai/UIEffect/issues/333)
2025-04-17 05:07:03 +00:00
mob-sakai 6eabdc694e docs: update readme 2025-04-17 14:06:24 +09:00
mob-sakai ae177a800c fix: fix alpha clipping for ShaderGraph 2025-04-17 02:57:46 +09:00
mob-sakai 88bb76d735 update demo 2025-04-17 02:57:46 +09:00
mob-sakai 37daad01c4 fix: ShadowMode.Mirror does not flip the effect 2025-04-17 02:57:46 +09:00
mob-sakai 1ce32f7829 refactor: refactor code 2025-04-17 02:23:09 +09:00
mob-sakai 726bb100a0 fix: unable to add editor presets as runtime presets to project settings
close #330
2025-04-17 02:23:09 +09:00
mob-sakai f8682f3c98 feat: ScriptableObject based preset system
NOTE: This change will rename the built-in runtime preset.
For example, change the name `001 - Tone - Glayscale` to `Tone-Glayscale`.
close #333
2025-04-17 02:23:09 +09:00
mob-sakai 99669728cc refactor: refactor code 2025-04-17 02:23:09 +09:00
mob-sakai 30bf783320 feat: add DetailColor property
close #332
2025-04-17 02:23:09 +09:00
semantic-release-bot d6ee505e7c chore(release): 5.7.0 [skip ci]
# [5.7.0](https://github.com/mob-sakai/UIEffect/compare/5.6.4...5.7.0) (2025-04-11)

### Bug Fixes

* colors appeared darker when alpha was low ([21172f3](https://github.com/mob-sakai/UIEffect/commit/21172f37c21792906ac9e33827c771d388397653))
* shrink shader variants for color filters ([7f60a56](https://github.com/mob-sakai/UIEffect/commit/7f60a56a9af6b4ecee223b466f1b2499af0194f4))

### Features

* `UIEffectReplica.flip` has been deprecated ([6af34e2](https://github.com/mob-sakai/UIEffect/commit/6af34e2994378fd33025b41fe08898b552aa08ab))
* add `GradationIntensity` and `GradationColorFilter` properties ([a6781b9](https://github.com/mob-sakai/UIEffect/commit/a6781b92899c38f49eccfebf4173028955a5aced))
* calculate the normalized position on the shader side ([01bbeed](https://github.com/mob-sakai/UIEffect/commit/01bbeedde7cf2d757d6d295475f0ad9acd24dce3)), closes [#323](https://github.com/mob-sakai/UIEffect/issues/323) [#324](https://github.com/mob-sakai/UIEffect/issues/324)
* ShaderGraph support ([2dd2e26](https://github.com/mob-sakai/UIEffect/commit/2dd2e261666b611be3a1fd5ac112db34fd99038e)), closes [#326](https://github.com/mob-sakai/UIEffect/issues/326)
2025-04-11 07:35:55 +00:00
mob-sakai 3917df60af docs: update readme 2025-04-11 09:52:49 +09:00
mob-sakai 6845678f8f chore: update test workflows 2025-04-11 09:50:48 +09:00
mob-sakai 9fbaae7d07 demo: add urp project 2025-04-11 09:50:48 +09:00
mob-sakai 3d1abb979a chore: update demos 2025-04-11 09:50:48 +09:00
mob-sakai 6af34e2994 feat: UIEffectReplica.flip has been deprecated 2025-04-11 09:50:48 +09:00
mob-sakai a6781b9289 feat: add GradationIntensity and GradationColorFilter properties 2025-04-11 09:50:48 +09:00
mob-sakai 7f60a56a9a fix: shrink shader variants for color filters
This avoids the local shader variant limit (=60).
Since it uses a uniform branch, there is no impact on rendering performance.
2025-04-11 03:17:40 +09:00
mob-sakai 2dd2e26166 feat: ShaderGraph support
close #326
2025-04-11 03:17:40 +09:00
mob-sakai 21172f37c2 fix: colors appeared darker when alpha was low 2025-04-10 18:07:46 +09:00
mob-sakai 01bbeedde7 feat: calculate the normalized position on the shader side
With this change, UIEffect becomes up to 50% faster.
Additionally, gradients are rendered more beautifully.
close #323, close #324
2025-04-10 18:07:46 +09:00
semantic-release-bot c6fa44a0b6 chore(release): 5.6.4 [skip ci]
## [5.6.4](https://github.com/mob-sakai/UIEffect/compare/5.6.3...5.6.4) (2025-04-10)

### Bug Fixes

* avoid potential allocations ([26da24d](https://github.com/mob-sakai/UIEffect/commit/26da24dbc4022dcd71e7a58e5f02a6922ba2ddff))
* optional shaders do not support all shader combinations ([6014ab5](https://github.com/mob-sakai/UIEffect/commit/6014ab54d010872f8fee63fc961ac5ab2edd08e1))
2025-04-10 09:07:31 +00:00
mob-sakai 26da24dbc4 fix: avoid potential allocations 2025-04-10 09:26:09 +09:00
mob-sakai 6014ab54d0 fix: optional shaders do not support all shader combinations 2025-04-08 23:40:58 +09:00
semantic-release-bot dbdb99b52a chore(release): 5.6.3 [skip ci]
## [5.6.3](https://github.com/mob-sakai/UIEffect/compare/5.6.2...5.6.3) (2025-04-06)

### Bug Fixes

* fix a potential `ArgumentOutOfRangeException` that could occur when changing the FontAsset in TextMeshPro ([3b095bc](https://github.com/mob-sakai/UIEffect/commit/3b095bcebd8b1264c373b8b71c27d3c35f673f3b)), closes [#327](https://github.com/mob-sakai/UIEffect/issues/327)
2025-04-06 22:39:51 +00:00
mob-sakai 3b095bcebd fix: fix a potential ArgumentOutOfRangeException that could occur when changing the FontAsset in TextMeshPro
close #327
2025-04-07 07:39:18 +09:00
semantic-release-bot 2a900987f5 chore(release): 5.6.2 [skip ci]
## [5.6.2](https://github.com/mob-sakai/UIEffect/compare/5.6.1...5.6.2) (2025-04-04)

### Bug Fixes

* fix a potential `ArgumentOutOfRangeException` that could occur when changing the FontAsset in TextMeshPro ([909281c](https://github.com/mob-sakai/UIEffect/commit/909281c66b702d8497e9f847c91b688716b9c6a7)), closes [#327](https://github.com/mob-sakai/UIEffect/issues/327)
* Remove unnecessary vertex expansion ([974e3e8](https://github.com/mob-sakai/UIEffect/commit/974e3e8769d456c5cdd8eb1767a7cf57ab4d52fc))
* undo now works correctly after clicking the 'Clear' button in the inspector ([75ed355](https://github.com/mob-sakai/UIEffect/commit/75ed355e27faf8962390eb6788e1887ffd1b5f89))
2025-04-04 11:20:33 +00:00
mob-sakai 974e3e8769 fix: Remove unnecessary vertex expansion 2025-04-04 14:29:39 +09:00
mob-sakai 909281c66b fix: fix a potential ArgumentOutOfRangeException that could occur when changing the FontAsset in TextMeshPro
close #327
2025-04-04 13:56:00 +09:00
mob-sakai 75ed355e27 fix: undo now works correctly after clicking the 'Clear' button in the inspector 2025-04-04 13:55:51 +09:00
mob-sakai a0dd316df6 docs: update readme 2025-03-29 01:37:36 +09:00
semantic-release-bot 4f66bbfb4d chore(release): 5.6.1 [skip ci]
## [5.6.1](https://github.com/mob-sakai/UIEffect/compare/5.6.0...5.6.1) (2025-03-28)

### Bug Fixes

* changes were not correctly marked as dirty when loading presets ([76be0fc](https://github.com/mob-sakai/UIEffect/commit/76be0fc860c27b89235b7fb9a766dcc38b3d9924))
2025-03-28 11:18:28 +00:00
mob-sakai 91d5519356 docs: update docs 2025-03-28 20:17:37 +09:00
mob-sakai 76be0fc860 fix: changes were not correctly marked as dirty when loading presets 2025-03-28 20:17:36 +09:00
semantic-release-bot a7e826c4f9 chore(release): 5.6.0 [skip ci]
# [5.6.0](https://github.com/mob-sakai/UIEffect/compare/5.5.3...5.6.0) (2025-03-28)

### Bug Fixes

* fix edge detection ([9462170](https://github.com/mob-sakai/UIEffect/commit/946217069f10714798070481d8576f5470e243db))
* fix project settings icon ([202601c](https://github.com/mob-sakai/UIEffect/commit/202601c96d6fb564ee5d6b8868b0ff0a8dba0ba1))
* the strength of ColorGlow, TransitionColorGlow, and ShadowColorGlow now changes according to intensity ([aa4ec8d](https://github.com/mob-sakai/UIEffect/commit/aa4ec8d9c449bfe361aa277e25cbb389e0daa983)), closes [#316](https://github.com/mob-sakai/UIEffect/issues/316)
* UIEffect with TextMeshPro SubMeshUI appears black in the editor when saving assets ([de91871](https://github.com/mob-sakai/UIEffect/commit/de918718d062979c8e9b4202b6b2ae389ae10bab))

### Features

* `TransitionAutoPlaySpeed`, `TransitionTexSpeed`, and `EdgeShinyAutoPlaySpeed` are previewed only when the object is selected in edit mode ([952a94f](https://github.com/mob-sakai/UIEffect/commit/952a94f50b3ae4279a48b03d019f341e46b2f5b7)), closes [#319](https://github.com/mob-sakai/UIEffect/issues/319)
* add 'Flip' feature ([def49c3](https://github.com/mob-sakai/UIEffect/commit/def49c34f5b963c8b0cce6fb8cace3f7d93b5a1e))
* add `Detail Filter` feature ([3e2c5c1](https://github.com/mob-sakai/UIEffect/commit/3e2c5c1613d9a2c08487d94c4eef28f066f2eb7b))
* add `EdgeColorGlow` option ([53db1e6](https://github.com/mob-sakai/UIEffect/commit/53db1e62546384f04b9c526df2623c4598dd34bf))
* add `onChangeRate` event for UIEffectTweener ([8ad57c8](https://github.com/mob-sakai/UIEffect/commit/8ad57c828ef4f1d7df6dd22c1edb7af3efa04d75)), closes [#321](https://github.com/mob-sakai/UIEffect/issues/321)
* add `TransitionTexSpeed` option ([6b8dc5e](https://github.com/mob-sakai/UIEffect/commit/6b8dc5ec338590d909511eba3bb1b2e0ec6627f3))
* add a tool that automatically fixes shaders when 'TextMeshPro Essential Resources' are located in a non-default path ([8388d59](https://github.com/mob-sakai/UIEffect/commit/8388d590457755cda0699835b37b5bf0673c4386))
* add built-in presets ([3db94e0](https://github.com/mob-sakai/UIEffect/commit/3db94e00f83195ff90d26ee270c7984825fa22b7))
* add shaders for TextMeshPro Overlay/SSD ([51cd6d8](https://github.com/mob-sakai/UIEffect/commit/51cd6d8525a12581c8afd4ab5d16e5968e15c8fe))
* Allow specifying a preset as the target for `UIEffectReplica` ([cb0e8d2](https://github.com/mob-sakai/UIEffect/commit/cb0e8d283bb8f9085d4910051b5ae0b77368db76))
* custom transform for transition and gradation ([045db9c](https://github.com/mob-sakai/UIEffect/commit/045db9c3b79234cd12bdfb4ea52898b7d86240af))
* expose color subfields as float-type public properties ([396d06f](https://github.com/mob-sakai/UIEffect/commit/396d06f774e10adee84d06156a7fc8723d986bbd)), closes [#321](https://github.com/mob-sakai/UIEffect/issues/321)
* load presets partially and append to existing instance ([6542543](https://github.com/mob-sakai/UIEffect/commit/654254342265fc239804e60a64d01b80076e5e8e))
* separate reverse curve for UIEffectTweener ([2540b75](https://github.com/mob-sakai/UIEffect/commit/2540b75349af92f1359433e73ffa3b5400479b02)), closes [#312](https://github.com/mob-sakai/UIEffect/issues/312)
* support `SoftMaskForUGUI ` package with `UIEffect` ([65457e2](https://github.com/mob-sakai/UIEffect/commit/65457e263644c36cd772ad1f42fb9fb3f84ab753)), closes [#270](https://github.com/mob-sakai/UIEffect/issues/270)
* support UIFlip as v4 compatible component ([e965b9e](https://github.com/mob-sakai/UIEffect/commit/e965b9e9ab33dcfab067542abf2f19bc1d5243fc)), closes [#322](https://github.com/mob-sakai/UIEffect/issues/322)
* update demo sample ([abc9a41](https://github.com/mob-sakai/UIEffect/commit/abc9a4184c4aeac85287a882d174f9cdc2c28c04)), closes [#318](https://github.com/mob-sakai/UIEffect/issues/318) [#320](https://github.com/mob-sakai/UIEffect/issues/320)
2025-03-28 09:16:55 +00:00
mob-sakai 78fbc9a330 docs: update readme
close #317
2025-03-19 09:24:06 +09:00
mob-sakai abc9a4184c feat: update demo sample
close #318, close #320
2025-03-19 09:24:05 +09:00
mob-sakai 3e2c5c1613 feat: add Detail Filter feature 2025-03-19 09:24:05 +09:00
mob-sakai cb0e8d283b feat: Allow specifying a preset as the target for UIEffectReplica 2025-03-19 09:24:05 +09:00
mob-sakai def49c34f5 feat: add 'Flip' feature 2025-03-19 09:24:05 +09:00
mob-sakai a0ac27291b chore: add symbolic linker for development 2025-03-19 09:24:05 +09:00
mob-sakai 8388d59045 feat: add a tool that automatically fixes shaders when 'TextMeshPro Essential Resources' are located in a non-default path 2025-03-19 09:24:05 +09:00
mob-sakai 53db1e6254 feat: add EdgeColorGlow option 2025-03-19 09:24:05 +09:00
mob-sakai aa4ec8d9c4 fix: the strength of ColorGlow, TransitionColorGlow, and ShadowColorGlow now changes according to intensity
close #316
2025-03-19 09:24:05 +09:00
mob-sakai e965b9e9ab feat: support UIFlip as v4 compatible component
close #322
2025-03-19 09:24:05 +09:00
mob-sakai 202601c96d fix: fix project settings icon 2025-03-19 09:24:05 +09:00
mob-sakai 396d06f774 feat: expose color subfields as float-type public properties
close #321
2025-03-19 09:24:05 +09:00
mob-sakai 8ad57c828e feat: add onChangeRate event for UIEffectTweener
close #321
2025-03-19 09:24:05 +09:00
mob-sakai 952a94f50b feat: TransitionAutoPlaySpeed, TransitionTexSpeed, and EdgeShinyAutoPlaySpeed are previewed only when the object is selected in edit mode
close #319
2025-03-19 09:24:05 +09:00
mob-sakai 2540b75349 feat: separate reverse curve for UIEffectTweener
close #312
2025-03-19 09:24:05 +09:00
mob-sakai 6b8dc5ec33 feat: add TransitionTexSpeed option 2025-03-19 09:24:05 +09:00
mob-sakai de918718d0 fix: UIEffect with TextMeshPro SubMeshUI appears black in the editor when saving assets 2025-03-19 09:24:05 +09:00
mob-sakai 045db9c3b7 feat: custom transform for transition and gradation 2025-03-19 09:24:05 +09:00
mob-sakai 6542543422 feat: load presets partially and append to existing instance 2025-03-19 09:24:05 +09:00
mob-sakai 3db94e00f8 feat: add built-in presets 2025-03-18 19:43:11 +09:00
mob-sakai 946217069f fix: fix edge detection 2025-03-18 19:43:11 +09:00
mob-sakai 51cd6d8525 feat: add shaders for TextMeshPro Overlay/SSD 2025-03-14 18:05:27 +09:00
mob-sakai 65457e2636 feat: support SoftMaskForUGUI package with UIEffect
This feature allow `UIEffect` component to automatically select shaders like 'UIEffect-SoftMaskable' without any manual configuration.
close #270
2025-03-06 17:50:56 +09:00
semantic-release-bot 3eb775dcf5 chore(release): 5.5.3 [skip ci]
## [5.5.3](https://github.com/mob-sakai/UIEffect/compare/5.5.2...5.5.3) (2025-03-06)

### Bug Fixes

* blur with 'Filled' Image type may cause error ([f0a7642](https://github.com/mob-sakai/UIEffect/commit/f0a76424e690355c101cc2e12183d1a7e77b16c3)), closes [#313](https://github.com/mob-sakai/UIEffect/issues/313)
* IL2CPP build fails on older versions of Unity ([1af89af](https://github.com/mob-sakai/UIEffect/commit/1af89af2c58320f67b8d753767b3b4cf905f844d)), closes [#315](https://github.com/mob-sakai/UIEffect/issues/315)
2025-03-06 08:50:27 +00:00
mob-sakai 1af89af2c5 fix: IL2CPP build fails on older versions of Unity
close #315
2025-03-06 16:59:35 +09:00
mob-sakai f0a76424e6 fix: blur with 'Filled' Image type may cause error
close #313
2025-03-06 16:59:35 +09:00
mob-sakai f2753e9a3d chore: update devtool for windows 2025-03-06 16:59:35 +09:00
semantic-release-bot 91e5be706d chore(release): 5.5.2 [skip ci]
## [5.5.2](https://github.com/mob-sakai/UIEffect/compare/5.5.1...5.5.2) (2025-02-28)

### Bug Fixes

* `PlayOnEnable.Reverse` in UIEffectTweener does not work ([3f5a7dc](https://github.com/mob-sakai/UIEffect/commit/3f5a7dcd2d8248b9e47fb9d38c083f26b798e063)), closes [#310](https://github.com/mob-sakai/UIEffect/issues/310)
* `TransitionFilter` and `GradationMode` do not work correctly when the initial scale is 0 ([bdbf293](https://github.com/mob-sakai/UIEffect/commit/bdbf293c1489c0b248078969b37ec66890620d44)), closes [#311](https://github.com/mob-sakai/UIEffect/issues/311)
* component icons will no longer be displayed in the scene view (Unity 2021.2 or later) ([40ff828](https://github.com/mob-sakai/UIEffect/commit/40ff828ff0697dc8f6597cfcf094cc63532a19dd))
* fix potential issues ([a748adf](https://github.com/mob-sakai/UIEffect/commit/a748adf1bde5e400fcc84ec902a1438867105f75))
* reset time button does not work correctly in the inspector when `UIEffectTweener.direction=Reverse` in the editor ([8513970](https://github.com/mob-sakai/UIEffect/commit/8513970e6f71d393430a573bfb0207428998bee1)), closes [#310](https://github.com/mob-sakai/UIEffect/issues/310)
2025-02-28 09:04:55 +00:00
mob-sakai 8513970e6f fix: reset time button does not work correctly in the inspector when UIEffectTweener.direction=Reverse in the editor
close #310
2025-02-28 17:37:37 +09:00
mob-sakai 3f5a7dcd2d fix: PlayOnEnable.Reverse in UIEffectTweener does not work
close #310
2025-02-27 18:41:37 +09:00
mob-sakai a748adf1bd fix: fix potential issues 2025-02-27 17:43:54 +09:00
mob-sakai 40ff828ff0 fix: component icons will no longer be displayed in the scene view (Unity 2021.2 or later) 2025-02-27 17:43:54 +09:00
mob-sakai bdbf293c14 fix: TransitionFilter and GradationMode do not work correctly when the initial scale is 0
close #311
2025-02-27 09:29:51 +09:00
semantic-release-bot 8155f94943 chore(release): 5.5.1 [skip ci]
## [5.5.1](https://github.com/mob-sakai/UIEffect/compare/5.5.0...5.5.1) (2025-02-14)

### Bug Fixes

* fix v4 compatible components ([6f6a8c9](https://github.com/mob-sakai/UIEffect/commit/6f6a8c95f878a290b1c4238cd0519f14febc04b6))
* fully visible when the transition rate is set to 1 ([0a99bb7](https://github.com/mob-sakai/UIEffect/commit/0a99bb7765443a84070e19c9ea0096808442932e)), closes [#309](https://github.com/mob-sakai/UIEffect/issues/309)
* UIEffect with TextMeshPro appears black in the editor when saving scene ([8cbcd76](https://github.com/mob-sakai/UIEffect/commit/8cbcd765ed9e11c38e3257191c2fc7dcd2c9916e))
2025-02-14 08:01:21 +00:00
mob-sakai 0a99bb7765 fix: fully visible when the transition rate is set to 1
close #309
2025-02-14 15:56:10 +09:00
mob-sakai 6b6ff3e1d8 chore: update demo 2025-02-14 15:56:10 +09:00
mob-sakai 8cbcd765ed fix: UIEffect with TextMeshPro appears black in the editor when saving scene 2025-02-14 15:56:10 +09:00
mob-sakai 6f6a8c95f8 fix: fix v4 compatible components 2025-02-14 15:56:10 +09:00
semantic-release-bot fbc697ce85 chore(release): 5.5.0 [skip ci]
# [5.5.0](https://github.com/mob-sakai/UIEffect/compare/5.4.0...5.5.0) (2025-02-12)

### Features

* add `GradationMode.Diagonal` with 4 colors ([b72a1c0](https://github.com/mob-sakai/UIEffect/commit/b72a1c05c6d1d7b3c0aa11582d4a97da80d7fce9)), closes [#308](https://github.com/mob-sakai/UIEffect/issues/308)
* add built-in presets ([8930b56](https://github.com/mob-sakai/UIEffect/commit/8930b563cb580463e2265483ccd3a42cb84e644b))
2025-02-12 10:25:05 +00:00
mob-sakai 9f8f9f3e7a chore: add demo 2025-02-12 19:11:34 +09:00
mob-sakai 8930b563cb feat: add built-in presets 2025-02-12 12:39:23 +09:00
mob-sakai b72a1c05c6 feat: add GradationMode.Diagonal with 4 colors
close #308
2025-02-12 11:30:13 +09:00
semantic-release-bot fc09152b93 chore(release): 5.4.0 [skip ci]
# [5.4.0](https://github.com/mob-sakai/UIEffect/compare/5.3.4...5.4.0) (2025-02-10)

### Bug Fixes

* gradient color is not updated when calling the `SetGradientKeys` method ([a959fdd](https://github.com/mob-sakai/UIEffect/commit/a959fddd34a93dd0846369938b1cb6be514eee2d))

### Features

* tweener supports `EdgeMode.Shiny` ([32558d4](https://github.com/mob-sakai/UIEffect/commit/32558d4481de31ed9020c82861dc2a2d8ca7d53c)), closes [#307](https://github.com/mob-sakai/UIEffect/issues/307)
2025-02-10 12:19:15 +00:00
mob-sakai fa9c53a0d0 chore: add demo 2025-02-10 20:25:46 +09:00
mob-sakai a959fddd34 fix: gradient color is not updated when calling the SetGradientKeys method 2025-02-10 20:25:46 +09:00
mob-sakai 32558d4481 feat: tweener supports EdgeMode.Shiny
close #307
2025-02-10 20:25:46 +09:00
semantic-release-bot bbb1f965fd chore(release): 5.3.4 [skip ci]
## [5.3.4](https://github.com/mob-sakai/UIEffect/compare/5.3.3...5.3.4) (2025-02-10)

### Bug Fixes

* UIEffect v5.3.3 with TextMeshPro is not working in play mode in editor ([365c43e](https://github.com/mob-sakai/UIEffect/commit/365c43e21dcaaff349cf1362f9bd25b7deb163f7)), closes [#306](https://github.com/mob-sakai/UIEffect/issues/306)
2025-02-10 06:29:40 +00:00
mob-sakai b778d02131 chore: update test workflow 2025-02-10 14:49:34 +09:00
mob-sakai 365c43e21d fix: UIEffect v5.3.3 with TextMeshPro is not working in play mode in editor
close #306
2025-02-10 14:38:43 +09:00
semantic-release-bot 31b16329bc chore(release): 5.3.3 [skip ci]
## [5.3.3](https://github.com/mob-sakai/UIEffect/compare/5.3.2...5.3.3) (2025-02-06)

### Bug Fixes

* when modifying TextMeshPro vertices, element disapear ([7529a7c](https://github.com/mob-sakai/UIEffect/commit/7529a7c4cd8db27a6d3312bce0a6ed6b13e40f35)), closes [#305](https://github.com/mob-sakai/UIEffect/issues/305)
2025-02-06 10:47:39 +00:00
mob-sakai 7529a7c4cd fix: when modifying TextMeshPro vertices, element disapear
close #305
2025-02-06 19:30:01 +09:00
semantic-release-bot c51b5f34bb chore(release): 5.3.2 [skip ci]
## [5.3.2](https://github.com/mob-sakai/UIEffect/compare/5.3.1...5.3.2) (2025-02-04)

### Bug Fixes

* some effects are not working correctly for TextMeshProUGUI in Unity 6 ([63de374](https://github.com/mob-sakai/UIEffect/commit/63de3742ecd7fcdcaa8dcca8dc104c7288291211))
2025-02-04 00:20:28 +00:00
mob-sakai 63de3742ec fix: some effects are not working correctly for TextMeshProUGUI in Unity 6 2025-02-04 09:07:14 +09:00
mob-sakai e9b32e14fd docs: update readme 2025-01-27 15:32:16 +09:00
semantic-release-bot f4ea151244 chore(release): 5.3.1 [skip ci]
## [5.3.1](https://github.com/mob-sakai/UIEffect/compare/5.3.0...5.3.1) (2025-01-27)

### Bug Fixes

* shader keywords for UIEfect are not recognized in Unity 6 ([fd39abf](https://github.com/mob-sakai/UIEffect/commit/fd39abf5a71138919f8feee587576ba187075304)), closes [#301](https://github.com/mob-sakai/UIEffect/issues/301)
2025-01-27 05:03:16 +00:00
mob-sakai fd39abf5a7 fix: shader keywords for UIEfect are not recognized in Unity 6
It seems that `shader_feature_local_fragment needs` to be defined in the shader itself rather than in the cginc file to properly recognize the keywords.
close #301
2025-01-27 14:02:42 +09:00
semantic-release-bot 27a04ca294 chore(release): 5.3.0 [skip ci]
# [5.3.0](https://github.com/mob-sakai/UIEffect/compare/5.2.4...5.3.0) (2025-01-26)

### Features

* `SamplingFilter.EdgeAlpha` and `SamplingFilter.EdgeLuminance` now support the `Sampling Width` property for edge width ([33b1177](https://github.com/mob-sakai/UIEffect/commit/33b1177815b935a887c5a8918748cbeafec32b6b))
* add `EdgeMode` feature ([eadb477](https://github.com/mob-sakai/UIEffect/commit/eadb477bcd91f8909bfa7b8976241411363ee12c))
* add `ResetOnEnable` option for `UIEffectTweener` ([e326bb7](https://github.com/mob-sakai/UIEffect/commit/e326bb77537b921df775646142105a490ae54851)), closes [#299](https://github.com/mob-sakai/UIEffect/issues/299)
* add `TransitionAutoSpeed` property ([7a765c3](https://github.com/mob-sakai/UIEffect/commit/7a765c32d87f6dfbdb990d5b3a272dd80696b374))
* add `TransitionFilter.Pattern` feature ([b57e98b](https://github.com/mob-sakai/UIEffect/commit/b57e98b64c61a7c7eb3ca97f3bd7e909956ee469))
2025-01-26 16:44:32 +00:00
mob-sakai 8edf1f1128 docs: update readme 2025-01-27 01:18:59 +09:00
mob-sakai c5dfc3bd35 demo: add demos 2025-01-27 01:15:43 +09:00
mob-sakai 372519d01f chore: update coffee.internal 2025-01-27 01:15:43 +09:00
mob-sakai 6be2ab7a4f refactor editor 2025-01-27 01:15:43 +09:00
mob-sakai e326bb7753 feat: add ResetOnEnable option for UIEffectTweener
#299
2025-01-27 01:15:43 +09:00
mob-sakai 7a765c32d8 feat: add TransitionAutoSpeed property
You can use this property to loop the TransitionRate without tweener or animation.
2025-01-27 01:15:43 +09:00
mob-sakai b57e98b64c feat: add TransitionFilter.Pattern feature 2025-01-27 01:15:43 +09:00
mob-sakai eadb477bcd feat: add EdgeMode feature 2025-01-27 01:15:43 +09:00
mob-sakai 33b1177815 feat: SamplingFilter.EdgeAlpha and SamplingFilter.EdgeLuminance now support the Sampling Width property for edge width 2025-01-27 01:15:43 +09:00
mob-sakai 792db85b79 refactor: move shader_feature keywords to cginc 2025-01-27 01:15:43 +09:00
semantic-release-bot 889c7ff578 chore(release): 5.2.4 [skip ci]
## [5.2.4](https://github.com/mob-sakai/UIEffect/compare/5.2.3...5.2.4) (2025-01-26)

### Bug Fixes

* properties may not update correctly when changed via code or animation ([5994f88](https://github.com/mob-sakai/UIEffect/commit/5994f8875ed2280e5c863c30f9c7900d4dce70ed)), closes [#300](https://github.com/mob-sakai/UIEffect/issues/300)
2025-01-26 16:04:15 +00:00
mob-sakai 5994f8875e fix: properties may not update correctly when changed via code or animation
close #300
2025-01-25 19:30:01 +09:00
semantic-release-bot b2d70af9c3 chore(release): 5.2.3 [skip ci]
## [5.2.3](https://github.com/mob-sakai/UIEffect/compare/5.2.2...5.2.3) (2025-01-23)

### Bug Fixes

* `SamplingFilter.None` now correctly respects the sampling scale setting ([bc1578b](https://github.com/mob-sakai/UIEffect/commit/bc1578b0ca91b830b976bf200d387d0ac6963ae6))
* fix the shadow mode inspector in editor ([da53585](https://github.com/mob-sakai/UIEffect/commit/da535854ccbeeb98b2556423425d39058bd5f479))
* UIEffect may not work correctly when using `FallbackAtlas` with TextMeshProUGUI ([d3779f9](https://github.com/mob-sakai/UIEffect/commit/d3779f9f57d0410fa4526527ebed30885bfbc2dd)), closes [#298](https://github.com/mob-sakai/UIEffect/issues/298)
2025-01-23 10:17:55 +00:00
mob-sakai da535854cc fix: fix the shadow mode inspector in editor 2025-01-23 16:29:10 +09:00
mob-sakai bc1578b0ca fix: SamplingFilter.None now correctly respects the sampling scale setting 2025-01-23 16:29:10 +09:00
mob-sakai d3779f9f57 fix: UIEffect may not work correctly when using FallbackAtlas with TextMeshProUGUI
close #298
2025-01-23 16:13:10 +09:00
semantic-release-bot 213daa85e9 chore(release): 5.2.2 [skip ci]
## [5.2.2](https://github.com/mob-sakai/UIEffect/compare/5.2.1...5.2.2) (2025-01-18)

### Bug Fixes

* in Unity 6, `Shadow Color` has no effect on TextMeshPro ([6e4d4ab](https://github.com/mob-sakai/UIEffect/commit/6e4d4ab03db786e4c28d0f2c57d9e58655c5d029)), closes [#297](https://github.com/mob-sakai/UIEffect/issues/297)
2025-01-18 08:24:10 +00:00
mob-sakai 6e4d4ab03d fix: in Unity 6, Shadow Color has no effect on TextMeshPro
Import `TextMeshPro Support` again.
close #297
2025-01-18 17:00:56 +09:00
semantic-release-bot 4222d72318 chore(release): 5.2.1 [skip ci]
## [5.2.1](https://github.com/mob-sakai/UIEffect/compare/5.2.0...5.2.1) (2025-01-14)

### Bug Fixes

* shadow color being transparent at maximum `Shadow Fade` ([1d849e5](https://github.com/mob-sakai/UIEffect/commit/1d849e54cb57218a67afc2f8ad36d345bfdd0f74)), closes [#296](https://github.com/mob-sakai/UIEffect/issues/296)
* TextMeshPro is not displayed in prefab mode ([2b44837](https://github.com/mob-sakai/UIEffect/commit/2b44837bb9c93e1cc817a2c1cd112b244cd09391)), closes [#295](https://github.com/mob-sakai/UIEffect/issues/295)
* TextMeshProUGUI disappears when the Y-axis scale is changed ([8159c09](https://github.com/mob-sakai/UIEffect/commit/8159c091e8a6805a7781046ae0f660a3be13862c)), closes [#295](https://github.com/mob-sakai/UIEffect/issues/295)
2025-01-14 11:46:54 +00:00
mob-sakai 8159c091e8 fix: TextMeshProUGUI disappears when the Y-axis scale is changed
close #295
2025-01-14 20:05:01 +09:00
mob-sakai 2b44837bb9 fix: TextMeshPro is not displayed in prefab mode
close #295
2025-01-14 19:58:26 +09:00
mob-sakai 1d849e54cb fix: shadow color being transparent at maximum Shadow Fade
close #296
2025-01-14 19:42:46 +09:00
semantic-release-bot 811f5762e6 chore(release): 5.2.0 [skip ci]
# [5.2.0](https://github.com/mob-sakai/UIEffect/compare/5.1.0...5.2.0) (2025-01-07)

### Bug Fixes

* `Gradation` properties do not update when a preset is loaded ([edf6943](https://github.com/mob-sakai/UIEffect/commit/edf694313f101b66f760bca64593fb87037dcb3d)), closes [#291](https://github.com/mob-sakai/UIEffect/issues/291)
* an error occurs when saving a preset ([894c561](https://github.com/mob-sakai/UIEffect/commit/894c5610d044f211067037b6c69f9860ac496ffc)), closes [#293](https://github.com/mob-sakai/UIEffect/issues/293)
* fix gradation gradient edge (angle gradient) ([0ef6027](https://github.com/mob-sakai/UIEffect/commit/0ef60273714c7b68131f2f0d233b16335a5cd367))

### Features

* `Angle Gradient` gradation supports fixed mode gradient ([7cb8325](https://github.com/mob-sakai/UIEffect/commit/7cb8325e445350d2175865f736186f719e1cbe00))
* `Angle Gradient` gradation supports RectTransform pivot ([2f63adf](https://github.com/mob-sakai/UIEffect/commit/2f63adfba057bec7f8183a5b34654cdf84163a34))
* add `Use HDR Color Picker` option for project settings (editor) ([1be0cd4](https://github.com/mob-sakai/UIEffect/commit/1be0cd45db952d05e51d508c58f65a6541df9de0)), closes [#290](https://github.com/mob-sakai/UIEffect/issues/290)
* the `Allow To Modify Mesh Shape` property should remain unchanged when loading a preset ([f7175c0](https://github.com/mob-sakai/UIEffect/commit/f7175c037371278eb7a0c7883cffccb5c31dba0a)), closes [#294](https://github.com/mob-sakai/UIEffect/issues/294)
* the `Sampling Scale` property should remain unchanged when loading a preset ([238a17d](https://github.com/mob-sakai/UIEffect/commit/238a17d57ddf1f6b859ce830e80a1be6c3d739f1)), closes [#292](https://github.com/mob-sakai/UIEffect/issues/292)
2025-01-07 19:36:25 +00:00
mob-sakai 2f63adfba0 feat: Angle Gradient gradation supports RectTransform pivot 2025-01-08 04:26:07 +09:00
mob-sakai 7cb8325e44 feat: Angle Gradient gradation supports fixed mode gradient 2025-01-08 04:26:07 +09:00
mob-sakai eafb9ce365 test: add reflection test for internal API 2025-01-08 04:26:07 +09:00
mob-sakai 0ef6027371 fix: fix gradation gradient edge (angle gradient) 2025-01-08 04:26:07 +09:00
mob-sakai 92f9611a39 docs: update readme 2025-01-08 04:26:07 +09:00
mob-sakai edf694313f fix: Gradation properties do not update when a preset is loaded
close #291
2025-01-07 17:23:22 +09:00
mob-sakai 894c5610d0 fix: an error occurs when saving a preset
close #293
2025-01-07 17:23:22 +09:00
mob-sakai f7175c0373 feat: the Allow To Modify Mesh Shape property should remain unchanged when loading a preset
close #294
2025-01-07 17:23:22 +09:00
mob-sakai 238a17d57d feat: the Sampling Scale property should remain unchanged when loading a preset
close #292
2025-01-07 17:23:22 +09:00
fumiko 97237b3aa8 style: apply format 2025-01-07 17:23:22 +09:00
fumiko 1be0cd45db feat: add Use HDR Color Picker option for project settings (editor)
close #290
2025-01-07 17:23:19 +09:00
semantic-release-bot 9799069633 chore(release): 5.1.0 [skip ci]
# [5.1.0](https://github.com/mob-sakai/UIEffect/compare/5.0.2...5.1.0) (2024-12-31)

### Bug Fixes

* changing the `shadowMirrorScale` property via code does not update the effect ([d9bf0e1](https://github.com/mob-sakai/UIEffect/commit/d9bf0e12fe918fc36120be3e1df2acbb00b1762b))
* fix reverse direction mode for UIEffectTweener ([54825ee](https://github.com/mob-sakai/UIEffect/commit/54825eedc8070e74fc276e1e08ea0073cf265189)), closes [#281](https://github.com/mob-sakai/UIEffect/issues/281) [#282](https://github.com/mob-sakai/UIEffect/issues/282) [#283](https://github.com/mob-sakai/UIEffect/issues/283)

### Features

* add `Color Glow`, `Transition Color Glow` and `Shadow Color Glow` options ([e9522d3](https://github.com/mob-sakai/UIEffect/commit/e9522d3f0e3bc0c429ef32f240625e903ca790ee))
* add `GradationMode.Angle` and `GradationMode.AngleGradient` ([08e9ba7](https://github.com/mob-sakai/UIEffect/commit/08e9ba73d78ba52502a6e795587441061377cd99))
* add `OnComplete` event for UIEffectTweener ([aeb78ed](https://github.com/mob-sakai/UIEffect/commit/aeb78ed577d70c47aacd754ea2aa3916e6e49c1b)), closes [#289](https://github.com/mob-sakai/UIEffect/issues/289) [#188](https://github.com/mob-sakai/UIEffect/issues/188)
* add `PlayOnEnable` option for UIEffectTweener ([1558736](https://github.com/mob-sakai/UIEffect/commit/155873669d77fc3281caaa0fc9f861e62aa489f2))
* add `SamplingScale` option ([2b43bc4](https://github.com/mob-sakai/UIEffect/commit/2b43bc42d4a9e0a1c224139ccf91f7a6f76656fc)), closes [#269](https://github.com/mob-sakai/UIEffect/issues/269)
* add `Shadow Color` and `Shadow Blur` options ([d0a3ca6](https://github.com/mob-sakai/UIEffect/commit/d0a3ca60904c0eebf63178a0fb899bb17ecefe75))
* add a button to swap gradation colors (editor) ([20a6ca0](https://github.com/mob-sakai/UIEffect/commit/20a6ca0815aaa899934fde318beecc1dde5e1132))
* add option to not automatically plays tweener effect ([88609f5](https://github.com/mob-sakai/UIEffect/commit/88609f5e368e38224a698270113b4f3190580a19))
* automatically display a dialog to import TextMeshPro support ([f2df188](https://github.com/mob-sakai/UIEffect/commit/f2df1889d152ae68926067978c60b4810fdef3f1))
* gradation feature ([bbe57df](https://github.com/mob-sakai/UIEffect/commit/bbe57df7a0a184793bd6d98a2b929055f69860b3)), closes [#277](https://github.com/mob-sakai/UIEffect/issues/277) [#66](https://github.com/mob-sakai/UIEffect/issues/66)
* on-demand UIEffect shader support ([bdd8e08](https://github.com/mob-sakai/UIEffect/commit/bdd8e0857235c56b7013fe768a333c5575aaa0ef)), closes [#212](https://github.com/mob-sakai/UIEffect/issues/212) [#271](https://github.com/mob-sakai/UIEffect/issues/271)
* support `TextMeshPro/Bitmap` and `TextMeshPro/Mobile/Bitmap` shaders. ([23ac398](https://github.com/mob-sakai/UIEffect/commit/23ac3985d2a2d9497b2d50b3755be671f3a07aa9)), closes [#284](https://github.com/mob-sakai/UIEffect/issues/284)
* support non full-rect graphics for some effect ([a66baea](https://github.com/mob-sakai/UIEffect/commit/a66baea1e8d895c424ba3dc1fce64f969d79561e))
* UIEffectTweener animation preview in edit mode ([e17b4a0](https://github.com/mob-sakai/UIEffect/commit/e17b4a0bfd262dc22ad2a13af5b0571b43a74abd)), closes [#279](https://github.com/mob-sakai/UIEffect/issues/279)
2024-12-31 00:32:24 +00:00
mob-sakai 43bc2e29a8 docs: update 2024-12-31 09:29:51 +09:00
mob-sakai 4a6007a467 demo: update demos 2024-12-31 09:29:51 +09:00
mob-sakai 08e9ba73d7 feat: add GradationMode.Angle and GradationMode.AngleGradient 2024-12-31 09:29:51 +09:00
mob-sakai aeb78ed577 feat: add OnComplete event for UIEffectTweener
close #289, close #188
2024-12-31 09:29:51 +09:00
mob-sakai 7fc8b1599a refactor: change allowExtendVertex to allowToModifyMeshShape 2024-12-31 09:21:30 +09:00
mob-sakai c9fe854b5d refactor 2024-12-31 09:21:30 +09:00
mob-sakai 20a6ca0815 feat: add a button to swap gradation colors (editor) 2024-12-31 09:21:30 +09:00
mob-sakai f2df1889d1 feat: automatically display a dialog to import TextMeshPro support 2024-12-31 09:21:30 +09:00
mob-sakai bbe57df7a0 feat: gradation feature
close #277, close #66
2024-12-31 09:21:30 +09:00
mob-sakai e9522d3f0e feat: add Color Glow, Transition Color Glow and Shadow Color Glow options 2024-12-30 17:03:47 +09:00
mob-sakai d0a3ca6090 feat: add Shadow Color and Shadow Blur options 2024-12-30 17:03:47 +09:00
mob-sakai a66baea1e8 feat: support non full-rect graphics for some effect 2024-12-30 17:03:47 +09:00
mob-sakai 5bee8adc83 refactor: shadow context 2024-12-30 17:03:47 +09:00
mob-sakai 9a97c50c54 style: format 2024-12-30 17:03:47 +09:00
mob-sakai bc20f28ac9 update coffee.internal 2024-12-30 17:03:47 +09:00
mob-sakai d9bf0e12fe fix: changing the shadowMirrorScale property via code does not update the effect 2024-12-30 17:03:47 +09:00
mob-sakai 2b43bc42d4 feat: add SamplingScale option
close #269
2024-12-28 00:15:38 +09:00
mob-sakai 23ac3985d2 feat: support TextMeshPro/Bitmap and TextMeshPro/Mobile/Bitmap shaders.
close #284
2024-12-28 00:15:38 +09:00
mob-sakai e17b4a0bfd feat: UIEffectTweener animation preview in edit mode
close #279
2024-12-28 00:15:37 +09:00
mob-sakai 155873669d feat: add PlayOnEnable option for UIEffectTweener 2024-12-28 00:15:37 +09:00
mob-sakai 54825eedc8 fix: fix reverse direction mode for UIEffectTweener
close #281, close #282, close #283
2024-12-24 19:52:05 +09:00
mob-sakai bdd8e08572 feat: on-demand UIEffect shader support
close #212, close #271
2024-12-24 19:51:17 +09:00
Victor Guilherme 88609f5e36 feat: add option to not automatically plays tweener effect
Added a new option on the tweener effect called "StartMode" to set it to not automatically play on start. eg. you have an image with a UIEffect and UIEffecTweener and do not want the effect to play instantly when the object starts but still want to use Normal/Unscaled update mode to not have to tween values manually in code.
2024-12-24 19:49:48 +09:00
semantic-release-bot 476a0ba23d chore(release): 5.0.2 [skip ci]
## [5.0.2](https://github.com/mob-sakai/UIEffect/compare/5.0.1...5.0.2) (2024-12-24)

### Bug Fixes

* incorrect transparency when applying the shiny filter to TextMeshProUGUI ([f74279f](https://github.com/mob-sakai/UIEffect/commit/f74279fb8353226b494f00582ed5eb7fe87d147f)), closes [#287](https://github.com/mob-sakai/UIEffect/issues/287)
* TextMeshProUGUI disappears when the Y-axis scale is changed ([9d98c5d](https://github.com/mob-sakai/UIEffect/commit/9d98c5d3e1c6ead8e3312a7e3a36fe89b38aed68)), closes [#286](https://github.com/mob-sakai/UIEffect/issues/286)
2024-12-24 03:52:37 +00:00
mob-sakai 9d98c5d3e1 fix: TextMeshProUGUI disappears when the Y-axis scale is changed
close #286
2024-12-24 11:44:54 +09:00
mob-sakai bc11095020 refactor 2024-12-24 10:18:07 +09:00
mob-sakai f74279fb83 fix: incorrect transparency when applying the shiny filter to TextMeshProUGUI
close #287
2024-12-24 10:17:52 +09:00
semantic-release-bot 3d23cbfcdb chore(release): 5.0.1 [skip ci]
## [5.0.1](https://github.com/mob-sakai/UIEffect/compare/5.0.0...5.0.1) (2024-12-14)

### Bug Fixes

* build AssetBundle error ([7374747](https://github.com/mob-sakai/UIEffect/commit/73747478a4e5754891ebd4fd2d54955e82a72eb3))
* fix cutoff transition effect ([c893cb0](https://github.com/mob-sakai/UIEffect/commit/c893cb0ce2e90bf13456adbc7d2e0e0642cbac1d))
* fix TextMeshPro shader (underlay and bevel) ([f39097a](https://github.com/mob-sakai/UIEffect/commit/f39097a73fc8560a50f848290ce4c5a235b68cac))
* TextMeshPro objects appeared as black blocks when saving prefabs in prefab mode ([5889486](https://github.com/mob-sakai/UIEffect/commit/5889486f18afde6dec203bbe4aaca45760a9dce1)), closes [#285](https://github.com/mob-sakai/UIEffect/issues/285)
2024-12-14 14:42:55 +00:00
mob-sakai 5889486f18 fix: TextMeshPro objects appeared as black blocks when saving prefabs in prefab mode
close #285
2024-12-14 23:34:42 +09:00
mob-sakai f39097a73f fix: fix TextMeshPro shader (underlay and bevel) 2024-12-14 21:09:52 +09:00
mob-sakai c893cb0ce2 fix: fix cutoff transition effect 2024-12-14 21:09:45 +09:00
mob-sakai 73747478a4 fix: build AssetBundle error 2024-12-14 21:09:07 +09:00
mob-sakai 36bd7892fa chore: update workflow 2024-12-14 21:08:59 +09:00
mob-sakai 5d0b03a39c chore: update test workflow for PR 2024-11-23 13:41:19 +09:00
rickytheoldtree 40df577dbc docs: update README.md 2024-11-23 11:30:56 +09:00
mob-sakai f0823aa985 Create CODEOWNERS 2024-11-23 11:01:14 +09:00
mob-sakai 952adb3c26 chore: update deploy workflow 2024-11-11 23:43:26 +09:00
semantic-release-bot 53e6b41b9d chore(release): 5.0.0 [skip ci]
# [5.0.0](https://github.com/mob-sakai/UIEffect/compare/4.0.0...5.0.0) (2024-11-11)

### Features

* add built-in UIEffect preset ([4adb58c](https://github.com/mob-sakai/UIEffect/commit/4adb58ca61d75897e67ef8674f9be9b9d6156b24))
* add support for TextMeshPro, including `<font>` and `<sprite>` tags ([a4f85cb](https://github.com/mob-sakai/UIEffect/commit/a4f85cb0ee58a60e20572fcce0ebf204effce51e))
* add UIEffectProjectSettings ([1306e19](https://github.com/mob-sakai/UIEffect/commit/1306e19cab9aeb9ec86a8047d59c2a9ad11bb128))
* add UIEffectReplica component ([3bdc61c](https://github.com/mob-sakai/UIEffect/commit/3bdc61c2efe51e198650171e7a235276b82cb1f0))
* add UIEffectTweener component ([e2c1605](https://github.com/mob-sakai/UIEffect/commit/e2c1605c1986c34f23c85dc9ec22f00f16bca21d))
* add v4 compatible components ([d40a019](https://github.com/mob-sakai/UIEffect/commit/d40a0198c439b47c5b87f554df7eeb6ad5741fcd))
* completely redesigned UIEffect architecture ([4e069a4](https://github.com/mob-sakai/UIEffect/commit/4e069a45d9817095f727f3bd18d793683fb052c2))

### BREAKING CHANGES

* All v4 components are obsolete. See README to upgrade.
2024-11-11 14:12:38 +00:00
mob-sakai ef028058a7 docs: add docs 2024-11-11 22:30:08 +09:00
mob-sakai e8e14c8d15 chore: add workflows 2024-11-11 22:30:08 +09:00
mob-sakai bd3428d3c1 chore: add demos 2024-11-11 22:30:08 +09:00
mob-sakai 74f0dc4d5c docs: add component icons 2024-11-11 22:30:08 +09:00
mob-sakai d40a0198c4 feat: add v4 compatible components
Use these components for an easy upgrade to v5 with minimal changes.
2024-11-11 22:30:08 +09:00
mob-sakai a4f85cb0ee feat: add support for TextMeshPro, including <font> and <sprite> tags 2024-11-11 22:30:07 +09:00
mob-sakai 1306e19cab feat: add UIEffectProjectSettings
You can adjust the project-wide settings for UIEffect.
2024-11-11 22:30:07 +09:00
mob-sakai e2c1605c19 feat: add UIEffectTweener component
`UIEffectTweener` component animates `UIEffect` intensity or rate, enabling easy control over effect animations without the need for an `AnimationClip`.
2024-11-11 22:30:07 +09:00
mob-sakai 3bdc61c2ef feat: add UIEffectReplica component
`UIEffectReplica` component applies visual effects to UI elements by replicating the settings of another `UIEffect` component.
This allows the same effect to be applied across multiple UI elements simultaneously.
2024-11-11 22:30:07 +09:00
mob-sakai 4adb58ca61 feat: add built-in UIEffect preset 2024-11-11 22:30:07 +09:00
mob-sakai 4e069a45d9 feat: completely redesigned UIEffect architecture
BREAKING CHANGE: All v4 components are obsolete. See README to upgrade.
2024-11-11 22:30:07 +09:00
mob-sakai 0424295dfc chore: import coffee.internal 2024-11-11 04:08:46 +09:00
mob-sakai 20c040284c chore: add resources 2024-11-09 18:37:00 +09:00
mob-sakai 1bd04e712c init project 2024-11-09 18:35:22 +09:00
792 changed files with 280674 additions and 96746 deletions
+212
View File
@@ -0,0 +1,212 @@
root = true
[*.json]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true
[*.asmdef]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true
# C# files
[*.cs]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true
csharp_style_namespace_declarations = block_scoped
csharp_style_implicit_object_creation_when_type_is_apparent = false
resharper_object_creation_when_type_evident = explicitly_typed
# Keep
csharp_keep_existing_attribute_arrangement = true
csharp_keep_existing_embedded_arrangement = true
csharp_keep_user_linebreaks = true
csharp_keep_existing_linebreaks = true
csharp_place_simple_embedded_statement_on_same_line = false
csharp_place_simple_blocks_on_single_line = false
csharp_keep_existing_initializer_arrangement = true
csharp_keep_existing_arrangement = true
# Standard properties
end_of_line = lf
insert_final_newline = true
# Brace preferences
csharp_brace_style = next_line
csharp_braces_for_ifelse = required_for_multiline_statement
csharp_braces_for_for = required
csharp_braces_for_foreach = required
csharp_braces_for_while = required
csharp_braces_for_dowhile = required
csharp_braces_for_using = required
csharp_case_block_braces = next_line
csharp_initializer_braces = next_line
# New line preferences
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_between_query_expression_clauses = true
# Indentation preferences
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = false
csharp_indent_switch_labels = true
csharp_indent_labels = one_less_than_current
# Modifier preferences
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
# avoid this. unless absolutely necessary
dotnet_style_qualification_for_field = false:suggestion
dotnet_style_qualification_for_property = false:suggestion
dotnet_style_qualification_for_method = false:suggestion
dotnet_style_qualification_for_event = false:suggestion
# Types: use keywords instead of BCL types, and permit var only when the type is clear
csharp_style_var_for_built_in_types = true:suggestion
csharp_style_var_when_type_is_apparent = true:none
csharp_style_var_elsewhere = true:suggestion
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
dotnet_style_predefined_type_for_member_access = true:suggestion
#
resharper_keep_existing_embedded_arrangement = true
# Arguments
csharp_arguments_literal = named:suggestion
csharp_arguments_string_literal = named:suggestion
# Naming: public and protected fields -> camelCase
dotnet_naming_rule.protected_public_fields.severity = suggestion
dotnet_naming_rule.protected_public_fields.symbols = protected_public_fields
dotnet_naming_rule.protected_public_fields.style = camel_case
dotnet_naming_symbols.protected_public_fields.applicable_kinds = field, event
dotnet_naming_symbols.protected_public_fields.applicable_accessibilities = public, protected
dotnet_naming_style.camel_case.capitalization = camel_case
# Naming: properties -> camelCase
dotnet_naming_rule.properties.severity = suggestion
dotnet_naming_rule.properties.symbols = properties
dotnet_naming_rule.properties.style = camel_case
dotnet_naming_symbols.properties.applicable_kinds = property
# Naming: constant fields -> k_PascalCase
dotnet_naming_rule.constant_fields.severity = suggestion
dotnet_naming_rule.constant_fields.symbols = constant_fields
dotnet_naming_rule.constant_fields.style = k_pascal_case
dotnet_naming_symbols.constant_fields.applicable_kinds = field
dotnet_naming_symbols.constant_fields.required_modifiers = const
dotnet_naming_style.k_pascal_case.required_prefix = k_
dotnet_naming_style.k_pascal_case.capitalization = pascal_case
# Naming: static fields -> s_PascalCase
dotnet_naming_rule.static_fields_should_have_prefix.severity = suggestion
dotnet_naming_rule.static_fields_should_have_prefix.symbols = static_fields
dotnet_naming_rule.static_fields_should_have_prefix.style = s_pascal_case
dotnet_naming_symbols.static_fields.applicable_kinds = field, property
dotnet_naming_symbols.static_fields.required_modifiers = static
dotnet_naming_symbols.static_fields.applicable_accessibilities = private, internal, private_protected
dotnet_naming_style.s_pascal_case.required_prefix = s_
dotnet_naming_style.s_pascal_case.capitalization = pascal_case
# Naming: internal and private fields -> _camelCase
dotnet_naming_rule.private_internal_fields.severity = suggestion
dotnet_naming_rule.private_internal_fields.symbols = private_internal_fields
dotnet_naming_rule.private_internal_fields.style = _camel_case
dotnet_naming_symbols.private_internal_fields.applicable_kinds = field
dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal
dotnet_naming_style._camel_case.required_prefix = _
dotnet_naming_style._camel_case.capitalization = camel_case
# Code style defaults
dotnet_sort_system_directives_first = true
csharp_preserve_single_line_statements = false
csharp_prefer_static_local_function = true:suggestion
csharp_prefer_simple_using_statement = false:none
csharp_style_prefer_switch_expression = true:suggestion
dotnet_style_readonly_field = true:suggestion
# Expression-level preferences
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_auto_properties = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
csharp_prefer_simple_default_expression = true:suggestion
# Expression-bodied members
csharp_style_expression_bodied_accessors = when_on_single_line:suggestion
csharp_style_expression_bodied_methods = false:suggestion
csharp_style_expression_bodied_constructors = false:suggestion
csharp_style_expression_bodied_operators = false:suggestion
csharp_style_expression_bodied_properties = when_on_single_line:suggestion
csharp_style_expression_bodied_indexers = false:suggestion
csharp_style_expression_bodied_lambdas = when_on_single_line:silent
csharp_style_expression_bodied_local_functions = false:suggestion
# Pattern matching
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
# Null checking preferences
csharp_style_throw_expression = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion
# Other features
csharp_style_prefer_index_operator = false:none
csharp_style_prefer_range_operator = false:none
csharp_style_pattern_local_over_anonymous_function = false:none
# Space preferences
csharp_space_after_cast = false
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_comma = true
csharp_space_after_dot = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_after_semicolon_in_for_statement = true
csharp_space_around_binary_operators = before_and_after
csharp_space_around_declaration_statements = false
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_before_comma = false
csharp_space_before_dot = false
csharp_space_before_open_square_brackets = false
csharp_space_before_semicolon_in_for_statement = false
csharp_space_between_empty_square_brackets = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_name_and_open_parenthesis = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false
# ReSharper inspection severities
resharper_check_namespace_highlighting = none
resharper_for_can_be_converted_to_foreach_highlighting = none
resharper_xmldoc_indent_text = ZeroIndent
+6
View File
@@ -0,0 +1,6 @@
# This is a comment.
# Each line is a file pattern followed by one or more owners.
# https://docs.github.com/ja/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
# Default owners
* @mob-sakai
+12
View File
@@ -0,0 +1,12 @@
# 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']
+15 -3
View File
@@ -1,9 +1,14 @@
---
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.
@@ -14,10 +19,17 @@ Steps to reproduce the behavior:
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. 1.0.0]
- Platform: [e.g. Editor(Windows/Mac), Standalone(Windows/Mac), iOS, Android, WebGL]
- Unity: [e.g. 2018.2.8f1]
- UIEffect: [e.g. v3.0.0]
- Unity version: [e.g. 2018.2.8f1]
- Build options: [e.g. IL2CPP, .Net 4.x, LWRP]
**Additional context**
Add any other context, screenshots or gif animations about the bug here.
Add any other context about the problem here.
+6 -1
View File
@@ -1,9 +1,14 @@
---
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 [...]
@@ -14,4 +19,4 @@ A clear and concise description of what you want to happen.
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context, screenshots or gif animations about the feature request here.
Add any other context or screenshots about the feature request here.
+8 -8
View File
@@ -1,16 +1,16 @@
---
name: Question
about: Feel free to ask us any question.
about: Ask a question about this project
title: ''
labels: question
assignees: mob-sakai
---
**Describe the question**
A clear and concise description of what the question is.
NOTE: Your issue may already be reported! Please search on the [issue tracker](../) before creating one.
**Environment (please complete the following information):**
- Platform: [e.g. Editor(Windows/Mac), Standalone(Windows/Mac), iOS, Android, WebGL]
- Unity: [e.g. 2018.2.8f1]
- UIEffect: [e.g. v3.0.0]
**Describe what help do you need**
A description of the question.
**Additional context**
Add any other context, screenshots or gif animations about the question here.
Add any other context or screenshots about the question here.
+37
View File
@@ -0,0 +1,37 @@
# Pull Request Template
## Description
- Please include a summary of the change and which issue is fixed.
- Please also include relevant motivation and context.
- List any dependencies that are required for this change.
Fixes #{issue_number}
## Type of change
Please write the commit message in the format corresponding to the change type.
Please see [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) for more information.
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Update documentations
- [ ] Others (refactoring, style changes, etc.)
## Test environment
- Platform: [e.g. Editor(Windows/Mac), Standalone(Windows/Mac), iOS, Android, WebGL]
- Unity version: [e.g. 2022.2.0f1]
- Build options: [e.g. IL2CPP, .Net 4.x, URP/HDRP]
## Checklist
- [ ] This pull request is for merging into the `develop` branch
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have checked my code and corrected any misspellings
+28
View File
@@ -0,0 +1,28 @@
name: 🚀 Deploy with Zip
on:
workflow_dispatch:
inputs:
zip:
description: "The url to the zip file"
required: true
jobs:
deploy:
name: 🚀 Deploy
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
steps:
- name: 📦 Download zip file To '_site'
run: |
curl -L ${{ github.event.inputs.zip }} -o _site.zip
unzip _site.zip -d _site
find _site -name __MACOSX | xargs rm -rf
- name: 📦 Upload '_site'
uses: actions/upload-pages-artifact@v3
- name: 🚀 Deploy To GitHub Pages
uses: actions/deploy-pages@v4
+44
View File
@@ -0,0 +1,44 @@
name: 🔖 Release
run-name: 🔖 Release (${{ github.ref_name }})
on:
workflow_dispatch:
push:
branches:
- preview
- main
- v*.x
tags-ignore:
- "**"
jobs:
release:
name: 🔖 Release (${{ github.ref_name }})
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
issues: write
outputs:
channel: ${{ steps.release.outputs.new_release_channel }}
released: ${{ steps.release.outputs.new_release_published }}
tag: ${{ steps.release.outputs.new_release_git_tag }}
steps:
- name: 🚚 Checkout (${{ github.ref_name }})
uses: actions/checkout@v4
- name: 🔖 Run semantic release
uses: cycjimmy/semantic-release-action@v4
id: release
with:
working_directory: Packages/src
extra_plugins: |
@semantic-release/changelog
@semantic-release/git
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- run: |
echo "🔖 New release published: '${{ steps.release.outputs.new_release_published }}'" | tee -a $GITHUB_STEP_SUMMARY
echo "🔖 New release channel: '${{ steps.release.outputs.new_release_channel }}'" | tee -a $GITHUB_STEP_SUMMARY
echo "🔖 New release git tag: '${{ steps.release.outputs.new_release_git_tag }}'" | tee -a $GITHUB_STEP_SUMMARY
+126
View File
@@ -0,0 +1,126 @@
# Required secrets
# UNITY_LICENSE: The contents of Unity license file
# UNITY_EMAIL: Unity user email to login
# UNITY_PASSWORD: Unity user password to login
name: 🧪 Test URP
run-name: 🧪 Test URP (${{ github.event.pull_request.title || github.ref_name }})
env:
# MINIMUM_VERSION: The minimum version of Unity.
MINIMUM_VERSION: 6000.0
# EXCLUDE_FILTER: The excluded versions of Unity.
EXCLUDE_FILTER: "(2020.2.0|2021.1|2023.2|2023.3)"
PROJECT_PATH: UIEffectURP
on:
workflow_dispatch:
inputs:
usePeriodVersions:
description: "Use the period versions (.0f1, .10f1, 20f1, ...)."
required: false
default: "true"
push:
branches:
- develop
- "develop-*"
tags:
- "!*"
paths-ignore:
- "**.md"
pull_request_target:
types:
- opened
- reopened
- synchronize
paths-ignore:
- "**.md"
jobs:
setup:
name: ⚙️ Setup
runs-on: ubuntu-latest
outputs:
unityVersions: ${{ steps.setup.outputs.unityVersions }}
steps:
- name: ⚙️ Find target Unity versions
id: setup
run: |
echo "==== Target Unity Versions ===="
LATEST_VERSIONS=`npx unity-changeset list --versions --latest-patch --min ${MINIMUM_VERSION} --json --all`
if [ "${{ inputs.usePeriodVersions }}" = "true" ]; then
ADDITIONAL_VERSIONS=`npx unity-changeset list --versions --grep '0f' --min ${MINIMUM_VERSION} --json`
else
ADDITIONAL_VERSIONS=[]
fi
VERSIONS=`echo "[${LATEST_VERSIONS}, ${ADDITIONAL_VERSIONS}]" \
| jq -c '[ flatten | sort | unique | .[] | select( test("${{ env.EXCLUDE_FILTER }}") | not ) ]'`
echo "unityVersions=${VERSIONS}" | tee $GITHUB_OUTPUT
test:
name: 🧪 Run tests
runs-on: ubuntu-latest
permissions:
checks: write
contents: read
needs: setup
strategy:
fail-fast: false
max-parallel: 6
matrix:
unityVersion: ${{ fromJson(needs.setup.outputs.unityVersions) }}
steps:
- name: 🚚 Checkout ($${{ github.ref }})
if: github.event_name == 'push'
uses: actions/checkout@v4
- name: 🚚 Checkout pull request (pull_request_target)
if: github.event_name == 'pull_request_target'
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: 🚚 Marge pull request (pull_request_target)
if: github.event_name == 'pull_request_target'
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git merge origin/${{ github.event.pull_request.base.ref }} --no-edit
- name: 📥 Cache library
uses: actions/cache@v4
with:
path: Library
key: Library-${{ matrix.unityVersion }}-${{ github.event.pull_request.head.sha || github.sha }}
restore-keys: |
Library-${{ matrix.unityVersion }}-
Library-
- name: 🛠️ Build Unity Project (Test)
uses: game-ci/unity-builder@v4
timeout-minutes: 45
with:
customImage: ghcr.io/mob-sakai/unity3d:${{ matrix.unityVersion }}
targetPlatform: StandaloneLinux64
allowDirtyBuild: true
customParameters: -nographics
projectPath: ${{ env.PROJECT_PATH }}
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
# - name: 🧪 Run tests
# uses: game-ci/unity-test-runner@v4
# timeout-minutes: 45
# with:
# customImage: ghcr.io/mob-sakai/unity3d:${{ matrix.unityVersion }}
# # unityVersion: ${{ matrix.unityVersion }}
# customParameters: -nographics
# checkName: ${{ matrix.unityVersion }} Test Results
# githubToken: ${{ github.token }}
# env:
# UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
# UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
# UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
+127
View File
@@ -0,0 +1,127 @@
# Required secrets
# UNITY_LICENSE: The contents of Unity license file
# UNITY_EMAIL: Unity user email to login
# UNITY_PASSWORD: Unity user password to login
name: 🧪 Test
run-name: 🧪 Test (${{ github.event.pull_request.title || github.ref_name }})
env:
# MINIMUM_VERSION: The minimum version of Unity.
MINIMUM_VERSION: 2020.3
# EXCLUDE_FILTER: The excluded versions of Unity.
EXCLUDE_FILTER: "(2020.2.0|2021.1|2023.2|2023.3)"
PROJECT_PATH: .
on:
workflow_dispatch:
inputs:
usePeriodVersions:
description: "Use the period versions (.0f1, .10f1, 20f1, ...)."
required: false
default: "true"
push:
branches:
- develop
- "develop-*"
tags:
- "!*"
paths-ignore:
- "**.md"
pull_request_target:
types:
- opened
- reopened
- synchronize
paths-ignore:
- "**.md"
jobs:
setup:
name: ⚙️ Setup
runs-on: ubuntu-latest
outputs:
unityVersions: ${{ steps.setup.outputs.unityVersions }}
steps:
- name: ⚙️ Find target Unity versions
id: setup
run: |
echo "==== Target Unity Versions ===="
LATEST_VERSIONS=`npx unity-changeset list --versions --latest-patch --min ${MINIMUM_VERSION} --json --all`
if [ "${{ inputs.usePeriodVersions }}" = "true" ]; then
ADDITIONAL_VERSIONS=`npx unity-changeset list --versions --grep '0f' --min ${MINIMUM_VERSION} --json`
else
ADDITIONAL_VERSIONS=[]
fi
VERSIONS=`echo "[${LATEST_VERSIONS}, ${ADDITIONAL_VERSIONS}]" \
| jq -c '[ flatten | sort | unique | .[] | select( test("${{ env.EXCLUDE_FILTER }}") | not ) ]'`
echo "unityVersions=${VERSIONS}" | tee $GITHUB_OUTPUT
test:
name: 🧪 Run tests
runs-on: ubuntu-latest
permissions:
checks: write
contents: read
needs: setup
strategy:
fail-fast: false
max-parallel: 6
matrix:
unityVersion: ${{ fromJson(needs.setup.outputs.unityVersions) }}
steps:
- name: 🚚 Checkout ($${{ github.ref }})
if: github.event_name == 'push'
uses: actions/checkout@v4
- name: 🚚 Checkout pull request (pull_request_target)
if: github.event_name == 'pull_request_target'
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: 🚚 Marge pull request (pull_request_target)
if: github.event_name == 'pull_request_target'
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git merge origin/${{ github.event.pull_request.base.ref }} --no-edit
- name: 📥 Cache library
uses: actions/cache@v4
with:
path: Library
key: Library-${{ matrix.unityVersion }}-${{ github.event.pull_request.head.sha || github.sha }}
restore-keys: |
Library-${{ matrix.unityVersion }}-
Library-
- name: 🛠️ Build Unity Project (Test)
uses: game-ci/unity-builder@v4
timeout-minutes: 45
with:
customImage: ghcr.io/mob-sakai/unity3d:${{ matrix.unityVersion }}
targetPlatform: StandaloneLinux64
allowDirtyBuild: true
customParameters: -nographics
projectPath: ${{ env.PROJECT_PATH }}
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
- name: 🧪 Run tests
uses: game-ci/unity-test-runner@v4
timeout-minutes: 45
with:
customImage: ghcr.io/mob-sakai/unity3d:${{ matrix.unityVersion }}
# unityVersion: ${{ matrix.unityVersion }}
customParameters: -nographics
checkName: ${{ matrix.unityVersion }} Test Results
githubToken: ${{ github.token }}
projectPath: ${{ env.PROJECT_PATH }}
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
-3
View File
@@ -1,3 +0,0 @@
issues-wo-labels=false
pr-wo-labels=false
exclude_labels=duplicate,question,invalid,wontfix,Duplicate,Question,Invalid,Wontfix,Meta: Exclude From Changelog
+24 -39
View File
@@ -1,44 +1,29 @@
[Ll]ibrary/
[Tt]emp/
[Oo]bj/
[Bb]uild/
/[Bb]uilds/
/Assets/AssetStoreTools*
# Windows
Thumbs.db
Desktop.ini
/*.csproj
/*.sln
# Autogenerated VS/MD solution and project files
ExportedObj/
*.csproj
*.unityproj
*.sln
*.suo
*.tmp
*.user
*.userprefs
*.pidb
*.booproj
*.svd
# macOS
.DS_Store
# Vim
*.swp
# Unity3D generated meta files
*.pidb.meta
# Unity3D Generated File On Crash Reports
sysinfo.txt
# Mac
*.DS_Store
# Builds
*.apk
# Packages
*.unitypackage
build.app
unity.log
# Unity
/Logs
/Library
/Temp
Assets/Plugins.meta
Assets/Plugins/
# VS
.vs/
_Android/
_iOS/
_WebGL/
_Standalone/
.vscode/
.idea/
obj/
bin/
UserSettings/
*.app/
Build/
Assets/TextMeshPro Support*
@@ -1 +0,0 @@
./../../../../CHANGELOG.md
Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

@@ -1,92 +0,0 @@
fileFormatVersion: 2
guid: f3b45d5175ff30c42aab20cc35e51f4e
timeCreated: 1528468261
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: 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: 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:
Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

@@ -1,92 +0,0 @@
fileFormatVersion: 2
guid: 42fa8c34958b97442a6de1f23f479c99
timeCreated: 1528469143
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: 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: 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:
@@ -1,49 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace Coffee.UIExtensions
{
public class UIEffect_Demo : MonoBehaviour
{
[SerializeField] RectMask2D mask;
// Use this for initialization
void Start()
{
if (mask)
{
mask.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;
}
}
}
@@ -1,16 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!200 &20000000
ShaderVariantCollection:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: UIEffect_Demo
m_Shaders:
- first: {fileID: 4800000, guid: 7a6f925a07c3c5846a1c782eaaeb7087, type: 3}
second:
variants:
- keywords: DETAILBLUR GRAYSCALE
passType: 0
- keywords: DETAILBLUR SEPIA
passType: 0
File diff suppressed because it is too large Load Diff
Binary file not shown.

Before

Width:  |  Height:  |  Size: 177 KiB

@@ -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,751 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &-1746834952
AnimationClip:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Open
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:
- serializedVersion: 2
time: 0
value: 0
inSlope: 2
outSlope: 2
tangentMode: 34
- serializedVersion: 2
time: 0.5
value: 1
inSlope: 2
outSlope: 2
tangentMode: 34
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Alpha
path:
classID: 225
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 1
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
- serializedVersion: 2
time: 0.5
value: 1
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_BlocksRaycasts
path:
classID: 225
script: {fileID: 0}
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: 1574349066
script: {fileID: 0}
classID: 225
customType: 0
isPPtrCurve: 0
- path: 0
attribute: 3739863151
script: {fileID: 0}
classID: 225
customType: 0
isPPtrCurve: 0
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0.5
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 0
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:
- serializedVersion: 2
time: 0
value: 0
inSlope: 2
outSlope: 2
tangentMode: 34
- serializedVersion: 2
time: 0.5
value: 1
inSlope: 2
outSlope: 2
tangentMode: 34
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Alpha
path:
classID: 225
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 1
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
- serializedVersion: 2
time: 0.5
value: 1
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_BlocksRaycasts
path:
classID: 225
script: {fileID: 0}
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_GenerateMotionCurves: 0
m_IsEmpty: 0
m_Events: []
--- !u!1102 &-1537770706
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: 0}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
--- !u!74 &7415318
AnimationClip:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Close
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:
- serializedVersion: 2
time: 0
value: 1
inSlope: -2
outSlope: -2
tangentMode: 34
- serializedVersion: 2
time: 0.5
value: 0
inSlope: -2
outSlope: -2
tangentMode: 34
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Alpha
path:
classID: 225
script: {fileID: 0}
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: 1574349066
script: {fileID: 0}
classID: 225
customType: 0
isPPtrCurve: 0
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0.5
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 0
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:
- serializedVersion: 2
time: 0
value: 1
inSlope: -2
outSlope: -2
tangentMode: 34
- serializedVersion: 2
time: 0.5
value: 0
inSlope: -2
outSlope: -2
tangentMode: 34
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Alpha
path:
classID: 225
script: {fileID: 0}
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_GenerateMotionCurves: 0
m_IsEmpty: 0
m_Events:
- time: 0.5
functionName: Closed
data:
objectReferenceParameter: {fileID: 0}
floatParameter: 0
intParameter: 0
messageOptions: 0
--- !u!74 &7450624
AnimationClip:
m_ObjectHideFlags: 3
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: 1 to 0
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:
- serializedVersion: 2
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
- serializedVersion: 2
time: 1
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
- serializedVersion: 2
time: 2
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
- serializedVersion: 2
time: 3
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_EffectFactor
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: 2148837408
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: 3
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:
- serializedVersion: 2
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
- serializedVersion: 2
time: 1
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
- serializedVersion: 2
time: 2
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
- serializedVersion: 2
time: 3
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_EffectFactor
path:
classID: 114
script: {fileID: 11500000, guid: f8b2ed11d675446c5a49da1ea296d490, type: 3}
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_GenerateMotionCurves: 0
m_IsEmpty: 0
m_Events: []
--- !u!74 &7451788
AnimationClip:
m_ObjectHideFlags: 3
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: 0 to 1
serializedVersion: 6
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves:
- curve:
- time: 0
value: {fileID: 0}
attribute: m_Sprite
path:
classID: 212
script: {fileID: 0}
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: 0
script: {fileID: 0}
classID: 212
customType: 23
isPPtrCurve: 1
pptrCurveMapping:
- {fileID: 0}
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0.083333336
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 0
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: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_GenerateMotionCurves: 0
m_IsEmpty: 0
m_Events: []
--- !u!74 &7487404
AnimationClip:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Closed
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:
- serializedVersion: 2
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 34
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Alpha
path:
classID: 225
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_BlocksRaycasts
path:
classID: 225
script: {fileID: 0}
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: 3739863151
script: {fileID: 0}
classID: 225
customType: 0
isPPtrCurve: 0
- path: 0
attribute: 1574349066
script: {fileID: 0}
classID: 225
customType: 0
isPPtrCurve: 0
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 0
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:
- serializedVersion: 2
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 34
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Alpha
path:
classID: 225
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_BlocksRaycasts
path:
classID: 225
script: {fileID: 0}
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_GenerateMotionCurves: 0
m_IsEmpty: 0
m_Events: []
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: UIEffect_Demo_Dialog
serializedVersion: 5
m_AnimatorParameters:
- m_Name: Close
m_Type: 9
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!1101 &110180378
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 1
m_ConditionEvent: Close
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 110202250}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0
m_TransitionOffset: 0
m_ExitTime: 0
m_HasExitTime: 0
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &110200840
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: 1 to 0 (Exported)
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: 0}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
--- !u!1102 &110202250
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Close
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 0
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_Motion: {fileID: 7415318}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
--- !u!1102 &110244674
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Open
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: 110180378}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 0
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_Motion: {fileID: -1746834952}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
--- !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: 110244674}
m_Position: {x: 336, y: -12, z: 0}
- serializedVersion: 1
m_State: {fileID: 110202250}
m_Position: {x: 336, y: 60, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
m_StateMachineTransitions: {}
m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 144, y: 72, z: 0}
m_EntryPosition: {x: 144, y: -12, z: 0}
m_ExitPosition: {x: 144, y: 108, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: 110244674}
@@ -1,27 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace Coffee.UIExtensions
{
public class UIEffect_Demo_Dialog : MonoBehaviour
{
[SerializeField] Animator m_Animator;
public void Open()
{
gameObject.SetActive(true);
}
public void Close()
{
m_Animator.SetTrigger("Close");
}
public void Closed()
{
gameObject.SetActive(false);
}
}
}
File diff suppressed because it is too large Load Diff
Binary file not shown.

Before

Width:  |  Height:  |  Size: 172 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:
File diff suppressed because it is too large Load Diff
Binary file not shown.

Before

Width:  |  Height:  |  Size: 953 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.9 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: 834 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: 883 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.2 MiB

@@ -1 +0,0 @@
./../../../../LICENSE.txt
@@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 39ac2ac7853a94fbc9d9e3d1151b9dfe
folderAsset: yes
timeCreated: 1515203270
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
@@ -1,238 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 8
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: UI-Effect-Dissolve
m_Shader: {fileID: 4800000, guid: e1b48dc831eb147e9886c049033213bf, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 1
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
- first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _NoiseTex
second:
m_Texture: {fileID: 2800000, guid: 3e04c247fb2604af186173fce0bc62de, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _ParamTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- first:
name: _ColorMask
second: 15
- first:
name: _Stencil
second: 0
- first:
name: _StencilComp
second: 8
- first:
name: _StencilOp
second: 0
- first:
name: _StencilReadMask
second: 255
- first:
name: _StencilWriteMask
second: 255
- first:
name: _UseUIAlphaClip
second: 0
m_Colors:
- first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
--- !u!21 &21162286589123374
Material:
serializedVersion: 6
m_ObjectHideFlags: 9
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: UI-Effect-Dissolve-Fill
m_Shader: {fileID: 4800000, guid: e1b48dc831eb147e9886c049033213bf, type: 3}
m_ShaderKeywords: FILL
m_LightmapFlags: 5
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
- first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _NoiseTex
second:
m_Texture: {fileID: 2800000, guid: 3e04c247fb2604af186173fce0bc62de, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _ParamTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- first:
name: _ColorMask
second: 15
- first:
name: _Stencil
second: 0
- first:
name: _StencilComp
second: 8
- first:
name: _StencilOp
second: 0
- first:
name: _StencilReadMask
second: 255
- first:
name: _StencilWriteMask
second: 255
- first:
name: _UseUIAlphaClip
second: 0
m_Colors:
- first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
--- !u!21 &21841578701121694
Material:
serializedVersion: 6
m_ObjectHideFlags: 9
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: UI-Effect-Dissolve-Subtract
m_Shader: {fileID: 4800000, guid: e1b48dc831eb147e9886c049033213bf, type: 3}
m_ShaderKeywords: SUBTRACT
m_LightmapFlags: 5
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
- first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _NoiseTex
second:
m_Texture: {fileID: 2800000, guid: 3e04c247fb2604af186173fce0bc62de, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _ParamTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- first:
name: _ColorMask
second: 15
- first:
name: _Stencil
second: 0
- first:
name: _StencilComp
second: 8
- first:
name: _StencilOp
second: 0
- first:
name: _StencilReadMask
second: 255
- first:
name: _StencilWriteMask
second: 255
- first:
name: _UseUIAlphaClip
second: 0
m_Colors:
- first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
--- !u!21 &21939717441729078
Material:
serializedVersion: 6
m_ObjectHideFlags: 9
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: UI-Effect-Dissolve-Add
m_Shader: {fileID: 4800000, guid: e1b48dc831eb147e9886c049033213bf, type: 3}
m_ShaderKeywords: ADD
m_LightmapFlags: 5
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
- first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _NoiseTex
second:
m_Texture: {fileID: 2800000, guid: 3e04c247fb2604af186173fce0bc62de, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _ParamTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- first:
name: _ColorMask
second: 15
- first:
name: _Stencil
second: 0
- first:
name: _StencilComp
second: 8
- first:
name: _StencilOp
second: 0
- first:
name: _StencilReadMask
second: 255
- first:
name: _StencilWriteMask
second: 255
- first:
name: _UseUIAlphaClip
second: 0
m_Colors:
- first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
@@ -1,154 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: UI-Effect-HSV
m_Shader: {fileID: 4800000, guid: 7fc74090480c84f8b977cfcd55cdfe82, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 1
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
- first:
name: _BumpMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailAlbedoMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailMask
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailNormalMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _EmissionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MetallicGlossMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _OcclusionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _ParallaxMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _ParamTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- first:
name: _BumpScale
second: 1
- first:
name: _ColorMask
second: 15
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DstBlend
second: 0
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 0.5
- first:
name: _GlossyReflections
second: 1
- first:
name: _Metallic
second: 0
- first:
name: _Mode
second: 0
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SrcBlend
second: 1
- first:
name: _Stencil
second: 0
- first:
name: _StencilComp
second: 8
- first:
name: _StencilOp
second: 0
- first:
name: _StencilReadMask
second: 255
- first:
name: _StencilWriteMask
second: 255
- first:
name: _UVSec
second: 0
- first:
name: _UseUIAlphaClip
second: 0
- first:
name: _ZWrite
second: 1
m_Colors:
- first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}
@@ -1,55 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: UI-Effect-Shiny
m_Shader: {fileID: 4800000, guid: 20ffe76c2439c403aabdd25bd94bf011, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 1
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
- first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _ParamTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- first:
name: _ColorMask
second: 15
- first:
name: _Stencil
second: 0
- first:
name: _StencilComp
second: 8
- first:
name: _StencilOp
second: 0
- first:
name: _StencilReadMask
second: 255
- first:
name: _StencilWriteMask
second: 255
- first:
name: _UseUIAlphaClip
second: 0
m_Colors:
- first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: aee96bc531e6eba468ec405e536f515f
timeCreated: 1516545204
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
File diff suppressed because it is too large Load Diff
@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 1a1a8e44196ca754a9a7b9cb80e17573
timeCreated: 1516545204
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

@@ -1 +0,0 @@
./../../../../README.md
@@ -1,13 +0,0 @@
namespace Coffee.UIExtensions
{
/// <summary>
/// Blur effect mode.
/// </summary>
public enum BlurMode
{
None = 0,
FastBlur = 1,
MediumBlur = 2,
DetailBlur = 3,
}
}
@@ -1,13 +0,0 @@
namespace Coffee.UIExtensions
{
/// <summary>
/// Color effect mode.
/// </summary>
public enum ColorMode
{
Multiply = 0,
Fill = 1,
Add = 2,
Subtract = 3,
}
}
@@ -1,68 +0,0 @@
using UnityEngine;
using UnityEngine.UI;
namespace Coffee.UIExtensions
{
/// <summary>
/// Area for effect.
/// </summary>
public enum EffectArea
{
RectTransform,
Fit,
Character,
}
public static class EffectAreaExtensions
{
static readonly Rect rectForCharacter = new Rect(0, 0, 1, 1);
/// <summary>
/// Gets effect for area.
/// </summary>
public static Rect GetEffectArea(this EffectArea area, VertexHelper vh, Graphic graphic, float aspectRatio = -1)
{
Rect rect = default(Rect);
switch (area)
{
case EffectArea.RectTransform:
rect = graphic.rectTransform.rect;
break;
case EffectArea.Character:
rect = rectForCharacter;
break;
case EffectArea.Fit:
// Fit to contents.
UIVertex vertex = default(UIVertex);
rect.xMin = rect.yMin = float.MaxValue;
rect.xMax = rect.yMax = float.MinValue;
for (int i = 0; i < vh.currentVertCount; i++)
{
vh.PopulateUIVertex(ref vertex, i);
rect.xMin = Mathf.Min(rect.xMin, vertex.position.x);
rect.yMin = Mathf.Min(rect.yMin, vertex.position.y);
rect.xMax = Mathf.Max(rect.xMax, vertex.position.x);
rect.yMax = Mathf.Max(rect.yMax, vertex.position.y);
}
break;
default:
rect = graphic.rectTransform.rect;
break;
}
if(0 < aspectRatio)
{
if (rect.width < rect.height)
{
rect.width = rect.height * aspectRatio;
}
else
{
rect.height = rect.width / aspectRatio;
}
}
return rect;
}
}
}
@@ -1,130 +0,0 @@
using UnityEngine;
using System;
using System.Collections.Generic;
namespace Coffee.UIExtensions
{
/// <summary>
/// Effect player.
/// </summary>
[Serializable]
public class EffectPlayer
{
//################################
// Public Members.
//################################
/// <summary>
/// Gets or sets a value indicating whether is playing.
/// </summary>
[Tooltip("Playing.")]
public bool play = false;
/// <summary>
/// Gets or sets a value indicating whether can loop.
/// </summary>
[Tooltip("Loop.")]
public bool loop = false;
/// <summary>
/// Gets or sets the duration.
/// </summary>
[Tooltip("Duration.")]
[Range(0.01f,10f)]
public float duration = 1;
/// <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);
_time = 0;
_callback = callback;
}
/// <summary>
/// Unregister player.
/// </summary>
public void OnDisable()
{
_callback = null;
s_UpdateActions.Remove(OnWillRenderCanvases);
}
/// <summary>
/// Start playing.
/// </summary>
public void Play(Action<float> callback = null)
{
_time = 0;
play = true;
if (callback != null)
{
_callback = callback;
}
}
/// <summary>
/// Stop playing.
/// </summary>
public void Stop()
{
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);
}
}
}
@@ -1,95 +0,0 @@
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace Coffee.UIExtensions
{
public class MaterialCache
{
public ulong hash { get; private set; }
public int referenceCount { get; private set; }
public Texture texture { get; private set; }
public Material material { get; private set; }
#if UNITY_EDITOR
[UnityEditor.InitializeOnLoadMethod]
static void ClearCache()
{
foreach (var cache in materialCaches)
{
cache.material = null;
}
materialCaches.Clear();
}
#endif
public static List<MaterialCache> materialCaches = new List<MaterialCache>();
public static MaterialCache Register(ulong hash, Texture texture, System.Func<Material> onCreateMaterial)
{
var cache = materialCaches.FirstOrDefault(x => x.hash == hash);
if (cache != null && cache.material)
{
if (cache.material)
{
cache.referenceCount++;
}
else
{
materialCaches.Remove(cache);
cache = null;
}
}
if (cache == null)
{
cache = new MaterialCache()
{
hash = hash,
material = onCreateMaterial(),
referenceCount = 1,
};
materialCaches.Add(cache);
}
return cache;
}
public static MaterialCache Register(ulong hash, System.Func<Material> onCreateMaterial)
{
var cache = materialCaches.FirstOrDefault(x => x.hash == hash);
if (cache != null)
{
cache.referenceCount++;
}
if (cache == null)
{
cache = new MaterialCache()
{
hash = hash,
material = onCreateMaterial(),
referenceCount = 1,
};
materialCaches.Add(cache);
}
return cache;
}
public static void Unregister(MaterialCache cache)
{
if (cache == null)
{
return;
}
cache.referenceCount--;
if (cache.referenceCount <= 0)
{
MaterialCache.materialCaches.Remove(cache);
cache.material = null;
}
}
}
}
@@ -1,120 +0,0 @@
#if UNITY_EDITOR
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEditor;
using UnityEngine;
namespace Coffee.UIExtensions
{
public class MaterialResolver
{
static readonly StringBuilder s_StringBuilder = new StringBuilder();
static readonly Dictionary<string, Material> s_MaterialMap = new Dictionary<string, Material>();
public static Material GetOrGenerateMaterialVariant(Shader shader, params object[] append)
{
if (!shader)
{
return null;
}
string[] keywords = append.Where(x => 0 < (int)x)
.Select(x => x.ToString().ToUpper())
.ToArray();
Material mat = GetMaterial(shader, append);
if (mat)
{
if (!mat.shaderKeywords.OrderBy(x => x).SequenceEqual(keywords.OrderBy(x => x)))
{
mat.shaderKeywords = keywords;
EditorUtility.SetDirty(mat);
if (!Application.isPlaying)
{
EditorApplication.delayCall += AssetDatabase.SaveAssets;
}
}
return mat;
}
string variantName = GetVariantName(shader, append);
if (s_MaterialMap.TryGetValue(variantName, out mat) && mat)
{
return mat;
}
Debug.Log("Generate material : " + variantName);
mat = new Material(shader);
mat.shaderKeywords = keywords;
mat.name = variantName;
mat.hideFlags |= HideFlags.NotEditable;
s_MaterialMap[variantName] = mat;
bool isMainAsset = append.Cast<int>().All(x => x == 0);
EditorApplication.delayCall += () => SaveMaterial(mat, shader, isMainAsset);
return mat;
}
static void SaveMaterial(Material mat, Shader shader, bool isMainAsset)
{
string materialPath = GetDefaultMaterialPath(shader);
#if UIEFFECT_SEPARATE
string dir = Path.GetDirectoryName(materialPath);
materialPath = Path.Combine(Path.Combine(dir, "Separated"), mat.name + ".mat");
isMainAsset = true;
#endif
if (isMainAsset)
{
Directory.CreateDirectory(Path.GetDirectoryName(materialPath));
AssetDatabase.CreateAsset(mat, materialPath);
}
else
{
GetOrGenerateMaterialVariant(shader);
mat.hideFlags |= HideFlags.HideInHierarchy;
AssetDatabase.AddObjectToAsset(mat, materialPath);
}
AssetDatabase.SaveAssets();
}
public static Material GetMaterial(Shader shader, params object[] append)
{
string variantName = GetVariantName(shader, append);
return AssetDatabase.FindAssets("t:Material " + Path.GetFileName(shader.name))
.Select(x => AssetDatabase.GUIDToAssetPath(x))
.SelectMany(x => AssetDatabase.LoadAllAssetsAtPath(x))
.OfType<Material>()
.FirstOrDefault(x => x.name == variantName);
}
public static string GetDefaultMaterialPath(Shader shader)
{
var name = Path.GetFileName(shader.name);
return AssetDatabase.FindAssets("t:Material " + name)
.Select(x => AssetDatabase.GUIDToAssetPath(x))
.FirstOrDefault(x => Path.GetFileNameWithoutExtension(x) == name)
?? ("Assets/" + name + ".mat");
}
public static string GetVariantName(Shader shader, params object[] append)
{
s_StringBuilder.Length = 0;
#if UIEFFECT_SEPARATE
s_StringBuilder.Append("[Separated] ");
#endif
s_StringBuilder.Append(Path.GetFileName(shader.name));
foreach (object mode in append.Where(x=>0<(int)x))
{
s_StringBuilder.Append("-");
s_StringBuilder.Append(mode.ToString());
}
return s_StringBuilder.ToString();
}
}
}
#endif
@@ -1,33 +0,0 @@
using UnityEngine;
namespace Coffee.UIExtensions
{
/// <summary>
/// Matrix2x3.
/// </summary>
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
);
}
}
}
@@ -1,60 +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);
}
}
@@ -1,188 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
using System;
namespace Coffee.UIExtensions
{
public interface IParameterTexture
{
int parameterIndex { get; set; }
ParameterTexture ptex { get; }
}
/// <summary>
/// Parameter texture.
/// </summary>
[System.Serializable]
public class ParameterTexture
{
//################################
// Public Members.
//################################
/// <summary>
/// Initializes a new instance of the <see cref="Coffee.UIExtensions.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)
{
_texture = new Texture2D(_channels / 4, _instanceLimit, TextureFormat.RGBA32, false, false);
_texture.filterMode = FilterMode.Point;
_texture.wrapMode = TextureWrapMode.Clamp;
updates.Add(UpdateParameterTexture);
}
}
void UpdateParameterTexture()
{
if (_needUpload && _texture)
{
_needUpload = false;
_texture.LoadRawTextureData(_data);
_texture.Apply(false, false);
}
}
}
}
@@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: 65eafa89b3a3a494a99e185423ba6cad
timeCreated: 1533006319
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,14 +0,0 @@
namespace Coffee.UIExtensions
{
/// <summary>
/// Shadow effect style.
/// </summary>
public enum ShadowStyle
{
None = 0,
Shadow,
Outline,
Outline8,
Shadow3,
}
}
@@ -1,14 +0,0 @@
namespace Coffee.UIExtensions
{
/// <summary>
/// Effect mode.
/// </summary>
public enum EffectMode
{
None = 0,
Grayscale = 1,
Sepia = 2,
Nega = 3,
Pixel = 4,
}
}
@@ -1,162 +0,0 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using System.Linq;
using System.IO;
namespace Coffee.UIExtensions
{
/// <summary>
/// Abstract effect base for UI.
/// </summary>
[RequireComponent(typeof(Graphic))]
[DisallowMultipleComponent]
public abstract class UIEffectBase : BaseMeshEffect, IParameterTexture
#if UNITY_EDITOR
, ISerializationCallbackReceiver
#endif
{
protected static readonly Vector2[] splitedCharacterPosition = { Vector2.up, Vector2.one, Vector2.right, Vector2.zero };
protected static readonly List<UIVertex> tempVerts = new List<UIVertex>();
[HideInInspector]
[SerializeField] int m_Version;
[SerializeField] protected Material m_EffectMaterial;
/// <summary>
/// Gets or sets the parameter index.
/// </summary>
public int parameterIndex { get; set; }
/// <summary>
/// Gets the parameter texture.
/// </summary>
public virtual ParameterTexture ptex { get { return null; } }
/// <summary>
/// Gets target graphic for effect.
/// </summary>
public Graphic targetGraphic { get { return graphic; } }
/// <summary>
/// Gets material for effect.
/// </summary>
public Material effectMaterial { get { return m_EffectMaterial; } }
#if UNITY_EDITOR
protected override void Reset()
{
m_Version = 300;
OnValidate();
}
/// <summary>
/// Raises the validate event.
/// </summary>
protected override void OnValidate()
{
var mat = GetMaterial();
if (m_EffectMaterial != mat)
{
m_EffectMaterial = mat;
UnityEditor.EditorUtility.SetDirty(this);
}
ModifyMaterial();
targetGraphic.SetVerticesDirty();
SetDirty();
}
public void OnBeforeSerialize()
{
}
public void OnAfterDeserialize()
{
UnityEditor.EditorApplication.delayCall += UpgradeIfNeeded;
}
protected bool IsShouldUpgrade(int expectedVersion)
{
if (m_Version < expectedVersion)
{
Debug.LogFormat(gameObject, "<b>{0}({1})</b> has been upgraded: <i>version {2} -> {3}</i>", name, GetType().Name, m_Version, expectedVersion);
m_Version = expectedVersion;
//UnityEditor.EditorApplication.delayCall += () =>
{
UnityEditor.EditorUtility.SetDirty(this);
if (!Application.isPlaying && gameObject && gameObject.scene.IsValid())
{
UnityEditor.SceneManagement.EditorSceneManager.MarkSceneDirty(gameObject.scene);
}
}
;
return true;
}
return false;
}
protected virtual void UpgradeIfNeeded()
{
}
/// <summary>
/// Gets the material.
/// </summary>
/// <returns>The material.</returns>
protected virtual Material GetMaterial()
{
return null;
}
#endif
/// <summary>
/// Modifies the material.
/// </summary>
public virtual void ModifyMaterial()
{
targetGraphic.material = isActiveAndEnabled ? m_EffectMaterial : null;
}
/// <summary>
/// This function is called when the object becomes enabled and active.
/// </summary>
protected override void OnEnable()
{
if (ptex != null)
{
ptex.Register(this);
}
ModifyMaterial();
targetGraphic.SetVerticesDirty();
SetDirty();
}
/// <summary>
/// This function is called when the behaviour becomes disabled () or inactive.
/// </summary>
protected override void OnDisable()
{
ModifyMaterial();
targetGraphic.SetVerticesDirty();
if (ptex != null)
{
ptex.Unregister(this);
}
}
/// <summary>
/// Mark the UIEffect as dirty.
/// </summary>
protected virtual void SetDirty()
{
targetGraphic.SetVerticesDirty();
}
protected override void OnDidApplyAnimationProperties()
{
SetDirty();
}
}
}
@@ -1,53 +0,0 @@
using System.Collections;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEditor;
using UnityEngine;
namespace Coffee.UIExtensions.Editors
{
/// <summary>
/// Remove deprecated files in old .unitypackage, after compiling.
/// </summary>
public class DeprecatedRemover
{
/// <summary>
/// GUIDs of deprecated files.
/// </summary>
static readonly List<string> DeprecatedFiles = new List<string>()
{
"156b57fee6ef941958e66a129ce387e2", // UICustomEffect.cs
"a4961e148a8cd4fe0b84dddc2741894a", // UICustomEffectEditor.cs
"7b1ed09bdf5e54042b5cd1fbe69361bf", // MaterialBundle.cs
};
#if UNITY_EDITOR
[UnityEditor.InitializeOnLoadMethod]
static void RemoveFiles()
{
// The deprecated file path that exists.
var files = DeprecatedFiles.Select(x => AssetDatabase.GUIDToAssetPath(x))
.Where(x => File.Exists(x))
.ToArray();
if (files.Any())
{
StringBuilder sb = new StringBuilder();
sb.AppendFormat("<b><color=orange>[{0}]</color></b> {1} files have been removed.\n", typeof(DeprecatedRemover).Name, files.Length);
foreach (var path in files)
{
AssetDatabase.DeleteAsset(path);
sb.AppendFormat(" - {0}\n", path);
}
AssetDatabase.Refresh();
UnityEngine.Debug.Log(sb);
}
}
#endif
}
}
@@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: 6955fce24c79542af9ba39b3cf6f610f
timeCreated: 1536108312
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,116 +0,0 @@
using UnityEditor;
using UnityEditorInternal;
using UnityEngine;
using System.Linq;
namespace Coffee.UIExtensions.Editors
{
/// <summary>
/// UIEffect editor.
/// </summary>
[CustomEditor(typeof(UIDissolve))]
[CanEditMultipleObjects]
public class UIDissolveEditor : Editor
{
//################################
// Public/Protected Members.
//################################
/// <summary>
/// This function is called when the object becomes enabled and active.
/// </summary>
protected void OnEnable()
{
_spMaterial = serializedObject.FindProperty("m_EffectMaterial");
_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");
_spNoiseTexture = serializedObject.FindProperty("m_NoiseTexture");
_spKeepAspectRatio = serializedObject.FindProperty("m_KeepAspectRatio");
var player = serializedObject.FindProperty("m_Player");
_spDuration = player.FindPropertyRelative("duration");
_spUpdateMode = player.FindPropertyRelative("updateMode");
}
/// <summary>
/// Implement this function to make a custom inspector.
/// </summary>
public override void OnInspectorGUI()
{
serializedObject.Update();
//================
// Effect material.
//================
EditorGUI.BeginDisabledGroup(true);
EditorGUILayout.PropertyField(_spMaterial);
EditorGUI.EndDisabledGroup();
//================
// Effect setting.
//================
EditorGUILayout.PropertyField(_spEffectFactor);
EditorGUILayout.PropertyField(_spWidth);
EditorGUILayout.PropertyField(_spSoftness);
EditorGUILayout.PropertyField(_spColor);
EditorGUILayout.PropertyField(_spColorMode);
EditorGUILayout.PropertyField(_spNoiseTexture);
//================
// Advanced option.
//================
GUILayout.Space(10);
EditorGUILayout.LabelField("Advanced Option", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(_spEffectArea);
EditorGUILayout.PropertyField(_spKeepAspectRatio);
//================
// Effect runner.
//================
GUILayout.Space(10);
EditorGUILayout.LabelField("Effect Player", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(_spDuration);
EditorGUILayout.PropertyField(_spUpdateMode);
// 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();
}
//################################
// Private Members.
//################################
SerializedProperty _spMaterial;
SerializedProperty _spEffectFactor;
SerializedProperty _spWidth;
SerializedProperty _spColor;
SerializedProperty _spSoftness;
SerializedProperty _spColorMode;
SerializedProperty _spNoiseTexture;
SerializedProperty _spEffectArea;
SerializedProperty _spKeepAspectRatio;
SerializedProperty _spPlay;
SerializedProperty _spDuration;
SerializedProperty _spUpdateMode;
}
}
@@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: f7f7349a5d61649b69946853317db047
timeCreated: 1538806040
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,191 +0,0 @@
using UnityEditor;
using UnityEditor.UI;
using UnityEngine;
using DesamplingRate = Coffee.UIExtensions.UIEffectCapturedImage.DesamplingRate;
namespace Coffee.UIExtensions.Editors
{
/// <summary>
/// UIEffectCapturedImage editor.
/// </summary>
[CustomEditor(typeof(UIEffectCapturedImage))]
[CanEditMultipleObjects]
public class UIEffectCapturedImageEditor : RawImageEditor
{
//################################
// Constant or Static Members.
//################################
public enum QualityMode : int
{
Fast = (DesamplingRate.x2 << 0) + (DesamplingRate.x2 << 4) + (FilterMode.Bilinear << 8) + (2 << 10),
Medium = (DesamplingRate.x1 << 0) + (DesamplingRate.x1 << 4) + (FilterMode.Bilinear << 8) + (3 << 10),
Detail = (DesamplingRate.None << 0) + (DesamplingRate.x1 << 4) + (FilterMode.Bilinear << 8) + (5 << 10),
Custom = -1,
}
//################################
// Public/Protected Members.
//################################
/// <summary>
/// This function is called when the object becomes enabled and active.
/// </summary>
protected override void OnEnable()
{
base.OnEnable();
_spTexture = serializedObject.FindProperty("m_Texture");
_spColor = serializedObject.FindProperty("m_Color");
_spRaycastTarget = serializedObject.FindProperty("m_RaycastTarget");
_spDesamplingRate = serializedObject.FindProperty("m_DesamplingRate");
_spReductionRate = serializedObject.FindProperty("m_ReductionRate");
_spFilterMode = serializedObject.FindProperty("m_FilterMode");
_spIterations = serializedObject.FindProperty("m_BlurIterations");
_spKeepSizeToRootCanvas = serializedObject.FindProperty("m_FitToScreen");
_spBlurMode = serializedObject.FindProperty("m_BlurMode");
_spCaptureOnEnable = serializedObject.FindProperty("m_CaptureOnEnable");
_spImmediateCapturing = serializedObject.FindProperty("m_ImmediateCapturing");
_customAdvancedOption = (qualityMode == QualityMode.Custom);
}
/// <summary>
/// Implement this function to make a custom inspector.
/// </summary>
public override void OnInspectorGUI()
{
var graphic = (target as UIEffectCapturedImage);
serializedObject.Update();
//================
// Basic properties.
//================
EditorGUILayout.PropertyField(_spTexture);
EditorGUILayout.PropertyField(_spColor);
EditorGUILayout.PropertyField(_spRaycastTarget);
//================
// Capture effect.
//================
GUILayout.Space(10);
EditorGUILayout.LabelField("Capture Effect", EditorStyles.boldLabel);
UIEffectEditor.DrawEffectProperties(serializedObject);
//================
// Advanced option.
//================
GUILayout.Space(10);
EditorGUILayout.LabelField("Advanced Option", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(_spCaptureOnEnable);// CaptureOnEnable.
EditorGUILayout.PropertyField(_spKeepSizeToRootCanvas);// Keep Graphic Size To RootCanvas.
EditorGUILayout.PropertyField(_spImmediateCapturing);// Capture immediately.
EditorGUI.BeginChangeCheck();
QualityMode quality = qualityMode;
quality = (QualityMode)EditorGUILayout.EnumPopup("Quality Mode", quality);
if (EditorGUI.EndChangeCheck())
{
_customAdvancedOption = (quality == QualityMode.Custom);
qualityMode = quality;
}
// When qualityMode is `Custom`, show advanced option.
if (_customAdvancedOption)
{
if (_spBlurMode.intValue != 0)
{
EditorGUILayout.PropertyField(_spIterations);// Iterations.
}
DrawDesamplingRate(_spReductionRate);// Reduction rate.
EditorGUILayout.Space();
EditorGUILayout.LabelField("Result Texture Setting", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(_spFilterMode);// Filter Mode.
DrawDesamplingRate(_spDesamplingRate);// Desampling rate.
}
serializedObject.ApplyModifiedProperties();
// Debug.
using (new EditorGUILayout.HorizontalScope(EditorStyles.helpBox))
{
GUILayout.Label("Debug");
if (GUILayout.Button("Capture", "ButtonLeft"))
{
graphic.Release();
EditorApplication.delayCall += graphic.Capture;
}
EditorGUI.BeginDisabledGroup(!(target as UIEffectCapturedImage).capturedTexture);
if (GUILayout.Button("Release", "ButtonRight"))
{
graphic.Release();
}
EditorGUI.EndDisabledGroup();
}
}
//################################
// Private Members.
//################################
const int Bits4 = (1 << 4) - 1;
const int Bits2 = (1 << 2) - 1;
bool _customAdvancedOption = false;
SerializedProperty _spTexture;
SerializedProperty _spColor;
SerializedProperty _spRaycastTarget;
SerializedProperty _spDesamplingRate;
SerializedProperty _spReductionRate;
SerializedProperty _spFilterMode;
SerializedProperty _spBlurMode;
SerializedProperty _spIterations;
SerializedProperty _spKeepSizeToRootCanvas;
SerializedProperty _spCaptureOnEnable;
SerializedProperty _spImmediateCapturing;
QualityMode qualityMode
{
get
{
if (_customAdvancedOption)
return QualityMode.Custom;
int qualityValue = (_spDesamplingRate.intValue << 0)
+ (_spReductionRate.intValue << 4)
+ (_spFilterMode.intValue << 8)
+ (_spIterations.intValue << 10);
return System.Enum.IsDefined(typeof(QualityMode), qualityValue) ? (QualityMode)qualityValue : QualityMode.Custom;
}
set
{
if (value != QualityMode.Custom)
{
int qualityValue = (int)value;
_spDesamplingRate.intValue = (qualityValue >> 0) & Bits4;
_spReductionRate.intValue = (qualityValue >> 4) & Bits4;
_spFilterMode.intValue = (qualityValue >> 8) & Bits2;
_spIterations.intValue = (qualityValue >> 10) & Bits4;
}
}
}
/// <summary>
/// Draws the desampling rate.
/// </summary>
void DrawDesamplingRate(SerializedProperty sp)
{
using (new EditorGUILayout.HorizontalScope())
{
EditorGUILayout.PropertyField(sp);
int w, h;
(target as UIEffectCapturedImage).GetDesamplingSize((UIEffectCapturedImage.DesamplingRate)sp.intValue, out w, out h);
GUILayout.Label(string.Format("{0}x{1}", w, h), EditorStyles.miniLabel);
}
}
}
}
@@ -1,128 +0,0 @@
using UnityEditor;
using UnityEditorInternal;
using UnityEngine;
using System.Linq;
namespace Coffee.UIExtensions.Editors
{
/// <summary>
/// UIEffect editor.
/// </summary>
[CustomEditor(typeof(UIEffect))]
[CanEditMultipleObjects]
public class UIEffectEditor : Editor
{
static readonly GUIContent contentEffectColor = new GUIContent ("Effect Color");
//################################
// Constant or Static Members.
//################################
/// <summary>
/// Draw effect properties.
/// </summary>
public static void DrawEffectProperties(SerializedObject serializedObject)
{
//================
// Effect material.
//================
var spMaterial = serializedObject.FindProperty("m_EffectMaterial");
EditorGUI.BeginDisabledGroup(true);
EditorGUILayout.PropertyField(spMaterial);
EditorGUI.EndDisabledGroup();
//================
// Effect setting.
//================
var spToneMode = serializedObject.FindProperty("m_EffectMode");
EditorGUILayout.PropertyField(spToneMode);
// When tone is enable, show parameters.
if (spToneMode.intValue != (int)EffectMode.None)
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(serializedObject.FindProperty("m_EffectFactor"));
EditorGUI.indentLevel--;
}
//================
// Color setting.
//================
var spColorMode = serializedObject.FindProperty("m_ColorMode");
EditorGUILayout.PropertyField(spColorMode);
// When color is enable, show parameters.
//if (spColorMode.intValue != (int)ColorMode.Multiply)
{
EditorGUI.indentLevel++;
SerializedProperty spColor = serializedObject.FindProperty("m_Color");
if (spColor == null && serializedObject.targetObject is UIEffect) {
spColor = new SerializedObject (serializedObject.targetObjects.Select(x=>(x as UIEffect).targetGraphic).ToArray()).FindProperty("m_Color");
}
EditorGUI.BeginChangeCheck ();
EditorGUI.showMixedValue = spColor.hasMultipleDifferentValues;
spColor.colorValue = EditorGUILayout.ColorField (contentEffectColor, spColor.colorValue, true, false, false, null);
if (EditorGUI.EndChangeCheck ()) {
spColor.serializedObject.ApplyModifiedProperties ();
}
EditorGUILayout.PropertyField(serializedObject.FindProperty("m_ColorFactor"));
EditorGUI.indentLevel--;
}
//================
// Blur setting.
//================
var spBlurMode = serializedObject.FindProperty("m_BlurMode");
EditorGUILayout.PropertyField(spBlurMode);
// When blur is enable, show parameters.
if (spBlurMode.intValue != (int)BlurMode.None)
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(serializedObject.FindProperty("m_BlurFactor"));
var spAdvancedBlur = serializedObject.FindProperty("m_AdvancedBlur");
if (spAdvancedBlur != null)
{
EditorGUILayout.PropertyField(spAdvancedBlur);
}
EditorGUI.indentLevel--;
}
}
//################################
// Private Members.
//################################
/// <summary>
/// Implement this function to make a custom inspector.
/// </summary>
public override void OnInspectorGUI()
{
serializedObject.Update();
DrawEffectProperties(serializedObject);
serializedObject.ApplyModifiedProperties();
#if UNITY_5_6_OR_NEWER
var graphic = (target as UIEffectBase).targetGraphic;
if(graphic)
{
var canvas = graphic.canvas;
if( canvas && 0 == (canvas.additionalShaderChannels & AdditionalCanvasShaderChannels.TexCoord1))
{
using (new GUILayout.HorizontalScope())
{
EditorGUILayout.HelpBox("[Unity5.6+] Enable TexCoord1 of Canvas.additionalShaderChannels to use UIEffect.", MessageType.Warning);
if (GUILayout.Button("Fix"))
canvas.additionalShaderChannels |= AdditionalCanvasShaderChannels.TexCoord1;
}
}
}
#endif
}
}
}
@@ -1,102 +0,0 @@
using UnityEditor;
using UnityEngine;
using UnityEngine.UI;
namespace Coffee.UIExtensions.Editors
{
/// <summary>
/// UIEffect editor.
/// </summary>
[CustomEditor(typeof(UIGradient))]
[CanEditMultipleObjects]
public class UIGradientEditor : Editor
{
public override void OnInspectorGUI()
{
serializedObject.Update();
//================
// Direction.
//================
var spDirection = serializedObject.FindProperty("m_Direction");
EditorGUILayout.PropertyField(spDirection);
//================
// Color.
//================
var spColor1 = serializedObject.FindProperty("m_Color1");
var spColor2 = serializedObject.FindProperty("m_Color2");
var spColor3 = serializedObject.FindProperty("m_Color3");
var spColor4 = serializedObject.FindProperty("m_Color4");
switch ((UIGradient.Direction)spDirection.intValue)
{
case UIGradient.Direction.Horizontal:
EditorGUILayout.PropertyField(spColor1, new GUIContent("Left"));
EditorGUILayout.PropertyField(spColor2, new GUIContent("Right"));
break;
case UIGradient.Direction.Vertical:
EditorGUILayout.PropertyField(spColor1, new GUIContent("Top"));
EditorGUILayout.PropertyField(spColor2, new GUIContent("Bottom"));
break;
case UIGradient.Direction.Angle:
EditorGUILayout.PropertyField(spColor1, new GUIContent("Color 1"));
EditorGUILayout.PropertyField(spColor2, new GUIContent("Color 2"));
break;
case UIGradient.Direction.Diagonal:
Rect r = EditorGUILayout.GetControlRect(false, 34);
r = EditorGUI.PrefixLabel(r, new GUIContent("Diagonal Color"));
float w = r.width / 2;
EditorGUI.PropertyField(new Rect(r.x, r.y, w, 16), spColor3, GUIContent.none);
EditorGUI.PropertyField(new Rect(r.x + w, r.y, w, 16), spColor4, GUIContent.none);
EditorGUI.PropertyField(new Rect(r.x, r.y + 18, w, 16), spColor1, GUIContent.none);
EditorGUI.PropertyField(new Rect(r.x + w, r.y + 18, w, 16), spColor2, GUIContent.none);
break;
}
//================
// Angle.
//================
if ((int)UIGradient.Direction.Angle <= spDirection.intValue)
{
EditorGUILayout.PropertyField(serializedObject.FindProperty("m_Rotation"));
}
//================
// Offset.
//================
if ((int)UIGradient.Direction.Diagonal == spDirection.intValue)
{
EditorGUILayout.PropertyField(serializedObject.FindProperty("m_Offset1"), new GUIContent("Vertical Offset"));
EditorGUILayout.PropertyField(serializedObject.FindProperty("m_Offset2"), new GUIContent("Horizontal Offset"));
}
else
{
EditorGUILayout.PropertyField(serializedObject.FindProperty("m_Offset1"), new GUIContent("Offset"));
}
//================
// Advanced options.
//================
EditorGUILayout.Space();
EditorGUILayout.LabelField("Advanced Options", EditorStyles.boldLabel);
EditorGUI.indentLevel++;
{
if ((target as UIGradient).targetGraphic is Text)
EditorGUILayout.PropertyField(serializedObject.FindProperty("m_GradientStyle"));
EditorGUILayout.PropertyField(serializedObject.FindProperty("m_ColorSpace"));
EditorGUILayout.PropertyField(serializedObject.FindProperty("m_IgnoreAspectRatio"));
}
EditorGUI.indentLevel--;
serializedObject.ApplyModifiedProperties();
}
}
}
@@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: c28dcc885fbba4a5187a6a1aa5fb1b3b
timeCreated: 1515895646
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,54 +0,0 @@
using UnityEditor;
using UnityEditorInternal;
using UnityEngine;
namespace Coffee.UIExtensions.Editors
{
/// <summary>
/// UIShadow editor.
/// </summary>
[CustomEditor(typeof(UIShadow))]
[CanEditMultipleObjects]
public class UIShadowEditor : Editor
{
UIEffect uiEffect;
void OnEnable()
{
uiEffect = (target as UIShadow).GetComponent<UIEffect>();
}
/// <summary>
/// Implement this function to make a custom inspector.
/// </summary>
public override void OnInspectorGUI()
{
serializedObject.Update();
//================
// Shadow setting.
//================
var spShadowMode = serializedObject.FindProperty("m_Style");
EditorGUILayout.PropertyField(spShadowMode);
// When shadow is enable, show parameters.
if (spShadowMode.intValue != (int)ShadowStyle.None)
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(serializedObject.FindProperty("m_EffectDistance"));
EditorGUILayout.PropertyField(serializedObject.FindProperty("m_EffectColor"));
EditorGUILayout.PropertyField(serializedObject.FindProperty("m_UseGraphicAlpha"));
if (uiEffect && uiEffect.blurMode != BlurMode.None)
{
EditorGUILayout.PropertyField(serializedObject.FindProperty("m_BlurFactor"));
}
EditorGUI.indentLevel--;
}
serializedObject.ApplyModifiedProperties();
}
}
}
@@ -1,120 +0,0 @@
using UnityEditor;
using UnityEditorInternal;
using UnityEngine;
using System.Linq;
namespace Coffee.UIExtensions.Editors
{
/// <summary>
/// UIEffect editor.
/// </summary>
[CustomEditor(typeof(UIShiny))]
[CanEditMultipleObjects]
public class UIShinyEditor : Editor
{
//################################
// Public/Protected Members.
//################################
/// <summary>
/// This function is called when the object becomes enabled and active.
/// </summary>
protected void OnEnable()
{
_spMaterial = serializedObject.FindProperty("m_EffectMaterial");
_spEffectFactor = serializedObject.FindProperty("m_EffectFactor");
_spEffectArea = serializedObject.FindProperty("m_EffectArea");
_spWidth = serializedObject.FindProperty("m_Width");
_spRotation = serializedObject.FindProperty("m_Rotation");
_spSoftness = serializedObject.FindProperty("m_Softness");
_spBrightness = serializedObject.FindProperty("m_Brightness");
_spGloss = serializedObject.FindProperty("m_Gloss");
var player = serializedObject.FindProperty("m_Player");
_spPlay = player.FindPropertyRelative("play");
_spDuration = player.FindPropertyRelative("duration");
_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 material.
//================
EditorGUI.BeginDisabledGroup(true);
EditorGUILayout.PropertyField(_spMaterial);
EditorGUI.EndDisabledGroup();
//================
// Effect setting.
//================
EditorGUILayout.PropertyField(_spEffectFactor);
EditorGUILayout.PropertyField(_spWidth);
EditorGUILayout.PropertyField(_spRotation);
EditorGUILayout.PropertyField(_spSoftness);
EditorGUILayout.PropertyField(_spBrightness);
EditorGUILayout.PropertyField(_spGloss);
//================
// Advanced option.
//================
GUILayout.Space(10);
EditorGUILayout.LabelField("Advanced Option", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(_spEffectArea);
//================
// Effect runner.
//================
GUILayout.Space(10);
EditorGUILayout.LabelField("Effect Player", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(_spPlay);
EditorGUILayout.PropertyField(_spDuration);
EditorGUILayout.PropertyField(_spLoop);
EditorGUILayout.PropertyField(_spLoopDelay);
EditorGUILayout.PropertyField(_spUpdateMode);
// Debug.
using (new EditorGUI.DisabledGroupScope(!Application.isPlaying))
using (new EditorGUILayout.HorizontalScope(EditorStyles.helpBox))
{
GUILayout.Label("Debug");
if (GUILayout.Button("Play", "ButtonLeft"))
{
(target as UIShiny).Play();
}
if (GUILayout.Button("Stop", "ButtonRight"))
{
(target as UIShiny).Stop();
}
}
serializedObject.ApplyModifiedProperties();
}
//################################
// Private Members.
//################################
SerializedProperty _spMaterial;
SerializedProperty _spEffectFactor;
SerializedProperty _spWidth;
SerializedProperty _spRotation;
SerializedProperty _spSoftness;
SerializedProperty _spBrightness;
SerializedProperty _spGloss;
SerializedProperty _spEffectArea;
SerializedProperty _spPlay;
SerializedProperty _spLoop;
SerializedProperty _spLoopDelay;
SerializedProperty _spDuration;
SerializedProperty _spUpdateMode;
}
}
@@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: 0080e984bad7545cd957d9121e99f988
timeCreated: 1538806052
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,121 +0,0 @@
using UnityEditor;
using UnityEditorInternal;
using UnityEngine;
using System.Linq;
namespace Coffee.UIExtensions.Editors
{
/// <summary>
/// UIEffect editor.
/// </summary>
[CustomEditor(typeof(UITransitionEffect))]
[CanEditMultipleObjects]
public class UITransitionEffectEditor : Editor
{
SerializedProperty _spMaterial;
SerializedProperty _spEffectMode;
SerializedProperty _spEffectFactor;
SerializedProperty _spEffectArea;
SerializedProperty _spKeepAspectRatio;
SerializedProperty _spDissolveWidth;
SerializedProperty _spDissolveSoftness;
SerializedProperty _spDissolveColor;
SerializedProperty _spTransitionTexture;
SerializedProperty _spDuration;
SerializedProperty _spUpdateMode;
SerializedProperty _spPassRayOnHidden;
//################################
// Public/Protected Members.
//################################
/// <summary>
/// This function is called when the object becomes enabled and active.
/// </summary>
protected void OnEnable()
{
_spMaterial = serializedObject.FindProperty("m_EffectMaterial");
_spEffectMode = serializedObject.FindProperty("m_EffectMode");
_spEffectFactor = serializedObject.FindProperty("m_EffectFactor");
_spEffectArea = serializedObject.FindProperty("m_EffectArea");
_spKeepAspectRatio = serializedObject.FindProperty("m_KeepAspectRatio");
_spDissolveWidth = serializedObject.FindProperty("m_DissolveWidth");
_spDissolveSoftness = serializedObject.FindProperty("m_DissolveSoftness");
_spDissolveColor = serializedObject.FindProperty("m_DissolveColor");
_spTransitionTexture = serializedObject.FindProperty("m_TransitionTexture");
var player = serializedObject.FindProperty("m_Player");
_spDuration = player.FindPropertyRelative("duration");
_spUpdateMode = player.FindPropertyRelative("updateMode");
_spPassRayOnHidden = serializedObject.FindProperty("m_PassRayOnHidden");
}
/// <summary>
/// Implement this function to make a custom inspector.
/// </summary>
public override void OnInspectorGUI()
{
serializedObject.Update();
//================
// Effect material.
//================
EditorGUI.BeginDisabledGroup(true);
EditorGUILayout.PropertyField(_spMaterial);
EditorGUI.EndDisabledGroup();
//================
// Effect setting.
//================
EditorGUILayout.PropertyField(_spEffectMode);
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_spEffectFactor);
if (_spEffectMode.intValue == (int)UITransitionEffect.EffectMode.Dissolve)
{
EditorGUILayout.PropertyField(_spDissolveWidth);
EditorGUILayout.PropertyField(_spDissolveSoftness);
EditorGUILayout.PropertyField(_spDissolveColor);
}
EditorGUI.indentLevel--;
//================
// Advanced option.
//================
GUILayout.Space(10);
EditorGUILayout.LabelField("Advanced Option", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(_spEffectArea);
EditorGUILayout.PropertyField(_spTransitionTexture);
EditorGUILayout.PropertyField(_spKeepAspectRatio);
EditorGUILayout.PropertyField(_spPassRayOnHidden);
//================
// Effect runner.
//================
GUILayout.Space(10);
EditorGUILayout.LabelField("Effect Player", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(_spDuration);
EditorGUILayout.PropertyField(_spUpdateMode);
// Debug.
using (new EditorGUI.DisabledGroupScope(!Application.isPlaying))
using (new EditorGUILayout.HorizontalScope(EditorStyles.helpBox))
{
GUILayout.Label("Debug");
if (GUILayout.Button("Show", "ButtonLeft"))
{
(target as UITransitionEffect).Show();
}
if (GUILayout.Button("Hide", "ButtonRight"))
{
(target as UITransitionEffect).Hide();
}
}
serializedObject.ApplyModifiedProperties();
}
}
}
@@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: 631f363a54c834f1f846f823b31bd321
timeCreated: 1538806067
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,399 +0,0 @@
using System;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Serialization;
namespace Coffee.UIExtensions
{
/// <summary>
/// Dissolve effect for uGUI.
/// </summary>
[AddComponentMenu("UI/UIEffect/UIDissolve", 3)]
public class UIDissolve : UIEffectBase
{
//################################
// Constant or Static Members.
//################################
public const string shaderName = "UI/Hidden/UI-Effect-Dissolve";
static readonly ParameterTexture _ptex = new ParameterTexture(8, 128, "_ParamTex");
//################################
// Serialize Members.
//################################
[Tooltip("Current location[0-1] for dissolve effect. 0 is not dissolved, 1 is completely dissolved.")]
[FormerlySerializedAs("m_Location")]
[SerializeField] [Range(0, 1)] float m_EffectFactor = 0.5f;
[Tooltip("Edge width.")]
[SerializeField] [Range(0, 1)] float m_Width = 0.5f;
[Tooltip("Edge softness.")]
[SerializeField] [Range(0, 1)] float m_Softness = 0.5f;
[Tooltip("Edge color.")]
[SerializeField] [ColorUsage(false)] Color m_Color = new Color(0.0f, 0.25f, 1.0f);
[Tooltip("Edge color effect mode.")]
[SerializeField] ColorMode m_ColorMode = ColorMode.Add;
[Tooltip("Noise texture for dissolving (single channel texture).")]
[SerializeField] Texture m_NoiseTexture;
[Tooltip("The area for effect.")]
[SerializeField] protected EffectArea m_EffectArea;
[Tooltip("Keep effect aspect ratio.")]
[SerializeField] bool m_KeepAspectRatio;
[Header("Effect Player")]
[SerializeField] EffectPlayer m_Player;
[Obsolete][HideInInspector]
[SerializeField] bool m_Play;
[Obsolete][HideInInspector]
[SerializeField][Range(0.1f, 10)] float m_Duration = 1;
[Obsolete][HideInInspector]
[SerializeField] AnimatorUpdateMode m_UpdateMode = AnimatorUpdateMode.Normal;
//################################
// Public Members.
//################################
/// <summary>
/// Effect factor between 0(start) and 1(end).
/// </summary>
[System.Obsolete("Use effectFactor instead (UnityUpgradable) -> effectFactor")]
public float location
{
get { return m_EffectFactor; }
set
{
value = Mathf.Clamp(value, 0, 1);
if (!Mathf.Approximately(m_EffectFactor, value))
{
m_EffectFactor = value;
SetDirty();
}
}
}
/// <summary>
/// Effect factor between 0(start) and 1(end).
/// </summary>
public float effectFactor
{
get { return m_EffectFactor; }
set
{
value = Mathf.Clamp(value, 0, 1);
if (!Mathf.Approximately(m_EffectFactor, value))
{
m_EffectFactor = value;
SetDirty();
}
}
}
/// <summary>
/// Edge width.
/// </summary>
public float width
{
get { return m_Width; }
set
{
value = Mathf.Clamp(value, 0, 1);
if (!Mathf.Approximately(m_Width, value))
{
m_Width = value;
SetDirty();
}
}
}
/// <summary>
/// Edge softness.
/// </summary>
public float softness
{
get { return m_Softness; }
set
{
value = Mathf.Clamp(value, 0, 1);
if (!Mathf.Approximately(m_Softness, value))
{
m_Softness = value;
SetDirty();
}
}
}
/// <summary>
/// Edge color.
/// </summary>
public Color color
{
get { return m_Color; }
set
{
if (m_Color != value)
{
m_Color = value;
SetDirty();
}
}
}
/// <summary>
/// Noise texture.
/// </summary>
public Texture noiseTexture
{
get { return m_NoiseTexture ?? graphic.material.GetTexture("_NoiseTex"); }
set
{
if (m_NoiseTexture != value)
{
m_NoiseTexture = value;
if (graphic)
{
ModifyMaterial();
}
}
}
}
/// <summary>
/// The area for effect.
/// </summary>
public EffectArea effectArea
{
get { return m_EffectArea; }
set
{
if (m_EffectArea != value)
{
m_EffectArea = value;
SetDirty();
}
}
}
/// <summary>
/// Keep aspect ratio.
/// </summary>
public bool keepAspectRatio
{
get { return m_KeepAspectRatio; }
set
{
if (m_KeepAspectRatio != value)
{
m_KeepAspectRatio = value;
SetDirty();
}
}
}
/// <summary>
/// Color effect mode.
/// </summary>
public ColorMode colorMode { get { return m_ColorMode; } }
/// <summary>
/// Play effect on enable.
/// </summary>
[System.Obsolete("Use Show/Hide method instead")]
public bool play { get { return _player.play; } set { _player.play = value; } }
/// <summary>
/// Play effect loop.
/// </summary>
[System.Obsolete]
public bool loop { get { return _player.loop; } set { _player.loop = value; } }
/// <summary>
/// The duration for playing effect.
/// </summary>
public float duration { get { return _player.duration; } set { _player.duration = Mathf.Max(value, 0.1f); } }
/// <summary>
/// Delay on loop effect.
/// </summary>
[System.Obsolete]
public float loopDelay { get { return _player.loopDelay; } set { _player.loopDelay = Mathf.Max(value, 0); } }
/// <summary>
/// Update mode for playing effect.
/// </summary>
public AnimatorUpdateMode updateMode { get { return _player.updateMode; } set { _player.updateMode = value; } }
/// <summary>
/// Gets the parameter texture.
/// </summary>
public override ParameterTexture ptex { get { return _ptex; } }
/// <summary>
/// Modifies the material.
/// </summary>
public override void ModifyMaterial()
{
ulong hash = (m_NoiseTexture ? (uint)m_NoiseTexture.GetInstanceID() : 0) + ((ulong)1 << 32) + ((ulong)m_ColorMode << 36);
if (_materialCache != null && (_materialCache.hash != hash || !isActiveAndEnabled || !m_EffectMaterial))
{
MaterialCache.Unregister(_materialCache);
_materialCache = null;
}
if (!isActiveAndEnabled || !m_EffectMaterial)
{
graphic.material = null;
}
else if (!m_NoiseTexture)
{
graphic.material = m_EffectMaterial;
}
else if (_materialCache != null && _materialCache.hash == hash)
{
graphic.material = _materialCache.material;
}
else
{
_materialCache = MaterialCache.Register(hash, m_NoiseTexture, () =>
{
var mat = new Material(m_EffectMaterial);
mat.name += "_" + m_NoiseTexture.name;
mat.SetTexture("_NoiseTex", m_NoiseTexture);
return mat;
});
graphic.material = _materialCache.material;
}
}
/// <summary>
/// Modifies the mesh.
/// </summary>
public override void ModifyMesh(VertexHelper vh)
{
if (!isActiveAndEnabled)
return;
float normalizedIndex = ptex.GetNormalizedIndex(this);
// rect.
var tex = noiseTexture;
var aspectRatio = m_KeepAspectRatio && tex ? ((float)tex.width) / tex.height : -1;
Rect rect = m_EffectArea.GetEffectArea(vh, graphic, aspectRatio);
// Calculate vertex position.
UIVertex vertex = default(UIVertex);
bool effectEachCharacter = graphic is Text && m_EffectArea == EffectArea.Character;
float x, y;
int count = vh.currentVertCount;
for (int i = 0; i < count; i++)
{
vh.PopulateUIVertex(ref vertex, i);
if (effectEachCharacter)
{
x = splitedCharacterPosition[i % 4].x;
y = splitedCharacterPosition[i % 4].y;
}
else
{
x = Mathf.Clamp01(vertex.position.x / rect.width + 0.5f);
y = Mathf.Clamp01(vertex.position.y / rect.height + 0.5f);
}
vertex.uv0 = new Vector2(
Packer.ToFloat(vertex.uv0.x, vertex.uv0.y),
Packer.ToFloat(x, y, normalizedIndex)
);
vh.SetUIVertex(vertex, i);
}
}
protected override void SetDirty()
{
ptex.RegisterMaterial(targetGraphic.material);
ptex.SetData(this, 0, m_EffectFactor); // param1.x : location
ptex.SetData(this, 1, m_Width); // param1.y : width
ptex.SetData(this, 2, m_Softness); // param1.z : softness
ptex.SetData(this, 4, m_Color.r); // param2.x : red
ptex.SetData(this, 5, m_Color.g); // param2.y : green
ptex.SetData(this, 6, m_Color.b); // param2.z : blue
}
/// <summary>
/// Play effect.
/// </summary>
public void Play()
{
_player.Play();
}
/// <summary>
/// Stop effect.
/// </summary>
public void Stop()
{
_player.Stop();
}
//################################
// Protected Members.
//################################
/// <summary>
/// This function is called when the object becomes enabled and active.
/// </summary>
protected override void OnEnable()
{
base.OnEnable();
_player.OnEnable(f => effectFactor = f);
}
protected override void OnDisable()
{
MaterialCache.Unregister(_materialCache);
_materialCache = null;
_player.OnDisable();
base.OnDisable();
}
#if UNITY_EDITOR
/// <summary>
/// Gets the material.
/// </summary>
/// <returns>The material.</returns>
protected override Material GetMaterial()
{
return MaterialResolver.GetOrGenerateMaterialVariant(Shader.Find(shaderName), m_ColorMode);
}
#pragma warning disable 0612
protected override void UpgradeIfNeeded()
{
// Upgrade for v3.0.0
if (IsShouldUpgrade(300))
{
_player.play = false;
_player.duration = m_Duration;
_player.loop = false;
_player.loopDelay = 1;
_player.updateMode = m_UpdateMode;
}
}
#pragma warning restore 0612
#endif
//################################
// Private Members.
//################################
MaterialCache _materialCache = null;
EffectPlayer _player{ get { return m_Player ?? (m_Player = new EffectPlayer()); } }
}
}
@@ -1,15 +0,0 @@
fileFormatVersion: 2
guid: ce76b7a490bd74f34a2f2752641aea24
timeCreated: 1538866738
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences:
- m_EffectMaterial: {instanceID: 0}
- m_PtexMaterial: {instanceID: 0}
- m_NoiseTexture: {fileID: 2800000, guid: 3e04c247fb2604af186173fce0bc62de, type: 3}
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,449 +0,0 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Serialization;
#if UNITY_EDITOR
using System.IO;
using System.Linq;
using UnityEditor;
#endif
namespace Coffee.UIExtensions
{
/// <summary>
/// UIEffect.
/// </summary>
[ExecuteInEditMode]
[RequireComponent(typeof(Graphic))]
[DisallowMultipleComponent]
[AddComponentMenu("UI/UIEffect/UIEffect", 1)]
public class UIEffect : UIEffectBase
{
//################################
// Constant or Static Members.
//################################
public const string shaderName = "UI/Hidden/UI-Effect";
static readonly ParameterTexture _ptex = new ParameterTexture(4, 1024, "_ParamTex");
//################################
// Serialize Members.
//################################
[FormerlySerializedAs("m_ToneLevel")]
[Tooltip("Effect factor between 0(no effect) and 1(complete effect).")]
[SerializeField][Range(0, 1)] float m_EffectFactor = 1;
[Tooltip("Color effect factor between 0(no effect) and 1(complete effect).")]
[SerializeField][Range(0, 1)] float m_ColorFactor = 1;
[FormerlySerializedAs("m_Blur")]
[Tooltip("How far is the blurring from the graphic.")]
[SerializeField][Range(0, 1)] float m_BlurFactor = 1;
[FormerlySerializedAs("m_ToneMode")]
[Tooltip("Effect mode")]
[SerializeField] EffectMode m_EffectMode;
[Tooltip("Color effect mode")]
[SerializeField] ColorMode m_ColorMode;
[Tooltip("Blur effect mode")]
[SerializeField] BlurMode m_BlurMode;
[Tooltip("Advanced blurring remove common artifacts in the blur effect for uGUI.")]
[SerializeField] bool m_AdvancedBlur = false;
[Obsolete][HideInInspector]
[SerializeField][Range(0, 1)] float m_ShadowBlur = 1;
[Obsolete][HideInInspector]
[SerializeField] ShadowStyle m_ShadowStyle;
[Obsolete][HideInInspector]
[SerializeField] Color m_ShadowColor = Color.black;
[Obsolete][HideInInspector]
[SerializeField] Vector2 m_EffectDistance = new Vector2(1f, -1f);
[Obsolete][HideInInspector]
[SerializeField] bool m_UseGraphicAlpha = true;
[Obsolete][HideInInspector]
[SerializeField] Color m_EffectColor = Color.white;
[Obsolete][HideInInspector]
[SerializeField] List<UIShadow.AdditionalShadow> m_AdditionalShadows = new List<UIShadow.AdditionalShadow>();
public enum BlurEx
{
None = 0,
Ex = 1,
}
//################################
// Public Members.
//################################
/// <summary>
/// Effect factor between 0(no effect) and 1(complete effect).
/// </summary>
[System.Obsolete("Use effectFactor instead (UnityUpgradable) -> effectFactor")]
public float toneLevel
{
get { return m_EffectFactor; }
set
{
m_EffectFactor = Mathf.Clamp(value, 0, 1);
SetDirty();
}
}
/// <summary>
/// Effect factor between 0(no effect) and 1(complete effect).
/// </summary>
public float effectFactor
{
get { return m_EffectFactor; }
set
{
m_EffectFactor = Mathf.Clamp(value, 0, 1);
SetDirty();
}
}
/// <summary>
/// Color effect factor between 0(no effect) and 1(complete effect).
/// </summary>
public float colorFactor
{
get { return m_ColorFactor; }
set
{
m_ColorFactor = Mathf.Clamp(value, 0, 1);
SetDirty();
}
}
/// <summary>
/// How far is the blurring from the graphic.
/// </summary>
[System.Obsolete("Use blurFactor instead (UnityUpgradable) -> blurFactor")]
public float blur
{
get { return m_BlurFactor; }
set
{
m_BlurFactor = Mathf.Clamp(value, 0, 1);
SetDirty();
}
}
/// <summary>
/// How far is the blurring from the graphic.
/// </summary>
[System.Obsolete("Use effectFactor instead (UnityUpgradable) -> effectFactor")]
public float blurFactor
{
get { return m_BlurFactor; }
set
{
m_BlurFactor = Mathf.Clamp(value, 0, 1);
SetDirty();
}
}
/// <summary>
/// Effect mode(readonly).
/// </summary>
[System.Obsolete("Use effectMode instead (UnityUpgradable) -> effectMode")]
public EffectMode toneMode { get { return m_EffectMode; } }
/// <summary>
/// Effect mode(readonly).
/// </summary>
public EffectMode effectMode { get { return m_EffectMode; } }
/// <summary>
/// Color effect mode(readonly).
/// </summary>
public ColorMode colorMode { get { return m_ColorMode; } }
/// <summary>
/// Blur effect mode(readonly).
/// </summary>
public BlurMode blurMode { get { return m_BlurMode; } }
/// <summary>
/// Color for the color effect.
/// </summary>
public Color effectColor
{
get { return graphic.color; }
set
{
graphic.color = value;
SetDirty();
}
}
/// <summary>
/// Gets the parameter texture.
/// </summary>
public override ParameterTexture ptex { get { return _ptex; } }
/// <summary>
/// Modifies the mesh.
/// </summary>
public override void ModifyMesh(VertexHelper vh)
{
if (!isActiveAndEnabled)
{
return;
}
float normalizedIndex = ptex.GetNormalizedIndex(this);
if (m_BlurMode != BlurMode.None && m_AdvancedBlur)
{
vh.GetUIVertexStream(tempVerts);
vh.Clear();
var count = tempVerts.Count;
// Bundle
int bundleSize = targetGraphic is Text ? 6 : count;
Rect posBounds = default(Rect);
Rect uvBounds = default(Rect);
Vector3 size = default(Vector3);
Vector3 tPos = default(Vector3);
Vector3 tUV = default(Vector3);
float expand = (float)blurMode * 6 * 2;
for (int i = 0; i < count; i += bundleSize)
{
// min/max for bundled-quad
GetBounds(tempVerts, i, bundleSize, ref posBounds, ref uvBounds, true);
// Pack uv mask.
Vector2 uvMask = new Vector2(Packer.ToFloat(uvBounds.xMin, uvBounds.yMin), Packer.ToFloat(uvBounds.xMax, uvBounds.yMax));
// Quad
for (int j = 0; j < bundleSize; j += 6)
{
Vector3 cornerPos1 = tempVerts[i + j + 1].position;
Vector3 cornerPos2 = tempVerts[i + j + 4].position;
// Is outer quad?
bool hasOuterEdge = (bundleSize == 6)
|| !posBounds.Contains(cornerPos1)
|| !posBounds.Contains(cornerPos2);
if (hasOuterEdge)
{
Vector3 cornerUv1 = tempVerts[i + j + 1].uv0;
Vector3 cornerUv2 = tempVerts[i + j + 4].uv0;
Vector3 centerPos = (cornerPos1 + cornerPos2) / 2;
Vector3 centerUV = (cornerUv1 + cornerUv2) / 2;
size = (cornerPos1 - cornerPos2);
size.x = 1 + expand / Mathf.Abs(size.x);
size.y = 1 + expand / Mathf.Abs(size.y);
size.z = 1 + expand / Mathf.Abs(size.z);
tPos = centerPos - Vector3.Scale(size, centerPos);
tUV = centerUV - Vector3.Scale(size, centerUV);
}
// Vertex
for (int k = 0; k < 6; k++)
{
UIVertex vt = tempVerts[i + j + k];
Vector3 pos = vt.position;
Vector2 uv0 = vt.uv0;
if (hasOuterEdge && (pos.x < posBounds.xMin || posBounds.xMax < pos.x))
{
pos.x = pos.x * size.x + tPos.x;
uv0.x = uv0.x * size.x + tUV.x;
}
if (hasOuterEdge && (pos.y < posBounds.yMin || posBounds.yMax < pos.y))
{
pos.y = pos.y * size.y + tPos.y;
uv0.y = uv0.y * size.y + tUV.y;
}
vt.uv0 = new Vector2(Packer.ToFloat((uv0.x + 0.5f) / 2f, (uv0.y + 0.5f) / 2f), normalizedIndex);
vt.position = pos;
vt.uv1 = uvMask;
tempVerts[i + j + k] = vt;
}
}
}
vh.AddUIVertexTriangleStream(tempVerts);
tempVerts.Clear();
}
else
{
int count = vh.currentVertCount;
UIVertex vt = default(UIVertex);
for (int i = 0; i < count; i++)
{
vh.PopulateUIVertex(ref vt, i);
Vector2 uv0 = vt.uv0;
vt.uv0 = new Vector2(
Packer.ToFloat((uv0.x + 0.5f) / 2f, (uv0.y + 0.5f) / 2f),
normalizedIndex
);
vh.SetUIVertex(vt, i);
}
}
}
protected override void SetDirty()
{
ptex.RegisterMaterial(m_EffectMaterial);
ptex.SetData(this, 0, m_EffectFactor); // param.x : effect factor
ptex.SetData(this, 1, m_ColorFactor); // param.y : color factor
ptex.SetData(this, 2, m_BlurFactor); // param.z : blur factor
}
#if UNITY_EDITOR
/// <summary>
/// Gets the material.
/// </summary>
/// <returns>The material.</returns>
protected override Material GetMaterial()
{
return MaterialResolver.GetOrGenerateMaterialVariant(Shader.Find(shaderName), m_EffectMode, m_ColorMode, m_BlurMode, m_AdvancedBlur ? BlurEx.Ex : BlurEx.None);
}
#pragma warning disable 0612
protected override void UpgradeIfNeeded()
{
// Upgrade for v3.0.0
if (IsShouldUpgrade(300))
{
if (m_ColorMode != ColorMode.Multiply)
{
Color col = targetGraphic.color;
col.r = m_EffectColor.r;
col.g = m_EffectColor.g;
col.b = m_EffectColor.b;
targetGraphic.color = col;
m_ColorFactor = m_EffectColor.a;
}
if (m_ShadowStyle != ShadowStyle.None || m_AdditionalShadows.Any(x => x.style != ShadowStyle.None))
{
if (m_ShadowStyle != ShadowStyle.None)
{
var shadow = gameObject.GetComponent<UIShadow>() ?? gameObject.AddComponent<UIShadow>();
shadow.style = m_ShadowStyle;
shadow.effectDistance = m_EffectDistance;
shadow.effectColor = m_ShadowColor;
shadow.useGraphicAlpha = m_UseGraphicAlpha;
shadow.blurFactor = m_ShadowBlur;
}
foreach (var s in m_AdditionalShadows)
{
if (s.style == ShadowStyle.None)
{
continue;
}
var shadow = gameObject.AddComponent<UIShadow>();
shadow.style = s.style;
shadow.effectDistance = s.effectDistance;
shadow.effectColor = s.effectColor;
shadow.useGraphicAlpha = s.useGraphicAlpha;
shadow.blurFactor = s.blur;
}
m_ShadowStyle = ShadowStyle.None;
m_AdditionalShadows = null;
if (m_EffectMode == EffectMode.None && m_ColorMode == ColorMode.Multiply && m_BlurMode == BlurMode.None)
{
DestroyImmediate(this, true);
}
}
int tone = (int)m_EffectMode;
const int Mono = 5;
const int Cutoff = 6;
const int Hue = 7;
if (tone == Hue)
{
var go = gameObject;
var hue = m_EffectFactor;
DestroyImmediate(this, true);
var hsv = go.GetComponent<UIHsvModifier>() ?? go.AddComponent<UIHsvModifier>();
hsv.hue = hue;
hsv.range = 1;
}
// Cutoff/Mono
if (tone == Cutoff || tone == Mono)
{
var go = gameObject;
var factor = m_EffectFactor;
var transitionMode = tone == Cutoff
? UITransitionEffect.EffectMode.Cutoff
: UITransitionEffect.EffectMode.Fade;
DestroyImmediate(this, true);
var trans = go.GetComponent<UITransitionEffect>() ?? go.AddComponent<UITransitionEffect>();
trans.effectFactor = factor;
var sp = new SerializedObject(trans).FindProperty("m_EffectMode");
sp.intValue = (int)transitionMode;
sp.serializedObject.ApplyModifiedProperties();
}
}
}
#pragma warning restore 0612
#endif
//################################
// Private Members.
//################################
static void GetBounds(List<UIVertex> verts, int start, int count, ref Rect posBounds, ref Rect uvBounds, bool global)
{
Vector2 minPos = new Vector2(float.MaxValue, float.MaxValue);
Vector2 maxPos = new Vector2(float.MinValue, float.MinValue);
Vector2 minUV = new Vector2(float.MaxValue, float.MaxValue);
Vector2 maxUV = new Vector2(float.MinValue, float.MinValue);
for (int i = start; i < start + count; i++)
{
UIVertex vt = verts[i];
Vector2 uv = vt.uv0;
Vector3 pos = vt.position;
// Left-Bottom
if (minPos.x >= pos.x && minPos.y >= pos.y)
{
minPos = pos;
}
// Right-Top
else if (maxPos.x <= pos.x && maxPos.y <= pos.y)
{
maxPos = pos;
}
// Left-Bottom
if (minUV.x >= uv.x && minUV.y >= uv.y)
{
minUV = uv;
}
// Right-Top
else if (maxUV.x <= uv.x && maxUV.y <= uv.y)
{
maxUV = uv;
}
}
// Shrink coordinate for detect edge
posBounds.Set(minPos.x + 0.001f, minPos.y + 0.001f, maxPos.x - minPos.x - 0.002f, maxPos.y - minPos.y - 0.002f);
uvBounds.Set(minUV.x, minUV.y, maxUV.x - minUV.x, maxUV.y - minUV.y);
}
}
}
@@ -1,575 +0,0 @@
using System.Collections;
using System.Linq;
using UnityEngine;
using UnityEngine.Serialization;
using UnityEngine.Rendering;
using UnityEngine.UI;
namespace Coffee.UIExtensions
{
/// <summary>
/// UIEffectCapturedImage
/// </summary>
[AddComponentMenu("UI/UIEffect/UIEffectCapturedImage", 200)]
public class UIEffectCapturedImage : RawImage
#if UNITY_EDITOR
, ISerializationCallbackReceiver
#endif
{
//################################
// Constant or Static Members.
//################################
public const string shaderName = "UI/Hidden/UI-EffectCapture";
/// <summary>
/// Desampling rate.
/// </summary>
public enum DesamplingRate
{
None = 0,
x1 = 1,
x2 = 2,
x4 = 4,
x8 = 8,
}
//################################
// Serialize Members.
//################################
[Tooltip("Effect factor between 0(no effect) and 1(complete effect).")]
[FormerlySerializedAs("m_ToneLevel")]
[SerializeField][Range(0, 1)] float m_EffectFactor = 1;
[Tooltip("Color effect factor between 0(no effect) and 1(complete effect).")]
[SerializeField][Range(0, 1)] float m_ColorFactor = 1;
[Tooltip("How far is the blurring from the graphic.")]
[FormerlySerializedAs("m_Blur")]
[SerializeField][Range(0, 1)] float m_BlurFactor = 1;
[Tooltip("Effect mode.")]
[FormerlySerializedAs("m_ToneMode")]
[SerializeField] EffectMode m_EffectMode;
[Tooltip("Color effect mode.")]
[SerializeField] ColorMode m_ColorMode;
[Tooltip("Blur effect mode.")]
[SerializeField] BlurMode m_BlurMode;
[Tooltip("Color for the color effect.")]
[SerializeField] Color m_EffectColor = Color.white;
[Tooltip("Desampling rate of the generated RenderTexture.")]
[SerializeField] DesamplingRate m_DesamplingRate = DesamplingRate.x1;
[Tooltip("Desampling rate of reduction buffer to apply effect.")]
[SerializeField] DesamplingRate m_ReductionRate = DesamplingRate.x1;
[Tooltip("FilterMode for capturing.")]
[SerializeField] FilterMode m_FilterMode = FilterMode.Bilinear;
[Tooltip("Effect material.")]
[SerializeField] Material m_EffectMaterial;
[Tooltip("Blur iterations.")]
[FormerlySerializedAs("m_Iterations")]
[SerializeField][Range(1, 8)] int m_BlurIterations = 3;
[Tooltip("Fits graphic size to screen on captured.")]
[FormerlySerializedAs("m_KeepCanvasSize")]
[SerializeField] bool m_FitToScreen = true;
[Tooltip("Capture automatically on enable.")]
[SerializeField] bool m_CaptureOnEnable = false;
[Tooltip("Capture immediately.")]
[SerializeField] bool m_ImmediateCapturing = true;
//################################
// Public Members.
//################################
/// <summary>
/// Effect factor between 0(no effect) and 1(complete effect).
/// </summary>
[System.Obsolete("Use effectFactor instead (UnityUpgradable) -> effectFactor")]
public float toneLevel { get { return m_EffectFactor; } set { m_EffectFactor = Mathf.Clamp(value, 0, 1); } }
/// <summary>
/// Effect factor between 0(no effect) and 1(complete effect).
/// </summary>
public float effectFactor { get { return m_EffectFactor; } set { m_EffectFactor = Mathf.Clamp(value, 0, 1); } }
/// <summary>
/// Color effect factor between 0(no effect) and 1(complete effect).
/// </summary>
public float colorFactor { get { return m_ColorFactor; } set { m_ColorFactor = Mathf.Clamp(value, 0, 1); } }
/// <summary>
/// How far is the blurring from the graphic.
/// </summary>
[System.Obsolete("Use blurFactor instead (UnityUpgradable) -> blurFactor")]
public float blur { get { return m_BlurFactor; } set { m_BlurFactor = Mathf.Clamp(value, 0, 4); } }
/// <summary>
/// How far is the blurring from the graphic.
/// </summary>
public float blurFactor { get { return m_BlurFactor; } set { m_BlurFactor = Mathf.Clamp(value, 0, 4); } }
/// <summary>
/// Tone effect mode.
/// </summary>
[System.Obsolete("Use effectMode instead (UnityUpgradable) -> effectMode")]
public EffectMode toneMode { get { return m_EffectMode; } }
/// <summary>
/// Effect mode.
/// </summary>
public EffectMode effectMode { get { return m_EffectMode; } }
/// <summary>
/// Color effect mode.
/// </summary>
public ColorMode colorMode { get { return m_ColorMode; } }
/// <summary>
/// Blur effect mode.
/// </summary>
public BlurMode blurMode { get { return m_BlurMode; } }
/// <summary>
/// Color for the color effect.
/// </summary>
public Color effectColor { get { return m_EffectColor; } set { m_EffectColor = value; } }
/// <summary>
/// Effect material.
/// </summary>
public virtual Material effectMaterial { get { return m_EffectMaterial; } }
/// <summary>
/// Desampling rate of the generated RenderTexture.
/// </summary>
public DesamplingRate desamplingRate { get { return m_DesamplingRate; } set { m_DesamplingRate = value; } }
/// <summary>
/// Desampling rate of reduction buffer to apply effect.
/// </summary>
public DesamplingRate reductionRate { get { return m_ReductionRate; } set { m_ReductionRate = value; } }
/// <summary>
/// FilterMode for capturing.
/// </summary>
public FilterMode filterMode { get { return m_FilterMode; } set { m_FilterMode = value; } }
/// <summary>
/// Captured texture.
/// </summary>
public RenderTexture capturedTexture { get { return _rt; } }
/// <summary>
/// Blur iterations.
/// </summary>
[System.Obsolete("Use blurIterations instead (UnityUpgradable) -> blurIterations")]
public int iterations { get { return m_BlurIterations; } set { m_BlurIterations = value; } }
/// <summary>
/// Blur iterations.
/// </summary>
public int blurIterations { get { return m_BlurIterations; } set { m_BlurIterations = value; } }
/// <summary>
/// Fits graphic size to screen.
/// </summary>
[System.Obsolete("Use fitToScreen instead (UnityUpgradable) -> fitToScreen")]
public bool keepCanvasSize { get { return m_FitToScreen; } set { m_FitToScreen = value; } }
/// <summary>
/// Fits graphic size to screen on captured.
/// </summary>
public bool fitToScreen { get { return m_FitToScreen; } set { m_FitToScreen = value; } }
/// <summary>
/// Target RenderTexture to capture.
/// </summary>
[System.Obsolete]
public RenderTexture targetTexture { get { return null; } set { } }
/// <summary>
/// Capture automatically on enable.
/// </summary>
public bool captureOnEnable { get { return m_CaptureOnEnable; } set { m_CaptureOnEnable = value; } }
/// <summary>
/// Capture immediately.
/// </summary>
public bool immediateCapturing { get { return m_ImmediateCapturing; } set { m_ImmediateCapturing = value; } }
/// <summary>
/// This function is called when the object becomes enabled and active.
/// </summary>
protected override void OnEnable()
{
base.OnEnable();
if (m_CaptureOnEnable && Application.isPlaying)
{
Capture();
}
}
protected override void OnDisable()
{
base.OnDisable();
if (m_CaptureOnEnable && Application.isPlaying)
{
_Release(false);
texture = null;
}
}
/// <summary>
/// This function is called when the MonoBehaviour will be destroyed.
/// </summary>
protected override void OnDestroy()
{
Release();
base.OnDestroy();
}
/// <summary>
/// Callback function when a UI element needs to generate vertices.
/// </summary>
protected override void OnPopulateMesh(VertexHelper vh)
{
// When not displaying, clear vertex.
if (texture == null || color.a < 1 / 255f || canvasRenderer.GetAlpha() < 1 / 255f)
{
vh.Clear();
}
else
{
base.OnPopulateMesh(vh);
int count = vh.currentVertCount;
UIVertex vt = default(UIVertex);
Color c = new Color(1, 1, 1, color.a);
for (int i = 0; i < count; i++)
{
vh.PopulateUIVertex(ref vt, i);
vt.color = c;
vh.SetUIVertex(vt, i);
}
}
}
/// <summary>
/// Gets the size of the desampling.
/// </summary>
public void GetDesamplingSize(DesamplingRate rate, out int w, out int h)
{
#if UNITY_EDITOR
if (!Application.isPlaying)
{
var res = UnityEditor.UnityStats.screenRes.Split('x');
w = int.Parse(res[0]);
h = int.Parse(res[1]);
}
else
#endif
{
w = Screen.width;
h = Screen.height;
}
if (rate == DesamplingRate.None)
return;
float aspect = (float)w / h;
if (w < h)
{
h = Mathf.ClosestPowerOfTwo(h / (int)rate);
w = Mathf.CeilToInt(h * aspect);
}
else
{
w = Mathf.ClosestPowerOfTwo(w / (int)rate);
h = Mathf.CeilToInt(w / aspect);
}
}
/// <summary>
/// Capture rendering result.
/// </summary>
public void Capture()
{
// Fit to screen.
var rootCanvas = canvas.rootCanvas;
if (m_FitToScreen)
{
var rootTransform = rootCanvas.transform as RectTransform;
var size = rootTransform.rect.size;
rectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, size.x);
rectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, size.y);
rectTransform.position = rootTransform.position;
}
// Cache some ids.
if (s_CopyId == 0)
{
s_CopyId = Shader.PropertyToID("_UIEffectCapturedImage_ScreenCopyId");
s_EffectId1 = Shader.PropertyToID("_UIEffectCapturedImage_EffectId1");
s_EffectId2 = Shader.PropertyToID("_UIEffectCapturedImage_EffectId2");
s_EffectFactorId = Shader.PropertyToID("_EffectFactor");
s_ColorFactorId = Shader.PropertyToID("_ColorFactor");
s_CommandBuffer = new CommandBuffer();
}
// If size of result RT has changed, release it.
int w, h;
GetDesamplingSize(m_DesamplingRate, out w, out h);
if (_rt && (_rt.width != w || _rt.height != h))
{
_Release(ref _rt);
}
// Generate RT for result.
if (_rt == null)
{
_rt = new RenderTexture(w, h, 0, RenderTextureFormat.ARGB32, RenderTextureReadWrite.Default);
_rt.filterMode = m_FilterMode;
_rt.useMipMap = false;
_rt.wrapMode = TextureWrapMode.Clamp;
_rt.hideFlags = HideFlags.HideAndDontSave;
}
SetupCommandBuffer();
}
void SetupCommandBuffer()
{
// Material for effect.
Material mat = m_EffectMaterial;
if (s_CommandBuffer == null)
{
s_CommandBuffer = new CommandBuffer();
}
// [1] Capture from back buffer (back buffer -> copied screen).
int w, h;
GetDesamplingSize(DesamplingRate.None, out w, out h);
s_CommandBuffer.GetTemporaryRT(s_CopyId, w, h, 0, m_FilterMode);
#if UNITY_EDITOR
s_CommandBuffer.Blit(Resources.FindObjectsOfTypeAll<RenderTexture>().FirstOrDefault(x => x.name == "GameView RT"), s_CopyId);
#else
s_CommandBuffer.Blit(BuiltinRenderTextureType.BindableTexture, s_CopyId);
#endif
// Set properties for effect.
s_CommandBuffer.SetGlobalVector(s_EffectFactorId, new Vector4(m_EffectFactor, 0));
s_CommandBuffer.SetGlobalVector(s_ColorFactorId, new Vector4(m_EffectColor.r, m_EffectColor.g, m_EffectColor.b, m_EffectColor.a));
// [2] Apply base effect with reduction buffer (copied screen -> effect1).
GetDesamplingSize(m_ReductionRate, out w, out h);
s_CommandBuffer.GetTemporaryRT(s_EffectId1, w, h, 0, m_FilterMode);
s_CommandBuffer.Blit(s_CopyId, s_EffectId1, mat, 0);
s_CommandBuffer.ReleaseTemporaryRT(s_CopyId);
// Iterate blurring operation.
if (m_BlurMode != BlurMode.None)
{
s_CommandBuffer.GetTemporaryRT(s_EffectId2, w, h, 0, m_FilterMode);
for (int i = 0; i < m_BlurIterations; i++)
{
// [3] Apply blurring with reduction buffer (effect1 -> effect2, or effect2 -> effect1).
s_CommandBuffer.SetGlobalVector(s_EffectFactorId, new Vector4(m_BlurFactor, 0));
s_CommandBuffer.Blit(s_EffectId1, s_EffectId2, mat, 1);
s_CommandBuffer.SetGlobalVector(s_EffectFactorId, new Vector4(0, m_BlurFactor));
s_CommandBuffer.Blit(s_EffectId2, s_EffectId1, mat, 1);
}
s_CommandBuffer.ReleaseTemporaryRT(s_EffectId2);
}
// [4] Copy to result RT.
s_CommandBuffer.Blit(s_EffectId1, new RenderTargetIdentifier(capturedTexture));
s_CommandBuffer.ReleaseTemporaryRT(s_EffectId1);
#if UNITY_EDITOR
if (!Application.isPlaying)
{
Graphics.ExecuteCommandBuffer(s_CommandBuffer);
UpdateTexture();
return;
}
else
{
Graphics.ExecuteCommandBuffer(s_CommandBuffer);
}
#endif
if (m_ImmediateCapturing)
{
UpdateTexture();
}
else
{
// Execute command buffer.
canvas.rootCanvas.GetComponent<CanvasScaler>().StartCoroutine(_CoUpdateTextureOnNextFrame());
}
}
/// <summary>
/// Release captured image.
/// </summary>
public void Release()
{
_Release(true);
texture = null;
_SetDirty();
}
#if UNITY_EDITOR
protected override void Reset()
{
// Set parameters as 'Medium'.
m_BlurIterations = 3;
m_FilterMode = FilterMode.Bilinear;
m_DesamplingRate = DesamplingRate.x1;
m_ReductionRate = DesamplingRate.x1;
base.Reset();
}
/// <summary>
/// Raises the before serialize event.
/// </summary>
public void OnBeforeSerialize()
{
}
/// <summary>
/// Raises the after deserialize event.
/// </summary>
public void OnAfterDeserialize()
{
UnityEditor.EditorApplication.delayCall += () => UpdateMaterial(true);
}
/// <summary>
/// Raises the validate event.
/// </summary>
protected override void OnValidate()
{
base.OnValidate();
UnityEditor.EditorApplication.delayCall += () => UpdateMaterial(false);
}
/// <summary>
/// Updates the material.
/// </summary>
/// <param name="ignoreInPlayMode">If set to <c>true</c> ignore in play mode.</param>
protected void UpdateMaterial(bool ignoreInPlayMode)
{
if (!this || ignoreInPlayMode && Application.isPlaying)
{
return;
}
var mat = MaterialResolver.GetOrGenerateMaterialVariant(Shader.Find(shaderName), m_EffectMode, m_ColorMode, m_BlurMode);
if (m_EffectMaterial != mat)
{
material = null;
m_EffectMaterial = mat;
_SetDirty();
}
}
#endif
//################################
// Private Members.
//################################
RenderTexture _rt;
static int s_CopyId;
static int s_EffectId1;
static int s_EffectId2;
static int s_EffectFactorId;
static int s_ColorFactorId;
static CommandBuffer s_CommandBuffer;
/// <summary>
/// Release genarated objects.
/// </summary>
/// <param name="releaseRT">If set to <c>true</c> release cached RenderTexture.</param>
void _Release(bool releaseRT)
{
if (releaseRT)
{
texture = null;
_Release(ref _rt);
}
if (s_CommandBuffer != null)
{
s_CommandBuffer.Clear();
if (releaseRT)
{
s_CommandBuffer.Release();
s_CommandBuffer = null;
}
}
}
[System.Diagnostics.Conditional("UNITY_EDITOR")]
void _SetDirty()
{
#if UNITY_EDITOR
if (!Application.isPlaying)
{
UnityEditor.EditorUtility.SetDirty(this);
}
#endif
}
void _Release(ref RenderTexture obj)
{
if (obj)
{
obj.Release();
#if UNITY_EDITOR
if (!Application.isPlaying)
DestroyImmediate(obj);
else
#endif
Destroy(obj);
obj = null;
}
}
/// <summary>
/// Set texture on next frame.
/// </summary>
IEnumerator _CoUpdateTextureOnNextFrame()
{
yield return new WaitForEndOfFrame();
UpdateTexture();
}
void UpdateTexture()
{
#if !UNITY_EDITOR
// Execute command buffer.
Graphics.ExecuteCommandBuffer (s_CommandBuffer);
#endif
_Release(false);
texture = capturedTexture;
_SetDirty();
}
}
}
@@ -1,15 +0,0 @@
fileFormatVersion: 2
guid: e96dacbf1b116f64da658fbad66839e2
timeCreated: 1513158591
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences:
- m_Material: {instanceID: 0}
- m_Texture: {instanceID: 0}
- m_Shader: {fileID: 4800000, guid: c7bb8dee750384818a922a942cd437f9, type: 3}
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,63 +0,0 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace Coffee.UIExtensions
{
[RequireComponent(typeof(Graphic))]
[DisallowMultipleComponent]
[AddComponentMenu("UI/UIEffect/UIFlip",102)]
public class UIFlip : BaseMeshEffect
{
//################################
// Serialize Members.
//################################
[Tooltip("Flip horizontally.")]
[SerializeField] private bool m_Horizontal = false;
[Tooltip("Flip vertically.")]
[SerializeField] private bool m_Veritical = false;
//################################
// Public Members.
//################################
/// <summary>
/// Gets or sets a value indicating whether this <see cref="Coffee.UIExtensions.UIFlip"/> should be flipped horizontally.
/// </summary>
/// <value><c>true</c> if be flipped horizontally; otherwise, <c>false</c>.</value>
public bool horizontal { get { return this.m_Horizontal; } set { this.m_Horizontal = value; } }
/// <summary>
/// Gets or sets a value indicating whether this <see cref="Coffee.UIExtensions.UIFlip"/> should be flipped vertically.
/// </summary>
/// <value><c>true</c> if be flipped horizontally; otherwise, <c>false</c>.</value>
public bool vertical { get { return this.m_Veritical; } set { this.m_Veritical = value; } }
/// <summary>
/// Call used to modify mesh.
/// </summary>
/// <param name="vh">VertexHelper.</param>
public override void ModifyMesh(VertexHelper vh)
{
RectTransform rt = graphic.rectTransform;
UIVertex vt = default(UIVertex);
Vector3 pos;
Vector2 center = rt.rect.center;
for (int i = 0; i < vh.currentVertCount; i++)
{
vh.PopulateUIVertex(ref vt, i);
pos = vt.position;
vt.position = new Vector3(
m_Horizontal ? -pos.x : pos.x,
m_Veritical ? -pos.y : pos.y
// m_Horizontal ? (pos.x + (center.x - pos.x) * 2) : pos.x,
// m_Veritical ? (pos.y + (center.y - pos.y) * 2) : pos.y
);
vh.SetUIVertex(vt, i);
}
}
}
}
@@ -1,386 +0,0 @@
using UnityEngine;
using UnityEngine.UI;
namespace Coffee.UIExtensions
{
/// <summary>
/// UIGradient.
/// </summary>
[DisallowMultipleComponent]
[AddComponentMenu("UI/UIEffect/UIGradient",101)]
public class UIGradient : BaseMeshEffect
{
//################################
// Constant or Static Members.
//################################
/// <summary>
/// Gradient direction.
/// </summary>
public enum Direction
{
Horizontal,
Vertical,
Angle,
Diagonal,
}
/// <summary>
/// Gradient space for Text.
/// </summary>
public enum GradientStyle
{
Rect,
Fit,
Split,
}
//################################
// Serialize Members.
//################################
[Tooltip("Gradient Direction.")]
[SerializeField] Direction m_Direction;
[Tooltip("Color1: Top or Left.")]
[SerializeField] Color m_Color1 = Color.white;
[Tooltip("Color2: Bottom or Right.")]
[SerializeField] Color m_Color2 = Color.white;
[Tooltip("Color3: For diagonal.")]
[SerializeField] Color m_Color3 = Color.white;
[Tooltip("Color4: For diagonal.")]
[SerializeField] Color m_Color4 = Color.white;
[Tooltip("Gradient rotation.")]
[SerializeField][Range(-180, 180)] float m_Rotation;
[Tooltip("Gradient offset for Horizontal, Vertical or Angle.")]
[SerializeField][Range(-1, 1)] float m_Offset1;
[Tooltip("Gradient offset for Diagonal.")]
[SerializeField][Range(-1, 1)] float m_Offset2;
[Tooltip("Gradient style for Text.")]
[SerializeField] GradientStyle m_GradientStyle;
[Tooltip("Color space to correct color.")]
[SerializeField] ColorSpace m_ColorSpace = ColorSpace.Uninitialized;
[Tooltip("Ignore aspect ratio.")]
[SerializeField] bool m_IgnoreAspectRatio = true;
//################################
// Public Members.
//################################
public Graphic targetGraphic { get { return base.graphic; } }
/// <summary>
/// Gradient Direction.
/// </summary>
public Direction direction
{
get { return m_Direction; }
set
{
if (m_Direction != value)
{
m_Direction = value;
graphic.SetVerticesDirty();
}
}
}
/// <summary>
/// Color1: Top or Left.
/// </summary>
public Color color1
{
get { return m_Color1; }
set
{
if (m_Color1 != value)
{
m_Color1 = value;
graphic.SetVerticesDirty();
}
}
}
/// <summary>
/// Color2: Bottom or Right.
/// </summary>
public Color color2
{
get { return m_Color2; }
set
{
if (m_Color2 != value)
{
m_Color2 = value;
graphic.SetVerticesDirty();
}
}
}
/// <summary>
/// Color3: For diagonal.
/// </summary>
public Color color3
{
get { return m_Color3; }
set
{
if (m_Color3 != value)
{
m_Color3 = value;
graphic.SetVerticesDirty();
}
}
}
/// <summary>
/// Color4: For diagonal.
/// </summary>
public Color color4
{
get { return m_Color4; }
set
{
if (m_Color4 != value)
{
m_Color4 = value;
graphic.SetVerticesDirty();
}
}
}
/// <summary>
/// Gradient rotation.
/// </summary>
public float rotation
{
get
{
return m_Direction == Direction.Horizontal ? -90
: m_Direction == Direction.Vertical ? 0
: m_Rotation;
}
set
{
if (!Mathf.Approximately(m_Rotation, value))
{
m_Rotation = value;
graphic.SetVerticesDirty();
}
}
}
/// <summary>
/// Gradient offset for Horizontal, Vertical or Angle.
/// </summary>
public float offset
{
get { return m_Offset1; }
set
{
if (m_Offset1 != value)
{
m_Offset1 = value;
graphic.SetVerticesDirty();
}
}
}
/// <summary>
/// Gradient offset for Diagonal.
/// </summary>
public Vector2 offset2
{
get { return new Vector2(m_Offset2, m_Offset1); }
set
{
if (m_Offset1 != value.y || m_Offset2 != value.x)
{
m_Offset1 = value.y;
m_Offset2 = value.x;
graphic.SetVerticesDirty();
}
}
}
/// <summary>
/// Gradient style for Text.
/// </summary>
public GradientStyle gradientStyle
{
get { return m_GradientStyle; }
set
{
if (m_GradientStyle != value)
{
m_GradientStyle = value;
graphic.SetVerticesDirty();
}
}
}
/// <summary>
/// Color space to correct color.
/// </summary>
public ColorSpace colorSpace
{
get { return m_ColorSpace; }
set
{
if (m_ColorSpace != value)
{
m_ColorSpace = value;
graphic.SetVerticesDirty();
}
}
}
/// <summary>
/// Ignore aspect ratio.
/// </summary>
public bool ignoreAspectRatio
{
get { return m_IgnoreAspectRatio; }
set
{
if (m_IgnoreAspectRatio != value)
{
m_IgnoreAspectRatio = value;
graphic.SetVerticesDirty();
}
}
}
/// <summary>
/// Call used to modify mesh.
/// </summary>
public override void ModifyMesh(VertexHelper vh)
{
if (!IsActive())
return;
// Gradient space.
Rect rect = default(Rect);
UIVertex vertex = default(UIVertex);
if (!(graphic is Text) || m_GradientStyle == GradientStyle.Rect)
{
// RectTransform.
rect = graphic.rectTransform.rect;
}
else if (m_GradientStyle == GradientStyle.Split)
{
// Each characters.
rect.Set(0, 0, 1, 1);
}
else if (m_GradientStyle == GradientStyle.Fit)
{
// Fit to contents.
rect.xMin = rect.yMin = float.MaxValue;
rect.xMax = rect.yMax = float.MinValue;
for (int i = 0; i < vh.currentVertCount; i++)
{
vh.PopulateUIVertex(ref vertex, i);
rect.xMin = Mathf.Min(rect.xMin, vertex.position.x);
rect.yMin = Mathf.Min(rect.yMin, vertex.position.y);
rect.xMax = Mathf.Max(rect.xMax, vertex.position.x);
rect.yMax = Mathf.Max(rect.yMax, vertex.position.y);
}
}
// Gradient rotation.
float rad = rotation * Mathf.Deg2Rad;
Vector2 dir = new Vector2(Mathf.Cos(rad), Mathf.Sin(rad));
if (!m_IgnoreAspectRatio && Direction.Angle <= m_Direction)
{
dir.x *= rect.height / rect.width;
dir = dir.normalized;
}
// Calculate vertex color.
Color color;
Vector2 nomalizedPos;
Matrix2x3 localMatrix = new Matrix2x3(rect, dir.x, dir.y); // Get local matrix.
for (int i = 0; i < vh.currentVertCount; i++)
{
vh.PopulateUIVertex(ref vertex, i);
// Normalize vertex position by local matrix.
if (m_GradientStyle == GradientStyle.Split)
{
// Each characters.
nomalizedPos = localMatrix * s_SplitedCharacterPosition[i % 4] + offset2;
}
else
{
nomalizedPos = localMatrix * vertex.position + offset2;
}
// Interpolate vertex color.
if (direction == Direction.Diagonal)
{
color = Color.LerpUnclamped(
Color.LerpUnclamped(m_Color1, m_Color2, nomalizedPos.x),
Color.LerpUnclamped(m_Color3, m_Color4, nomalizedPos.x),
nomalizedPos.y);
}
else
{
color = Color.LerpUnclamped(m_Color2, m_Color1, nomalizedPos.y);
}
// Correct color.
vertex.color *= (m_ColorSpace == ColorSpace.Gamma) ? color.gamma
: (m_ColorSpace == ColorSpace.Linear) ? color.linear
: color;
vh.SetUIVertex(vertex, i);
}
}
//################################
// Private Members.
//################################
static readonly Vector2[] s_SplitedCharacterPosition = { Vector2.up, Vector2.one, Vector2.right, Vector2.zero };
/// <summary>
/// Matrix2x3.
/// </summary>
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
);
}
}
}
}
@@ -1,185 +0,0 @@
using UnityEngine;
using UnityEngine.Serialization;
using UnityEngine.UI;
namespace Coffee.UIExtensions
{
/// <summary>
/// HSV Modifier.
/// </summary>
[AddComponentMenu("UI/UIEffect/UIHsvModifier", 4)]
public class UIHsvModifier : UIEffectBase
{
//################################
// Constant or Static Members.
//################################
public const string shaderName = "UI/Hidden/UI-Effect-HSV";
static readonly ParameterTexture _ptex = new ParameterTexture(7, 128, "_ParamTex");
//################################
// Serialize Members.
//################################
[Header("Target")]
[Tooltip("Target color to affect hsv shift.")]
[SerializeField] [ColorUsage(false)] Color m_TargetColor = Color.red;
[Tooltip("Color range to affect hsv shift [0 ~ 1].")]
[SerializeField] [Range(0, 1)] float m_Range = 0.1f;
[Header("Adjustment")]
[Tooltip("Hue shift [-0.5 ~ 0.5].")]
[SerializeField] [Range(-0.5f, 0.5f)] float m_Hue;
[Tooltip("Saturation shift [-0.5 ~ 0.5].")]
[SerializeField] [Range(-0.5f, 0.5f)] float m_Saturation;
[Tooltip("Value shift [-0.5 ~ 0.5].")]
[SerializeField] [Range(-0.5f, 0.5f)] float m_Value;
//################################
// Public Members.
//################################
/// <summary>
/// Target color to affect hsv shift.
/// </summary>
public Color targetColor
{
get { return m_TargetColor; }
set
{
if (m_TargetColor != value)
{
m_TargetColor = value;
SetDirty();
}
}
}
/// <summary>
/// Color range to affect hsv shift [0 ~ 1].
/// </summary>
public float range
{
get { return m_Range; }
set
{
value = Mathf.Clamp(value, 0, 1);
if (!Mathf.Approximately(m_Range, value))
{
m_Range = value;
SetDirty();
}
}
}
/// <summary>
/// Saturation shift [-0.5 ~ 0.5].
/// </summary>
public float saturation
{
get { return m_Saturation; }
set
{
value = Mathf.Clamp(value, -0.5f, 0.5f);
if (!Mathf.Approximately(m_Saturation, value))
{
m_Saturation = value;
SetDirty();
}
}
}
/// <summary>
/// Value shift [-0.5 ~ 0.5].
/// </summary>
public float value
{
get { return m_Value; }
set
{
value = Mathf.Clamp(value, -0.5f, 0.5f);
if (!Mathf.Approximately(m_Value, value))
{
m_Value = value;
SetDirty();
}
}
}
/// <summary>
/// Hue shift [-0.5 ~ 0.5].
/// </summary>
public float hue
{
get { return m_Hue; }
set
{
value = Mathf.Clamp(value, -0.5f, 0.5f);
if (!Mathf.Approximately(m_Hue, value))
{
m_Hue = value;
SetDirty();
}
}
}
/// <summary>
/// Gets the parameter texture.
/// </summary>
public override ParameterTexture ptex { get { return _ptex; } }
#if UNITY_EDITOR
protected override Material GetMaterial()
{
return MaterialResolver.GetOrGenerateMaterialVariant(Shader.Find(shaderName));
}
#endif
/// <summary>
/// Modifies the mesh.
/// </summary>
public override void ModifyMesh(VertexHelper vh)
{
if (!isActiveAndEnabled)
return;
float normalizedIndex = ptex.GetNormalizedIndex(this);
UIVertex vertex = default(UIVertex);
int count = vh.currentVertCount;
for (int i = 0; i < count; i++)
{
vh.PopulateUIVertex(ref vertex, i);
vertex.uv0 = new Vector2(
Packer.ToFloat(vertex.uv0.x, vertex.uv0.y),
normalizedIndex
);
vh.SetUIVertex(vertex, i);
}
}
protected override void SetDirty()
{
float h, s, v;
Color.RGBToHSV(m_TargetColor, out h, out s, out v);
ptex.RegisterMaterial(targetGraphic.material);
ptex.SetData(this, 0, h); // param1.x : target hue
ptex.SetData(this, 1, s); // param1.y : target saturation
ptex.SetData(this, 2, v); // param1.z : target value
ptex.SetData(this, 3, m_Range); // param1.w : target range
ptex.SetData(this, 4, m_Hue + 0.5f); // param2.x : hue shift
ptex.SetData(this, 5, m_Saturation + 0.5f); // param2.y : saturation shift
ptex.SetData(this, 6, m_Value + 0.5f); // param2.z : value shift
}
//################################
// Private Members.
//################################
}
}
@@ -1,365 +0,0 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Serialization;
using UnityEngine.UI;
#if UNITY_EDITOR
using System.IO;
using System.Linq;
using UnityEditor;
#endif
namespace Coffee.UIExtensions
{
/// <summary>
/// UIEffect.
/// </summary>
[RequireComponent(typeof(Graphic))]
[AddComponentMenu("UI/UIEffect/UIShadow", 100)]
public class UIShadow : Shadow, IParameterTexture
#if UNITY_EDITOR
, ISerializationCallbackReceiver
#endif
{
/// <summary>
/// Additional shadow.
/// </summary>
[System.Obsolete]
[System.Serializable]
public class AdditionalShadow
{
/// <summary>
/// How far is the blurring shadow from the graphic.
/// </summary>
[FormerlySerializedAs("shadowBlur")]
[Range(0, 1)] public float blur = 0.25f;
/// <summary>
/// Shadow effect mode.
/// </summary>
[FormerlySerializedAs("shadowMode")]
public ShadowStyle style = ShadowStyle.Shadow;
/// <summary>
/// Color for the shadow effect.
/// </summary>
[FormerlySerializedAs("shadowColor")]
public Color effectColor = Color.black;
/// <summary>
/// How far is the shadow from the graphic.
/// </summary>
public Vector2 effectDistance = new Vector2(1f, -1f);
/// <summary>
/// Should the shadow inherit the alpha from the graphic?
/// </summary>
public bool useGraphicAlpha = true;
}
//################################
// Serialize Members.
//################################
[Tooltip("How far is the blurring shadow from the graphic.")]
[FormerlySerializedAs("m_Blur")]
[SerializeField][Range(0, 1)] float m_BlurFactor = 1;
[Tooltip("Shadow effect style.")]
[SerializeField] ShadowStyle m_Style = ShadowStyle.Shadow;
[HideInInspector][System.Obsolete]
[SerializeField] List<AdditionalShadow> m_AdditionalShadows = new List<AdditionalShadow>();
//################################
// Public Members.
//################################
/// <summary>
/// How far is the blurring shadow from the graphic.
/// </summary>
[System.Obsolete("Use blurFactor instead (UnityUpgradable) -> blurFactor")]
public float blur
{
get { return m_BlurFactor; }
set
{
m_BlurFactor = Mathf.Clamp(value, 0, 2);
_SetDirty();
}
}
/// <summary>
/// How far is the blurring shadow from the graphic.
/// </summary>
public float blurFactor
{
get { return m_BlurFactor; }
set
{
m_BlurFactor = Mathf.Clamp(value, 0, 2);
_SetDirty();
}
}
/// <summary>
/// Shadow effect style.
/// </summary>
public ShadowStyle style
{
get { return m_Style; }
set
{
m_Style = value;
_SetDirty();
}
}
/// <summary>
/// Gets or sets the parameter index.
/// </summary>
public int parameterIndex { get; set; }
/// <summary>
/// Gets the parameter texture.
/// </summary>
public ParameterTexture ptex{ get; private set; }
int _graphicVertexCount;
int _start;
int _end;
static readonly List<UIShadow> tmpShadows = new List<UIShadow>();
protected override void OnEnable()
{
base.OnEnable();
_uiEffect = GetComponent<UIEffect>();
if (_uiEffect)
{
ptex = _uiEffect.ptex;
ptex.Register(this);
}
}
protected override void OnDisable()
{
base.OnDisable();
_uiEffect = null;
if (ptex != null)
{
ptex.Unregister(this);
ptex = null;
}
}
/// <summary>
/// Modifies the mesh.
/// </summary>
public override void ModifyMesh(VertexHelper vh)
{
if (!isActiveAndEnabled || vh.currentVertCount <= 0 || m_Style == ShadowStyle.None)
{
return;
}
vh.GetUIVertexStream(s_Verts);
GetComponents<UIShadow>(tmpShadows);
foreach (var s in tmpShadows)
{
if (s.isActiveAndEnabled)
{
if (s == this)
{
foreach (var s2 in tmpShadows)
{
s2._graphicVertexCount = s_Verts.Count;
}
}
break;
}
}
tmpShadows.Clear();
//================================
// Append shadow vertices.
//================================
{
_uiEffect = _uiEffect ?? GetComponent<UIEffect>();
var start = s_Verts.Count - _graphicVertexCount;
var end = s_Verts.Count;
if (ptex != null && _uiEffect && _uiEffect.isActiveAndEnabled)
{
ptex.SetData(this, 0, _uiEffect.effectFactor); // param.x : effect factor
ptex.SetData(this, 1, 255); // param.y : color factor
ptex.SetData(this, 2, m_BlurFactor); // param.z : blur factor
}
_ApplyShadow(s_Verts, effectColor, ref start, ref end, effectDistance, style, useGraphicAlpha);
}
vh.Clear();
vh.AddUIVertexTriangleStream(s_Verts);
s_Verts.Clear();
}
UIEffect _uiEffect;
//################################
// Private Members.
//################################
static readonly List<UIVertex> s_Verts = new List<UIVertex>();
/// <summary>
/// Append shadow vertices.
/// * It is similar to Shadow component implementation.
/// </summary>
void _ApplyShadow(List<UIVertex> verts, Color color, ref int start, ref int end, Vector2 effectDistance, ShadowStyle style, bool useGraphicAlpha)
{
if (style == ShadowStyle.None || color.a <= 0)
return;
// Append Shadow.
_ApplyShadowZeroAlloc(s_Verts, color, ref start, ref end, effectDistance.x, effectDistance.y, useGraphicAlpha);
// Append Shadow3.
if (ShadowStyle.Shadow3 == style)
{
_ApplyShadowZeroAlloc(s_Verts, color, ref start, ref end, effectDistance.x, 0, useGraphicAlpha);
_ApplyShadowZeroAlloc(s_Verts, color, ref start, ref end, 0, effectDistance.y, useGraphicAlpha);
}
// Append Outline.
else if (ShadowStyle.Outline == style)
{
_ApplyShadowZeroAlloc(s_Verts, color, ref start, ref end, effectDistance.x, -effectDistance.y, useGraphicAlpha);
_ApplyShadowZeroAlloc(s_Verts, color, ref start, ref end, -effectDistance.x, effectDistance.y, useGraphicAlpha);
_ApplyShadowZeroAlloc(s_Verts, color, ref start, ref end, -effectDistance.x, -effectDistance.y, useGraphicAlpha);
}
// Append Outline8.
else if (ShadowStyle.Outline8 == style)
{
_ApplyShadowZeroAlloc(s_Verts, color, ref start, ref end, effectDistance.x, -effectDistance.y, useGraphicAlpha);
_ApplyShadowZeroAlloc(s_Verts, color, ref start, ref end, -effectDistance.x, effectDistance.y, useGraphicAlpha);
_ApplyShadowZeroAlloc(s_Verts, color, ref start, ref end, -effectDistance.x, -effectDistance.y, useGraphicAlpha);
_ApplyShadowZeroAlloc(s_Verts, color, ref start, ref end, -effectDistance.x, 0, useGraphicAlpha);
_ApplyShadowZeroAlloc(s_Verts, color, ref start, ref end, 0, -effectDistance.y, useGraphicAlpha);
_ApplyShadowZeroAlloc(s_Verts, color, ref start, ref end, effectDistance.x, 0, useGraphicAlpha);
_ApplyShadowZeroAlloc(s_Verts, color, ref start, ref end, 0, effectDistance.y, useGraphicAlpha);
}
}
/// <summary>
/// Append shadow vertices.
/// * It is similar to Shadow component implementation.
/// </summary>
void _ApplyShadowZeroAlloc(List<UIVertex> verts, Color color, ref int start, ref int end, float x, float y, bool useGraphicAlpha)
{
// Check list capacity.
int count = end - start;
var neededCapacity = verts.Count + count;
if (verts.Capacity < neededCapacity)
verts.Capacity = neededCapacity;
float normalizedIndex = ptex != null && _uiEffect && _uiEffect.isActiveAndEnabled
? ptex.GetNormalizedIndex(this)
: -1;
// Add
UIVertex vt = default(UIVertex);
for (int i = 0; i < count; i++)
{
verts.Add(vt);
}
// Move
for (int i = verts.Count - 1; count <= i; i--)
{
verts[i] = verts[i - count];
}
// Append shadow vertices to the front of list.
// * The original vertex is pushed backward.
for (int i = 0; i < count; ++i)
{
vt = verts[i + start + count];
Vector3 v = vt.position;
vt.position.Set(v.x + x, v.y + y, v.z);
Color vertColor = effectColor;
vertColor.a = useGraphicAlpha ? color.a * vt.color.a / 255 : color.a;
vt.color = vertColor;
// Set UIEffect prameters
if (0 <= normalizedIndex)
{
vt.uv0 = new Vector2(
vt.uv0.x,
normalizedIndex
);
}
verts[i] = vt;
}
// Update next shadow offset.
start = end;
end = verts.Count;
}
/// <summary>
/// Mark the UIEffect as dirty.
/// </summary>
void _SetDirty()
{
if (graphic)
graphic.SetVerticesDirty();
}
#if UNITY_EDITOR
public void OnBeforeSerialize()
{
}
public void OnAfterDeserialize()
{
EditorApplication.delayCall += UpgradeIfNeeded;
}
#pragma warning disable 0612
void UpgradeIfNeeded()
{
if (0 < m_AdditionalShadows.Count)
{
foreach (var s in m_AdditionalShadows)
{
if (s.style == ShadowStyle.None)
{
continue;
}
var shadow = gameObject.AddComponent<UIShadow>();
shadow.style = s.style;
shadow.effectDistance = s.effectDistance;
shadow.effectColor = s.effectColor;
shadow.useGraphicAlpha = s.useGraphicAlpha;
shadow.blurFactor = s.blur;
}
m_AdditionalShadows = null;
}
}
#pragma warning restore 0612
#endif
}
}
@@ -1,405 +0,0 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Serialization;
using UnityEngine.UI;
using System.Collections;
#if UNITY_EDITOR
using System.IO;
using System.Linq;
using UnityEditor;
#endif
namespace Coffee.UIExtensions
{
/// <summary>
/// UIEffect.
/// </summary>
[AddComponentMenu("UI/UIEffect/UIShiny", 2)]
public class UIShiny : UIEffectBase
{
//################################
// Constant or Static Members.
//################################
public const string shaderName = "UI/Hidden/UI-Effect-Shiny";
static readonly ParameterTexture _ptex = new ParameterTexture(8, 128, "_ParamTex");
//################################
// Serialize Members.
//################################
[Tooltip("Location for shiny effect.")]
[FormerlySerializedAs("m_Location")]
[SerializeField] [Range(0, 1)] float m_EffectFactor = 0;
[Tooltip("Width for shiny effect.")]
[SerializeField] [Range(0, 1)] float m_Width = 0.25f;
[Tooltip("Rotation for shiny effect.")]
[SerializeField] [Range(-180, 180)] float m_Rotation;
[Tooltip("Softness for shiny effect.")]
[SerializeField][Range(0.01f, 1)] float m_Softness = 1f;
[Tooltip("Brightness for shiny effect.")]
[FormerlySerializedAs("m_Alpha")]
[SerializeField][Range(0, 1)] float m_Brightness = 1f;
[Tooltip("Gloss factor for shiny effect.")]
[FormerlySerializedAs("m_Highlight")]
[SerializeField][Range(0, 1)] float m_Gloss = 1;
[Tooltip("The area for effect.")]
[SerializeField] protected EffectArea m_EffectArea;
[SerializeField] EffectPlayer m_Player;
[Obsolete][HideInInspector]
[SerializeField] bool m_Play = false;
[Obsolete][HideInInspector]
[SerializeField] bool m_Loop = false;
[Obsolete][HideInInspector]
[SerializeField][Range(0.1f, 10)] float m_Duration = 1;
[Obsolete][HideInInspector]
[SerializeField][Range(0, 10)] float m_LoopDelay = 1;
[Obsolete][HideInInspector]
[SerializeField] AnimatorUpdateMode m_UpdateMode = AnimatorUpdateMode.Normal;
//################################
// Public Members.
//################################
/// <summary>
/// Effect factor between 0(start) and 1(end).
/// </summary>
[System.Obsolete("Use effectFactor instead (UnityUpgradable) -> effectFactor")]
public float location
{
get { return m_EffectFactor; }
set
{
value = Mathf.Clamp(value, 0, 1);
if (!Mathf.Approximately(m_EffectFactor, value))
{
m_EffectFactor = value;
SetDirty();
}
}
}
/// <summary>
/// Effect factor between 0(start) and 1(end).
/// </summary>
public float effectFactor
{
get { return m_EffectFactor; }
set
{
value = Mathf.Clamp(value, 0, 1);
if (!Mathf.Approximately(m_EffectFactor, value))
{
m_EffectFactor = value;
SetDirty();
}
}
}
/// <summary>
/// Width for shiny effect.
/// </summary>
public float width
{
get { return m_Width; }
set
{
value = Mathf.Clamp(value, 0, 1);
if (!Mathf.Approximately(m_Width, value))
{
m_Width = value;
SetDirty();
}
}
}
/// <summary>
/// Softness for shiny effect.
/// </summary>
public float softness
{
get { return m_Softness; }
set
{
value = Mathf.Clamp(value, 0.01f, 1);
if (!Mathf.Approximately(m_Softness, value))
{
m_Softness = value;
SetDirty();
}
}
}
/// <summary>
/// Brightness for shiny effect.
/// </summary>
[System.Obsolete("Use brightness instead (UnityUpgradable) -> brightness")]
public float alpha
{
get { return m_Brightness; }
set
{
value = Mathf.Clamp(value, 0, 1);
if (!Mathf.Approximately(m_Brightness, value))
{
m_Brightness = value;
SetDirty();
}
}
}
/// <summary>
/// Brightness for shiny effect.
/// </summary>
public float brightness
{
get { return m_Brightness; }
set
{
value = Mathf.Clamp(value, 0, 1);
if (!Mathf.Approximately(m_Brightness, value))
{
m_Brightness = value;
SetDirty();
}
}
}
/// <summary>
/// Gloss factor for shiny effect.
/// </summary>
[System.Obsolete("Use gloss instead (UnityUpgradable) -> gloss")]
public float highlight
{
get { return m_Gloss; }
set
{
value = Mathf.Clamp(value, 0, 1);
if (!Mathf.Approximately(m_Gloss, value))
{
m_Gloss = value;
SetDirty();
}
}
}
/// <summary>
/// Gloss factor for shiny effect.
/// </summary>
public float gloss
{
get { return m_Gloss; }
set
{
value = Mathf.Clamp(value, 0, 1);
if (!Mathf.Approximately(m_Gloss, value))
{
m_Gloss = value;
SetDirty();
}
}
}
/// <summary>
/// Rotation for shiny effect.
/// </summary>
public float rotation
{
get { return m_Rotation; }
set
{
if (!Mathf.Approximately(m_Rotation, value))
{
m_Rotation = value;
SetDirty();
}
}
}
/// <summary>
/// The area for effect.
/// </summary>
public EffectArea effectArea
{
get { return m_EffectArea; }
set
{
if (m_EffectArea != value)
{
m_EffectArea = value;
SetDirty();
}
}
}
/// <summary>
/// Play shinning on enable.
/// </summary>
public bool play { get { return _player.play; } set { _player.play = value; } }
/// <summary>
/// Play shinning loop.
/// </summary>
public bool loop { get { return _player.loop; } set { _player.loop = value; } }
/// <summary>
/// Shinning duration.
/// </summary>
public float duration { get { return _player.duration; } set { _player.duration = Mathf.Max(value, 0.1f); } }
/// <summary>
/// Delay on loop.
/// </summary>
public float loopDelay { get { return _player.loopDelay; } set { _player.loopDelay = Mathf.Max(value, 0); } }
/// <summary>
/// Shinning update mode.
/// </summary>
public AnimatorUpdateMode updateMode { get { return _player.updateMode; } set { _player.updateMode = value; } }
/// <summary>
/// Gets the parameter texture.
/// </summary>
public override ParameterTexture ptex { get { return _ptex; } }
/// <summary>
/// This function is called when the object becomes enabled and active.
/// </summary>
protected override void OnEnable()
{
base.OnEnable();
_player.OnEnable(f => effectFactor = f);
}
/// <summary>
/// This function is called when the behaviour becomes disabled () or inactive.
/// </summary>
protected override void OnDisable()
{
base.OnDisable();
_player.OnDisable();
}
#if UNITY_EDITOR
protected override Material GetMaterial()
{
return MaterialResolver.GetOrGenerateMaterialVariant(Shader.Find(shaderName));
}
#pragma warning disable 0612
protected override void UpgradeIfNeeded()
{
// Upgrade for v3.0.0
if (IsShouldUpgrade(300))
{
_player.play = m_Play;
_player.duration = m_Duration;
_player.loop = m_Loop;
_player.loopDelay = m_LoopDelay;
_player.updateMode = m_UpdateMode;
}
}
#pragma warning restore 0612
#endif
/// <summary>
/// Modifies the mesh.
/// </summary>
public override void ModifyMesh(VertexHelper vh)
{
if (!isActiveAndEnabled)
return;
float normalizedIndex = ptex.GetNormalizedIndex(this);
// rect.
Rect rect = m_EffectArea.GetEffectArea(vh, graphic);
// rotation.
float rad = m_Rotation * Mathf.Deg2Rad;
Vector2 dir = new Vector2(Mathf.Cos(rad), Mathf.Sin(rad));
dir.x *= rect.height / rect.width;
dir = dir.normalized;
// Calculate vertex position.
bool effectEachCharacter = graphic is Text && m_EffectArea == EffectArea.Character;
UIVertex vertex = default(UIVertex);
Vector2 nomalizedPos;
Matrix2x3 localMatrix = new Matrix2x3(rect, dir.x, dir.y); // Get local matrix.
for (int i = 0; i < vh.currentVertCount; i++)
{
vh.PopulateUIVertex(ref vertex, i);
// Normalize vertex position by local matrix.
if (effectEachCharacter)
{
nomalizedPos = localMatrix * splitedCharacterPosition[i % 4];
}
else
{
nomalizedPos = localMatrix * vertex.position;
}
vertex.uv0 = new Vector2(
Packer.ToFloat(vertex.uv0.x, vertex.uv0.y),
Packer.ToFloat(nomalizedPos.y, normalizedIndex)
);
vh.SetUIVertex(vertex, i);
}
}
/// <summary>
/// Play effect.
/// </summary>
public void Play()
{
_player.Play();
}
/// <summary>
/// Stop effect.
/// </summary>
public void Stop()
{
_player.Stop();
}
protected override void SetDirty()
{
ptex.RegisterMaterial(targetGraphic.material);
ptex.SetData(this, 0, m_EffectFactor); // param1.x : location
ptex.SetData(this, 1, m_Width); // param1.y : width
ptex.SetData(this, 2, m_Softness); // param1.z : softness
ptex.SetData(this, 3, m_Brightness);// param1.w : blightness
ptex.SetData(this, 4, m_Gloss); // param2.x : gloss
if (!Mathf.Approximately(_lastRotation, m_Rotation) && targetGraphic)
{
_lastRotation = m_Rotation;
targetGraphic.SetVerticesDirty();
}
}
//################################
// Private Members.
//################################
float _lastRotation;
EffectPlayer _player{ get { return m_Player ?? (m_Player = new EffectPlayer()); } }
}
}
@@ -1,349 +0,0 @@
using UnityEngine;
using UnityEngine.UI;
namespace Coffee.UIExtensions
{
/// <summary>
/// Transition effect.
/// </summary>
[AddComponentMenu("UI/UIEffect/UITransitionEffect", 5)]
public class UITransitionEffect : UIEffectBase
{
//################################
// Constant or Static Members.
//################################
public const string shaderName = "UI/Hidden/UI-Effect-Transition";
static readonly ParameterTexture _ptex = new ParameterTexture(8, 128, "_ParamTex");
/// <summary>
/// Effect mode.
/// </summary>
public enum EffectMode
{
Fade = 1,
Cutoff = 2,
Dissolve = 3,
}
//################################
// Serialize Members.
//################################
[Tooltip("Effect mode.")]
[SerializeField] EffectMode m_EffectMode = EffectMode.Cutoff;
[Tooltip("Effect factor between 0(hidden) and 1(shown).")]
[SerializeField][Range(0, 1)] float m_EffectFactor = 1;
[Tooltip("Transition texture (single channel texture).")]
[SerializeField] Texture m_TransitionTexture;
[Tooltip("The area for effect.")]
[SerializeField] EffectArea m_EffectArea;
[Tooltip("Keep effect aspect ratio.")]
[SerializeField] bool m_KeepAspectRatio;
[Tooltip("Dissolve edge width.")]
[SerializeField] [Range(0, 1)] float m_DissolveWidth = 0.5f;
[Tooltip("Dissolve edge softness.")]
[SerializeField] [Range(0, 1)] float m_DissolveSoftness = 0.5f;
[Tooltip("Dissolve edge color.")]
[SerializeField] [ColorUsage(false)] Color m_DissolveColor = new Color(0.0f, 0.25f, 1.0f);
[Tooltip("Disable graphic's raycast target on hidden.")]
[SerializeField] bool m_PassRayOnHidden;
[Header("Effect Player")]
[SerializeField] EffectPlayer m_Player;
//################################
// Public Members.
//################################
/// <summary>
/// Effect factor between 0(no effect) and 1(complete effect).
/// </summary>
public float effectFactor
{
get { return m_EffectFactor; }
set
{
value = Mathf.Clamp(value, 0, 1);
if (!Mathf.Approximately(m_EffectFactor, value))
{
m_EffectFactor = value;
SetDirty();
}
}
}
/// <summary>
/// Transition texture.
/// </summary>
public Texture transitionTexture
{
get { return m_TransitionTexture; }
set
{
if (m_TransitionTexture != value)
{
m_TransitionTexture = value;
if (graphic)
{
ModifyMaterial();
}
}
}
}
/// <summary>
/// Effect mode.
/// </summary>
public EffectMode effectMode { get { return m_EffectMode; } }
/// <summary>
/// Keep aspect ratio.
/// </summary>
public bool keepAspectRatio
{
get { return m_KeepAspectRatio; }
set
{
if (m_KeepAspectRatio != value)
{
m_KeepAspectRatio = value;
targetGraphic.SetVerticesDirty();
}
}
}
/// <summary>
/// Gets the parameter texture.
/// </summary>
public override ParameterTexture ptex { get { return _ptex; } }
/// <summary>
/// Dissolve edge width.
/// </summary>
public float dissolveWidth
{
get { return m_DissolveWidth; }
set
{
value = Mathf.Clamp(value, 0, 1);
if (!Mathf.Approximately(m_DissolveWidth, value))
{
m_DissolveWidth = value;
SetDirty();
}
}
}
/// <summary>
/// Dissolve edge softness.
/// </summary>
public float dissolveSoftness
{
get { return m_DissolveSoftness; }
set
{
value = Mathf.Clamp(value, 0, 1);
if (!Mathf.Approximately(m_DissolveSoftness, value))
{
m_DissolveSoftness = value;
SetDirty();
}
}
}
/// <summary>
/// Dissolve edge color.
/// </summary>
public Color dissolveColor
{
get { return m_DissolveColor; }
set
{
if (m_DissolveColor != value)
{
m_DissolveColor = value;
SetDirty();
}
}
}
/// <summary>
/// Duration for showing/hiding.
/// </summary>
public float duration { get { return _player.duration; } set { _player.duration = Mathf.Max(value, 0.1f); } }
/// <summary>
/// Update mode for showing/hiding.
/// </summary>
public AnimatorUpdateMode updateMode { get { return _player.updateMode; } set { _player.updateMode = value; } }
/// <summary>
/// Show transition.
/// </summary>
public void Show()
{
_player.loop = false;
_player.Play(f => effectFactor = f);
}
/// <summary>
/// Hide transition.
/// </summary>
public void Hide()
{
_player.loop = false;
_player.Play(f => effectFactor = 1 - f);
}
/// <summary>
/// Modifies the material.
/// </summary>
public override void ModifyMaterial()
{
ulong hash = (m_TransitionTexture ? (uint)m_TransitionTexture.GetInstanceID() : 0) + ((ulong)2 << 32) + ((ulong)m_EffectMode << 36);
if (_materialCache != null && (_materialCache.hash != hash || !isActiveAndEnabled || !m_EffectMaterial))
{
MaterialCache.Unregister(_materialCache);
_materialCache = null;
}
if (!isActiveAndEnabled || !m_EffectMaterial)
{
graphic.material = null;
}
else if (!m_TransitionTexture)
{
graphic.material = m_EffectMaterial;
}
else if (_materialCache != null && _materialCache.hash == hash)
{
graphic.material = _materialCache.material;
}
else
{
_materialCache = MaterialCache.Register(hash, m_TransitionTexture, () =>
{
var mat = new Material(m_EffectMaterial);
mat.name += "_" + m_TransitionTexture.name;
mat.SetTexture("_TransitionTexture", m_TransitionTexture);
return mat;
});
graphic.material = _materialCache.material;
}
}
/// <summary>
/// Modifies the mesh.
/// </summary>
public override void ModifyMesh(VertexHelper vh)
{
if (!isActiveAndEnabled)
{
return;
}
// rect.
var tex = transitionTexture;
var aspectRatio = m_KeepAspectRatio && tex ? ((float)tex.width) / tex.height : -1;
Rect rect = m_EffectArea.GetEffectArea(vh, graphic, aspectRatio);
// Set prameters to vertex.
float normalizedIndex = ptex.GetNormalizedIndex(this);
UIVertex vertex = default(UIVertex);
bool effectEachCharacter = graphic is Text && m_EffectArea == EffectArea.Character;
float x, y;
int count = vh.currentVertCount;
for (int i = 0; i < count; i++)
{
vh.PopulateUIVertex(ref vertex, i);
if (effectEachCharacter)
{
x = splitedCharacterPosition[i % 4].x;
y = splitedCharacterPosition[i % 4].y;
}
else
{
x = Mathf.Clamp01(vertex.position.x / rect.width + 0.5f);
y = Mathf.Clamp01(vertex.position.y / rect.height + 0.5f);
}
vertex.uv0 = new Vector2(
Packer.ToFloat(vertex.uv0.x, vertex.uv0.y),
Packer.ToFloat(x, y, normalizedIndex)
);
vh.SetUIVertex(vertex, i);
}
}
//################################
// Protected Members.
//################################
/// <summary>
/// This function is called when the object becomes enabled and active.
/// </summary>
protected override void OnEnable()
{
base.OnEnable();
_player.OnEnable(null);
_player.loop = false;
}
/// <summary>
/// This function is called when the behaviour becomes disabled () or inactive.
/// </summary>
protected override void OnDisable()
{
MaterialCache.Unregister(_materialCache);
_materialCache = null;
base.OnDisable();
_player.OnDisable();
}
protected override void SetDirty()
{
ptex.RegisterMaterial(targetGraphic.material);
ptex.SetData(this, 0, m_EffectFactor); // param1.x : effect factor
if (m_EffectMode == EffectMode.Dissolve)
{
ptex.SetData(this, 1, m_DissolveWidth); // param1.y : width
ptex.SetData(this, 2, m_DissolveSoftness); // param1.z : softness
ptex.SetData(this, 4, m_DissolveColor.r); // param2.x : red
ptex.SetData(this, 5, m_DissolveColor.g); // param2.y : green
ptex.SetData(this, 6, m_DissolveColor.b); // param2.z : blue
}
// Disable graphic's raycastTarget on hidden.
if (m_PassRayOnHidden)
{
graphic.raycastTarget = 0 < m_EffectFactor;
}
}
#if UNITY_EDITOR
/// <summary>
/// Gets the material.
/// </summary>
/// <returns>The material.</returns>
protected override Material GetMaterial()
{
return MaterialResolver.GetOrGenerateMaterialVariant(Shader.Find(shaderName), m_EffectMode);
}
#endif
//################################
// Private Members.
//################################
MaterialCache _materialCache = null;
EffectPlayer _player{ get { return m_Player ?? (m_Player = new EffectPlayer()); } }
}
}
@@ -1,16 +0,0 @@
fileFormatVersion: 2
guid: 922b805bc01c243e5853d9cbb544118c
timeCreated: 1538827562
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences:
- m_EffectMaterial: {instanceID: 0}
- m_PtexMaterial: {instanceID: 0}
- m_TransitionTexture: {fileID: 2800000, guid: 3e04c247fb2604af186173fce0bc62de,
type: 3}
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,139 +0,0 @@
Shader "UI/Hidden/UI-Effect-Dissolve"
{
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" {}
[Header(Dissolve)]
_NoiseTex("Noise Texture (A)", 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
#pragma shader_feature __ ADD SUBTRACT FILL
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#include "UI-Effect.cginc"
struct appdata_t
{
float4 vertex : POSITION;
float4 color : COLOR;
float2 texcoord : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f
{
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
float4 worldPosition : TEXCOORD1;
UNITY_VERTEX_OUTPUT_STEREO
half3 param : TEXCOORD2;
};
fixed4 _Color;
fixed4 _TextureSampleAdd;
float4 _ClipRect;
sampler2D _MainTex;
sampler2D _NoiseTex;
sampler2D _ParamTex;
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(IN.vertex);
OUT.texcoord = IN.texcoord;
OUT.color = IN.color * _Color;
OUT.texcoord = UnpackToVec2(IN.texcoord.x);
OUT.param = UnpackToVec3(IN.texcoord.y);
return OUT;
}
fixed4 frag(v2f IN) : SV_Target
{
fixed4 param1 = tex2D(_ParamTex, float2(0.25, IN.param.z));
fixed location = param1.x;
fixed width = param1.y/4;
fixed softness = param1.z;
fixed3 dissolveColor = tex2D(_ParamTex, float2(0.75, IN.param.z)).rgb;
float cutout = tex2D(_NoiseTex, IN.param.xy).a;
half4 color = (tex2D(_MainTex, IN.texcoord) + _TextureSampleAdd) * IN.color;
color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect);
float factor = cutout - location * ( 1 + width ) + width;
#ifdef UNITY_UI_ALPHACLIP
clip (min(color.a - 0.01, factor));
#endif
fixed edgeLerp = step(factor, color.a) * saturate((width - factor)*16/ softness);
color = ApplyColorEffect(color, fixed4(dissolveColor, edgeLerp));
color.a *= saturate((factor)*32/ softness);
return color;
}
ENDCG
}
}
}
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: e1b48dc831eb147e9886c049033213bf
timeCreated: 1523859834
licenseType: Pro
ShaderImporter:
defaultTextures:
- _MainTex: {instanceID: 0}
- _NoiseTex: {fileID: 2800000, guid: 3e04c247fb2604af186173fce0bc62de, type: 3}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,146 +0,0 @@
Shader "UI/Hidden/UI-Effect-HSV"
{
Properties
{
[PerRendererData] _MainTex ("Main Texture", 2D) = "white" {}
_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"
#include "UI-Effect.cginc"
sampler2D _MainTex;
fixed4 _TextureSampleAdd;
float4 _ClipRect;
sampler2D _ParamTex;
struct appdata_t
{
float4 vertex : POSITION;
float4 color : COLOR;
float2 texcoord : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f
{
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
float4 wpos : TEXCOORD1;
UNITY_VERTEX_OUTPUT_STEREO
half param : TEXCOORD2;
};
v2f vert(appdata_t IN)
{
v2f OUT;
UNITY_SETUP_INSTANCE_ID(IN);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT);
OUT.wpos = IN.vertex;
OUT.vertex = UnityObjectToClipPos(IN.vertex);
OUT.texcoord = IN.texcoord;
OUT.color = IN.color;
OUT.texcoord = UnpackToVec2(IN.texcoord.x);
OUT.param = IN.texcoord.y;
return OUT;
}
half3 rgb2hsv(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 hsv2rgb(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 - K.xxx, 0.0, 1.0), c.y);
}
fixed4 frag(v2f IN) : COLOR
{
fixed4 param1 = tex2D(_ParamTex, float2(0.25, IN.param));
fixed4 param2 = tex2D(_ParamTex, float2(0.75, IN.param));
fixed3 targetHsv = param1.rgb;
fixed3 targetRange = param1.w;
fixed3 hsvShift = param2.xyz - 0.5;
half4 color = tex2D(_MainTex, IN.texcoord);// + _TextureSampleAdd) * IN.color;
color.a *= UnityGet2DClipping(IN.wpos.xy, _ClipRect);
#ifdef UNITY_UI_ALPHACLIP
clip (color.a - 0.001);
#endif
half3 hsv = rgb2hsv(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 = hsv2rgb(hsv + hsvShift * masked);
return (color + _TextureSampleAdd) * IN.color;
}
ENDCG
}
}
}
@@ -1,136 +0,0 @@
Shader "UI/Hidden/UI-Effect-Shiny"
{
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"
#include "UI-Effect.cginc"
struct appdata_t
{
float4 vertex : POSITION;
float4 color : COLOR;
float2 texcoord : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f
{
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
float4 worldPosition : TEXCOORD1;
UNITY_VERTEX_OUTPUT_STEREO
half2 param : TEXCOORD2;
};
fixed4 _Color;
fixed4 _TextureSampleAdd;
float4 _ClipRect;
sampler2D _MainTex;
float4 _MainTex_TexelSize;
sampler2D _ParamTex;
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(IN.vertex);
OUT.color = IN.color * _Color;
OUT.texcoord = UnpackToVec2(IN.texcoord.x);
OUT.param = UnpackToVec2(IN.texcoord.y);
return OUT;
}
fixed4 frag(v2f IN) : SV_Target
{
fixed nomalizedPos = IN.param.x;
fixed4 param1 = tex2D(_ParamTex, float2(0.25, IN.param.y));
fixed4 param2 = tex2D(_ParamTex, float2(0.75, IN.param.y));
half location = param1.x * 2 - 0.5;
fixed width = param1.y;
fixed softness = param1.z;
fixed brightness = param1.w;
fixed gloss = param2.x;
half4 color = (tex2D(_MainTex, IN.texcoord) + _TextureSampleAdd);
fixed4 originAlpha = color.a;
color *= IN.color;
color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect);
#ifdef UNITY_UI_ALPHACLIP
clip (color.a - 0.001);
#endif
half normalized = 1 - saturate(abs((nomalizedPos - location) / width));
half shinePower = smoothstep(0, softness*2, normalized);
half3 reflectColor = lerp(1, color.rgb * 10, gloss);
color.rgb += originAlpha * (shinePower / 2) * brightness * reflectColor;
return color;
}
ENDCG
}
}
}
@@ -1,145 +0,0 @@
Shader "UI/Hidden/UI-Effect-Transition"
{
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)]
_TransitionTexture("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
#pragma multi_compile __ UNITY_UI_ALPHACLIP
#pragma shader_feature __ FADE CUTOFF DISSOLVE
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#include "UI-Effect.cginc"
struct appdata_t
{
float4 vertex : POSITION;
float4 color : COLOR;
float2 texcoord : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f
{
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
float4 wpos : TEXCOORD1;
half3 param : TEXCOORD2;
UNITY_VERTEX_OUTPUT_STEREO
};
fixed4 _Color;
fixed4 _TextureSampleAdd;
float4 _ClipRect;
sampler2D _MainTex;
sampler2D _TransitionTexture;
sampler2D _ParamTex;
v2f vert(appdata_t IN)
{
v2f OUT;
UNITY_SETUP_INSTANCE_ID(IN);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT);
OUT.wpos = IN.vertex;
OUT.vertex = UnityObjectToClipPos(OUT.wpos);
OUT.texcoord = UnpackToVec2(IN.texcoord.x);
OUT.param = UnpackToVec3(IN.texcoord.y);
OUT.color = IN.color * _Color;
return OUT;
}
fixed4 frag(v2f IN) : SV_Target
{
fixed4 param1 = tex2D(_ParamTex, float2(0.25, IN.param.z));
fixed effectFactor = param1.x;
float alpha = tex2D(_TransitionTexture, IN.param.xy).a;
half4 color = (tex2D(_MainTex, IN.texcoord) + _TextureSampleAdd);
color.a *= UnityGet2DClipping(IN.wpos.xy, _ClipRect);
#if FADE
color.a *= saturate(alpha + (effectFactor * 2 - 1));
#elif CUTOFF
color.a *= step(0.001, color.a * alpha - 1 + effectFactor);
#elif DISSOLVE
fixed width = param1.y/4;
fixed softness = param1.z;
fixed3 dissolveColor = tex2D(_ParamTex, float2(0.75, IN.param.z)).rgb;
float factor = alpha - (1 - effectFactor) * ( 1 + width ) + width;
fixed edgeLerp = step(factor, color.a) * saturate((width - factor)*16/ softness);
color.rgb += dissolveColor.rgb * edgeLerp;
color.a *= saturate((factor)*32/ softness);
#endif
color *= IN.color;
#if UNITY_UI_ALPHACLIP
clip (color.a - 0.001);
#endif
return color;
}
ENDCG
}
}
}
@@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: 85ad24dd0759947ddb117625e108d49c
timeCreated: 1482973535
licenseType: Pro
ShaderImporter:
defaultTextures:
- _MainTex: {instanceID: 0}
- _TransitionTexture: {fileID: 2800000, guid: a74d3d4a498866d44b094d3d3717604d,
type: 3}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,216 +0,0 @@
#ifndef UI_EFFECT_INCLUDED
#define UI_EFFECT_INCLUDED
#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.
half4 ApplyColorEffect(half4 color, half4 factor)
{
#ifdef 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;
}
#endif // UI_EFFECT_INCLUDED
@@ -1,167 +0,0 @@
Shader "UI/Hidden/UI-Effect"
{
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 shader_feature __ GRAYSCALE SEPIA NEGA PIXEL
#pragma shader_feature __ ADD SUBTRACT FILL
#pragma shader_feature __ FASTBLUR MEDIUMBLUR DETAILBLUR
#pragma shader_feature __ EX
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#include "UI-Effect.cginc"
struct appdata_t
{
float4 vertex : POSITION;
float4 color : COLOR;
float2 texcoord : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
#if defined(EX)
float2 uvMask : TEXCOORD1;
#endif
};
struct v2f
{
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
float4 worldPosition : TEXCOORD1;
UNITY_VERTEX_OUTPUT_STEREO
half param : TEXCOORD2;
#if defined(EX)
half4 uvMask : TEXCOORD3;
#endif
};
fixed4 _Color;
fixed4 _TextureSampleAdd;
float4 _ClipRect;
sampler2D _MainTex;
float4 _MainTex_TexelSize;
sampler2D _ParamTex;
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);
OUT.color = IN.color * _Color;
OUT.texcoord = UnpackToVec2(IN.texcoord.x) * 2 - 0.5;
OUT.param = IN.texcoord.y;
#if defined(EX)
OUT.uvMask.xy = UnpackToVec2(IN.uvMask.x);
OUT.uvMask.zw = UnpackToVec2(IN.uvMask.y);
#endif
return OUT;
}
fixed4 frag(v2f IN) : SV_Target
{
fixed4 param = tex2D(_ParamTex, float2(0.5, IN.param));
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
}
}
}
@@ -1,101 +0,0 @@
Shader "UI/Hidden/UI-EffectCapture"
{
Properties
{
[PerRendererData] _MainTex("Main Texture", 2D) = "white" {}
}
SubShader
{
ZTest Always
Cull Off
ZWrite Off
Fog{ Mode off }
Pass
{
Name "Effect-Base"
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma target 2.0
#pragma shader_feature __ GRAYSCALE SEPIA NEGA PIXEL
#pragma shader_feature __ ADD SUBTRACT FILL
#include "UnityCG.cginc"
#include "UI-Effect.cginc"
sampler2D _MainTex;
float4 _MainTex_TexelSize;
half4 _EffectFactor;
fixed4 _ColorFactor;
v2f_img vert(appdata_img v)
{
v2f_img o;
o.pos = UnityObjectToClipPos(v.vertex);
o.uv = v.texcoord;
#if UNITY_UV_STARTS_AT_TOP
o.uv.y = 1 - o.uv.y;
#endif
return o;
}
fixed4 frag(v2f_img IN) : SV_Target
{
half effectFactor = _EffectFactor.x;
fixed4 colorFactor = _ColorFactor;
#if PIXEL
half2 pixelScale = max(2, (1 - effectFactor) * _MainTex_TexelSize.zw);
IN.uv = round(IN.uv * pixelScale) / pixelScale;
#endif
half4 color = tex2D(_MainTex, IN.uv);
#if defined (UI_TONE)
color = ApplyToneEffect(color, effectFactor);
#endif
#if defined (UI_COLOR)
color = ApplyColorEffect(color, colorFactor);
#endif
color.a = 1;
return color;
}
ENDCG
}
Pass
{
Name "Effect-Blur"
CGPROGRAM
#pragma vertex vert_img
#pragma fragment frag_blur
#pragma target 2.0
#pragma shader_feature __ FASTBLUR MEDIUMBLUR DETAILBLUR
#include "UnityCG.cginc"
#include "UI-Effect.cginc"
sampler2D _MainTex;
float4 _MainTex_TexelSize;
half4 _EffectFactor;
fixed4 frag_blur(v2f_img IN) : SV_Target
{
half2 blurFactor = _EffectFactor.xy;
half4 color = Tex2DBlurring1D(_MainTex, IN.uv, blurFactor * _MainTex_TexelSize.xy * 2);
color.a = 1;
return color;
}
ENDCG
}
}
}
@@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 7a6f925a07c3c5846a1c782eaaeb7087
timeCreated: 1482973535
licenseType: Pro
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -1,9 +1,8 @@
fileFormatVersion: 2
guid: 96837540e9d9b4d199c332f11ef9047a
guid: f8316adc5942148aaa478bb0bd261b07
folderAsset: yes
timeCreated: 1487124681
licenseType: Pro
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

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