Compare commits

..

10 Commits

Author SHA1 Message Date
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
22 changed files with 201 additions and 135 deletions
+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
+35 -7
View File
@@ -1,9 +1,37 @@
---
name: Pull Request
about: Create a pull request
title: ''
assignees: mob-sakai
---
# Pull Request Template
**NOTE: Create a pull request to merge into `develop` branch**
## 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
+4 -4
View File
@@ -4,7 +4,7 @@ on:
workflow_dispatch:
inputs:
zip:
description: 'The url to the zip file'
description: "The url to the zip file"
required: true
jobs:
@@ -19,10 +19,10 @@ jobs:
run: |
curl -L ${{ github.event.inputs.zip }} -o _site.zip
unzip _site.zip -d _site
find _site -name __MACOSX -exec rm -rf {} \;
find _site -name __MACOSX | xargs rm -rf
- name: 📦 Upload '_site'
uses: actions/upload-pages-artifact@v2
uses: actions/upload-pages-artifact@v3
- name: 🚀 Deploy To GitHub Pages
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v4
+44 -23
View File
@@ -3,21 +3,21 @@
# UNITY_EMAIL: Unity user email to login
# UNITY_PASSWORD: Unity user password to login
name: 🧪 Test
run-name: 🧪 Test (${{ github.ref_name }})
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|2023.3)'
EXCLUDE_FILTER: "(2020.2.0|2021.1|2023.3)"
on:
workflow_dispatch:
inputs:
inputs:
usePeriodVersions:
description: 'Use the period versions (.0f1, .10f1, 20f1, ...).'
description: "Use the period versions (.0f1, .10f1, 20f1, ...)."
required: false
default: 'true'
default: "true"
push:
branches:
- develop
@@ -25,11 +25,14 @@ on:
tags:
- "!*"
paths-ignore:
- "*.md"
pull_request:
- "**.md"
pull_request_target:
types:
- opened
- reopened
- synchronize
paths-ignore:
- "**.md"
jobs:
setup:
@@ -56,10 +59,6 @@ jobs:
test:
name: 🧪 Run tests
runs-on: ubuntu-latest
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
permissions:
checks: write
contents: read
@@ -70,14 +69,29 @@ jobs:
matrix:
unityVersion: ${{ fromJson(needs.setup.outputs.unityVersions) }}
steps:
- name: 🚚 Checkout
- 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.sha }}
key: Library-${{ matrix.unityVersion }}-${{ github.event.pull_request.head.sha || github.sha }}
restore-keys: |
Library-${{ matrix.unityVersion }}-
Library-
@@ -90,14 +104,21 @@ jobs:
targetPlatform: StandaloneLinux64
allowDirtyBuild: true
customParameters: -nographics
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 }}
# coverageOptions: "dontClear;generateHtmlReport;generateBadgeReport;pathFilters:+**/Packages/src/**;assemblyFilters:+<packages>,-*.Editor,-*.Test"
- 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 }}
-8
View File
@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 7778bda1348584d92b6e1c762c341ea6
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+10
View File
@@ -1,3 +1,13 @@
## [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)
# [5.0.0](https://github.com/mob-sakai/UIEffect/compare/4.0.0...5.0.0) (2024-11-11)
File diff suppressed because one or more lines are too long
-8
View File
@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: ba0cc6c34514c480c878314286014b4a
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 4900000
userData:
assetBundleName:
assetBundleVariant:

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

@@ -98,7 +98,7 @@ TextureImporter:
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 1
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
+1 -1
View File
@@ -251,7 +251,7 @@ UIEffect supports TextMeshProUGUI elements. To use UIEffect with TextMeshPro, fo
1. First, you must import [TMP Essential Resources](https://docs.unity3d.com/Packages/com.unity.textmeshpro@3.0/manual/index.html#installation) before using.
![](https://github.com/user-attachments/assets/70653ccf-0b5e-4352-ac62-76bdd49c5f92)
2. Open the `Package Manager` window and select the `UI Soft Mask` package in the package list and click the `TextMeshPro Support > Import` button.
2. Open the `Package Manager` window and select the `UI Effect` package in the package list and click the `TextMeshPro Support > Import` button.
⚠️ If you are using `Unity 2023.2/6000.0+` or `TextMeshPro 3.2/4.0+`, click the `TextMeshPro Support (Unity 6) > Import` button instead.
![](https://github.com/user-attachments/assets/a1b246d3-3a0b-4a70-a9d2-3e75429fa757)
@@ -0,0 +1,76 @@
using System;
using System.Diagnostics;
using UnityEditor;
using UnityEngine;
using Object = UnityEngine.Object;
#if UNITY_EDITOR && UNITY_2021_2_OR_NEWER
using UnityEditor.SceneManagement;
#elif UNITY_EDITOR
using UnityEditor.Experimental.SceneManagement;
#endif
namespace Coffee.UIEffectInternal
{
internal static class Misc
{
public static T[] FindObjectsOfType<T>() where T : Object
{
#if UNITY_2023_1_OR_NEWER
return Object.FindObjectsByType<T>(FindObjectsInactive.Include, FindObjectsSortMode.None);
#else
return Object.FindObjectsOfType<T>();
#endif
}
public static void Destroy(Object obj)
{
if (!obj) return;
#if UNITY_EDITOR
if (!Application.isPlaying)
{
Object.DestroyImmediate(obj);
}
else
#endif
{
Object.Destroy(obj);
}
}
public static void DestroyImmediate(Object obj)
{
if (!obj) return;
#if UNITY_EDITOR
if (Application.isEditor)
{
Object.DestroyImmediate(obj);
}
else
#endif
{
Object.Destroy(obj);
}
}
[Conditional("UNITY_EDITOR")]
public static void SetDirty(Object obj)
{
#if UNITY_EDITOR
if (!obj) return;
EditorUtility.SetDirty(obj);
#endif
}
#if UNITY_EDITOR
public static T[] GetAllComponentsInPrefabStage<T>() where T : Component
{
if (!PrefabStageUtility.GetCurrentPrefabStage()) return Array.Empty<T>();
var prefabStage = PrefabStageUtility.GetCurrentPrefabStage();
if (!prefabStage) return Array.Empty<T>();
return prefabStage.prefabContentsRoot.GetComponentsInChildren<T>(true);
}
#endif
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b516f6b0a2e2542dab543c7ab4026245
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+1 -1
View File
@@ -5,7 +5,7 @@ MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {fileID: 617344605838670728, guid: ba0cc6c34514c480c878314286014b4a, type: 2}
icon: {fileID: 2800000, guid: 5b93acc4527c740459bbfbd3404191be, type: 3}
userData:
assetBundleName:
assetBundleVariant:
+3 -5
View File
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using Coffee.UIEffectInternal;
using UnityEngine;
@@ -245,11 +246,8 @@ namespace Coffee.UIEffects
if (Application.isBatchMode || BuildPipeline.isBuildingPlayer) return;
s_ShaderNameCache.Clear();
#if UNITY_2021_3 || UNITY_2022_2_OR_NEWER
foreach (var effect in FindObjectsByType<UIEffectBase>(FindObjectsSortMode.None))
#else
foreach (var effect in FindObjectsOfType<UIEffectBase>())
#endif
foreach (var effect in Misc.FindObjectsOfType<UIEffectBase>()
.Concat(Misc.GetAllComponentsInPrefabStage<UIEffectBase>()))
{
if (!effect.isActiveAndEnabled) continue;
if (!(effect.graphic is TextMeshProUGUI tmp) || !tmp.isActiveAndEnabled) continue;
@@ -5,7 +5,7 @@ MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {fileID: 617344605838670728, guid: ba0cc6c34514c480c878314286014b4a, type: 2}
icon: {fileID: 2800000, guid: 5b93acc4527c740459bbfbd3404191be, type: 3}
userData:
assetBundleName:
assetBundleVariant:
+1 -1
View File
@@ -5,7 +5,7 @@ MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {fileID: 617344605838670728, guid: ba0cc6c34514c480c878314286014b4a, type: 2}
icon: {fileID: 2800000, guid: 5b93acc4527c740459bbfbd3404191be, type: 3}
userData:
assetBundleName:
assetBundleVariant:
+1 -1
View File
@@ -5,7 +5,7 @@ MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {fileID: 617344605838670728, guid: ba0cc6c34514c480c878314286014b4a, type: 2}
icon: {fileID: 2800000, guid: 5b93acc4527c740459bbfbd3404191be, type: 3}
userData:
assetBundleName:
assetBundleVariant:
@@ -275,7 +275,7 @@ SubShader {
float c = tex2D(_MainTex, input.atlas + uvMove).a;
#ifndef UNDERLAY_ON
clip(c - input.param.x);
c *= step(input.param.x, c);
#endif
float scale = input.param.y;
@@ -298,7 +298,7 @@ SubShader {
#if BEVEL_ON
float3 dxy = float3(0.5 / _TextureWidth, 0.5 / _TextureHeight, 0);
float3 n = GetSurfaceNormal(input.atlas, weight, dxy);
float3 n = GetSurfaceNormal(input.atlas + uvMove, weight, dxy);
float3 bump = UnpackNormal(tex2D(_BumpMap, input.textures.xy + float2(_FaceUVSpeedX, _FaceUVSpeedY) * _Time.y)).xyz;
bump *= lerp(_BumpFace, _BumpOutline, saturate(sd + outline * 0.5));
@@ -330,16 +330,6 @@ SubShader {
faceColor.rgb += glowColor.rgb * glowColor.a;
#endif
// Alternative implementation to UnityGet2DClipping with support for softness.
#if UNITY_UI_CLIP_RECT
half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(input.mask.xy)) * input.mask.zw);
faceColor *= m.x * m.y;
#endif
#if UNITY_UI_ALPHACLIP
clip(faceColor.a - 0.001);
#endif
return faceColor * input.color.a;
}
#define UIEFFECT_TEXTMESHPRO 1
@@ -267,8 +267,7 @@ SubShader {
float c = tex2D(_MainTex, input.atlas + uvMove).a;
#ifndef UNDERLAY_ON
if (c - input.param.x < 0)
return fixed4(0,0,0,0);
c *= step(input.param.x, c);
#endif
float scale = input.param.y;
@@ -291,7 +290,7 @@ SubShader {
#if BEVEL_ON
float3 dxy = float3(0.5 / _TextureWidth, 0.5 / _TextureHeight, 0);
float3 n = GetSurfaceNormal(input.atlas, weight, dxy);
float3 n = GetSurfaceNormal(input.atlas + uvMove, weight, dxy);
float3 bump = UnpackNormal(tex2D(_BumpMap, input.textures.xy + float2(_FaceUVSpeedX, _FaceUVSpeedY) * _Time.y)).xyz;
bump *= lerp(_BumpFace, _BumpOutline, saturate(sd + outline * 0.5));
+1 -1
View File
@@ -300,7 +300,7 @@ half4 apply_transition_filter(half4 color, const float alpha)
}
#elif TRANSITION_CUTOFF // Transition.Cutoff
{
color *= step(0.001, color.a * alpha - _TransitionRate);
color *= step(0.001, alpha - _TransitionRate);
}
// Transition.Dissolve/Shiny/ShinyOnly/Melt
#elif TRANSITION_DISSOLVE || TRANSITION_SHINY || TRANSITION_MASK || TRANSITION_MELT || TRANSITION_BURN
+1 -1
View File
@@ -2,7 +2,7 @@
"name": "com.coffee.ui-effect",
"displayName": "UI Effect",
"description": "UIEffect is an open-source package that allows you to intuitively apply rich UI effects directly from the Inspector or via code.\nCombine various filters, such as grayscale, blur, and dissolve, to decorate your UI with a unique visual style!",
"version": "5.0.0",
"version": "5.0.1",
"unity": "2020.3",
"license": "MIT",
"repository": {