Skip to content

Commit d6d0716

Browse files
committed
- Added test github workflow
- Updated extension for LICENSE - Added CHANGELOG.md to keep track of changes - Renamed TextTransition to TransitionEffect - Added abstract layer in-between Tag and Transition components within MotionProfile - Removed the ability to add new components from MotionCollection to move it into the MotionProfile Editor script - Renamed MotionEffectRegistry to MotionComponentRegistry - Improved MotionCollection API and documentation - Moved and renamed Resources folder to Icons inside Editor folder
1 parent 5291730 commit d6d0716

26 files changed

+231
-134
lines changed

.github/workflows/main.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: "Run Tests"
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test-package:
7+
name: build the project
8+
runs-on: ubuntu-latest
9+
steps:
10+
11+
#Checkout
12+
- name: Checkout repository
13+
uses: actions/checkout@v4
14+
with:
15+
lfs: true
16+
17+
#Cache
18+
- uses: actions/cache@v4
19+
with:
20+
path: Library
21+
key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
22+
restore-keys: |
23+
Library-
24+
25+
# Test
26+
- name: Run tests
27+
uses: game-ci/unity-test-runner@v4
28+
env:
29+
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
30+
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
31+
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
32+
with:
33+
githubToken: ${{ secrets.GITHUB_TOKEN }}

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# CHANGELOG
2+
No major version has been released yet

ToDo.md.meta renamed to CHANGELOG.md.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<engine:UXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:engine="UnityEngine.UIElements" xmlns:editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="False">
22
<engine:VisualElement style="flex-grow: 1;">
33
<engine:VisualElement name="elements-list" />
4-
<engine:Button text="Add" name="add-element-button" />
54
</engine:VisualElement>
65
</engine:UXML>

Editor/MotionCollection/MotionCollectionEditor.cs

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using BP.TextMotion;
2-
using System.Linq;
32
using System.Reflection;
43
using UnityEditor;
54
using UnityEditor.UIElements;
@@ -77,42 +76,6 @@ void UpdateBody()
7776
}
7877
}
7978

80-
addButton.clicked += () =>
81-
{
82-
var menu = new GenericMenu();
83-
var registry = MotionEffectRegistry.Components;
84-
foreach (var entry in registry)
85-
{
86-
if (Enumerable
87-
.Range(0, listProp.arraySize)
88-
.Select(i => listProp.GetArrayElementAtIndex(i).objectReferenceValue)
89-
.Any(obj => obj != null && obj.GetType() == entry.Type))
90-
{
91-
continue;
92-
}
93-
94-
menu.AddItem(new GUIContent(entry.DisplayName), false, () =>
95-
{
96-
var listTarget = property.serializedObject.targetObject as ScriptableObject;
97-
Undo.RecordObject(listTarget, "Add Component");
98-
99-
var inst = ScriptableObject.CreateInstance(entry.Type);
100-
inst.hideFlags = HideFlags.HideInInspector | HideFlags.HideInHierarchy;
101-
102-
AssetDatabase.AddObjectToAsset(inst,
103-
AssetDatabase.GetAssetPath(listTarget));
104-
105-
listProp.arraySize++;
106-
var newElem = listProp.GetArrayElementAtIndex(listProp.arraySize - 1);
107-
newElem.objectReferenceValue = inst;
108-
property.serializedObject.ApplyModifiedProperties();
109-
110-
RefreshList();
111-
});
112-
}
113-
menu.ShowAsContext();
114-
};
115-
11679
RefreshList();
11780
return root;
11881
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ public MotionComponentDescriptor(Type type, string displayName, TextMotionRole r
2626
}
2727

2828
[InitializeOnLoad]
29-
internal static class MotionEffectRegistry
29+
internal static class MotionComponentRegistry
3030
{
3131
public static readonly List<MotionComponentDescriptor> Components = new();
32-
static MotionEffectRegistry() => Init();
32+
static MotionComponentRegistry() => Init();
3333

3434
public static void Init()
3535
{

0 commit comments

Comments
 (0)