Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2f9b0ff512 | ||
|
|
fbba140fd6 | ||
|
|
b2ce5637a0 | ||
|
|
b589f2a385 | ||
|
|
e279c4230e | ||
|
|
61b7c4da73 | ||
|
|
98c43fc193 | ||
|
|
4b843ea337 |
@@ -15,22 +15,39 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
NODE_AUTH_TOKEN: ${{ secrets.SHRINKSDK_PACKAGE_TOKEN }}
|
NODE_AUTH_TOKEN: ${{ secrets.SHRINKSDK_PACKAGE_TOKEN }}
|
||||||
steps:
|
steps:
|
||||||
- name: Fetch tagged revision
|
- name: Fetch exact tagged release archive
|
||||||
|
env:
|
||||||
|
GITEA_REF: ${{ gitea.ref }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
ref="${{ gitea.sha }}"
|
tag="${GITEA_REF#refs/tags/}"
|
||||||
test -n "$ref"
|
case "$tag" in
|
||||||
git init .
|
v[0-9]*) ;;
|
||||||
git remote add origin "https://git.crash.work/ShrinkSDK/ShrinkTutorial.git"
|
*) echo "Expected a version tag ref, got: $GITEA_REF" >&2; exit 1 ;;
|
||||||
git fetch --depth=1 origin "$ref"
|
esac
|
||||||
git checkout --detach FETCH_HEAD
|
export SHRINKSDK_ARCHIVE_URL="https://git.crash.work/ShrinkSDK/ShrinkTutorial/archive/${tag}.tar.gz"
|
||||||
|
node --input-type=module <<'NODE'
|
||||||
|
import { writeFile } from 'node:fs/promises';
|
||||||
|
|
||||||
|
const response = await fetch(process.env.SHRINKSDK_ARCHIVE_URL);
|
||||||
|
if (!response.ok) {
|
||||||
|
throw new Error(`Release archive download failed: ${response.status} ${response.statusText}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
await writeFile('release.tar.gz', new Uint8Array(await response.arrayBuffer()));
|
||||||
|
NODE
|
||||||
|
mkdir release
|
||||||
|
tar -xzf release.tar.gz --strip-components=1 -C release
|
||||||
|
rm -f release.tar.gz
|
||||||
|
printf '%s' "$tag" > release/.shrink-sdk-release-tag
|
||||||
|
|
||||||
- name: Validate immutable release version
|
- name: Validate immutable release version
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
tag="$(git describe --exact-match --tags HEAD)"
|
cd release
|
||||||
|
tag="$(cat .shrink-sdk-release-tag)"
|
||||||
version="$(node -p "require('./package.json').version")"
|
version="$(node -p "require('./package.json').version")"
|
||||||
test "$tag" = "v$version"
|
test "$tag" = "v$version"
|
||||||
npm pack --dry-run
|
npm pack --dry-run
|
||||||
@@ -40,10 +57,11 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
: "${NODE_AUTH_TOKEN:?SHRINKSDK_PACKAGE_TOKEN is required}"
|
: "${NODE_AUTH_TOKEN:?SHRINKSDK_PACKAGE_TOKEN is required}"
|
||||||
|
cd release
|
||||||
npmrc="$HOME/.npmrc"
|
npmrc="$HOME/.npmrc"
|
||||||
cleanup() { rm -f "$npmrc"; }
|
cleanup() { rm -f "$npmrc"; }
|
||||||
trap cleanup EXIT
|
trap cleanup EXIT
|
||||||
printf '%s\n' \
|
printf '%s\n' \
|
||||||
'registry=https://git.crash.work/api/packages/ShrinkSDK/npm/' \
|
'registry=https://git.crash.work/api/packages/ShrinkSDK/npm/' \
|
||||||
'//git.crash.work/api/packages/ShrinkSDK/npm/:_authToken=${NODE_AUTH_TOKEN}' > "$npmrc"
|
'//git.crash.work/api/packages/ShrinkSDK/npm/:_authToken=${NODE_AUTH_TOKEN}' > "$npmrc"
|
||||||
npm publish --registry=https://git.crash.work/api/packages/ShrinkSDK/npm/
|
npm publish --registry=https://git.crash.work/api/packages/ShrinkSDK/npm/
|
||||||
|
|||||||
@@ -26,12 +26,17 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
|
machine_id_file="/root/.local/share/unity3d/Unity/.machine-id"
|
||||||
|
if test -s "$machine_id_file"; then
|
||||||
|
cat "$machine_id_file" > /etc/machine-id
|
||||||
|
echo "Unity machine identity restored"
|
||||||
|
fi
|
||||||
|
git config --global url."https://ghfast.top/https://github.com/".insteadOf "https://github.com/"
|
||||||
unity_bin="$(command -v unity-editor || command -v unity || command -v Unity || true)"
|
unity_bin="$(command -v unity-editor || command -v unity || command -v Unity || true)"
|
||||||
test -n "$unity_bin"
|
test -n "$unity_bin"
|
||||||
"$unity_bin" \
|
"$unity_bin" \
|
||||||
-batchmode \
|
-batchmode \
|
||||||
-nographics \
|
-nographics \
|
||||||
-quit \
|
|
||||||
-projectPath "$PWD/Development~/UnityProject" \
|
-projectPath "$PWD/Development~/UnityProject" \
|
||||||
-runTests \
|
-runTests \
|
||||||
-testPlatform EditMode \
|
-testPlatform EditMode \
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 0.1.1
|
||||||
|
|
||||||
|
- 声明 `JsonUtility` 所需的 Unity JSON Serialize 模块,使包可在最小消费者项目中独立解析与编译。
|
||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
- 修复 `ClickTarget` 对 UI 目标过早在按下阶段完成的问题,改为等待指针释放并确认 EventSystem 射线真实命中目标后再过步。
|
- 修复 `ClickTarget` 对 UI 目标过早在按下阶段完成的问题,改为等待指针释放并确认 EventSystem 射线真实命中目标后再过步。
|
||||||
|
|||||||
@@ -11,5 +11,8 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.unity.test-framework": "1.1.33",
|
"com.unity.test-framework": "1.1.33",
|
||||||
"com.cneicy.shrink-tutorial": "file:../../.."
|
"com.cneicy.shrink-tutorial": "file:../../.."
|
||||||
}
|
},
|
||||||
|
"testables": [
|
||||||
|
"com.cneicy.shrink-tutorial"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -104,12 +104,6 @@ namespace ShrinkTutorial.Editor
|
|||||||
Debug.Log("[ShrinkTutorial] Sample scene created: Assets/Scenes/ShrinkTutorialSample.unity");
|
Debug.Log("[ShrinkTutorial] Sample scene created: Assets/Scenes/ShrinkTutorialSample.unity");
|
||||||
}
|
}
|
||||||
|
|
||||||
[MenuItem("ShrinkSDK/Tutorial/Create Sample Scene")]
|
|
||||||
public static void BuildSampleSceneAlias()
|
|
||||||
{
|
|
||||||
BuildSampleScene();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static ShrinkTutorialSettings EnsureSettings()
|
private static ShrinkTutorialSettings EnsureSettings()
|
||||||
{
|
{
|
||||||
var settings = AssetDatabase.LoadAssetAtPath<ShrinkTutorialSettings>(SettingsPath);
|
var settings = AssetDatabase.LoadAssetAtPath<ShrinkTutorialSettings>(SettingsPath);
|
||||||
|
|||||||
@@ -22,12 +22,6 @@ namespace ShrinkTutorial.Editor
|
|||||||
window.Show();
|
window.Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
[MenuItem("ShrinkSDK/Tutorial/Editor")]
|
|
||||||
public static void ShowWindowAlias()
|
|
||||||
{
|
|
||||||
ShowWindow();
|
|
||||||
}
|
|
||||||
|
|
||||||
[MenuItem("ShrinkSDK/引导/重置教程进度")]
|
[MenuItem("ShrinkSDK/引导/重置教程进度")]
|
||||||
public static void ResetProgress()
|
public static void ResetProgress()
|
||||||
{
|
{
|
||||||
@@ -37,12 +31,6 @@ namespace ShrinkTutorial.Editor
|
|||||||
Debug.Log("[ShrinkTutorial] 已重置教程进度。");
|
Debug.Log("[ShrinkTutorial] 已重置教程进度。");
|
||||||
}
|
}
|
||||||
|
|
||||||
[MenuItem("ShrinkSDK/Tutorial/Reset Progress")]
|
|
||||||
public static void ResetProgressAlias()
|
|
||||||
{
|
|
||||||
ResetProgress();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnEnable()
|
private void OnEnable()
|
||||||
{
|
{
|
||||||
TryAssignDefaultDatabase();
|
TryAssignDefaultDatabase();
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ using UnityEngine;
|
|||||||
|
|
||||||
namespace ShrinkTutorial
|
namespace ShrinkTutorial
|
||||||
{
|
{
|
||||||
[CreateAssetMenu(fileName = "ShrinkTutorialData", menuName = "ShrinkTutorial/Tutorial Data")]
|
[CreateAssetMenu(fileName = "ShrinkTutorialData", menuName = "ShrinkSDK/引导/教程数据")]
|
||||||
public class ShrinkTutorialData : ScriptableObject
|
public class ShrinkTutorialData : ScriptableObject
|
||||||
{
|
{
|
||||||
public string tutorialId = string.Empty;
|
public string tutorialId = string.Empty;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ using UnityEngine;
|
|||||||
|
|
||||||
namespace ShrinkTutorial
|
namespace ShrinkTutorial
|
||||||
{
|
{
|
||||||
[CreateAssetMenu(fileName = "ShrinkTutorialDatabase", menuName = "ShrinkTutorial/Tutorial Database")]
|
[CreateAssetMenu(fileName = "ShrinkTutorialDatabase", menuName = "ShrinkSDK/引导/教程数据库")]
|
||||||
public class ShrinkTutorialDatabase : ScriptableObject
|
public class ShrinkTutorialDatabase : ScriptableObject
|
||||||
{
|
{
|
||||||
[SerializeField] private List<ShrinkTutorialData> tutorials = new();
|
[SerializeField] private List<ShrinkTutorialData> tutorials = new();
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using UnityEngine;
|
|||||||
|
|
||||||
namespace ShrinkTutorial
|
namespace ShrinkTutorial
|
||||||
{
|
{
|
||||||
[CreateAssetMenu(fileName = "ShrinkTutorialSettings", menuName = "ShrinkTutorial/Settings")]
|
[CreateAssetMenu(fileName = "ShrinkTutorialSettings", menuName = "ShrinkSDK/引导/引导设置")]
|
||||||
public class ShrinkTutorialSettings : ScriptableObject
|
public class ShrinkTutorialSettings : ScriptableObject
|
||||||
{
|
{
|
||||||
private static ShrinkTutorialSettings _instance;
|
private static ShrinkTutorialSettings _instance;
|
||||||
|
|||||||
+3
-2
@@ -1,13 +1,14 @@
|
|||||||
{
|
{
|
||||||
"name": "com.cneicy.shrink-tutorial",
|
"name": "com.cneicy.shrink-tutorial",
|
||||||
"version": "0.1.0",
|
"version": "0.1.2",
|
||||||
"displayName": "ShrinkTutorial",
|
"displayName": "ShrinkTutorial",
|
||||||
"description": "面向 Unity 的互动式新手引导系统,提供数据驱动教程、遮罩挖洞、动态锚点、步骤条件与运行时调度。",
|
"description": "面向 Unity 的互动式新手引导系统,提供数据驱动教程、遮罩挖洞、动态锚点、步骤条件与运行时调度。",
|
||||||
"unity": "2022.3",
|
"unity": "2022.3",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.unity.textmeshpro": "3.0.7",
|
"com.unity.textmeshpro": "3.0.7",
|
||||||
"com.unity.ugui": "1.0.0",
|
"com.unity.ugui": "1.0.0",
|
||||||
"com.unity.modules.physics": "1.0.0"
|
"com.unity.modules.physics": "1.0.0",
|
||||||
|
"com.unity.modules.jsonserialize": "1.0.0"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tutorial",
|
"tutorial",
|
||||||
|
|||||||
Reference in New Issue
Block a user