feat: initial commit

This commit is contained in:
2025-12-01 12:36:01 +08:00
commit ee78bf2cb5
221 changed files with 56853 additions and 0 deletions

61
Assets/Template~/.gitignore vendored Normal file
View File

@@ -0,0 +1,61 @@
# This .gitignore file should be placed at the root of your Unity project directory
#
# Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore
#
/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/[Ll]ogs/
/[Mm]emoryCaptures/
# Asset meta data should only be ignored when the corresponding asset is also ignored
!/[Aa]ssets/**/*.meta
# Uncomment this line if you wish to ignore the asset store tools plugin
# /[Aa]ssets/AssetStoreTools*
# Autogenerated Jetbrains Rider plugin
[Aa]ssets/Plugins/Editor/JetBrains*
# Visual Studio cache directory
.vs/
.config
# Gradle cache directory
.gradle/
# Autogenerated VS/MD/Consulo solution and project files
ExportedObj/
.consulo/
*.csproj
*.unityproj
*.sln
*.suo
*.tmp
*.user
*.userprefs
*.pidb
*.booproj
*.svd
*.pdb
*.mdb
*.opendb
*.VC.db
# Unity3D generated meta files
*.pidb.meta
*.pdb.meta
*.mdb.meta
# Unity3D generated file on crash reports
sysinfo.txt
# Builds
*.apk
*.unitypackage
# Crashlytics generated file
crashlytics-build.properties

View File

@@ -0,0 +1,12 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.0.0] - 20XX-XX-XX
### Added
- Initial release of the Unity package.

View File

@@ -0,0 +1,16 @@
{
"name": "[PackageName].Editor",
"rootNamespace": "[root-namespace]",
"references": [],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2025 [author_name]
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.

View File

@@ -0,0 +1,8 @@
# com.[company-name].[package-name]
## Installation
1. Open `Package Manager`
2. Click `+`
3. Select `Add package from git URL...`
4. Paste `[git-url].git?path=[package-path]`

View File

@@ -0,0 +1,16 @@
{
"name": "[PackageName].Runtime",
"rootNamespace": "[root-namespace]",
"references": [
"GUID:75469ad4d38634e559750d17036d5f7c"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@@ -0,0 +1,11 @@
{
"name": "[company-name].[package-name].Editor",
"references": [
"UnityEngine.TestRunner",
"UnityEditor.TestRunner"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": []
}

View File

@@ -0,0 +1,11 @@
{
"name": "[company-name].[package-name].RunTime",
"references": [
"UnityEngine.TestRunner",
"UnityEditor.TestRunner"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": []
}

View File

@@ -0,0 +1,23 @@
{
"name": "com.[company-name].[package-name]",
"version": "1.0.0",
"description": "[package-description]",
"displayName": "[package-display-name]",
"unity": "2019.4",
"author": {
"name": "[author-name]",
"url": "[author-url]"
},
"changelogUrl": "[git-url]/blob/main/CHANGELOG.md",
"dependencies": {},
"documentationUrl": "[git-url]/",
"keywords": [],
"licensesUrl": "[git-url]/blob/main/LICENSE.md",
"samples": [
{
"displayName": "Samples SampleFolder1",
"description": "Contains samples from SampleFolder1",
"path": "Samples~/SampleFolder1"
}
]
}

View File

@@ -0,0 +1,76 @@
@echo off
setlocal enabledelayedexpansion
:: Default values
set "company_name=company-name"
set "package_name=package-name"
set "CompanyName=CompanyName"
set "PackageName=PackageName"
set "root_namespace="
set "package_display_name=Package Display Name"
set "package_description=This is an example package description."
set "git_url=https://github.com/your-username/your-project-name"
set "package_path=Assets/FolderName"
set "author_name=Your Name"
set "author_url=https://github.com/your-username"
:: Get user input with defaults
echo.
set /p "input_company_name=Enter company_name [%company_name%]: "
if not "!input_company_name!"=="" set "company_name=!input_company_name!"
echo.
set /p "input_package_name=Enter package_name [%package_name%]: "
if not "!input_package_name!"=="" set "package_name=!input_package_name!"
echo.
set /p "input_CompanyName=Enter CompanyName [%CompanyName%]: "
if not "!input_CompanyName!"=="" set "CompanyName=!input_CompanyName!"
echo.
set /p "input_PackageName=Enter PackageName [%PackageName%]: "
if not "!input_PackageName!"=="" set "PackageName=!input_PackageName!"
echo.
set /p "input_root_namespace=Enter root_namespace [%root_namespace%]: "
if not "!input_root_namespace!"=="" set "root_namespace=!input_root_namespace!"
echo.
set /p "input_package_display_name=Enter package_display_name [%package_display_name%]: "
if not "!input_package_display_name!"=="" set "package_display_name=!input_package_display_name!"
echo.
set /p "input_package_description=Enter package_description [%package_description%]: "
if not "!input_package_description!"=="" set "package_description=!input_package_description!"
echo.
set /p "input_git_url=Enter git_url [%git_url%]: "
if not "!input_git_url!"=="" set "git_url=!input_git_url!"
echo.
set /p "input_package_path=Enter package_path [%package_path%]: "
if not "!input_package_path!"=="" set "package_path=!input_package_path!"
echo.
set /p "input_author_name=Enter author_name [%author_name%]: "
if not "!input_author_name!"=="" set "author_name=!input_author_name!"
echo.
set /p "input_author_url=Enter author_url [%author_url%]: "
if not "!input_author_url!"=="" set "author_url=!input_author_url!"
:: Update files
echo.
echo Updating variables ^& filenames...
:: Use PowerShell to update file contents (excluding .git folder and batch files)
powershell -Command "$companyName='%company_name%'; $packageName='%package_name%'; $CompanyName='%CompanyName%'; $PackageName='%PackageName%'; $rootNamespace='%root_namespace%'; $displayName='%package_display_name%'; $description='%package_description%'; $gitUrl='%git_url%'; $packagePath='%package_path%'; $authorName='%author_name%'; $authorUrl='%author_url%'; Get-ChildItem -Recurse -File | Where-Object { $_.FullName -notmatch '\\.git' -and $_.Extension -ne '.bat' } | ForEach-Object { $content = [System.IO.File]::ReadAllText($_.FullName); $content = $content -replace '\[company-name\]', $companyName -replace '\[package-name\]', $packageName -replace '\[CompanyName\]', $CompanyName -replace '\[PackageName\]', $PackageName -replace '\[root-namespace\]', $rootNamespace -replace '\[package-display-name\]', $displayName -replace '\[package-description\]', $description -replace '\[git-url\]', $gitUrl -replace '\[package-path\]', $packagePath -replace '\[author-name\]', $authorName -replace '\[author_name\]', $authorName -replace '\[author-url\]', $authorUrl; [System.IO.File]::WriteAllText($_.FullName, $content) }"
:: Rename files (excluding .git folder and batch files)
powershell -Command "$companyName='%company_name%'; $packageName='%package_name%'; $CompanyName='%CompanyName%'; $PackageName='%PackageName%'; Get-ChildItem -Recurse -File | Where-Object { $_.FullName -notmatch '\\.git' -and $_.Extension -ne '.bat' -and ($_.Name -match '\[company-name\]\.\[package-name\]' -or $_.Name -match '\[CompanyName\]\.\[PackageName\]' -or $_.Name -match '^\[package-name\]' -or $_.Name -match '^\[PackageName\]') } | ForEach-Object { $dir = $_.DirectoryName; $newName = $_.Name -replace '\[company-name\]\.\[package-name\]', ($companyName + '.' + $packageName) -replace '\[CompanyName\]\.\[PackageName\]', ($CompanyName + '.' + $PackageName) -replace '^\[package-name\]', $packageName -replace '^\[PackageName\]', $PackageName; Rename-Item -LiteralPath $_.FullName -NewName $newName }"
echo.
echo DONE!
echo.
pause