init
Some checks failed
Sync Github To Image / sync-gitlink (push) Has been cancelled
Sync Github To Image / sync-gitlab (push) Has been cancelled
Sync Github To Image / sync-gitee (push) Has been cancelled
Sync Github To Image / sync-atomgit (push) Has been cancelled
Sync Github To Image / sync-gitcode (push) Has been cancelled
Sync Github To Image / sync-framagit (push) Has been cancelled

This commit is contained in:
陈思海 2025-01-09 14:22:37 +08:00
commit 3cdda73eac
23 changed files with 2173 additions and 0 deletions

51
.github/workflows/publish-release.yml vendored Normal file
View File

@ -0,0 +1,51 @@
name: Publish Release
on:
push:
tags:
- '*'
# branches: [main]
#schedule:
# 定时任务,每天 UTC 时间 0 点运行
#- cron: "0 0 * * *"
#workflow_dispatch:
permissions: # Global permissions configuration starts here
contents: read # 'read' access to repository contents
pull-requests: write # 'write' access to pull requests
jobs:
tags:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # 为了 git pull --unshallow我们需要获取所有的提交历史
- name: Set up Git user
run: |
git config --global user.email "wangfj11@foxmail.com"
git config --global user.name "AlianBlank"
- name: "✏️ Generate release changelog"
uses: heinrichreimer/action-github-changelog-generator@v2.3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Commit CHANGELOG.md
run: |
git add CHANGELOG.md
git commit -m "[修改]1.修改更新日志"
- name: change-version-by-tag
uses: AlianBlank/github-action-tag-version@1.0.0
with:
version: ${{ github.ref_name }}
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: ${{ github.head_ref }}

288
.github/workflows/sync.yml vendored Normal file
View File

@ -0,0 +1,288 @@
name: Sync Github To Image
on:
push:
branches: [main]
#schedule:
# 定时任务,每天 UTC 时间 0 点运行
#- cron: "0 0 * * *"
#workflow_dispatch:
jobs:
sync-gitlink:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # 为了 git pull --unshallow我们需要获取所有的提交历史
- name: Set up Git user
run: |
git config --global user.email "wangfj11@foxmail.com"
git config --global user.name "AlianBlank"
- name: Set SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.GITLINK_ID_RSA }}" >> ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
eval $(ssh-agent -s) && ssh-add ~/.ssh/id_rsa
# 信任域名
ssh-keyscan -H code.gitlink.org.cn >> ~/.ssh/known_hosts
# 查看当前分支
- name: Check current branch
run: echo 当前分支:${{ github.ref_name }} ${{ github.Repository }}
# 查看远端 地址
- name: echo git url
run: echo git@code.gitlink.org.cn:${{ github.Repository }}.git
# 添加远端
- name: add remote url
run: git remote add gitlink "git@code.gitlink.org.cn:${{ github.Repository }}.git"
# 获取
- name: fetch
run: git fetch --prune gitlink --tags --verbose
# 拉取
- name: pull and push
run: |
if [ "${{ github.ref_name }}" ]; then
git checkout ${{ github.ref_name }}
git pull --progress -v --no-rebase gitlink ${{ github.ref_name }} --tags --verbose || echo 远端不存在${{ github.ref_name }}分支;
git push -u gitlink ${{ github.ref_name }} --tags --verbose
fi
sync-gitlab:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # 为了 git pull --unshallow我们需要获取所有的提交历史
- name: Set up Git user
run: |
git config --global user.email "wangfj11@foxmail.com"
git config --global user.name "AlianBlank"
- name: Set SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.GITLAB_ID_RSA }}" >> ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
eval $(ssh-agent -s) && ssh-add ~/.ssh/id_rsa
# 信任域名
ssh-keyscan -H gitlab.com >> ~/.ssh/known_hosts
# 查看当前分支
- name: Check current branch
run: echo 当前分支:${{ github.ref_name }} ${{ github.Repository }}
# 查看远端 地址
- name: echo git url
run: echo git@gitlab.com:${{ github.Repository }}.git
# 添加远端
- name: add remote url
run: git remote add gitlab "git@gitlab.com:${{ github.Repository }}.git"
# 获取
- name: fetch
run: git fetch --prune gitlab --tags --verbose
# 拉取
- name: pull and push
run: |
if [ "${{ github.ref_name }}" ]; then
git checkout ${{ github.ref_name }}
git pull --progress -v --no-rebase gitlab ${{ github.ref_name }} --tags --verbose || echo 远端不存在${{ github.ref_name }}分支;
git push -u gitlab ${{ github.ref_name }} --tags --verbose
fi
sync-gitee:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # 为了 git pull --unshallow我们需要获取所有的提交历史
- name: Set up Git user
run: |
git config --global user.email "wangfj11@foxmail.com"
git config --global user.name "AlianBlank"
- name: Set SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.GITEE_ID_RSA }}" >> ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
eval $(ssh-agent -s) && ssh-add ~/.ssh/id_rsa
# 信任域名
ssh-keyscan -H gitee.com >> ~/.ssh/known_hosts
# 查看当前分支
- name: Check current branch
run: echo 当前分支:${{ github.ref_name }} ${{ github.Repository }}
# 查看远端 地址
- name: echo git url
run: echo git@gitee.com:${{ github.Repository }}.git
# 添加远端
- name: add remote url
run: git remote add gitee "git@gitee.com:${{ github.Repository }}.git"
# 获取
- name: fetch
run: git fetch --prune gitee --tags --verbose
# 拉取
- name: pull and push
run: |
if [ "${{ github.ref_name }}" ]; then
git checkout ${{ github.ref_name }}
git pull --progress -v --no-rebase gitee ${{ github.ref_name }} --tags --verbose || echo 远端不存在${{ github.ref_name }}分支;
git push -u gitee ${{ github.ref_name }} --tags --verbose
fi
sync-atomgit:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # 为了 git pull --unshallow我们需要获取所有的提交历史
- name: Set up Git user
run: |
git config --global user.email "wangfj11@foxmail.com"
git config --global user.name "AlianBlank"
- name: Set SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.ATOMGIT_ID_RSA }}" >> ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
eval $(ssh-agent -s) && ssh-add ~/.ssh/id_rsa
# 信任域名
ssh-keyscan -H atomgit.com >> ~/.ssh/known_hosts
# 查看当前分支
- name: Check current branch
run: echo 当前分支:${{ github.ref_name }} ${{ github.Repository }}
# 查看远端 地址
- name: echo git url
run: echo git@atomgit.com:${{ github.Repository }}.git
# 添加远端
- name: add remote url
run: git remote add atomgit "git@atomgit.com:${{ github.Repository }}.git"
# 获取
- name: fetch
run: git fetch --prune atomgit --tags --verbose
# 拉取
- name: pull and push
run: |
if [ "${{ github.ref_name }}" ]; then
git checkout ${{ github.ref_name }}
git pull --progress -v --no-rebase atomgit ${{ github.ref_name }} --tags --verbose || echo 远端不存在${{ github.ref_name }}分支;
git push -u atomgit ${{ github.ref_name }} --tags --verbose
fi
sync-gitcode:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # 为了 git pull --unshallow我们需要获取所有的提交历史
- name: Set up Git user
run: |
git config --global user.email "wangfj11@foxmail.com"
git config --global user.name "AlianBlank"
- name: Set SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.GITCODE_ID_RSA }}" >> ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
eval $(ssh-agent -s) && ssh-add ~/.ssh/id_rsa
# 信任域名
ssh-keyscan -H gitcode.net >> ~/.ssh/known_hosts
# 查看当前分支
- name: Check current branch
run: echo 当前分支:${{ github.ref_name }} ${{ github.Repository }}
# 查看远端 地址
- name: echo git url
run: echo git@gitcode.net:${{ github.Repository }}.git
# 添加远端
- name: add remote url
run: git remote add gitcode "git@gitcode.net:${{ github.Repository }}.git"
# 获取
- name: fetch
run: git fetch --prune gitcode --tags --verbose
# 拉取
- name: pull and push
run: |
if [ "${{ github.ref_name }}" ]; then
git checkout ${{ github.ref_name }}
git pull --progress -v --no-rebase gitcode ${{ github.ref_name }} --tags --verbose || echo 远端不存在${{ github.ref_name }}分支;
git push -u gitcode ${{ github.ref_name }} --tags --verbose
fi
sync-framagit:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # 为了 git pull --unshallow我们需要获取所有的提交历史
- name: Set up Git user
run: |
git config --global user.email "wangfj11@foxmail.com"
git config --global user.name "AlianBlank"
- name: Set SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.FRAMAGIT_ID_RSA }}" >> ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
eval $(ssh-agent -s) && ssh-add ~/.ssh/id_rsa
# 信任域名
ssh-keyscan -H framagit.org >> ~/.ssh/known_hosts
# 查看当前分支
- name: Check current branch
run: echo 当前分支:${{ github.ref_name }} ${{ github.Repository }}
# 查看远端 地址
- name: echo git url
run: echo git@framagit.org:${{ github.Repository }}.git
# 添加远端
- name: add remote url
run: git remote add framagit "git@framagit.org:${{ github.Repository }}.git"
# 获取
- name: fetch
run: git fetch --prune framagit --tags --verbose
# 拉取
- name: pull and push
run: |
if [ "${{ github.ref_name }}" ]; then
git checkout ${{ github.ref_name }}
git pull --progress -v --no-rebase framagit ${{ github.ref_name }} --tags --verbose || echo 远端不存在${{ github.ref_name }}分支;
git push -u framagit ${{ github.ref_name }} --tags --verbose
fi

21
LICENSE.md Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2023 Blank
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

3
LICENSE.md.meta Normal file
View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 65ab0fd9d052403ebdaead4404d96767
timeCreated: 1702092259

30
README.md Normal file
View File

@ -0,0 +1,30 @@
# 非常强大的配置表解决方案
uban是一个强大、易用、优雅、稳定的游戏配置解决方案。它设计目标为满足从小型到超大型游戏项目的简单到复杂的游戏配置工作流需求。
luban可以处理丰富的文件类型支持主流的语言可以生成多种导出格式支持丰富的数据检验功能具有良好的跨平台能力并且生成极快。 luban有清晰优雅的生成管线设计支持良好的模块化和插件化方便开发者进行二次开发。开发者很容易就能将luban适配到自己的配置格式定制出满足项目要求的强大的配置工具。
luban标准化了游戏配置开发工作流可以极大提升策划和程序的工作效率。
该库主要服务于 `https://github.com/GameFrameX/GameFrameX` 作为子库使用。
# 使用方式(三种方式)
1. 直接在 `manifest.json` 文件中添加以下内容
```json
{"com.gameframex.unity.focus-creative-games.luban": "https://github.com/gameframex/com.gameframex.unity.focus-creative-games.luban.git"}
```
2. 在Unity 的`Packages Manager` 中使用`Git URL` 的方式添加库,地址为https://github.com/gameframex/com.gameframex.unity.focus-creative-games.luban.git
3. 直接下载仓库放置到Unity 项目的`Packages` 目录下。会自动加载识别
# 改动功能
1. 增加 `Packages` 的支持
2. 移除ODIN 的依赖
3. 增加防裁剪的帮助类。需要在启动的主场景中挂载 `LuBanCroppingHelper` 脚本即可
# 使用文档
https://luban.doc.code-philosophy.com/docs/intro

3
README.md.meta Normal file
View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 5c4f345aed3f4bbe89a61e801e26701a
timeCreated: 1702092253

3
Runtime.meta Normal file
View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: f8d53bef08d0491fbbecdca8822460f4
timeCreated: 1684724064

10
Runtime/BeanBase.cs Normal file
View File

@ -0,0 +1,10 @@
using UnityEngine.Scripting;
namespace LuBan.Runtime
{
[Preserve]
public abstract class BeanBase : ITypeId
{
public abstract int GetTypeId();
}
}

3
Runtime/BeanBase.cs.meta Normal file
View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 560e8a442bea463c938d8741a0cf5b44
timeCreated: 1684724088

1608
Runtime/ByteBuf.cs Normal file

File diff suppressed because it is too large Load Diff

3
Runtime/ByteBuf.cs.meta Normal file
View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: eca47860d2cb49dd8b8fb5e9f9221605
timeCreated: 1684724088

10
Runtime/ITypeId.cs Normal file
View File

@ -0,0 +1,10 @@
using UnityEngine.Scripting;
namespace LuBan.Runtime
{
[Preserve]
public interface ITypeId
{
int GetTypeId();
}
}

3
Runtime/ITypeId.cs.meta Normal file
View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 8fa700725576482699db273e14132680
timeCreated: 1684724088

View File

@ -0,0 +1,15 @@
{
"name": "LuBan.Runtime",
"references": [
"SimpleJSON.Runtime"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": true,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 35f72b24bc994054b1e03b73edf578cb
timeCreated: 1684724081

View File

@ -0,0 +1,23 @@
using UnityEngine;
using UnityEngine.Scripting;
namespace LuBan.Runtime
{
/// <summary>
/// 防止代码运行时发生裁剪报错。将这个脚本添加到启动场景中。不会对逻辑有任何影响
/// </summary>
[Preserve]
public class LuBanCroppingHelper : MonoBehaviour
{
void Start()
{
_ = typeof(LuBan.Runtime.BeanBase);
_ = typeof(LuBan.Runtime.EDeserializeError);
_ = typeof(LuBan.Runtime.SerializationException);
_ = typeof(LuBan.Runtime.SegmentSaveState);
_ = typeof(LuBan.Runtime.ByteBuf);
_ = typeof(LuBan.Runtime.ITypeId);
_ = typeof(LuBan.Runtime.StringUtil);
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 86fe866ea05248349bea870a0bb0d7b3
timeCreated: 1708607173

53
Runtime/StringUtil.cs Normal file
View File

@ -0,0 +1,53 @@
using System.Collections.Generic;
using System.Text;
using UnityEngine.Scripting;
namespace LuBan.Runtime
{
[Preserve]
public static class StringUtil
{
public static string ToStr(object o)
{
return ToStr(o, new StringBuilder());
}
public static string ToStr(object o, StringBuilder sb)
{
foreach (var p in o.GetType().GetFields())
{
sb.Append($"{p.Name} = {p.GetValue(o)},");
}
foreach (var p in o.GetType().GetProperties())
{
sb.Append($"{p.Name} = {p.GetValue(o)},");
}
return sb.ToString();
}
public static string ArrayToString<T>(T[] arr)
{
return "[" + string.Join(",", arr) + "]";
}
public static string CollectionToString<T>(IEnumerable<T> arr)
{
return "[" + string.Join(",", arr) + "]";
}
public static string CollectionToString<TK, TV>(IDictionary<TK, TV> dic)
{
var sb = new StringBuilder('{');
foreach (var e in dic)
{
sb.Append(e.Key).Append(':');
sb.Append(e.Value).Append(',');
}
sb.Append('}');
return sb.ToString();
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: bc1758ffb2834e7da0f2759a4b6614cf
timeCreated: 1684724088

5
Runtime/link.xml Normal file
View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<linker>
<assembly fullname="LuBan.Runtime" preserve="all">
</assembly>
</linker>

3
Runtime/link.xml.meta Normal file
View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 0b0fb94376904b4f8702b5b796ca5944
timeCreated: 1706789252

22
package.json Normal file
View File

@ -0,0 +1,22 @@
{
"name": "com.alicizax.unity.focus-creative-games.luban",
"displayName": "Aliciza X LuBan Config",
"category": "AlicizaX X",
"description": "Luban Config",
"version": "2.0.0",
"unity": "2019.4",
"keywords": [
"Game Framework X"
],
"repository": {
"name": "com.gameframex.unity.web",
"url": "https://github.com/gameframex/com.gameframex.unity.web.git",
"type": "git"
},
"author": {
"name": "Blank",
"email": "alianblank@outlook.com",
"url": "https://gameframex.doc.alianblank.com"
},
"dependencies": {}
}

7
package.json.meta Normal file
View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 04e79f64fb26b4fc4976bb3618b5a002
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: