```
feat(gameplay): 更新单位属性和材质配置 - 调整多个单位的基础生命值和攻击力数值平衡 - 修改CoreBattleGround材质的纹理缩放比例 - 更新地砖材质颜色为白色 - 优化纹理资源设置,调整最大纹理尺寸并添加PlayableAds平台支持 - 修复弓箭手技能目标查找逻辑,改用统一的敌人检测方法 - 为水晶矿添加中立阵营设置和光球视觉效果同步 - 调整预制体中的全局缩放参数 - 为狼人和石巨人添加NavMeshAgent组件支持 - 优化水晶矿血条显示位置计算方式 ```
This commit is contained in:
1 parent
0e7de5f885
commit
53d95802e5
448 files changed
+133333
-472
No files matched your search
@@ -0,0 +1,80 @@
|
||||
param(
|
||||
[switch]$Check,
|
||||
[switch]$NoStage
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$repoRoot = (Resolve-Path (Join-Path $PSScriptRoot "..")).Path
|
||||
Set-Location $repoRoot
|
||||
|
||||
$mode = if ($Check) { "check" } else { "fix" }
|
||||
$autoStage = -not $NoStage
|
||||
|
||||
function New-GuidHex {
|
||||
return [Guid]::NewGuid().ToString("N")
|
||||
}
|
||||
|
||||
$invalidCount = 0
|
||||
$fixedCount = 0
|
||||
|
||||
$metaFiles = Get-ChildItem -Path . -Recurse -Filter *.meta -File |
|
||||
Where-Object {
|
||||
$_.FullName -notmatch '\\\.git\\' -and
|
||||
$_.FullName -notmatch '\\build\\' -and
|
||||
$_.FullName -notmatch '\\obj\\'
|
||||
}
|
||||
|
||||
foreach ($file in $metaFiles) {
|
||||
$content = Get-Content -Path $file.FullName -Raw
|
||||
$guidMatch = [regex]::Match($content, '(?m)^guid:\s*(\S+)\s*$')
|
||||
if (-not $guidMatch.Success) {
|
||||
continue
|
||||
}
|
||||
|
||||
$guid = $guidMatch.Groups[1].Value
|
||||
if ($guid -match '^[a-f0-9]{32}$') {
|
||||
continue
|
||||
}
|
||||
|
||||
$invalidCount++
|
||||
$newGuid = New-GuidHex
|
||||
|
||||
if ($mode -eq "fix") {
|
||||
$newContent = [regex]::Replace($content, '(?m)^guid:\s*\S+\s*$', "guid: $newGuid", 1)
|
||||
[System.IO.File]::WriteAllText($file.FullName, $newContent)
|
||||
|
||||
if ($autoStage) {
|
||||
git add -- $file.FullName | Out-Null
|
||||
}
|
||||
|
||||
Write-Output "FIXED $($file.FullName): $guid -> $newGuid"
|
||||
$fixedCount++
|
||||
}
|
||||
else {
|
||||
Write-Output "INVALID $($file.FullName): $guid (would fix to $newGuid)"
|
||||
}
|
||||
}
|
||||
|
||||
if ($invalidCount -eq 0) {
|
||||
Write-Output "All .meta GUIDs are valid."
|
||||
exit 0
|
||||
}
|
||||
|
||||
if ($mode -eq "check") {
|
||||
Write-Output ""
|
||||
Write-Output "Found $invalidCount invalid .meta GUID(s)."
|
||||
Write-Output "Run to fix:"
|
||||
Write-Output " .\scripts\fix-meta-guids.ps1"
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Output ""
|
||||
Write-Output "Fixed $fixedCount invalid .meta GUID(s)."
|
||||
if ($autoStage) {
|
||||
Write-Output "Staged fixed .meta files automatically."
|
||||
}
|
||||
else {
|
||||
Write-Output "Remember to stage fixed files manually."
|
||||
}
|
||||
Write-Output "You can run git commit again."
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ed834971d9ff0994a8c730a72c2717db
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
#!/usr/bin/env sh
|
||||
# Replace invalid GUIDs in .meta files with proper 32-char lowercase hex.
|
||||
# Works on macOS (/dev/urandom) and Windows (Git Bash).
|
||||
#
|
||||
# Usage:
|
||||
# ./scripts/fix-meta-guids.sh # fix invalid GUIDs and stage changes
|
||||
# ./scripts/fix-meta-guids.sh --check # dry-run (show what would change)
|
||||
# ./scripts/fix-meta-guids.sh --no-stage # fix but do not git add changed files
|
||||
set -eu
|
||||
cd "$(dirname "$0")/.." || exit 1
|
||||
|
||||
MODE="fix"
|
||||
AUTO_STAGE=true
|
||||
|
||||
for arg in "$@"; do
|
||||
case "$arg" in
|
||||
--check)
|
||||
MODE="check"
|
||||
;;
|
||||
--fix)
|
||||
MODE="fix"
|
||||
;;
|
||||
--no-stage)
|
||||
AUTO_STAGE=false
|
||||
;;
|
||||
*)
|
||||
echo "Unknown option: $arg"
|
||||
echo "Usage:"
|
||||
echo " ./scripts/fix-meta-guids.sh"
|
||||
echo " ./scripts/fix-meta-guids.sh --check"
|
||||
echo " ./scripts/fix-meta-guids.sh --no-stage"
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
gen_guid() {
|
||||
od -An -tx1 -N16 /dev/urandom | tr -d ' \n' | head -c 32
|
||||
}
|
||||
|
||||
invalid_count=0
|
||||
fixed_count=0
|
||||
|
||||
tmp_list=".fix-meta-guids.list.$$"
|
||||
find . -name "*.meta" -not -path "./.git/*" -not -path "*/build/*" -not -path "*/obj/*" > "$tmp_list"
|
||||
|
||||
while IFS= read -r f; do
|
||||
[ -z "$f" ] && continue
|
||||
guid=$(awk '/^guid:/ { gsub(/\r/, "", $2); print $2 }' "$f")
|
||||
[ -z "$guid" ] && continue
|
||||
case "$guid" in
|
||||
[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9])
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
|
||||
invalid_count=$((invalid_count + 1))
|
||||
new_guid=$(gen_guid)
|
||||
if [ "$MODE" = "fix" ]; then
|
||||
awk -v ng="$new_guid" '/^guid:/ { print "guid: " ng; next } { print }' "$f" > "$f.tmp"
|
||||
mv "$f.tmp" "$f"
|
||||
if [ "$AUTO_STAGE" = "true" ]; then
|
||||
git add -- "$f"
|
||||
fi
|
||||
echo "FIXED $f: $guid -> $new_guid"
|
||||
fixed_count=$((fixed_count + 1))
|
||||
else
|
||||
echo "INVALID $f: $guid (would fix to $new_guid)"
|
||||
fi
|
||||
done < "$tmp_list"
|
||||
|
||||
rm -f "$tmp_list"
|
||||
|
||||
if [ "$invalid_count" -eq 0 ]; then
|
||||
echo "All .meta GUIDs are valid."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$MODE" = "check" ]; then
|
||||
echo ""
|
||||
echo "Found $invalid_count invalid .meta GUID(s)."
|
||||
echo "Run to fix:"
|
||||
echo " ./scripts/fix-meta-guids.sh"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Fixed $fixed_count invalid .meta GUID(s)."
|
||||
if [ "$AUTO_STAGE" = "true" ]; then
|
||||
echo "Staged fixed .meta files automatically."
|
||||
else
|
||||
echo "Remember to stage fixed files manually."
|
||||
fi
|
||||
echo "You can run git commit again."
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4e6296266e5389bdba55ad95c0c5cfaf
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
@echo off
|
||||
node "%~dp0release-tools\validate.cjs" --guids-only
|
||||
exit /b %ERRORLEVEL%
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cbfbb92df92cbd44b82bbc62adedc83c
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env sh
|
||||
# Validate Unity GUIDs only; release source policy is a separate Node command.
|
||||
set -eu
|
||||
exec node "$(dirname "$0")/release-tools/validate.cjs" --guids-only
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ab1bd0e5ff1fd9342a3bbd6aca8dfb04
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in new issue
Block a user