Skip to content

Commit

Permalink
Merge pull request #247 from anatawa12/change-component-folder-name
Browse files Browse the repository at this point in the history
chore: move every components into `Avatar Optimizer/` folder
  • Loading branch information
anatawa12 authored Jun 28, 2023
2 parents a2b30de + 13e5fdf commit 415c979
Show file tree
Hide file tree
Showing 13 changed files with 47 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG-PRERELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ The format is based on [Keep a Changelog].
### Added

### Changed
- Move Components into `Avatar Optimizer` folder `#247`
- Previously they are `Optimizer` folder

### Deprecated

Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ The format is based on [Keep a Changelog].
### Added

### Changed
- Move Components into `Avatar Optimizer` folder `#247`
- Previously they are `Optimizer` folder

### Deprecated

Expand Down
2 changes: 1 addition & 1 deletion Runtime/ClearEndpointPosition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Anatawa12.AvatarOptimizer
{
[AddComponentMenu("Optimizer/Clear Endpoint Position")]
[AddComponentMenu("Avatar Optimizer/Clear Endpoint Position")]
[RequireComponent(typeof(VRCPhysBoneBase))]
internal class ClearEndpointPosition : AvatarTagComponent
{
Expand Down
2 changes: 1 addition & 1 deletion Runtime/FreezeBlendShape.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Anatawa12.AvatarOptimizer
{
[AddComponentMenu("Optimizer/Freeze BlendShapes")]
[AddComponentMenu("Avatar Optimizer/Freeze BlendShapes")]
[DisallowMultipleComponent]
internal class FreezeBlendShape : EditSkinnedMeshComponent
{
Expand Down
2 changes: 2 additions & 0 deletions Runtime/MakeChildren.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using CustomLocalization4EditorExtension;
using UnityEngine;

namespace Anatawa12.AvatarOptimizer
{
[AddComponentMenu("Avatar Optimizer/Make Children")]
internal class MakeChildren : AvatarTagComponent
{
[CL4EELocalized("MakeChildren:prop:children")]
Expand Down
2 changes: 1 addition & 1 deletion Runtime/MergeBone.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Anatawa12.AvatarOptimizer
{
[AddComponentMenu("Optimizer/Merge Bone")]
[AddComponentMenu("Avatar Optimizer/Merge Bone")]
[DisallowMultipleComponent]
internal class MergeBone : AvatarTagComponent
{ }
Expand Down
2 changes: 1 addition & 1 deletion Runtime/MergePhysBone.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Anatawa12.AvatarOptimizer
{
[AddComponentMenu("Optimizer/Merge PhysBone")]
[AddComponentMenu("Avatar Optimizer/Merge PhysBone")]
[DisallowMultipleComponent]
[ExecuteAlways]
internal class MergePhysBone : AvatarTagComponent, IStaticValidated
Expand Down
2 changes: 1 addition & 1 deletion Runtime/MergeSkinnedMesh.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Anatawa12.AvatarOptimizer
{
[AddComponentMenu("Optimizer/Merge Skinned Mesh")]
[AddComponentMenu("Avatar Optimizer/Merge Skinned Mesh")]
[RequireComponent(typeof(SkinnedMeshRenderer))]
[DisallowMultipleComponent]
internal class MergeSkinnedMesh : EditSkinnedMeshComponent, IStaticValidated
Expand Down
2 changes: 1 addition & 1 deletion Runtime/MergeToonLitMaterial.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Anatawa12.AvatarOptimizer
{
[AddComponentMenu("Optimizer/Merge Toon Lit Material")]
[AddComponentMenu("Avatar Optimizer/Merge Toon Lit Material")]
internal class MergeToonLitMaterial : EditSkinnedMeshComponent
{
public MergeInfo[] merges = Array.Empty<MergeInfo>();
Expand Down
2 changes: 1 addition & 1 deletion Runtime/RemoveMeshInBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Anatawa12.AvatarOptimizer
{
[AddComponentMenu("Optimizer/Remove Mesh in Box")]
[AddComponentMenu("Avatar Optimizer/Remove Mesh in Box")]
[RequireComponent(typeof(SkinnedMeshRenderer))]
[DisallowMultipleComponent]
internal class RemoveMeshInBox : EditSkinnedMeshComponent
Expand Down
2 changes: 1 addition & 1 deletion Runtime/UnusedBonesByReferencesTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Anatawa12.AvatarOptimizer
{
[AddComponentMenu("Optimizer/UnusedBonesByReferencesTool")]
[AddComponentMenu("Avatar Optimizer/UnusedBonesByReferencesTool")]
[DisallowMultipleComponent]
internal class UnusedBonesByReferencesTool : AvatarGlobalComponent
{
Expand Down
30 changes: 30 additions & 0 deletions Test~/AddComponentMenuTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using NUnit.Framework;
using UnityEngine;

namespace Anatawa12.AvatarOptimizer.Test
{
public class AddComponentMenuTest
{
[Test]
[TestCaseSource(nameof(ComponentTypes))]
public void CheckAddComponentMenuIsInAvatarOptimizer(Type type)
{
var addComponentMenu = type.GetCustomAttribute<AddComponentMenu>();
Assert.That(addComponentMenu, Is.Not.Null);
Assert.That(addComponentMenu.componentMenu, Does.StartWith("Avatar Optimizer/").Or.Empty);
}

static IEnumerable<Type> ComponentTypes()
{
return
typeof(AvatarTagComponent).Assembly
.GetTypes()
.Where(x => x.IsClass && !x.IsAbstract)
.Where(x => typeof(MonoBehaviour).IsAssignableFrom(x));
}
}
}
3 changes: 3 additions & 0 deletions Test~/AddComponentMenuTest.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 415c979

Please sign in to comment.