Skip to content

Commit d408bd5

Browse files
committed
Complete project overhaul
- Renamed to Aftertone - Switched to chain architecture for ease of use - Updated and improved custom editors - Added transform tracking to ToneHandle - Added custom aftertone icon
1 parent d03b685 commit d408bd5

File tree

90 files changed

+1415
-1956
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+1415
-1956
lines changed

.github/workflows/release.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Build and upload artifact
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
workflow_dispatch:
8+
9+
jobs:
10+
build-package:
11+
name: Build and export package
12+
runs-on: ubuntu-latest
13+
steps:
14+
15+
#Checkout
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
with:
19+
lfs: true
20+
21+
# Read package name and version from package.json
22+
- name: Get package name and version
23+
id: pkg
24+
run: |
25+
PKG_NAME=$(jq -r '.name' ./package.json)
26+
PKG_VERSION=$(jq -r '.version' ./package.json)
27+
PKG_FILENAME="$(basename $PKG_NAME)-$PKG_VERSION.tgz"
28+
echo "pkg_name=$PKG_NAME" >> $GITHUB_OUTPUT
29+
echo "pkg_version=$PKG_VERSION" >> $GITHUB_OUTPUT
30+
echo "pkg_filename=$PKG_FILENAME" >> $GITHUB_OUTPUT
31+
32+
# Create .tgz tarball of the package folder
33+
- name: Pack UPM package
34+
run: |
35+
tar -czf "../${{ steps.pkg.outputs.pkg_filename }}" *
36+
37+
- name: Create Release
38+
uses: softprops/action-gh-release@v2
39+
with:
40+
files: ${{ steps.pkg.outputs.pkg_filename }}
41+
tag_name: ${{ github.ref_name }}
42+
name: Release ${{ steps.pkg.outputs.pkg_version }}
43+
body: |
44+
🎉 New release of ${{ steps.pkg.outputs.pkg_name }}
45+
Version: ${{ steps.pkg.outputs.pkg_version }}
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: "Run Tests"
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- "README.md"
7+
- "CHANGELOG.md"
8+
- ".github/**"
9+
- "Samples/**"
10+
11+
jobs:
12+
test-package:
13+
name: Test the package
14+
runs-on: ubuntu-latest
15+
steps:
16+
17+
#Checkout
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
with:
21+
lfs: true
22+
23+
# Move the package to a subdirectory
24+
- name: Move package to subdirectory
25+
run: |
26+
mkdir -p unity-package
27+
shopt -s extglob
28+
mv !(unity-package) unity-package/
29+
shopt -u extglob
30+
31+
# Test
32+
- name: Run tests
33+
uses: game-ci/unity-test-runner@v4
34+
env:
35+
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
36+
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
37+
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
38+
with:
39+
packageMode: true
40+
projectPath: unity-package
41+
githubToken: ${{ secrets.GITHUB_TOKEN }}
42+
unityVersion: ${{ vars.UNITY_VERSION }}

Editor/Aftertone-Icon.png

31.2 KB
Loading

Editor/Aftertone-Icon.png.meta

Lines changed: 217 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Editor/AftertoneEditor.cs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
using UnityEditor;
2+
using UnityEngine;
3+
4+
namespace BP.Aftertone.Editor
5+
{
6+
[InitializeOnLoad]
7+
public static class AftertoneEditor
8+
{
9+
static AftertoneEditor()
10+
{
11+
AftertoneUtil.LoadOrCreateConfig(Aftertone.ConfigPath, Aftertone.ConfigName);
12+
}
13+
14+
[MenuItem("CONTEXT/AudioSource/Convert To Aftertone")]
15+
public static void BoxSource(MenuCommand command)
16+
{
17+
if (command.context is not AudioSource target)
18+
return;
19+
20+
string path = EditorUtility.SaveFilePanelInProject("Save Asset", "ToneAsset", "asset", "");
21+
if (string.IsNullOrEmpty(path)) return;
22+
23+
var newAsset = ScriptableObject.CreateInstance<ToneAsset>();
24+
newAsset.CopyFromSource(target);
25+
26+
AssetDatabase.CreateAsset(newAsset, path);
27+
AssetDatabase.SaveAssets();
28+
29+
var snapSource = target.gameObject.AddComponent<AftertoneSource>();
30+
snapSource.Asset = newAsset;
31+
target.clip = null;
32+
Object.DestroyImmediate(target);
33+
}
34+
35+
[MenuItem("GameObject/Audio/Aftertone Source")]
36+
public static void CreateAftertoneSource(MenuCommand menuCommand)
37+
{
38+
var go = new GameObject("Aftertone Source", typeof(AftertoneSource));
39+
GameObjectUtility.SetParentAndAlign(go, menuCommand.context as GameObject);
40+
Undo.RegisterCreatedObjectUndo(go, "Create " + go.name);
41+
Selection.activeObject = go;
42+
}
43+
}
44+
}

Editor/AftertoneEditor.cs.meta

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)