0.10.0-preview.1

# [0.10.0-preview.1](https://github.com/mob-sakai/SoftMaskForUGUI/compare/v0.9.1...v0.10.0-preview.1) (2020-05-01)

### Bug Fixes

* softmask not working on PS4 ([b391c10](b391c103c5)), closes [#74](https://github.com/mob-sakai/SoftMaskForUGUI/issues/74)

### Features

* add sample importer ([d98a241](d98a241e78))
* raycast filter is now optional feature ([3b42727](3b427274c9)), closes [#73](https://github.com/mob-sakai/SoftMaskForUGUI/issues/73)
pull/87/head
semantic-release-bot 2020-05-01 09:38:37 +00:00
parent 4b59e3dc9b
commit a9c6dadfa1
59 changed files with 24396 additions and 279 deletions

12
.github/FUNDING.yml vendored Normal file
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']

35
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,35 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: mob-sakai
---
NOTE: Your issue may already be reported! Please search on the [issue tracker](../) before creating one.
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Environment (please complete the following information):**
- Version [e.g. 1.0.0]
- Platform: [e.g. Editor(Windows/Mac), Standalone(Windows/Mac), iOS, Android, WebGL]
- Unity version: [e.g. 2018.2.8f1]
- Build options: [e.g. IL2CPP, .Net 4.x, LWRP]
**Additional context**
Add any other context about the problem here.

View File

@ -0,0 +1,22 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: mob-sakai
---
NOTE: Your issue may already be reported! Please search on the [issue tracker](../) before creating one.
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

16
.github/ISSUE_TEMPLATE/question.md vendored Normal file
View File

@ -0,0 +1,16 @@
---
name: Question
about: Ask a question about this project
title: ''
labels: question
assignees: mob-sakai
---
NOTE: Your issue may already be reported! Please search on the [issue tracker](../) before creating one.
**Describe what help do you need**
A description of the question.
**Additional context**
Add any other context or screenshots about the question here.

45
.gitignore vendored
View File

@ -1,45 +0,0 @@
[Ll]ibrary/
[Tt]emp/
[Oo]bj/
[Bb]uild/
/[Bb]uilds/
/Assets/AssetStoreTools*
# Autogenerated VS/MD solution and project files
ExportedObj/
*.csproj
*.unityproj
*.sln
*.suo
*.tmp
*.user
*.userprefs
*.pidb
*.booproj
*.svd
# Unity3D generated meta files
*.pidb.meta
# Unity3D Generated File On Crash Reports
sysinfo.txt
# Mac
*.DS_Store
# Builds
*.apk
# Packages
build.app
unity.log
.vs/
_Android/
_iOS/
_WebGL/
_Standalone/
Assets/TextMesh Pro/
Assets/TextMesh Pro.meta

0
.releaserc Normal file
View File

View File

@ -1,3 +1,16 @@
# [0.10.0-preview.1](https://github.com/mob-sakai/SoftMaskForUGUI/compare/v0.9.1...v0.10.0-preview.1) (2020-05-01)
### Bug Fixes
* softmask not working on PS4 ([b391c10](https://github.com/mob-sakai/SoftMaskForUGUI/commit/b391c103c57cdb3a848701ee5663b86b962031cd)), closes [#74](https://github.com/mob-sakai/SoftMaskForUGUI/issues/74)
### Features
* add sample importer ([d98a241](https://github.com/mob-sakai/SoftMaskForUGUI/commit/d98a241e78f81a92bf22181d94a7622c6a65b589))
* raycast filter is now optional feature ([3b42727](https://github.com/mob-sakai/SoftMaskForUGUI/commit/3b427274c9842c46dd90fa8845dc5156822b04e1)), closes [#73](https://github.com/mob-sakai/SoftMaskForUGUI/issues/73)
# Changelog
## [v0.9.1](https://github.com/mob-sakai/SoftMaskForUGUI/tree/v0.9.1) (2020-01-28)

8
Icons.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4a1917472287145eaa9eea0e2984b5a3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@ -1,4 +1,4 @@
Copyright 2018 mob-sakai
Copyright 2018-2020 mob-sakai
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

273
README.md
View File

@ -1,24 +1,22 @@
SoftMaskForUGUI
===
Soft masking for uGUI elements in Unity.
UI Soft Mask is a smooth masking component for Unity UI (uGUI) elements.
By using SoftMask instead of the default Mask component, you can beautifully represent the rounded edges of UI elements.
![](https://user-images.githubusercontent.com/12690315/50282438-18408d80-0496-11e9-8f86-81e804edadd4.png)
[![](https://img.shields.io/github/release/mob-sakai/SoftMaskForUGUI.svg?label=latest%20version)](https://github.com/mob-sakai/SoftMaskForUGUI/releases)
[![](https://img.shields.io/github/release-date/mob-sakai/SoftMaskForUGUI.svg)](https://github.com/mob-sakai/SoftMaskForUGUI/releases)
![](https://img.shields.io/badge/unity-2017%20or%20later-green.svg)
[![](https://img.shields.io/npm/v/com.coffee.softmask-for-ugui?label=openupm&registry_uri=https://package.openupm.com)](https://openupm.com/packages/com.coffee.softmask-for-ugui/)
[![](https://img.shields.io/github/v/release/mob-sakai/SoftMaskForUGUI?include_prereleases)](https://github.com/mob-sakai/SoftMaskForUGUI/releases)
[![](https://img.shields.io/github/release-date/mob-sakai/SoftMaskForUGUI.svg)](https://github.com/mob-sakai/SoftMaskForUGUI/releases)
![](https://img.shields.io/badge/unity-2017.1%20or%20later-green.svg)
[![](https://img.shields.io/github/license/mob-sakai/SoftMaskForUGUI.svg)](https://github.com/mob-sakai/SoftMaskForUGUI/blob/upm/LICENSE.txt)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-orange.svg)](http://makeapullrequest.com)
[![](https://img.shields.io/github/watchers/mob-sakai/SoftMaskForUGUI.svg?style=social&label=Watch)](https://github.com/mob-sakai/SoftMaskForUGUI/subscription)
[![](https://img.shields.io/twitter/follow/mob_sakai.svg?label=Follow&style=social)](https://twitter.com/intent/follow?screen_name=mob_sakai)
<< [Description](#Description) | [WebGL Demo](#demo) | [Download](https://github.com/mob-sakai/SoftMaskForUGUI/releases) | [Usage](#usage) | [Development Note](#development-note) >>
### What's new? [See changelog ![](https://img.shields.io/github/release-date/mob-sakai/SoftMaskForUGUI.svg?label=last%20updated)](https://github.com/mob-sakai/SoftMaskForUGUI/blob/develop/CHANGELOG.md)
### Do you want to receive notifications for new releases? [Watch this repo ![](https://img.shields.io/github/watchers/mob-sakai/SoftMaskForUGUI.svg?style=social&label=Watch)](https://github.com/mob-sakai/SoftMaskForUGUI/subscription)
### Support me on Patreon!
[![become_a_patron](https://c5.patreon.com/external/logo/become_a_patron_button.png)](https://www.patreon.com/join/2343451?)
<< [Description](#Description) | [WebGL Demo](#demo) | [Installation](#installation) | [Usage](#usage) | [For Your Custom Shader](#support-soft-masks-with-your-custom-shaders) >>
@ -45,7 +43,7 @@ By using SoftMask instead of default Mask, rounded edges of UI elements can be e
![](https://user-images.githubusercontent.com/12690315/48708328-a0d4cf80-ec45-11e8-9945-e877faabc968.png)
* Support overlay, camera space and world space.
![](https://user-images.githubusercontent.com/12690315/48708329-a0d4cf80-ec45-11e8-8328-16b697f981ec.png)
* Raycast is filtered only for the visible part.
* (Option) Raycast is filtered only for the visible part.
![](https://user-images.githubusercontent.com/12690315/48708330-a16d6600-ec45-11e8-94bf-afecd1bd9a39.png)
* Contain soft maskable UI shader.
* Support soft masks in your custom shaders by adding just 3 lines. For details, please see [Development Note](#support-soft-masks-in-your-custom-shaders).
@ -57,12 +55,9 @@ By using SoftMask instead of default Mask, rounded edges of UI elements can be e
![](https://user-images.githubusercontent.com/12690315/50284153-76bc3a80-049b-11e9-8c55-719af897960a.png)
* Preview soft mask buffer in inspector.
![](https://user-images.githubusercontent.com/12690315/50284151-7459e080-049b-11e9-9cd3-24fb476766dc.png)
* Support TextMeshPro.
![](https://user-images.githubusercontent.com/12690315/50284145-71f78680-049b-11e9-8be1-ac0ccbdf0144.png)
* Make multiple holes on one background by 'Parts of parent' option.
![](https://user-images.githubusercontent.com/12690315/54102470-f5c26e80-440b-11e9-89d1-899aa4dca00d.png)
* Camera movement affects the mask rendering when on a World Space Canvas.
![](https://user-images.githubusercontent.com/12690315/57015752-68540b80-6c51-11e9-8511-2d4534dd9d58.gif)
#### Components
@ -84,77 +79,95 @@ By using SoftMask instead of default Mask, rounded edges of UI elements can be e
<br><br><br><br>
## Install
#### Using UnityPackageManager (for Unity 2018.3 or later)
#### Requirement
* Unity 2017.1 or later
* No other SDK are required
#### Using OpenUPM (for Unity 2018.3 or later)
This package is available on [OpenUPM](https://openupm.com).
You can install it via [openupm-cli](https://github.com/openupm/openupm-cli).
```
openupm add com.coffee.softmask-for-ugui
```
#### Using Git (for Unity 2018.3 or later)
Find the manifest.json file in the Packages folder of your project and edit it to look like this:
```js
{
"dependencies": {
"com.coffee.softmask-for-ugui": "https://github.com/mob-sakai/SoftMaskForUGUI.git#0.8.1",
"com.coffee.softmask-for-ugui": "https://github.com/mob-sakai/SoftMaskForUGUI.git",
...
},
}
```
To update the package, change `#{version}` to the target version.
Or, use [UpmGitExtension](https://github.com/mob-sakai/UpmGitExtension).
#### Using .unitypackage file (for Unity 2017.1 or later)
To update the package, change suffix `#{version}` to the target version.
Download `*.unitypackage` from [Releases](https://github.com/mob-sakai/SoftMaskForUGUI/releases) and import the package into your Unity project.
Select `Assets > Import Package > Custom Package` from the menu.
![](https://user-images.githubusercontent.com/12690315/46570979-edbb5a00-c9a7-11e8-845d-c5ee279effec.png)
* e.g. `"com.coffee.softmask-for-ugui": "https://github.com/mob-sakai/SoftMaskForUGUI.git#1.0.0",`
Or, use [UpmGitExtension](https://github.com/mob-sakai/UpmGitExtension) to install and update the package.
#### For Unity 2018.2 or earlier
1. Download a source code zip file from [Releases](https://github.com/mob-sakai/SoftMaskForUGUI/releases) page
2. Extract it
3. Import it into the following directory in your Unity project
- `Packages` (It works as an embedded package. For Unity 2018.1 or later)
- `Assets` (Legacy way. For Unity 2017.1 or later)
<br><br><br><br>
## How to play demo
* Import `SoftMask_Demo.unitypackage` into your project.
* The unitypackage exists in `Assets/Assets/Coffee/UIExtensions/SoftMaskForUGUI` or `Packages/Soft Mask For uGUI`.
![](https://user-images.githubusercontent.com/12690315/51080546-ff3b9d00-1720-11e9-8a58-9e22003714af.png)
* Open SoftMask_Demo scene and play it.
* The demo requires `TextMeshPro` and `TextMeshPro Essential Resources`. Import it before playing.
#### For Unity 2019.1 or later
1. Open `Package Manager` window and select `UI Soft Mask` package in package list
2. Click `Import in project` button
![](https://user-images.githubusercontent.com/12690315/79000480-a8bd4880-7b87-11ea-89c7-a17033a486ba.png)
3. The demo will be imported into `Assets/Samples/UI Soft Mask/{version}/Demo`; open `UISoftMask_Demo` scene and play it
#### For Unity 2018.4 or earlier
1. Select `Assets/Samples/UI Soft Mask Demo` from menu
![Assets_と_Menubar](https://user-images.githubusercontent.com/12690315/79001101-dd7dcf80-7b88-11ea-9cf2-b44c6c5c9b17.png)
2. The demo will be imported into `Assets/Samples/UI Soft Mask/{version}/Demo`; open `UISoftMask_Demo` scene and play it
<br><br><br><br>
## Usage
1. Add SoftMask component instead of Mask component.
Or, convert existing Mask component to SoftMask component from the context menu.
1. Add a SoftMask component instead of Mask component.
Or, convert an existing Mask component to SoftMask component from the context menu.
![](https://user-images.githubusercontent.com/12690315/48659018-902e2900-ea8e-11e8-9b6e-224365cdde7f.png)
2. Add SoftMaskable components to the child UI elements of SoftMask component.
2. Add a SoftMaskable components to the child UI elements of the SoftMask component.
![](https://user-images.githubusercontent.com/12690315/48704424-d4a9f800-ec39-11e8-8d65-8b7d1975750c.png)
Or, add SoftMaskable components from the inspector of SoftMask component.
Or, add a SoftMaskable components from the inspector of the SoftMask component.
![](https://user-images.githubusercontent.com/12690315/50284153-76bc3a80-049b-11e9-8c55-719af897960a.png)
3. Adjust softness of SoftMask.
3. Adjust softness setting of SoftMask.
![](https://user-images.githubusercontent.com/12690315/48661087-01ca9f00-eab0-11e8-8878-772a1ed1fb7b.gif)
4. Enjoy!
##### Requirement
* Unity 2017 or later *(including Unity 2018.x)*
* No other SDK are required
<br><br><br><br>
## Development Note
## Support soft masks with your custom shaders
#### Support soft masks in your custom shaders
<b>With just three additional lines,</b> you can now support softmasks in your custom shaders!
You can support soft masks in your custom shaders, by adding just 3 lines!
1. Add `#pragma` and `#include`. `SOFTMASK_EDITOR` is a keyword for editor only, not included in the build.
If you installed using packageManager, include `Packages/com.coffee.softmask-for-ugui/SoftMask.cginc` instead of.
1. Add `#pragma` and `#include` directives, where `SOFTMASK_EDITOR` is an editor-only keyword and is not included in the build.
If you didn't use package manager to install, include `SoftMask.cginc` in the appropriate path instead.
```
#include "Assets/Coffee/UIExtensions/SoftMaskForUGUI/SoftMask.cginc"
#include "Packages/com.coffee.softmask-for-ugui/Shaders/SoftMask.cginc"
#pragma shader_feature __ SOFTMASK_EDITOR
```
2. Apply a soft mask in the fragment shader.
- `IN.vertex` is clip position
- `IN.worldPosition` is world position
2. Apply a soft mask in the fragment shader.
This operation determines the final alpha according to the soft mask buffer.
- `IN.vertex`: the clip position
- `IN.worldPosition`: the world position
```
color.a *= SoftMask(IN.vertex, IN.worldPosition);
```
@ -162,149 +175,6 @@ color.a *= SoftMask(IN.vertex, IN.worldPosition);
As an example of implementation, please see [UI-Default-SoftMask.shader](https://raw.githubusercontent.com/mob-sakai/SoftMaskForUGUI/upm/Shaders/Resources/UI-Default-SoftMask.shader).
<br><br>
#### Tips: Convert component from context menu
Converting components from the context menu is very convenient.
You can convert multiple components at the same time, without having to remove the source components.
![](https://user-images.githubusercontent.com/12690315/48659018-902e2900-ea8e-11e8-9b6e-224365cdde7f.png)
If the destination component has the same properties as the source component, the value is set automatically.
In addition, if the destination component is compatible with the source component, it will not lose its reference.
For example, if `public Mask mask;` refers to a Mask, converting it to SoftMask in this way does not lose references.
This way consists of two generic methods.
```cs
/// <summary>
/// Verify whether it can be converted to the specified component.
/// </summary>
protected static bool CanConvertTo<T>(Object context)
where T : MonoBehaviour
{
return context && context.GetType() != typeof(T);
}
/// <summary>
/// Convert to the specified component.
/// </summary>
protected static void ConvertTo<T>(Object context) where T : MonoBehaviour
{
var target = context as MonoBehaviour;
var so = new SerializedObject(target);
so.Update();
bool oldEnable = target.enabled;
target.enabled = false;
// Find MonoScript of the specified component.
foreach (var script in Resources.FindObjectsOfTypeAll<MonoScript>())
{
if (script.GetClass() != typeof(T))
continue;
// Set 'm_Script' to convert.
so.FindProperty("m_Script").objectReferenceValue = script;
so.ApplyModifiedProperties();
break;
}
(so.targetObject as MonoBehaviour).enabled = oldEnable;
}
```
In SoftMask, they are implemented as follows.
* Mask and SoftMask can be converted to each other.
* If conversion is not possible, gray out the context menu.
```cs
[MenuItem("CONTEXT/Mask/Convert To SoftMask", true)]
static bool _ConvertToSoftMask(MenuCommand command)
{
return CanConvertTo<SoftMask>(command.context);
}
[MenuItem("CONTEXT/Mask/Convert To SoftMask", false)]
static void ConvertToSoftMask(MenuCommand command)
{
ConvertTo<SoftMask>(command.context);
}
[MenuItem("CONTEXT/Mask/Convert To Mask", true)]
static bool _ConvertToMask(MenuCommand command)
{
return CanConvertTo<Mask>(command.context);
}
[MenuItem("CONTEXT/Mask/Convert To Mask", false)]
static void ConvertToMask(MenuCommand command)
{
ConvertTo<Mask>(command.context);
}
```
For details, please see [SoftMaskEditor.cs](https://raw.githubusercontent.com/mob-sakai/SoftMaskForUGUI/upm/Scripts/Editor/SoftMaskEditor.cs).
<br><br>
#### Tips: Shader code for editor only
Do you know how to implement shader code "for editor only"?
SoftMask uses `SOFTMASK_EDITOR` keyword in shader code to determine whether it is running in the editor.
`#pragma shader_feature __ SOFTMASK_EDITOR`
`SOFTMASK_EDITOR` keyword is set from the editor script, but it is not set after it is built. Also, this shader variant will be excluded from build.
```cs
#if UNITY_EDITOR
material = new Material(shader);
material.hideFlags = HideFlags.HideAndDontSave;
material.EnableKeyword("SOFTMASK_EDITOR");
#endif
```
<br><br>
#### Tips: Shader code for SceneView only
Do you know how to implement shader code "for SceneView only"?
SoftMask understands that the current rendering is for SceneView, when SceneView's view projection matrix and UNITY_MATRIX_VP match.
`fixed isSceneView = 1 - any(UNITY_MATRIX_VP - _SceneViewVP);`
Actually, because of the movement operation in SceneView, use "approximate" instead of "match".
```cs
float4x4 _SceneViewVP;
fixed Approximate(float4x4 a, float4x4 b)
{
float4x4 d = abs(a - b);
return step(
max(d._m00,max(d._m01,max(d._m02,max(d._m03,
max(d._m10,max(d._m11,max(d._m12,max(d._m13,
max(d._m20,max(d._m21,max(d._m22,max(d._m23,
max(d._m30,max(d._m31,max(d._m32,d._m33))))))))))))))),
0.01);
}
fixed isSceneView = Approximate(UNITY_MATRIX_VP, _SceneViewVP);
```
`_SceneViewVP` is set every frame from the editor script.
```cs
#if UNITY_EDITOR
UnityEditor.EditorApplication.update += ()
{
Camera cam = UnityEditor.SceneView.lastActiveSceneView.camera;
Matrix4x4 vp = cam.projectionMatrix * cam.worldToCameraMatrix;
material.SetMatrix("_SceneViewVP", vp);
};
#endif
```
<br><br><br><br>
## License
@ -314,12 +184,22 @@ UnityEditor.EditorApplication.update += ()
<br><br><br><br>
## Support
This is an open-source project that I am developing in my free time.
If you like it, you can support me.
By supporting, you let me spend more time working on better tools that you can use for free. :)
[![become_a_patron_on_patreon](https://user-images.githubusercontent.com/12690315/50731629-3b18b480-11ad-11e9-8fad-4b13f27969c1.png)](https://www.patreon.com/join/2343451?)
[![become_a_sponsor_on_github](https://user-images.githubusercontent.com/12690315/66942881-03686280-f085-11e9-9586-fc0b6011029f.png)](https://github.com/users/mob-sakai/sponsorship)
## Author
[mob-sakai](https://github.com/mob-sakai)
[![](https://img.shields.io/twitter/follow/mob_sakai.svg?label=Follow&style=social)](https://twitter.com/intent/follow?screen_name=mob_sakai)
[![become_a_patron](https://c5.patreon.com/external/logo/become_a_patron_button.png)](https://www.patreon.com/join/2343451?)
[![](https://img.shields.io/twitter/follow/mob_sakai.svg?label=Follow&style=social)](https://twitter.com/intent/follow?screen_name=mob_sakai)
@ -328,5 +208,4 @@ UnityEditor.EditorApplication.update += ()
* GitHub page : https://github.com/mob-sakai/SoftMaskForUGUI
* Releases : https://github.com/mob-sakai/SoftMaskForUGUI/releases
* Issue tracker : https://github.com/mob-sakai/SoftMaskForUGUI/issues
* Current project : https://github.com/mob-sakai/SoftMaskForUGUI/projects/1
* Change log : https://github.com/mob-sakai/SoftMaskForUGUI/blob/upm/CHANGELOG.md

8
Samples~/Demo.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 26abda1ec55af483eb5e5013264e94b6
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,14 @@
{
"name": "Coffee.SoftMaskForUGUI_Demo",
"references": [
"Coffee.SoftMaskForUGUI"
],
"optionalUnityReferences": [],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": []
}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: ff8ec454d2eab4891b9064b4f14bb203
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,6 +1,7 @@
fileFormatVersion: 2
guid: fdbf04e4a4f2a4ce3aebd88b2e996fbe
timeCreated: 1547267633
guid: bd241c18e6c1945cb8b6c9cc5beaa014
folderAsset: yes
timeCreated: 1540000506
licenseType: Pro
DefaultImporter:
userData:

View File

@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: cb89e33902259704db92150f0a4ef290
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,20 @@
fileFormatVersion: 2
guid: ab2cfde409d710b47b0b502877abb479
timeCreated: 1473937939
licenseType: Pro
TrueTypeFontImporter:
serializedVersion: 4
fontSize: 72
forceTextureCase: -1
characterSpacing: 0
characterPadding: 1
includeFontData: 1
fontNames:
- Luckiest Guy
fallbackFontReferences: []
customCharacters:
fontRenderingMode: 0
ascentCalculationMode: 2
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

View File

@ -0,0 +1,100 @@
fileFormatVersion: 2
guid: 3ad57d818b4f448a190e524e494130b0
timeCreated: 1539763439
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: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: 16
mipBias: -1
wrapMode: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
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: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

@ -0,0 +1,116 @@
fileFormatVersion: 2
guid: dee1cb6c2ee294c6087ea9d89d368417
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
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:
serializedVersion: 2
filterMode: 1
aniso: -1
mipBias: -1
wrapU: 1
wrapV: 1
wrapW: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 31, y: 31, z: 31, w: 31}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- buildTarget: iPhone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

@ -0,0 +1,106 @@
fileFormatVersion: 2
guid: f3749669408984358921fc148ed3aa83
timeCreated: 1542628474
licenseType: Pro
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
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:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -1
wrapU: 1
wrapV: 1
wrapW: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 31, y: 0, z: 31, 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: []
outline: []
physicsShape: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,106 @@
fileFormatVersion: 2
guid: 801e306fcae92475592a6d3511bf58d7
timeCreated: 1540708816
licenseType: Pro
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
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:
serializedVersion: 2
filterMode: 1
aniso: -1
mipBias: -1
wrapU: 1
wrapV: 1
wrapW: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
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: []
outline: []
physicsShape: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

@ -0,0 +1,106 @@
fileFormatVersion: 2
guid: 0f125745ff7d640519fb2300ed8a96c7
timeCreated: 1542628487
licenseType: Pro
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
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:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -1
wrapU: 1
wrapV: 1
wrapW: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 31, z: 0, w: 31}
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: []
outline: []
physicsShape: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,63 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace Coffee.UIExtensions.Demos
{
public class SoftMask_Demo : MonoBehaviour
{
[SerializeField] RawImage[] softMaskBufferViewer;
[SerializeField] SoftMask[] softMask;
[SerializeField] Text text;
// Use this for initialization
void OnEnable()
{
text.text = string.Format("GPU: {0}\nDeviceType: {1}\nShaderLevel: {2}\nUVStartsAtTop: {3}",
SystemInfo.graphicsDeviceName,
SystemInfo.graphicsDeviceType,
SystemInfo.graphicsShaderLevel,
SystemInfo.graphicsUVStartsAtTop);
for (int i = 0; i < softMask.Length; i++)
{
softMaskBufferViewer[i].texture = softMask[i].softMaskBuffer;
}
}
// Update is called once per frame
void Update()
{
}
public void SetWorldSpase(bool flag)
{
if(flag)
{
GetComponent<Canvas> ().renderMode = RenderMode.ScreenSpaceCamera;
GetComponent<Canvas> ().renderMode = RenderMode.WorldSpace;
transform.rotation = Quaternion.Euler (new Vector3 (0, 6, 0));
}
}
public void SetScreenSpase (bool flag)
{
if (flag)
{
GetComponent<Canvas> ().renderMode = RenderMode.ScreenSpaceCamera;
}
}
public void SetOverlay (bool flag)
{
if (flag)
{
GetComponent<Canvas> ().renderMode = RenderMode.ScreenSpaceOverlay;
}
}
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 3ebfb22aa6f994ac8b91971f164836fe
timeCreated: 1540726460
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: aa372e7b286d0416eb942adfc3e442ec
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,713 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: SoftMask_Demo_Title
serializedVersion: 5
m_AnimatorParameters: []
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
m_StateMachine: {fileID: 1107074086602143662}
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!74 &74247020000484542
AnimationClip:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Loop
serializedVersion: 6
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0.6666667
value: {x: 2, y: 2, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
- serializedVersion: 2
time: 0.8333333
value: {x: 2.75, y: 2.75, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
- serializedVersion: 2
time: 1
value: {x: 2, y: 2, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path: SoftMask/Logo
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: {x: 1, y: 1, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
- serializedVersion: 2
time: 0.6666667
value: {x: 1, y: 1, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
- serializedVersion: 2
time: 0.75
value: {x: 1.1, y: 1.1, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
- serializedVersion: 2
time: 0.8333333
value: {x: 1, y: 1, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path: SoftMask/Text
m_FloatCurves: []
m_PPtrCurves: []
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings: []
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 1
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.6666667
value: 2
inSlope: 0
outSlope: 0
tangentMode: 136
- serializedVersion: 2
time: 0.8333333
value: 2.75
inSlope: 0
outSlope: 0
tangentMode: 136
- serializedVersion: 2
time: 1
value: 2
inSlope: 0
outSlope: 0
tangentMode: 136
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalScale.x
path: SoftMask/Logo
classID: 224
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0.6666667
value: 2
inSlope: 0
outSlope: 0
tangentMode: 136
- serializedVersion: 2
time: 0.8333333
value: 2.75
inSlope: 0
outSlope: 0
tangentMode: 136
- serializedVersion: 2
time: 1
value: 2
inSlope: 0
outSlope: 0
tangentMode: 136
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalScale.y
path: SoftMask/Logo
classID: 224
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 136
- serializedVersion: 2
time: 0.6666667
value: 1
inSlope: 0
outSlope: 0
tangentMode: 136
- serializedVersion: 2
time: 0.75
value: 1.1
inSlope: 0
outSlope: 0
tangentMode: 136
- serializedVersion: 2
time: 0.8333333
value: 1
inSlope: 0
outSlope: 0
tangentMode: 136
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalScale.x
path: SoftMask/Text
classID: 224
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 136
- serializedVersion: 2
time: 0.6666667
value: 1
inSlope: 0
outSlope: 0
tangentMode: 136
- serializedVersion: 2
time: 0.75
value: 1.1
inSlope: 0
outSlope: 0
tangentMode: 136
- serializedVersion: 2
time: 0.8333333
value: 1
inSlope: 0
outSlope: 0
tangentMode: 136
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalScale.y
path: SoftMask/Text
classID: 224
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalScale.z
path: SoftMask/Text
classID: 224
script: {fileID: 0}
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_GenerateMotionCurves: 0
m_Events: []
--- !u!74 &74250830961223546
AnimationClip:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Intro
serializedVersion: 6
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: {x: 2, y: 2, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
- serializedVersion: 2
time: 1
value: {x: 2, y: 2, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
- serializedVersion: 2
time: 1.5
value: {x: 2, y: 2, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path: SoftMask/Logo
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: {x: 1, y: 1, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
- serializedVersion: 2
time: 1
value: {x: 1, y: 1, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
- serializedVersion: 2
time: 1.5
value: {x: 1, y: 1, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path: SoftMask/Text
m_FloatCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 700
inSlope: 0
outSlope: 0
tangentMode: 136
- serializedVersion: 2
time: 1
value: 700
inSlope: 0
outSlope: 0
tangentMode: 136
- serializedVersion: 2
time: 1.5
value: 579.2
inSlope: 0
outSlope: 0
tangentMode: 136
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_SizeDelta.x
path:
classID: 224
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 500
inSlope: 0
outSlope: 0
tangentMode: 136
- serializedVersion: 2
time: 1
value: 500
inSlope: 0
outSlope: 0
tangentMode: 136
- serializedVersion: 2
time: 1.5
value: 354.1
inSlope: 0
outSlope: 0
tangentMode: 136
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_SizeDelta.y
path:
classID: 224
script: {fileID: 0}
m_PPtrCurves: []
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings: []
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 1.5
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: 2
inSlope: 0
outSlope: 0
tangentMode: 136
- serializedVersion: 2
time: 1
value: 2
inSlope: 0
outSlope: 0
tangentMode: 136
- serializedVersion: 2
time: 1.5
value: 2
inSlope: 0
outSlope: 0
tangentMode: 136
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalScale.x
path: SoftMask/Logo
classID: 224
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 2
inSlope: 0
outSlope: 0
tangentMode: 136
- serializedVersion: 2
time: 1
value: 2
inSlope: 0
outSlope: 0
tangentMode: 136
- serializedVersion: 2
time: 1.5
value: 2
inSlope: 0
outSlope: 0
tangentMode: 136
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalScale.y
path: SoftMask/Logo
classID: 224
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalScale.z
path: SoftMask/Logo
classID: 224
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 136
- serializedVersion: 2
time: 1
value: 1
inSlope: 0
outSlope: 0
tangentMode: 136
- serializedVersion: 2
time: 1.5
value: 1
inSlope: 0
outSlope: 0
tangentMode: 136
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalScale.x
path: SoftMask/Text
classID: 224
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 136
- serializedVersion: 2
time: 1
value: 1
inSlope: 0
outSlope: 0
tangentMode: 136
- serializedVersion: 2
time: 1.5
value: 1
inSlope: 0
outSlope: 0
tangentMode: 136
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalScale.y
path: SoftMask/Text
classID: 224
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalScale.z
path: SoftMask/Text
classID: 224
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 700
inSlope: 0
outSlope: 0
tangentMode: 136
- serializedVersion: 2
time: 1
value: 700
inSlope: 0
outSlope: 0
tangentMode: 136
- serializedVersion: 2
time: 1.5
value: 579.2
inSlope: 0
outSlope: 0
tangentMode: 136
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_SizeDelta.x
path:
classID: 224
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 500
inSlope: 0
outSlope: 0
tangentMode: 136
- serializedVersion: 2
time: 1
value: 500
inSlope: 0
outSlope: 0
tangentMode: 136
- serializedVersion: 2
time: 1.5
value: 354.1
inSlope: 0
outSlope: 0
tangentMode: 136
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_SizeDelta.y
path:
classID: 224
script: {fileID: 0}
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_GenerateMotionCurves: 0
m_Events: []
--- !u!1101 &1101833671069262892
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name:
m_Conditions: []
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 1102583906311020750}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0.75
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &1102583906311020750
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Loop
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: 74247020000484542}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
--- !u!1102 &1102859778462102860
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Intro
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: 1101833671069262892}
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: 74250830961223546}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
--- !u!1107 &1107074086602143662
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: 1102859778462102860}
m_Position: {x: 240, y: 108, z: 0}
- serializedVersion: 1
m_State: {fileID: 1102583906311020750}
m_Position: {x: 240, y: 180, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
m_StateMachineTransitions: {}
m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 50, y: 20, z: 0}
m_EntryPosition: {x: 50, y: 120, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: 1102859778462102860}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f1142cc2db608495ba510244d813cccf
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 9100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,401 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: SoftMask_Demo_Transition
serializedVersion: 5
m_AnimatorParameters:
- m_Name: Play
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: 1107074086602143662}
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!74 &74247020000484542
AnimationClip:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Animation
serializedVersion: 6
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0.6666667
value: {x: 2, y: 2, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
- serializedVersion: 2
time: 0.8333333
value: {x: 2.75, y: 2.75, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
- serializedVersion: 2
time: 1
value: {x: 2, y: 2, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path: SoftMask/Logo
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: {x: 1, y: 1, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
- serializedVersion: 2
time: 0.6666667
value: {x: 1, y: 1, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
- serializedVersion: 2
time: 0.75
value: {x: 1.1, y: 1.1, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
- serializedVersion: 2
time: 0.8333333
value: {x: 1, y: 1, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path: SoftMask/Text
m_FloatCurves: []
m_PPtrCurves: []
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 209171555
attribute: 3
script: {fileID: 0}
typeID: 4
customType: 0
isPPtrCurve: 0
- serializedVersion: 2
path: 3547498935
attribute: 3
script: {fileID: 0}
typeID: 4
customType: 0
isPPtrCurve: 0
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 1
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.6666667
value: 2
inSlope: 0
outSlope: 0
tangentMode: 136
- serializedVersion: 2
time: 0.8333333
value: 2.75
inSlope: 0
outSlope: 0
tangentMode: 136
- serializedVersion: 2
time: 1
value: 2
inSlope: 0
outSlope: 0
tangentMode: 136
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalScale.x
path: SoftMask/Logo
classID: 224
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0.6666667
value: 2
inSlope: 0
outSlope: 0
tangentMode: 136
- serializedVersion: 2
time: 0.8333333
value: 2.75
inSlope: 0
outSlope: 0
tangentMode: 136
- serializedVersion: 2
time: 1
value: 2
inSlope: 0
outSlope: 0
tangentMode: 136
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalScale.y
path: SoftMask/Logo
classID: 224
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 136
- serializedVersion: 2
time: 0.6666667
value: 1
inSlope: 0
outSlope: 0
tangentMode: 136
- serializedVersion: 2
time: 0.75
value: 1.1
inSlope: 0
outSlope: 0
tangentMode: 136
- serializedVersion: 2
time: 0.8333333
value: 1
inSlope: 0
outSlope: 0
tangentMode: 136
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalScale.x
path: SoftMask/Text
classID: 224
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 136
- serializedVersion: 2
time: 0.6666667
value: 1
inSlope: 0
outSlope: 0
tangentMode: 136
- serializedVersion: 2
time: 0.75
value: 1.1
inSlope: 0
outSlope: 0
tangentMode: 136
- serializedVersion: 2
time: 0.8333333
value: 1
inSlope: 0
outSlope: 0
tangentMode: 136
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalScale.y
path: SoftMask/Text
classID: 224
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalScale.z
path: SoftMask/Text
classID: 224
script: {fileID: 0}
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_GenerateMotionCurves: 0
m_Events: []
--- !u!1101 &1101040075164616526
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name:
m_Conditions: []
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 1102859778462102860}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0.75
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1101 &1101833671069262892
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 1
m_ConditionEvent: Play
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 1102583906311020750}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0.75
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &1102583906311020750
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:
- {fileID: 1101040075164616526}
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: 74247020000484542}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
--- !u!1102 &1102859778462102860
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Idle
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: 1101833671069262892}
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!1107 &1107074086602143662
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: 1102859778462102860}
m_Position: {x: 240, y: 108, z: 0}
- serializedVersion: 1
m_State: {fileID: 1102583906311020750}
m_Position: {x: 240, y: 180, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
m_StateMachineTransitions: {}
m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 50, y: 20, z: 0}
m_EntryPosition: {x: 50, y: 120, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: 1102859778462102860}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a3e65681898104501aee3ff30e223f28
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 9100000
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 391 KiB

View File

@ -0,0 +1,100 @@
fileFormatVersion: 2
guid: e5a8e8d861f62472d8f99611cf9d12c5
timeCreated: 1539763439
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: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: 16
mipBias: -1
wrapMode: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
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: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,76 @@
#if !UNITY_2019_1_OR_NEWER
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using UnityEditor;
namespace Coffee.UIExtensions
{
public static class ImportSampleMenu_UISoftMask
{
[MenuItem("Assets/Samples/Import UISoftMask Sample")]
private static void ImportSample()
{
const string jsonGuid = "c43fd233e88b347cdabc530c23ffe30a";
const string dirName = "Demo";
ImportSample(jsonGuid, dirName);
}
private static void ImportSample(string jsonGuid, string sampleName)
{
var jsonPath = AssetDatabase.GUIDToAssetPath(jsonGuid);
var json = File.ReadAllText(jsonPath);
var version = Regex.Match(json, "\"version\"\\s*:\\s*\"([^\"]+)\"").Groups[1].Value;
var displayName = Regex.Match(json, "\"displayName\"\\s*:\\s*\"([^\"]+)\"").Groups[1].Value;
var src = string.Format("{0}/Samples~/{1}", Path.GetDirectoryName(jsonPath), sampleName);
var srcAlt = string.Format("{0}/Samples/{1}", Path.GetDirectoryName(jsonPath), sampleName);
var dst = string.Format("Assets/Samples/{0}/{1}/{2}", displayName, version, sampleName);
var previousPath = GetPreviousSamplePath(displayName, sampleName);
// Remove the previous sample directory.
if (!string.IsNullOrEmpty(previousPath))
{
var msg = "A different version of the sample is already imported at\n\n"
+ previousPath
+ "\n\nIt will be deleted when you update. Are you sure you want to continue?";
if (!EditorUtility.DisplayDialog("Sample Importer", msg, "OK", "Cancel"))
return;
FileUtil.DeleteFileOrDirectory(previousPath);
var metaFile = previousPath + ".meta";
if (File.Exists(metaFile))
FileUtil.DeleteFileOrDirectory(metaFile);
}
if (!Directory.Exists(dst))
FileUtil.DeleteFileOrDirectory(dst);
var dstDir = Path.GetDirectoryName(dst);
if (!Directory.Exists(dstDir))
Directory.CreateDirectory(dstDir);
if (Directory.Exists(src))
FileUtil.CopyFileOrDirectory(src, dst);
else if (Directory.Exists(srcAlt))
FileUtil.CopyFileOrDirectory(srcAlt, dst);
else
throw new DirectoryNotFoundException(src);
AssetDatabase.Refresh(ImportAssetOptions.ImportRecursive);
}
private static string GetPreviousSamplePath(string displayName, string sampleName)
{
var sampleRoot = string.Format("Assets/Samples/{0}", displayName);
var sampleRootInfo = new DirectoryInfo(sampleRoot);
if (!sampleRootInfo.Exists) return null;
return sampleRootInfo.GetDirectories()
.Select(versionDir => Path.Combine(versionDir.ToString(), sampleName))
.FirstOrDefault(Directory.Exists);
}
}
}
#endif

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: aae59e0ee9bec4e71a10bd5a08f4fba4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

6
Scripts/SoftMask.cs Executable file → Normal file
View File

@ -262,8 +262,8 @@ namespace Coffee.UIExtensions
int x = (int)((softMaskBuffer.width - 1) * Mathf.Clamp01(sp.x / Screen.width));
int y = s_UVStartsAtTop
? (int)((softMaskBuffer.height - 1) * Mathf.Clamp01(sp.y / Screen.height))
: (int)((softMaskBuffer.height - 1) * (1 - Mathf.Clamp01(sp.y / Screen.height)));
? (int)((softMaskBuffer.height - 1) * (1 - Mathf.Clamp01(sp.y / Screen.height)))
: (int)((softMaskBuffer.height - 1) * Mathf.Clamp01(sp.y / Screen.height));
return 0.5f < GetPixelValue(x, y, interactions);
}
@ -286,11 +286,11 @@ namespace Coffee.UIExtensions
// Register.
if (s_ActiveSoftMasks.Count == 0)
{
s_UVStartsAtTop = SystemInfo.graphicsUVStartsAtTop;
Canvas.willRenderCanvases += UpdateMaskTextures;
if (s_StencilCompId == 0)
{
s_UVStartsAtTop = SystemInfo.graphicsUVStartsAtTop;
s_StencilCompId = Shader.PropertyToID("_StencilComp");
s_ColorMaskId = Shader.PropertyToID("_ColorMask");
s_MainTexId = Shader.PropertyToID("_MainTex");

17
Scripts/SoftMaskable.cs Executable file → Normal file
View File

@ -36,8 +36,10 @@ namespace Coffee.UIExtensions
[Tooltip("The interaction for each masks.")]
[HideInInspector]
[SerializeField] int m_MaskInteraction = kVisibleInside;
[Tooltip("Use stencil for masking.")]
[Tooltip("Use stencil to mask.")]
[SerializeField] bool m_UseStencil = false;
[Tooltip("Use soft-masked raycast target.\n\nNote: This option is expensive.")]
[SerializeField] bool m_RaycastFilter = false;
//################################
@ -115,6 +117,10 @@ namespace Coffee.UIExtensions
{
return false;
}
else if (!m_RaycastFilter)
{
return true;
}
var sm = _softMask;
for (int i = 0; i < 4; i++)
@ -144,6 +150,15 @@ namespace Coffee.UIExtensions
}
}
/// <summary>
/// Use soft-masked raycast target. This option is expensive.
/// </summary>
public bool raycastFilter
{
get { return m_RaycastFilter; }
set { m_RaycastFilter = value; }
}
/// <summary>
/// The graphic associated with the soft mask.
/// </summary>

View File

@ -1,16 +1,16 @@
Shader "Hidden/SoftMask" {
SubShader {
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
LOD 100
Cull Off
ZWrite Off
Blend SrcAlpha One
ColorMask [_ColorMask]
SubShader {
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
LOD 100
Cull Off
ZWrite Off
Blend SrcAlpha One
ColorMask [_ColorMask]
Pass {
CGPROGRAM
Pass {
CGPROGRAM
#pragma vertex vert_img
#pragma fragment frag
#pragma target 2.0
@ -25,8 +25,8 @@ SubShader {
{
return saturate(tex2D(_MainTex, i.uv).a/_Softness) * _Alpha;
}
ENDCG
ENDCG
}
}
}
}

View File

@ -46,10 +46,9 @@ Shader "UI/Default-SoftMask"
Pass
{
Name "Default"
CGPROGRAM
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma target 2.0
#include "UnityCG.cginc"
#include "UnityUI.cginc"
@ -57,8 +56,8 @@ Shader "UI/Default-SoftMask"
#pragma multi_compile __ UNITY_UI_CLIP_RECT
#pragma multi_compile __ UNITY_UI_ALPHACLIP
#include "./../../SoftMask.cginc" // Add for soft mask
#pragma shader_feature __ SOFTMASK_EDITOR // Add for soft mask
#include "Packages/com.coffee.softmask-for-ugui/Shaders/SoftMask.cginc" // Add for soft mask
#pragma shader_feature __ SOFTMASK_EDITOR // Add for soft mask
struct appdata_t
{
@ -105,14 +104,14 @@ Shader "UI/Default-SoftMask"
color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect);
#ifdef UNITY_UI_ALPHACLIP
clip (color.a - 0.001);
clip (color.a - 0.001);
#endif
color.a *= SoftMask(IN.vertex, IN.worldPosition); // Add for soft mask
return color;
}
ENDCG
ENDCG
}
}
}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2a275d73f49bc4248bab92430d3f2915
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -127,7 +127,7 @@ SubShader {
#include "Assets/TextMesh Pro/Resources/Shaders/TMPro_Properties.cginc"
#include "Assets/TextMesh Pro/Resources/Shaders/TMPro.cginc"
#include "./../SoftMask.cginc"
#include "Packages/com.coffee.softmask-for-ugui/Shaders/SoftMask.cginc"
#pragma shader_feature __ SOFTMASK_EDITOR
struct vertex_t {

View File

@ -95,7 +95,7 @@ SubShader {
#include "UnityUI.cginc"
#include "Assets/TextMesh Pro/Resources/Shaders/TMPro_Properties.cginc"
#include "./../SoftMask.cginc"
#include "Packages/com.coffee.softmask-for-ugui/Shaders/SoftMask.cginc"
#pragma shader_feature __ SOFTMASK_EDITOR
struct vertex_t {

View File

@ -56,7 +56,7 @@ Shader "TextMeshPro/Sprite (SoftMaskable)"
#pragma multi_compile __ UNITY_UI_CLIP_RECT
#pragma multi_compile __ UNITY_UI_ALPHACLIP
#include "./../SoftMask.cginc"
#include "Packages/com.coffee.softmask-for-ugui/Shaders/SoftMask.cginc"
#pragma shader_feature __ SOFTMASK_EDITOR
struct appdata_t

Binary file not shown.

View File

@ -1,18 +1,29 @@
{
"name": "com.coffee.softmask-for-ugui",
"displayName": "Soft Mask For uGUI",
"description": "SoftMask is a smooth masking component for uGUI elements in Unity.\nBy using SoftMask instead of default Mask, rounded edges of UI elements can be expressed beautifully.",
"version": "0.9.1",
"displayName": "UI Soft Mask",
"description": "UI Soft Mask is a smooth masking component for Unity UI (uGUI) elements.\nBy using SoftMask instead of the default Mask component, you can beautifully represent the rounded edges of UI elements.",
"version": "0.10.0-preview.1",
"unity": "2017.1",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/mob-sakai/SoftMaskForUGUI.git"
},
"src": "Assets/Coffee/UIExtensions/SoftMaskForUGUI",
"author": "mob-sakai <sakai861104@gmail.com> (https://github.com/mob-sakai)",
"editorOnly": false,
"upmSupport": true,
"dependencies": {
}
"author": {
"name": "mob-sakai",
"email": "sakai861104@gmail.com",
"url": "https://github.com/mob-sakai"
},
"dependencies": {},
"keywords": [
"ui",
"softmask"
],
"samples": [
{
"displayName": "Demo",
"description": "UI Soft Mask Demo",
"path": "Samples~/Demo"
}
]
}