Skip to content

Commit

Permalink
Merge pull request #135 from ReinaS-64892/v0.3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
ReinaS-64892 authored Sep 8, 2023
2 parents 3bd7300 + 004b150 commit 5482c8d
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/UpdatePackageJsonPlasTag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ jobs:
withoutvtagstr=`echo ${{ github.event.inputs.tag }} | sed -e "s/^v//"`
jq ".version|=\"${withoutvtagstr}\"" ./package.json > $tempjson
mv $tempjson ./package.json
- name: Upload-artifact
uses: actions/upload-artifact@v3
with:
name: package.json
path: ./package.json
- name: git commit
run: |
git config user.name "GitHub Action"
Expand Down
30 changes: 23 additions & 7 deletions .github/workflows/UpdateVersion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,28 @@ jobs:
steps:
- run: echo "HELLO MAIN"
call-Update:
needs: [StartPoint]
uses: ./.github/workflows/UpdatePackageJsonPlasTag.yml
with:
tag: ${{ github.event.inputs.tag }}
needs: [StartPoint]
uses: ./.github/workflows/UpdatePackageJsonPlasTag.yml
with:
tag: ${{ github.event.inputs.tag }}
call-TagToZip:
needs: [call-Update]
uses: ./.github/workflows/TagToZip.yml
needs: [call-Update]
uses: ./.github/workflows/TagToZip.yml
with:
tag: ${{ github.event.inputs.tag }}
Create-Release-Draft:
needs: [call-TagToZip]
runs-on: ubuntu-20.04
steps:
- uses: actions/download-artifact@v3
with:
name:
path: ./
- uses: softprops/action-gh-release@v1
with:
tag: ${{ github.event.inputs.tag }}
name: ${{ github.event.inputs.tag }}
tag_name: ${{ github.event.inputs.tag }}
draft: true
files: |
./tex-trans-tool-${{ github.event.inputs.tag }}
./package.json
22 changes: 20 additions & 2 deletions Runtime/Build/AvatarDomainDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,26 @@ public virtual AvatarDomain GetDomain(GameObject avatar, UnityEngine.Object Over
public virtual void Apply(GameObject avatar = null, UnityEngine.Object OverrideAssetContainer = null)
{
var texTransGroup = TexTransGroup;
if (texTransGroup == null) return;
if (texTransGroup.IsApply) return;
if (texTransGroup == null)
{
Debug.LogWarning("AvatarDomainDefinition : texTransGroupが存在しません。通常ではありえないエラーです。");
return;
}
if (!texTransGroup.IsPossibleApply)
{
Debug.LogWarning("AvatarDomainDefinition : このグループ内のどれかがプレビューできる状態ではないため実行できません。");
return;
}
if (texTransGroup.IsApply)
{
Debug.LogWarning("AvatarDomainDefinition : すでにこのコンポーネントでプレビュー状態のため実行できません。");
return;
}
if (TexTransGroupValidationUtils.SelfCallApplyExists(texTransGroup.Targets))
{
Debug.LogWarning("AvatarDomainDefinition : すでにプレビュー状態のものが存在しているためこのグループのプレビューはできません。すでにプレビューされている物を解除してください。");
return;
}
if (avatar == null && Avatar == null) return;
if (avatar == null) avatar = Avatar;
TexTransGroupValidationUtils.ValidateTexTransGroup(texTransGroup);
Expand Down
17 changes: 15 additions & 2 deletions Runtime/TexTransGroup/AbstractTexTransGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,21 @@ public abstract class AbstractTexTransGroup : TextureTransformer

public override void Apply(AvatarDomain AvatarMaterialDomain = null)
{
if (!IsPossibleApply) return;
if (_IsApply) return;
if (!IsPossibleApply)
{
Debug.LogWarning("TexTransGroup : このグループ内のどれかがプレビューできる状態ではないため実行できません。");
return;
}
if (_IsApply)
{
Debug.LogWarning("TexTransGroup : すでにこのコンポーネントでプレビュー状態のため実行できません。");
return;
}
if (TexTransGroupValidationUtils.SelfCallApplyExists(Targets))
{
Debug.LogWarning("TexTransGroup : すでにプレビュー状態のものが存在しているためこのグループのプレビューはできません。すでにプレビューされている物を解除してください。");
return;
}
_IsApply = true;
try
{
Expand Down
30 changes: 30 additions & 0 deletions Runtime/TexTransGroupValidationUtili.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,36 @@ private static void CollectTexTransForms(IEnumerable<TextureTransformer> tTFs, D
}
}
}

public static bool SelfCallApplyExists(IEnumerable<TextureTransformer> tTFs)
{
foreach (var tf in tTFs)
{
if (tf.IsApply && tf.IsSelfCallApply)
{
return true;
}
else
{
switch (tf)
{
default:
{
break;
}
case AbstractTexTransGroup abstractTexTransGroup:
{
if (SelfCallApplyExists(abstractTexTransGroup.Targets))
{
return true;
}
break;
}
}
}
}
return false;
}
}
}

Expand Down

0 comments on commit 5482c8d

Please sign in to comment.