mirror of
https://github.com/0x7c13/Pal3.Unity.git
synced 2026-11-26 17:38:10 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bc9247a4b9 | ||
|
|
effac5aaf6 | ||
|
|
25579c6c0d | ||
|
|
4cabbd03a7 | ||
|
|
d1b2c05eb4 | ||
|
|
00d7ac0c45 | ||
|
|
8ef2c946db |
No files matched your search
@@ -0,0 +1,52 @@
|
||||
root = true
|
||||
|
||||
[*.cs]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
# Match the existing Unity C# sources; keep each file's existing BOM.
|
||||
end_of_line = crlf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
csharp_new_line_before_open_brace = all
|
||||
csharp_new_line_before_else = true
|
||||
csharp_new_line_before_catch = true
|
||||
csharp_new_line_before_finally = true
|
||||
csharp_new_line_before_members_in_object_initializers = true
|
||||
csharp_new_line_before_members_in_anonymous_types = true
|
||||
csharp_new_line_between_query_expression_clauses = true
|
||||
csharp_indent_block_contents = true
|
||||
csharp_indent_braces = false
|
||||
csharp_indent_case_contents = true
|
||||
csharp_indent_case_contents_when_block = false
|
||||
csharp_indent_switch_labels = true
|
||||
csharp_indent_labels = one_less_than_current
|
||||
|
||||
csharp_space_after_cast = false
|
||||
csharp_space_after_keywords_in_control_flow_statements = true
|
||||
csharp_space_between_method_declaration_parameter_list_parentheses = false
|
||||
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
|
||||
csharp_space_between_method_call_parameter_list_parentheses = false
|
||||
csharp_space_between_method_call_empty_parameter_list_parentheses = false
|
||||
csharp_space_between_parentheses = none
|
||||
csharp_space_before_colon_in_inheritance_clause = true
|
||||
csharp_space_after_colon_in_inheritance_clause = true
|
||||
csharp_space_around_binary_operators = before_and_after
|
||||
csharp_space_before_comma = false
|
||||
csharp_space_after_comma = true
|
||||
csharp_space_before_dot = false
|
||||
csharp_space_after_dot = false
|
||||
csharp_space_before_semicolon_in_for_statement = false
|
||||
csharp_space_after_semicolon_in_for_statement = true
|
||||
csharp_space_before_open_square_brackets = false
|
||||
csharp_space_between_square_brackets = false
|
||||
csharp_space_between_empty_square_brackets = false
|
||||
csharp_preserve_single_line_statements = false
|
||||
csharp_preserve_single_line_blocks = false
|
||||
|
||||
# SDK whitespace formatting does not enforce spacing between members.
|
||||
# These targeted StyleCop rules also run through tools/format-csharp.py.
|
||||
dotnet_diagnostic.SA1107.severity = warning
|
||||
dotnet_diagnostic.SA1502.severity = warning
|
||||
dotnet_diagnostic.SA1507.severity = warning
|
||||
dotnet_diagnostic.SA1516.severity = warning
|
||||
@@ -0,0 +1,44 @@
|
||||
# Continuous integration
|
||||
|
||||
GitHub Actions builds PAL3 and PAL3A with the Unity version in
|
||||
`ProjectSettings/ProjectVersion.txt`. Each variant covers Android, iOS,
|
||||
macOS, Linux, and 32-bit/64-bit Windows. The workflows run only on pull requests.
|
||||
New commits cancel superseded runs for the same pull request and workflow.
|
||||
Successful desktop/Android builds upload artifacts.
|
||||
|
||||
The README badges show each workflow's latest pull request build using
|
||||
`event=pull_request`, with no branch filter. Without the event filter, GitHub's
|
||||
badges prefer the default branch and can keep showing old push builds after a
|
||||
workflow switches to PR-only triggers. The badge links filter the build history
|
||||
to pull requests as well.
|
||||
|
||||
The separate `Code style` workflow verifies changed owned C# files with the SDK's
|
||||
`dotnet format`, using `.editorconfig` and the SDK pinned in `global.json`.
|
||||
It combines whitespace formatting with pinned StyleCop layout rules SA1107, SA1502,
|
||||
SA1507 and SA1516 to enforce separate statements, multiline blocks and blank lines
|
||||
between members. StyleCop is restored only into the temporary formatting project.
|
||||
It parses both PAL3 and PAL3A conditional branches without Unity or game data.
|
||||
Run `python3 tools/format-csharp.py` locally to format current changes, then
|
||||
`python3 tools/format-csharp.py --check` to verify them. CI selects PR changes with
|
||||
`--check --base <base-sha>`; `--all` is an explicit full-source audit, not the default.
|
||||
Default and `--base` runs apply formatting only to changed lines and deletion
|
||||
boundaries, preserving existing formatting elsewhere. Explicit file/directory
|
||||
paths and `--all` format whole files. Check mode operates on temporary copies.
|
||||
This checks whitespace and layout, not semantic correctness or Unity behavior.
|
||||
|
||||
Codacy is not part of this repository's CI. Its repository webhook is disabled;
|
||||
there is no Codacy workflow or Codacy-required branch protection check. Re-enabling
|
||||
that external integration would resume its checks independently of these workflows.
|
||||
|
||||
The workflows use checkout v7.0.1, cache v6.1.0, and unity-builder v6.0.0.
|
||||
The builder CLI is pinned to v0.1.73 so its behavior does not change independently
|
||||
of the workflow. Update and validate this pin together with builder upgrades.
|
||||
|
||||
Keep the committed project configured for PAL3. PAL3A workflows switch their own
|
||||
checkout before building. Do not add original game data to CI inputs.
|
||||
|
||||
When investigating a failure, inspect the failed job's Unity/build logs first.
|
||||
Retry an isolated runner or network failure after checking the log; fix reproducible
|
||||
source/build problems without bypassing the build checks. A successful CI build
|
||||
checks compilation and packaging, and does not replace device or game-data runtime
|
||||
validation.
|
||||
@@ -1,6 +1,10 @@
|
||||
name: Builds - PAL3 - Mono - Android
|
||||
|
||||
on: [push, pull_request]
|
||||
on: [pull_request]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build_pal3_mono_android:
|
||||
@@ -21,16 +25,16 @@ jobs:
|
||||
large-packages: true
|
||||
docker-images: true
|
||||
swap-storage: true
|
||||
- uses: actions/checkout@v6.0.3
|
||||
- uses: actions/checkout@v7.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
lfs: true
|
||||
- uses: actions/cache@v5.0.5
|
||||
- uses: actions/cache@v6.1.0
|
||||
with:
|
||||
path: Library
|
||||
key: Library-${{ matrix.targetPlatform }}
|
||||
restore-keys: Library-
|
||||
- uses: game-ci/unity-builder@v5
|
||||
- uses: game-ci/unity-builder@v6.0.0
|
||||
env:
|
||||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
@@ -39,8 +43,9 @@ jobs:
|
||||
targetPlatform: ${{ matrix.targetPlatform }}
|
||||
buildName: PAL3
|
||||
versioning: Semantic
|
||||
- uses: actions/upload-artifact@v7.0.1
|
||||
cliVersion: v0.1.73
|
||||
- uses: actions/upload-artifact@v7.0.2
|
||||
with:
|
||||
name: PAL3-Mono-${{ matrix.targetPlatform }}
|
||||
path: build/${{ matrix.targetPlatform }}
|
||||
retention-days: 14
|
||||
retention-days: 14
|
||||
@@ -1,6 +1,10 @@
|
||||
name: Builds - PAL3 - Mono - iOS
|
||||
|
||||
on: [push, pull_request]
|
||||
on: [pull_request]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build_pal3_mono_ios:
|
||||
@@ -12,16 +16,16 @@ jobs:
|
||||
targetPlatform:
|
||||
- iOS # Build an iOS player.
|
||||
steps:
|
||||
- uses: actions/checkout@v6.0.3
|
||||
- uses: actions/checkout@v7.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
lfs: true
|
||||
- uses: actions/cache@v5.0.5
|
||||
- uses: actions/cache@v6.1.0
|
||||
with:
|
||||
path: Library
|
||||
key: Library-${{ matrix.targetPlatform }}
|
||||
restore-keys: Library-
|
||||
- uses: game-ci/unity-builder@v5
|
||||
- uses: game-ci/unity-builder@v6.0.0
|
||||
env:
|
||||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
@@ -30,4 +34,5 @@ jobs:
|
||||
targetPlatform: ${{ matrix.targetPlatform }}
|
||||
buildName: PAL3
|
||||
versioning: Semantic
|
||||
# do not upload artifacts for iOS builds
|
||||
cliVersion: v0.1.73
|
||||
# do not upload artifacts for iOS builds
|
||||
@@ -1,6 +1,10 @@
|
||||
name: Builds - PAL3 - Mono - Linux
|
||||
|
||||
on: [push, pull_request]
|
||||
on: [pull_request]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build_pal3_mono_linux:
|
||||
@@ -12,16 +16,16 @@ jobs:
|
||||
targetPlatform:
|
||||
- StandaloneLinux64 # Build a Linux 64-bit standalone.
|
||||
steps:
|
||||
- uses: actions/checkout@v6.0.3
|
||||
- uses: actions/checkout@v7.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
lfs: true
|
||||
- uses: actions/cache@v5.0.5
|
||||
- uses: actions/cache@v6.1.0
|
||||
with:
|
||||
path: Library
|
||||
key: Library-${{ matrix.targetPlatform }}
|
||||
restore-keys: Library-
|
||||
- uses: game-ci/unity-builder@v5
|
||||
- uses: game-ci/unity-builder@v6.0.0
|
||||
env:
|
||||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
@@ -30,8 +34,9 @@ jobs:
|
||||
targetPlatform: ${{ matrix.targetPlatform }}
|
||||
buildName: PAL3
|
||||
versioning: Semantic
|
||||
- uses: actions/upload-artifact@v7.0.1
|
||||
cliVersion: v0.1.73
|
||||
- uses: actions/upload-artifact@v7.0.2
|
||||
with:
|
||||
name: PAL3-Mono-${{ matrix.targetPlatform }}
|
||||
path: build/${{ matrix.targetPlatform }}
|
||||
retention-days: 14
|
||||
retention-days: 14
|
||||
@@ -1,6 +1,10 @@
|
||||
name: Builds - PAL3 - Mono - MacOS
|
||||
|
||||
on: [push, pull_request]
|
||||
on: [pull_request]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build_pal3_mono_macos:
|
||||
@@ -12,16 +16,16 @@ jobs:
|
||||
targetPlatform:
|
||||
- StandaloneOSX # Build a macOS standalone (Intel 64-bit).
|
||||
steps:
|
||||
- uses: actions/checkout@v6.0.3
|
||||
- uses: actions/checkout@v7.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
lfs: true
|
||||
- uses: actions/cache@v5.0.5
|
||||
- uses: actions/cache@v6.1.0
|
||||
with:
|
||||
path: Library
|
||||
key: Library-${{ matrix.targetPlatform }}
|
||||
restore-keys: Library-
|
||||
- uses: game-ci/unity-builder@v5
|
||||
- uses: game-ci/unity-builder@v6.0.0
|
||||
env:
|
||||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
@@ -30,8 +34,9 @@ jobs:
|
||||
targetPlatform: ${{ matrix.targetPlatform }}
|
||||
buildName: PAL3
|
||||
versioning: Semantic
|
||||
- uses: actions/upload-artifact@v7.0.1
|
||||
cliVersion: v0.1.73
|
||||
- uses: actions/upload-artifact@v7.0.2
|
||||
with:
|
||||
name: PAL3-Mono-${{ matrix.targetPlatform }}
|
||||
path: build/${{ matrix.targetPlatform }}
|
||||
retention-days: 14
|
||||
retention-days: 14
|
||||
@@ -1,6 +1,10 @@
|
||||
name: Builds - PAL3 - Mono - Windows
|
||||
|
||||
on: [push, pull_request]
|
||||
on: [pull_request]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build_pal3_mono_windows:
|
||||
@@ -13,16 +17,16 @@ jobs:
|
||||
- StandaloneWindows # Build a Windows standalone.
|
||||
- StandaloneWindows64 # Build a Windows 64-bit standalone.
|
||||
steps:
|
||||
- uses: actions/checkout@v6.0.3
|
||||
- uses: actions/checkout@v7.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
lfs: true
|
||||
- uses: actions/cache@v5.0.5
|
||||
- uses: actions/cache@v6.1.0
|
||||
with:
|
||||
path: Library
|
||||
key: Library-${{ matrix.targetPlatform }}
|
||||
restore-keys: Library-
|
||||
- uses: game-ci/unity-builder@v5
|
||||
- uses: game-ci/unity-builder@v6.0.0
|
||||
env:
|
||||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
@@ -31,8 +35,9 @@ jobs:
|
||||
targetPlatform: ${{ matrix.targetPlatform }}
|
||||
buildName: PAL3
|
||||
versioning: Semantic
|
||||
- uses: actions/upload-artifact@v7.0.1
|
||||
cliVersion: v0.1.73
|
||||
- uses: actions/upload-artifact@v7.0.2
|
||||
with:
|
||||
name: PAL3-Mono-${{ matrix.targetPlatform }}
|
||||
path: build/${{ matrix.targetPlatform }}
|
||||
retention-days: 14
|
||||
retention-days: 14
|
||||
@@ -1,6 +1,10 @@
|
||||
name: Builds - PAL3A - Mono - Android
|
||||
|
||||
on: [push, pull_request]
|
||||
on: [pull_request]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build_pal3a_mono_android:
|
||||
@@ -21,7 +25,7 @@ jobs:
|
||||
large-packages: true
|
||||
docker-images: true
|
||||
swap-storage: true
|
||||
- uses: actions/checkout@v6.0.3
|
||||
- uses: actions/checkout@v7.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
lfs: true
|
||||
@@ -37,12 +41,12 @@ jobs:
|
||||
find: "6b32649dccc45df4ebe8e3f8eccee249"
|
||||
replace: "d03d417e5660d5849939c8fe43732dbd"
|
||||
include: "**ProjectSettings.asset"
|
||||
- uses: actions/cache@v5.0.5
|
||||
- uses: actions/cache@v6.1.0
|
||||
with:
|
||||
path: Library
|
||||
key: Library-${{ matrix.targetPlatform }}
|
||||
restore-keys: Library-
|
||||
- uses: game-ci/unity-builder@v5
|
||||
- uses: game-ci/unity-builder@v6.0.0
|
||||
env:
|
||||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
@@ -52,8 +56,9 @@ jobs:
|
||||
targetPlatform: ${{ matrix.targetPlatform }}
|
||||
buildName: PAL3A
|
||||
versioning: Semantic
|
||||
- uses: actions/upload-artifact@v7.0.1
|
||||
cliVersion: v0.1.73
|
||||
- uses: actions/upload-artifact@v7.0.2
|
||||
with:
|
||||
name: PAL3A-Mono-${{ matrix.targetPlatform }}
|
||||
path: build/${{ matrix.targetPlatform }}
|
||||
retention-days: 14
|
||||
retention-days: 14
|
||||
@@ -1,6 +1,10 @@
|
||||
name: Builds - PAL3A - Mono - iOS
|
||||
|
||||
on: [push, pull_request]
|
||||
on: [pull_request]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build_pal3a_mono_ios:
|
||||
@@ -12,7 +16,7 @@ jobs:
|
||||
targetPlatform:
|
||||
- iOS # Build an iOS player.
|
||||
steps:
|
||||
- uses: actions/checkout@v6.0.3
|
||||
- uses: actions/checkout@v7.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
lfs: true
|
||||
@@ -28,12 +32,12 @@ jobs:
|
||||
find: "6b32649dccc45df4ebe8e3f8eccee249"
|
||||
replace: "d03d417e5660d5849939c8fe43732dbd"
|
||||
include: "**ProjectSettings.asset"
|
||||
- uses: actions/cache@v5.0.5
|
||||
- uses: actions/cache@v6.1.0
|
||||
with:
|
||||
path: Library
|
||||
key: Library-${{ matrix.targetPlatform }}
|
||||
restore-keys: Library-
|
||||
- uses: game-ci/unity-builder@v5
|
||||
- uses: game-ci/unity-builder@v6.0.0
|
||||
env:
|
||||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
@@ -43,4 +47,5 @@ jobs:
|
||||
targetPlatform: ${{ matrix.targetPlatform }}
|
||||
buildName: PAL3A
|
||||
versioning: Semantic
|
||||
# do not upload artifacts for iOS builds
|
||||
cliVersion: v0.1.73
|
||||
# do not upload artifacts for iOS builds
|
||||
@@ -1,6 +1,10 @@
|
||||
name: Builds - PAL3A - Mono - Linux
|
||||
|
||||
on: [push, pull_request]
|
||||
on: [pull_request]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build_pal3a_mono_linux:
|
||||
@@ -12,7 +16,7 @@ jobs:
|
||||
targetPlatform:
|
||||
- StandaloneLinux64 # Build a Linux 64-bit standalone.
|
||||
steps:
|
||||
- uses: actions/checkout@v6.0.3
|
||||
- uses: actions/checkout@v7.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
lfs: true
|
||||
@@ -28,12 +32,12 @@ jobs:
|
||||
find: "6b32649dccc45df4ebe8e3f8eccee249"
|
||||
replace: "d03d417e5660d5849939c8fe43732dbd"
|
||||
include: "**ProjectSettings.asset"
|
||||
- uses: actions/cache@v5.0.5
|
||||
- uses: actions/cache@v6.1.0
|
||||
with:
|
||||
path: Library
|
||||
key: Library-${{ matrix.targetPlatform }}
|
||||
restore-keys: Library-
|
||||
- uses: game-ci/unity-builder@v5
|
||||
- uses: game-ci/unity-builder@v6.0.0
|
||||
env:
|
||||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
@@ -43,8 +47,9 @@ jobs:
|
||||
targetPlatform: ${{ matrix.targetPlatform }}
|
||||
buildName: PAL3A
|
||||
versioning: Semantic
|
||||
- uses: actions/upload-artifact@v7.0.1
|
||||
cliVersion: v0.1.73
|
||||
- uses: actions/upload-artifact@v7.0.2
|
||||
with:
|
||||
name: PAL3A-Mono-${{ matrix.targetPlatform }}
|
||||
path: build/${{ matrix.targetPlatform }}
|
||||
retention-days: 14
|
||||
retention-days: 14
|
||||
@@ -1,6 +1,10 @@
|
||||
name: Builds - PAL3A - Mono - MacOS
|
||||
|
||||
on: [push, pull_request]
|
||||
on: [pull_request]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build_pal3a_mono_macos:
|
||||
@@ -12,7 +16,7 @@ jobs:
|
||||
targetPlatform:
|
||||
- StandaloneOSX # Build a macOS standalone (Intel 64-bit).
|
||||
steps:
|
||||
- uses: actions/checkout@v6.0.3
|
||||
- uses: actions/checkout@v7.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
lfs: true
|
||||
@@ -28,12 +32,12 @@ jobs:
|
||||
find: "6b32649dccc45df4ebe8e3f8eccee249"
|
||||
replace: "d03d417e5660d5849939c8fe43732dbd"
|
||||
include: "**ProjectSettings.asset"
|
||||
- uses: actions/cache@v5.0.5
|
||||
- uses: actions/cache@v6.1.0
|
||||
with:
|
||||
path: Library
|
||||
key: Library-${{ matrix.targetPlatform }}
|
||||
restore-keys: Library-
|
||||
- uses: game-ci/unity-builder@v5
|
||||
- uses: game-ci/unity-builder@v6.0.0
|
||||
env:
|
||||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
@@ -43,8 +47,9 @@ jobs:
|
||||
targetPlatform: ${{ matrix.targetPlatform }}
|
||||
buildName: PAL3A
|
||||
versioning: Semantic
|
||||
- uses: actions/upload-artifact@v7.0.1
|
||||
cliVersion: v0.1.73
|
||||
- uses: actions/upload-artifact@v7.0.2
|
||||
with:
|
||||
name: PAL3A-Mono-${{ matrix.targetPlatform }}
|
||||
path: build/${{ matrix.targetPlatform }}
|
||||
retention-days: 14
|
||||
retention-days: 14
|
||||
@@ -1,6 +1,10 @@
|
||||
name: Builds - PAL3A - Mono - Windows
|
||||
|
||||
on: [push, pull_request]
|
||||
on: [pull_request]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build_pal3a_mono_windows:
|
||||
@@ -13,7 +17,7 @@ jobs:
|
||||
- StandaloneWindows # Build a Windows standalone.
|
||||
- StandaloneWindows64 # Build a Windows 64-bit standalone.
|
||||
steps:
|
||||
- uses: actions/checkout@v6.0.3
|
||||
- uses: actions/checkout@v7.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
lfs: true
|
||||
@@ -29,12 +33,12 @@ jobs:
|
||||
find: "6b32649dccc45df4ebe8e3f8eccee249"
|
||||
replace: "d03d417e5660d5849939c8fe43732dbd"
|
||||
include: "**ProjectSettings.asset"
|
||||
- uses: actions/cache@v5.0.5
|
||||
- uses: actions/cache@v6.1.0
|
||||
with:
|
||||
path: Library
|
||||
key: Library-${{ matrix.targetPlatform }}
|
||||
restore-keys: Library-
|
||||
- uses: game-ci/unity-builder@v5
|
||||
- uses: game-ci/unity-builder@v6.0.0
|
||||
env:
|
||||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
@@ -44,8 +48,9 @@ jobs:
|
||||
targetPlatform: ${{ matrix.targetPlatform }}
|
||||
buildName: PAL3A
|
||||
versioning: Semantic
|
||||
- uses: actions/upload-artifact@v7.0.1
|
||||
cliVersion: v0.1.73
|
||||
- uses: actions/upload-artifact@v7.0.2
|
||||
with:
|
||||
name: PAL3A-Mono-${{ matrix.targetPlatform }}
|
||||
path: build/${{ matrix.targetPlatform }}
|
||||
retention-days: 14
|
||||
retention-days: 14
|
||||
@@ -0,0 +1,29 @@
|
||||
name: Code style
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
csharp-format:
|
||||
name: C# formatting (PAL3 and PAL3A)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v7.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-dotnet@v5.3.0
|
||||
with:
|
||||
global-json-file: global.json
|
||||
- name: Test formatter enforcement
|
||||
run: python3 tools/tests/test-format-csharp.py
|
||||
- name: Verify changed C# formatting
|
||||
env:
|
||||
BASE_REF: ${{ github.event.pull_request.base.sha }}
|
||||
run: python3 tools/format-csharp.py --check --base "$BASE_REF"
|
||||
+10
-15
@@ -77,20 +77,15 @@ crashlytics-build.properties
|
||||
# Unity StreamingAssets folder
|
||||
/Assets/StreamingAssets
|
||||
|
||||
# 3rd party plugin/assets
|
||||
/Assets/Hovl Studio
|
||||
/Assets/Hovl Studio.meta
|
||||
/Assets/RealToon
|
||||
/Assets/RealToon.meta
|
||||
|
||||
# VFX prefabs that are using 3rd party assets
|
||||
/Assets/Resources/Prefabs/VFX/PAL3/*.prefab
|
||||
/Assets/Resources/Prefabs/VFX/PAL3/*.meta
|
||||
/Assets/Resources/Prefabs/VFX/PAL3A/*.prefab
|
||||
/Assets/Resources/Prefabs/VFX/PAL3A/*.meta
|
||||
|
||||
# Materials that are using 3rd party assets
|
||||
/Assets/Resources/Materials/
|
||||
|
||||
# VS Conde config file
|
||||
.vsconfig
|
||||
|
||||
# Local asset imports
|
||||
/Assets/Hovl Studio/
|
||||
/Assets/Hovl Studio.meta
|
||||
/Assets/RealToon/
|
||||
/Assets/RealToon.meta
|
||||
/Assets/Resources/Prefabs/VFX/
|
||||
/Assets/Resources/Prefabs/VFX.meta
|
||||
/Assets/Resources/Materials/
|
||||
/Assets/Resources/Materials.meta
|
||||
@@ -4,6 +4,7 @@
|
||||
#endif
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEngine.Assemblies;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
@@ -154,7 +155,7 @@ namespace IngameDebugConsole
|
||||
#endif
|
||||
|
||||
#if UNITY_EDITOR || !NETFX_CORE
|
||||
foreach( Assembly assembly in AppDomain.CurrentDomain.GetAssemblies() )
|
||||
foreach( Assembly assembly in CurrentAssemblies.GetLoadedAssemblies() )
|
||||
#else
|
||||
foreach( Assembly assembly in new Assembly[] { typeof( DebugLogConsole ).Assembly } ) // On UWP, at least search this plugin's Assembly for console methods
|
||||
#endif
|
||||
|
||||
@@ -487,9 +487,6 @@ namespace IngameDebugConsole
|
||||
ShowLogWindow();
|
||||
}
|
||||
};
|
||||
|
||||
// On new Input System, scroll sensitivity is much higher than legacy Input system
|
||||
logItemsScrollRect.scrollSensitivity *= 0.25f;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -859,13 +859,6 @@ namespace SimpleFileBrowser
|
||||
|
||||
if( !showResizeCursor )
|
||||
Destroy( resizeCursorHandler );
|
||||
|
||||
#if ENABLE_INPUT_SYSTEM && !ENABLE_LEGACY_INPUT_MANAGER
|
||||
// On new Input System, scroll sensitivity is much higher than legacy Input system
|
||||
filesScrollRect.scrollSensitivity *= 0.25f;
|
||||
quickLinksContainer.GetComponentInParent<ScrollRect>().scrollSensitivity *= 0.25f;
|
||||
filtersDropdownContainer.GetComponent<ScrollRect>().scrollSensitivity *= 0.25f;
|
||||
#endif
|
||||
}
|
||||
|
||||
private void OnRectTransformDimensionsChange()
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3a9b453b46274425981a83d68df6473f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,798 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &-9130214687075653806
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: e021b4c809a781e468c2988c016ebbea, type: 3}
|
||||
m_Name: ColorLookup
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.ColorLookup
|
||||
active: 1
|
||||
texture:
|
||||
m_OverrideState: 1
|
||||
m_Value: {fileID: 0}
|
||||
dimension: 1
|
||||
contribution:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
--- !u!114 &-7817018176999065160
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 06437c1ff663d574d9447842ba0a72e4, type: 3}
|
||||
m_Name: ScreenSpaceLensFlare
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.ScreenSpaceLensFlare
|
||||
active: 1
|
||||
intensity:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
tintColor:
|
||||
m_OverrideState: 1
|
||||
m_Value: {r: 1, g: 1, b: 1, a: 1}
|
||||
bloomMip:
|
||||
m_OverrideState: 1
|
||||
m_Value: 1
|
||||
firstFlareIntensity:
|
||||
m_OverrideState: 1
|
||||
m_Value: 1
|
||||
secondaryFlareIntensity:
|
||||
m_OverrideState: 1
|
||||
m_Value: 1
|
||||
warpedFlareIntensity:
|
||||
m_OverrideState: 1
|
||||
m_Value: 1
|
||||
warpedFlareScale:
|
||||
m_OverrideState: 1
|
||||
m_Value: {x: 1, y: 1}
|
||||
samples:
|
||||
m_OverrideState: 1
|
||||
m_Value: 1
|
||||
sampleDimmer:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0.5
|
||||
vignetteEffect:
|
||||
m_OverrideState: 1
|
||||
m_Value: 1
|
||||
startingPosition:
|
||||
m_OverrideState: 1
|
||||
m_Value: 1.25
|
||||
scale:
|
||||
m_OverrideState: 1
|
||||
m_Value: 1.5
|
||||
streaksIntensity:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
streaksLength:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0.5
|
||||
streaksOrientation:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
streaksThreshold:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0.25
|
||||
resolution:
|
||||
m_OverrideState: 1
|
||||
m_Value: 4
|
||||
chromaticAbberationIntensity:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0.5
|
||||
--- !u!114 &-7524763356354129735
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 558a8e2b6826cf840aae193990ba9f2e, type: 3}
|
||||
m_Name: ShadowsMidtonesHighlights
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.ShadowsMidtonesHighlights
|
||||
active: 1
|
||||
shadows:
|
||||
m_OverrideState: 1
|
||||
m_Value: {x: 1, y: 1, z: 1, w: 0}
|
||||
midtones:
|
||||
m_OverrideState: 1
|
||||
m_Value: {x: 1, y: 1, z: 1, w: 0}
|
||||
highlights:
|
||||
m_OverrideState: 1
|
||||
m_Value: {x: 1, y: 1, z: 1, w: 0}
|
||||
shadowsStart:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
shadowsEnd:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0.3
|
||||
highlightsStart:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0.55
|
||||
highlightsEnd:
|
||||
m_OverrideState: 1
|
||||
m_Value: 1
|
||||
--- !u!114 &-7318447834972133286
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: c01700fd266d6914ababb731e09af2eb, type: 3}
|
||||
m_Name: DepthOfField
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.DepthOfField
|
||||
active: 1
|
||||
mode:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
gaussianStart:
|
||||
m_OverrideState: 1
|
||||
m_Value: 10
|
||||
gaussianEnd:
|
||||
m_OverrideState: 1
|
||||
m_Value: 30
|
||||
gaussianMaxRadius:
|
||||
m_OverrideState: 1
|
||||
m_Value: 1
|
||||
highQualitySampling:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
focusDistance:
|
||||
m_OverrideState: 1
|
||||
m_Value: 10
|
||||
aperture:
|
||||
m_OverrideState: 1
|
||||
m_Value: 5.6
|
||||
focalLength:
|
||||
m_OverrideState: 1
|
||||
m_Value: 50
|
||||
bladeCount:
|
||||
m_OverrideState: 1
|
||||
m_Value: 5
|
||||
bladeCurvature:
|
||||
m_OverrideState: 1
|
||||
m_Value: 1
|
||||
bladeRotation:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
--- !u!114 &-5971228661365037280
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 221518ef91623a7438a71fef23660601, type: 3}
|
||||
m_Name: WhiteBalance
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.WhiteBalance
|
||||
active: 1
|
||||
temperature:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
tint:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
--- !u!114 &-5807738211224766849
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 0b2db86121404754db890f4c8dfe81b2, type: 3}
|
||||
m_Name: Bloom
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.Bloom
|
||||
active: 1
|
||||
skipIterations:
|
||||
m_OverrideState: 1
|
||||
m_Value: 1
|
||||
threshold:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0.9
|
||||
intensity:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
scatter:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0.7
|
||||
clamp:
|
||||
m_OverrideState: 1
|
||||
m_Value: 65472
|
||||
tint:
|
||||
m_OverrideState: 1
|
||||
m_Value: {r: 1, g: 1, b: 1, a: 1}
|
||||
highQualityFiltering:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
filter:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
downscale:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
maxIterations:
|
||||
m_OverrideState: 1
|
||||
m_Value: 6
|
||||
dirtTexture:
|
||||
m_OverrideState: 1
|
||||
m_Value: {fileID: 0}
|
||||
dimension: 1
|
||||
dirtIntensity:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
--- !u!114 &-3309307926141130900
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 66f335fb1ffd8684294ad653bf1c7564, type: 3}
|
||||
m_Name: ColorAdjustments
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.ColorAdjustments
|
||||
active: 1
|
||||
postExposure:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
contrast:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
colorFilter:
|
||||
m_OverrideState: 1
|
||||
m_Value: {r: 1, g: 1, b: 1, a: 1}
|
||||
hueShift:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
saturation:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
--- !u!114 &-3033684091244297705
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5485954d14dfb9a4c8ead8edb0ded5b1, type: 3}
|
||||
m_Name: LiftGammaGain
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.LiftGammaGain
|
||||
active: 1
|
||||
lift:
|
||||
m_OverrideState: 1
|
||||
m_Value: {x: 1, y: 1, z: 1, w: 0}
|
||||
gamma:
|
||||
m_OverrideState: 1
|
||||
m_Value: {x: 1, y: 1, z: 1, w: 0}
|
||||
gain:
|
||||
m_OverrideState: 1
|
||||
m_Value: {x: 1, y: 1, z: 1, w: 0}
|
||||
--- !u!114 &-2693817965025424784
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: c5e1dc532bcb41949b58bc4f2abfbb7e, type: 3}
|
||||
m_Name: LensDistortion
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.LensDistortion
|
||||
active: 1
|
||||
intensity:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
xMultiplier:
|
||||
m_OverrideState: 1
|
||||
m_Value: 1
|
||||
yMultiplier:
|
||||
m_OverrideState: 1
|
||||
m_Value: 1
|
||||
center:
|
||||
m_OverrideState: 1
|
||||
m_Value: {x: 0.5, y: 0.5}
|
||||
scale:
|
||||
m_OverrideState: 1
|
||||
m_Value: 1
|
||||
--- !u!114 &-2240148774783229831
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fb60a22f311433c4c962b888d1393f88, type: 3}
|
||||
m_Name: PaniniProjection
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.PaniniProjection
|
||||
active: 1
|
||||
distance:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
cropToFit:
|
||||
m_OverrideState: 1
|
||||
m_Value: 1
|
||||
--- !u!114 &-1722524011614745028
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 3eb4b772797da9440885e8bd939e9560, type: 3}
|
||||
m_Name: ColorCurves
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.ColorCurves
|
||||
active: 1
|
||||
master:
|
||||
m_OverrideState: 1
|
||||
m_Value:
|
||||
<length>k__BackingField: 2
|
||||
m_Loop: 0
|
||||
m_ZeroValue: 0
|
||||
m_Range: 1
|
||||
m_Curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 1
|
||||
outSlope: 1
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
- serializedVersion: 3
|
||||
time: 1
|
||||
value: 1
|
||||
inSlope: 1
|
||||
outSlope: 1
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
red:
|
||||
m_OverrideState: 1
|
||||
m_Value:
|
||||
<length>k__BackingField: 2
|
||||
m_Loop: 0
|
||||
m_ZeroValue: 0
|
||||
m_Range: 1
|
||||
m_Curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 1
|
||||
outSlope: 1
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
- serializedVersion: 3
|
||||
time: 1
|
||||
value: 1
|
||||
inSlope: 1
|
||||
outSlope: 1
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
green:
|
||||
m_OverrideState: 1
|
||||
m_Value:
|
||||
<length>k__BackingField: 2
|
||||
m_Loop: 0
|
||||
m_ZeroValue: 0
|
||||
m_Range: 1
|
||||
m_Curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 1
|
||||
outSlope: 1
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
- serializedVersion: 3
|
||||
time: 1
|
||||
value: 1
|
||||
inSlope: 1
|
||||
outSlope: 1
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
blue:
|
||||
m_OverrideState: 1
|
||||
m_Value:
|
||||
<length>k__BackingField: 2
|
||||
m_Loop: 0
|
||||
m_ZeroValue: 0
|
||||
m_Range: 1
|
||||
m_Curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 1
|
||||
outSlope: 1
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
- serializedVersion: 3
|
||||
time: 1
|
||||
value: 1
|
||||
inSlope: 1
|
||||
outSlope: 1
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
hueVsHue:
|
||||
m_OverrideState: 1
|
||||
m_Value:
|
||||
<length>k__BackingField: 0
|
||||
m_Loop: 1
|
||||
m_ZeroValue: 0.5
|
||||
m_Range: 1
|
||||
m_Curve:
|
||||
serializedVersion: 2
|
||||
m_Curve: []
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
hueVsSat:
|
||||
m_OverrideState: 1
|
||||
m_Value:
|
||||
<length>k__BackingField: 0
|
||||
m_Loop: 1
|
||||
m_ZeroValue: 0.5
|
||||
m_Range: 1
|
||||
m_Curve:
|
||||
serializedVersion: 2
|
||||
m_Curve: []
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
satVsSat:
|
||||
m_OverrideState: 1
|
||||
m_Value:
|
||||
<length>k__BackingField: 0
|
||||
m_Loop: 0
|
||||
m_ZeroValue: 0.5
|
||||
m_Range: 1
|
||||
m_Curve:
|
||||
serializedVersion: 2
|
||||
m_Curve: []
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
lumVsSat:
|
||||
m_OverrideState: 1
|
||||
m_Value:
|
||||
<length>k__BackingField: 0
|
||||
m_Loop: 0
|
||||
m_ZeroValue: 0.5
|
||||
m_Range: 1
|
||||
m_Curve:
|
||||
serializedVersion: 2
|
||||
m_Curve: []
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
--- !u!114 &-383874240308919227
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: ccf1aba9553839d41ae37dd52e9ebcce, type: 3}
|
||||
m_Name: MotionBlur
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.MotionBlur
|
||||
active: 1
|
||||
mode:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
quality:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
intensity:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
clamp:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0.05
|
||||
--- !u!114 &-355272577634162072
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 70afe9e12c7a7ed47911bb608a23a8ff, type: 3}
|
||||
m_Name: SplitToning
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.SplitToning
|
||||
active: 1
|
||||
shadows:
|
||||
m_OverrideState: 1
|
||||
m_Value: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||
highlights:
|
||||
m_OverrideState: 1
|
||||
m_Value: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||
balance:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d7fd9488000d3734a9e00ee676215985, type: 3}
|
||||
m_Name: DefaultVolumeProfile
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.Core.Runtime::UnityEngine.Rendering.VolumeProfile
|
||||
components:
|
||||
- {fileID: -5807738211224766849}
|
||||
- {fileID: -1722524011614745028}
|
||||
- {fileID: -7318447834972133286}
|
||||
- {fileID: 2578353125976525908}
|
||||
- {fileID: -2240148774783229831}
|
||||
- {fileID: -7817018176999065160}
|
||||
- {fileID: 355823587882295533}
|
||||
- {fileID: -383874240308919227}
|
||||
- {fileID: 7634164242146030439}
|
||||
- {fileID: 2142330103019606968}
|
||||
- {fileID: -355272577634162072}
|
||||
- {fileID: -3309307926141130900}
|
||||
- {fileID: -2693817965025424784}
|
||||
- {fileID: -9130214687075653806}
|
||||
- {fileID: -3033684091244297705}
|
||||
- {fileID: -5971228661365037280}
|
||||
- {fileID: 1479729400236365617}
|
||||
- {fileID: -7524763356354129735}
|
||||
- {fileID: 8344855468588184016}
|
||||
--- !u!114 &355823587882295533
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 97c23e3b12dc18c42a140437e53d3951, type: 3}
|
||||
m_Name: Tonemapping
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.Tonemapping
|
||||
active: 1
|
||||
mode:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
neutralHDRRangeReductionMode:
|
||||
m_OverrideState: 1
|
||||
m_Value: 2
|
||||
acesPreset:
|
||||
m_OverrideState: 1
|
||||
m_Value: 3
|
||||
hueShiftAmount:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
detectPaperWhite:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
paperWhite:
|
||||
m_OverrideState: 1
|
||||
m_Value: 300
|
||||
detectBrightnessLimits:
|
||||
m_OverrideState: 1
|
||||
m_Value: 1
|
||||
minNits:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0.005
|
||||
maxNits:
|
||||
m_OverrideState: 1
|
||||
m_Value: 1000
|
||||
--- !u!114 &1479729400236365617
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 81180773991d8724ab7f2d216912b564, type: 3}
|
||||
m_Name: ChromaticAberration
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.ChromaticAberration
|
||||
active: 1
|
||||
intensity:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
--- !u!114 &2142330103019606968
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: cdfbdbb87d3286943a057f7791b43141, type: 3}
|
||||
m_Name: ChannelMixer
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.ChannelMixer
|
||||
active: 1
|
||||
redOutRedIn:
|
||||
m_OverrideState: 1
|
||||
m_Value: 100
|
||||
redOutGreenIn:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
redOutBlueIn:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
greenOutRedIn:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
greenOutGreenIn:
|
||||
m_OverrideState: 1
|
||||
m_Value: 100
|
||||
greenOutBlueIn:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
blueOutRedIn:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
blueOutGreenIn:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
blueOutBlueIn:
|
||||
m_OverrideState: 1
|
||||
m_Value: 100
|
||||
--- !u!114 &2578353125976525908
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 29fa0085f50d5e54f8144f766051a691, type: 3}
|
||||
m_Name: FilmGrain
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.FilmGrain
|
||||
active: 1
|
||||
type:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
intensity:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
response:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0.8
|
||||
texture:
|
||||
m_OverrideState: 1
|
||||
m_Value: {fileID: 0}
|
||||
--- !u!114 &7634164242146030439
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 899c54efeace73346a0a16faa3afe726, type: 3}
|
||||
m_Name: Vignette
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.Vignette
|
||||
active: 1
|
||||
color:
|
||||
m_OverrideState: 1
|
||||
m_Value: {r: 0, g: 0, b: 0, a: 1}
|
||||
center:
|
||||
m_OverrideState: 1
|
||||
m_Value: {x: 0.5, y: 0.5}
|
||||
intensity:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
smoothness:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0.2
|
||||
rounded:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
--- !u!114 &8344855468588184016
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 6bd486065ce11414fa40e631affc4900, type: 3}
|
||||
m_Name: ProbeVolumesOptions
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.Core.Runtime::UnityEngine.Rendering.ProbeVolumesOptions
|
||||
active: 1
|
||||
normalBias:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0.05
|
||||
viewBias:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0.1
|
||||
scaleBiasWithMinProbeDistance:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
samplingNoise:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0.1
|
||||
animateSamplingNoise:
|
||||
m_OverrideState: 1
|
||||
m_Value: 1
|
||||
leakReductionMode:
|
||||
m_OverrideState: 1
|
||||
m_Value: 2
|
||||
minValidDotProductValue:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0.1
|
||||
occlusionOnlyReflectionNormalization:
|
||||
m_OverrideState: 1
|
||||
m_Value: 1
|
||||
intensityMultiplier:
|
||||
m_OverrideState: 1
|
||||
m_Value: 1
|
||||
skyOcclusionIntensityMultiplier:
|
||||
m_OverrideState: 1
|
||||
m_Value: 1
|
||||
worldOffset:
|
||||
m_OverrideState: 1
|
||||
m_Value: {x: 0, y: 0, z: 0}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 580f5421befb34b3bab2e8645d38d6b6
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,99 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: de640fe3d0db1804a85f9fc8f5cadab6, type: 3}
|
||||
m_Name: Pal3 Forward+ Renderer
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.UniversalRendererData
|
||||
debugShaders:
|
||||
debugReplacementPS: {fileID: 4800000, guid: cf852408f2e174538bcd9b7fda1c5ae7, type: 3}
|
||||
hdrDebugViewPS: {fileID: 4800000, guid: 573620ae32aec764abd4d728906d2587, type: 3}
|
||||
probeVolumeSamplingDebugComputeShader: {fileID: 7200000, guid: 53626a513ea68ce47b59dc1299fe3959, type: 3}
|
||||
probeVolumeResources:
|
||||
probeVolumeDebugShader: {fileID: 0}
|
||||
probeVolumeFragmentationDebugShader: {fileID: 0}
|
||||
probeVolumeOffsetDebugShader: {fileID: 0}
|
||||
probeVolumeSamplingDebugShader: {fileID: 0}
|
||||
probeSamplingDebugMesh: {fileID: 0}
|
||||
probeSamplingDebugTexture: {fileID: 0}
|
||||
probeVolumeBlendStatesCS: {fileID: 0}
|
||||
m_RendererFeatures:
|
||||
- {fileID: 6015277420500135746}
|
||||
- {fileID: 7317615400953120047}
|
||||
m_RendererFeatureMap: 42af5692f18e7a532f05bdd06f648d65
|
||||
xrSystemData: {fileID: 0}
|
||||
postProcessData: {fileID: 11400000, guid: 41439944d30ece34e96484bdb6645b55, type: 2}
|
||||
m_AssetVersion: 3
|
||||
m_PrepassLayerMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_OpaqueLayerMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_TransparentLayerMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_DefaultStencilState:
|
||||
overrideStencilState: 0
|
||||
stencilReference: 0
|
||||
stencilCompareFunction: 8
|
||||
passOperation: 2
|
||||
failOperation: 0
|
||||
zFailOperation: 0
|
||||
m_ShadowTransparentReceive: 1
|
||||
m_RenderingMode: 2
|
||||
m_DepthPrimingMode: 0
|
||||
m_CopyDepthMode: 1
|
||||
m_DepthAttachmentFormat: 0
|
||||
m_DepthTextureFormat: 0
|
||||
m_AccurateGbufferNormals: 0
|
||||
m_IntermediateTextureMode: 0
|
||||
m_TileOnlyMode: 0
|
||||
--- !u!114 &6015277420500135746
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4d674bdfa579425487f9e1b03d25758e, type: 3}
|
||||
m_Name: Pal3 Screen Effects
|
||||
m_EditorClassIdentifier: Pal3.Game::Pal3.Game.Rendering.ScreenEffects.Pal3ScreenEffectsFeature
|
||||
m_Active: 1
|
||||
distortionShader: {fileID: 4800000, guid: 0b8bcccc572f924448668c94cfa547b4, type: 3}
|
||||
snowShader: {fileID: 4800000, guid: 310e70fe34ae470e9e0521e3fbb649d0, type: 3}
|
||||
--- !u!114 &7317615400953120047
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 8375d96629014bce9e8f3ecf7aad6a08, type: 3}
|
||||
m_Name: Toon Contact Shadows
|
||||
m_EditorClassIdentifier: Pal3.Game::Pal3.Game.Rendering.Toon.ToonAmbientOcclusionFeature
|
||||
m_Active: 1
|
||||
m_Settings:
|
||||
AOMethod: 0
|
||||
Downsample: 1
|
||||
AfterOpaque: 0
|
||||
Source: 1
|
||||
NormalSamples: 2
|
||||
Intensity: 0.95
|
||||
DirectLightingStrength: 0
|
||||
Radius: 0.32
|
||||
Samples: 1
|
||||
BlurQuality: 0
|
||||
Falloff: 60
|
||||
SampleCount: -1
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c20ae1cdbb0ac4acb80371ee4652c8ba
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,148 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: bf2edee5c58d82540a51f03df9d42094, type: 3}
|
||||
m_Name: Pal3 URP
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.UniversalRenderPipelineAsset
|
||||
k_AssetVersion: 13
|
||||
k_AssetPreviousVersion: 13
|
||||
m_RendererType: 1
|
||||
m_RendererData: {fileID: 0}
|
||||
m_RendererDataList:
|
||||
- {fileID: 11400000, guid: c20ae1cdbb0ac4acb80371ee4652c8ba, type: 2}
|
||||
m_DefaultRendererIndex: 0
|
||||
m_RequireDepthTexture: 0
|
||||
m_RequireOpaqueTexture: 0
|
||||
m_OpaqueDownsampling: 1
|
||||
m_SupportsTerrainHoles: 1
|
||||
m_SupportsHDR: 1
|
||||
m_HDRColorBufferPrecision: 0
|
||||
m_MSAA: 1
|
||||
m_RenderScale: 1
|
||||
m_UpscalingFilter: 0
|
||||
m_FsrOverrideSharpness: 0
|
||||
m_FsrSharpness: 0.92
|
||||
m_EnableLODCrossFade: 1
|
||||
m_LODCrossFadeDitheringType: 1
|
||||
m_ShEvalMode: 0
|
||||
m_LightProbeSystem: 0
|
||||
m_ProbeVolumeMemoryBudget: 1024
|
||||
m_ProbeVolumeBlendingMemoryBudget: 256
|
||||
m_SupportProbeVolumeGPUStreaming: 0
|
||||
m_SupportProbeVolumeDiskStreaming: 0
|
||||
m_SupportProbeVolumeScenarios: 0
|
||||
m_SupportProbeVolumeScenarioBlending: 0
|
||||
m_ProbeVolumeSHBands: 1
|
||||
m_MainLightRenderingMode: 1
|
||||
m_MainLightShadowsSupported: 1
|
||||
m_MainLightShadowmapResolution: 2048
|
||||
m_AdditionalLightsRenderingMode: 1
|
||||
m_AdditionalLightsPerObjectLimit: 2
|
||||
m_AdditionalLightShadowsSupported: 1
|
||||
m_AdditionalLightsShadowmapResolution: 1024
|
||||
m_AdditionalLightsShadowResolutionTierLow: 256
|
||||
m_AdditionalLightsShadowResolutionTierMedium: 512
|
||||
m_AdditionalLightsShadowResolutionTierHigh: 1024
|
||||
m_ReflectionProbeBlending: 0
|
||||
m_ReflectionProbeBoxProjection: 0
|
||||
m_ReflectionProbeAtlas: 1
|
||||
m_ShadowDistance: 85
|
||||
m_ShadowCascadeCount: 2
|
||||
m_Cascade2Split: 0.62
|
||||
m_Cascade3Split: {x: 0.1, y: 0.3}
|
||||
m_Cascade4Split: {x: 0.067, y: 0.2, z: 0.467}
|
||||
m_CascadeBorder: 0.2
|
||||
m_ShadowDepthBias: 1
|
||||
m_ShadowNormalBias: 1
|
||||
m_AnyShadowsSupported: 1
|
||||
m_SoftShadowsSupported: 1
|
||||
m_ConservativeEnclosingSphere: 1
|
||||
m_NumIterationsEnclosingSphere: 64
|
||||
m_SoftShadowQuality: 1
|
||||
m_AdditionalLightsCookieResolution: 2048
|
||||
m_AdditionalLightsCookieFormat: 3
|
||||
m_UseSRPBatcher: 1
|
||||
m_SupportsDynamicBatching: 0
|
||||
m_MixedLightingSupported: 1
|
||||
m_SupportsLightCookies: 1
|
||||
m_SupportsLightLayers: 0
|
||||
m_StoreActionsOptimization: 0
|
||||
m_UseAdaptivePerformance: 1
|
||||
m_ColorGradingMode: 0
|
||||
m_ColorGradingLutSize: 32
|
||||
m_AllowPostProcessAlphaOutput: 0
|
||||
m_UseFastSRGBLinearConversion: 0
|
||||
m_SupportDataDrivenLensFlare: 1
|
||||
m_SupportScreenSpaceLensFlare: 1
|
||||
m_GPUResidentDrawerMode: 0
|
||||
m_SmallMeshScreenPercentage: 0
|
||||
m_ShadowSmallMeshScreenPercentages: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_GPUResidentDrawerEnableOcclusionCullingInCameras: 0
|
||||
m_ShadowType: 1
|
||||
m_LocalShadowsSupported: 0
|
||||
m_LocalShadowsAtlasResolution: 256
|
||||
m_MaxPixelLights: 0
|
||||
m_ShadowAtlasResolution: 256
|
||||
m_VolumeFrameworkUpdateMode: 0
|
||||
m_VolumeProfile: {fileID: 0}
|
||||
apvScenesData:
|
||||
obsoleteSceneBounds:
|
||||
m_Keys: []
|
||||
m_Values: []
|
||||
obsoleteHasProbeVolumes:
|
||||
m_Keys: []
|
||||
m_Values:
|
||||
m_PrefilteringModeMainLightShadows: 1
|
||||
m_PrefilteringModeAdditionalLight: 4
|
||||
m_PrefilteringModeAdditionalLightShadows: 1
|
||||
m_PrefilterXRKeywords: 0
|
||||
m_PrefilteringModeForwardPlus: 1
|
||||
m_PrefilteringModeDeferredRendering: 1
|
||||
m_PrefilteringModeScreenSpaceOcclusion: 1
|
||||
m_PrefilteringModeScreenSpaceReflection: 1
|
||||
m_PrefilterWriteSmoothness: 1
|
||||
m_PrefilterDebugKeywords: 0
|
||||
m_PrefilterWriteRenderingLayers: 0
|
||||
m_PrefilterHDROutput: 0
|
||||
m_PrefilterAlphaOutput: 0
|
||||
m_PrefilterSSAODepthNormals: 0
|
||||
m_PrefilterSSAOSourceDepthLow: 0
|
||||
m_PrefilterSSAOSourceDepthMedium: 0
|
||||
m_PrefilterSSAOSourceDepthHigh: 0
|
||||
m_PrefilterSSAOInterleaved: 0
|
||||
m_PrefilterSSAOBlueNoise: 0
|
||||
m_PrefilterSSAOSampleCountLow: 0
|
||||
m_PrefilterSSAOSampleCountMedium: 0
|
||||
m_PrefilterSSAOSampleCountHigh: 0
|
||||
m_PrefilterDBufferMRT1: 0
|
||||
m_PrefilterDBufferMRT2: 0
|
||||
m_PrefilterDBufferMRT3: 0
|
||||
m_PrefilterSoftShadowsQualityLow: 0
|
||||
m_PrefilterSoftShadowsQualityMedium: 0
|
||||
m_PrefilterSoftShadowsQualityHigh: 0
|
||||
m_PrefilterSoftShadows: 0
|
||||
m_PrefilterScreenCoord: 0
|
||||
m_PrefilterScreenSpaceIrradiance: 0
|
||||
m_PrefilterNativeRenderPass: 0
|
||||
m_PrefilterUseLegacyLightmaps: 0
|
||||
m_PrefilterBicubicLightmapSampling: 0
|
||||
m_PrefilterReflectionProbeRotation: 0
|
||||
m_PrefilterReflectionProbeBlending: 0
|
||||
m_PrefilterReflectionProbeBoxProjection: 0
|
||||
m_PrefilterReflectionProbeAtlas: 0
|
||||
m_PrefilterPointSamplingUpsampling: 0
|
||||
m_Light2DPrefilteringMode: 0
|
||||
m_Light2DKeptVariantCombos: []
|
||||
m_ShaderVariantLogLevel: 0
|
||||
m_ShadowCascades: 0
|
||||
m_Textures:
|
||||
blueNoise64LTex: {fileID: 2800000, guid: e3d24661c1e055f45a7560c033dbb837, type: 3}
|
||||
bayerMatrixTex: {fileID: 2800000, guid: f9ee4ed84c1d10c49aabb9b210b0fc44, type: 3}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 895616fcdb17845859539e6c06adacb2
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5bf027559c874e4a8e859473daf66566
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+10
-8
@@ -1,7 +1,7 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// ------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
/*
|
||||
reference: https://www.shadertoy.com/view/MsKXDh
|
||||
@@ -17,15 +17,16 @@ Shader "Pal3/PostEffectDistortion"
|
||||
}
|
||||
|
||||
HLSLINCLUDE
|
||||
#include "Packages/com.unity.postprocessing/PostProcessing/Shaders/StdLib.hlsl"
|
||||
TEXTURE2D_SAMPLER2D(_MainTex, sampler_MainTex);
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
#include "Packages/com.unity.render-pipelines.core/Runtime/Utilities/Blit.hlsl"
|
||||
|
||||
float _TimeScale;
|
||||
float _XFactor;
|
||||
float _YFactor;
|
||||
|
||||
float4 Frag(VaryingsDefault i) : SV_Target
|
||||
float4 Frag(Varyings i) : SV_Target
|
||||
{
|
||||
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
|
||||
float2 uv = i.texcoord;
|
||||
const float time = _Time.y;
|
||||
|
||||
@@ -35,18 +36,19 @@ Shader "Pal3/PostEffectDistortion"
|
||||
uv.x += sin((uv.y+uv.x) * _XFactor + time * _TimeScale) / (180.0 + (_TimeScale * sin(time)));
|
||||
uv.y += cos((uv.y+uv.x) * _YFactor + time * _TimeScale) / (200.0 + (_TimeScale * sin(time)));
|
||||
|
||||
float4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex,uv);
|
||||
float4 col = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp,uv);
|
||||
return col;
|
||||
}
|
||||
ENDHLSL
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags { "RenderPipeline" = "UniversalPipeline" }
|
||||
Cull Off ZWrite Off ZTest Always
|
||||
Pass
|
||||
{
|
||||
HLSLPROGRAM
|
||||
#pragma vertex VertDefault
|
||||
#pragma vertex Vert
|
||||
#pragma fragment Frag
|
||||
ENDHLSL
|
||||
}
|
||||
File renamed without changes.
@@ -0,0 +1,108 @@
|
||||
// ------------------------------------------------------------------------
|
||||
// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
// Based on cician's shader from https://forum.unity3d.com/threads/simple-optimized-blur-shader.185327/#post-1267642
|
||||
// Based on RoundedCorners.shader from https://github.com/kirevdokimov/Unity-UI-Rounded-Corners
|
||||
// with some modifications
|
||||
|
||||
Shader "Pal3/RoundedFrostedGlass"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_BlurAmount ("Blur", Range(0, 30)) = 1
|
||||
_Transparency ("Transparency", Range(0, 1)) = 1
|
||||
[HideInInspector] _MainTex ("Masking Texture", 2D) = "white" {}
|
||||
_AdditiveColor ("Additive Tint color", Color) = (0, 0, 0, 0)
|
||||
_MultiplyColor ("Multiply Tint color", Color) = (1, 1, 1, 1)
|
||||
_WidthHeightRadius ("WidthHeightRadius", Vector) = (0, 0, 0, 0)
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags { "RenderPipeline" = "UniversalPipeline" "Queue" = "Transparent" "RenderType" = "Transparent" }
|
||||
Cull Off
|
||||
ZTest [unity_GUIZTestMode]
|
||||
ZWrite Off
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
|
||||
Pass
|
||||
{
|
||||
HLSLPROGRAM
|
||||
#pragma vertex Vert
|
||||
#pragma fragment Frag
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
|
||||
TEXTURE2D(_MainTex);
|
||||
SAMPLER(sampler_MainTex);
|
||||
TEXTURE2D(_Pal3SceneColor);
|
||||
|
||||
CBUFFER_START(UnityPerMaterial)
|
||||
float4 _MainTex_ST;
|
||||
float4 _WidthHeightRadius;
|
||||
half4 _AdditiveColor;
|
||||
half4 _MultiplyColor;
|
||||
float _BlurAmount;
|
||||
float _Transparency;
|
||||
CBUFFER_END
|
||||
|
||||
struct Attributes
|
||||
{
|
||||
float4 positionOS : POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
half4 color : COLOR;
|
||||
};
|
||||
|
||||
struct Varyings
|
||||
{
|
||||
float4 positionCS : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
float4 screenPosition : TEXCOORD1;
|
||||
half alpha : TEXCOORD2;
|
||||
};
|
||||
|
||||
Varyings Vert(Attributes input)
|
||||
{
|
||||
Varyings output;
|
||||
output.positionCS = TransformObjectToHClip(input.positionOS.xyz);
|
||||
output.uv = TRANSFORM_TEX(input.uv, _MainTex);
|
||||
output.screenPosition = output.positionCS;
|
||||
output.alpha = input.color.a;
|
||||
return output;
|
||||
}
|
||||
|
||||
half4 Frag(Varyings input) : SV_Target
|
||||
{
|
||||
float2 size = _WidthHeightRadius.xy;
|
||||
float radius = _WidthHeightRadius.z * 0.5;
|
||||
float2 edge = abs((input.uv - 0.5) * size) - (size * 0.5 - radius);
|
||||
float distanceToRect = length(max(edge, 0)) + min(max(edge.x, edge.y), 0) - radius;
|
||||
float edgeWidth = max(fwidth(distanceToRect), 0.001);
|
||||
float roundedAlpha = 1.0 - smoothstep(-edgeWidth, edgeWidth, distanceToRect);
|
||||
half mask = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, input.uv).a;
|
||||
|
||||
// The URP color copy uses Unity's bottom-left texture orientation.
|
||||
float2 uv = input.screenPosition.xy / input.screenPosition.w * 0.5 + 0.5;
|
||||
float2 pixelSize = abs(float2(ddx(uv.x), ddy(uv.y)));
|
||||
float2 delta = pixelSize * (_BlurAmount * 1.2);
|
||||
half3 blurred = 0;
|
||||
[unroll] for (int y = -1; y <= 1; y++)
|
||||
{
|
||||
[unroll] for (int x = -1; x <= 1; x++)
|
||||
{
|
||||
// Bilinear taps approximate a separable five-tap Gaussian.
|
||||
half weightX = x == 0 ? 0.375 : 0.3125;
|
||||
half weightY = y == 0 ? 0.375 : 0.3125;
|
||||
blurred += SAMPLE_TEXTURE2D(_Pal3SceneColor, sampler_LinearClamp,
|
||||
uv + float2(x, y) * delta).rgb * (weightX * weightY);
|
||||
}
|
||||
}
|
||||
|
||||
return half4(blurred * _MultiplyColor.rgb + _AdditiveColor.rgb,
|
||||
mask * roundedAlpha * _Transparency * input.alpha);
|
||||
}
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
}
|
||||
File renamed without changes.
+11
-8
@@ -1,7 +1,8 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// ------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
// Based on https://www.shadertoy.com/view/4dl3R4
|
||||
|
||||
Shader "Pal3/Snow"
|
||||
@@ -13,8 +14,8 @@ Shader "Pal3/Snow"
|
||||
}
|
||||
|
||||
HLSLINCLUDE
|
||||
#include "Packages/com.unity.postprocessing/PostProcessing/Shaders/StdLib.hlsl"
|
||||
TEXTURE2D_SAMPLER2D(_MainTex, sampler_MainTex);
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
#include "Packages/com.unity.render-pipelines.core/Runtime/Utilities/Blit.hlsl"
|
||||
|
||||
#define vec2 float2
|
||||
#define vec3 float3
|
||||
@@ -123,8 +124,9 @@ Shader "Pal3/Snow"
|
||||
return f;
|
||||
}
|
||||
|
||||
float4 Frag(VaryingsDefault i) : SV_Target
|
||||
float4 Frag(Varyings i) : SV_Target
|
||||
{
|
||||
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
|
||||
float2 uv = i.texcoord;
|
||||
float2 originUV = uv;
|
||||
const float time = _Time.y;
|
||||
@@ -166,18 +168,19 @@ Shader "Pal3/Snow"
|
||||
float Snowout=N5+N4+N3+N2+N1;
|
||||
|
||||
float4 snowColor = vec4(Snowout*0.9, Snowout, Snowout*1.1, 1.0);
|
||||
float4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex,originUV);
|
||||
float4 col = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, originUV);
|
||||
return col + snowColor;
|
||||
}
|
||||
ENDHLSL
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags { "RenderPipeline" = "UniversalPipeline" }
|
||||
Cull Off ZWrite Off ZTest Always
|
||||
Pass
|
||||
{
|
||||
HLSLPROGRAM
|
||||
#pragma vertex VertDefault
|
||||
#pragma vertex Vert
|
||||
#pragma fragment Frag
|
||||
ENDHLSL
|
||||
}
|
||||
File renamed without changes.
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9533b8de7e25413c95e416f6c0204c2f
|
||||
folderAsset: yes
|
||||
@@ -0,0 +1,55 @@
|
||||
// ------------------------------------------------------------------------
|
||||
// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
#include "Pal3ToonInput.hlsl"
|
||||
|
||||
struct ToonDepthVaryings
|
||||
{
|
||||
float4 positionCS : SV_POSITION;
|
||||
#if defined(PAL3_TOON_CUTOUT)
|
||||
float2 uv : TEXCOORD0;
|
||||
#endif
|
||||
#if defined(PAL3_TOON_DEPTH_NORMALS)
|
||||
half3 normalWS : TEXCOORD1;
|
||||
#endif
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
ToonDepthVaryings ToonDepthVertex(ToonAttributes input)
|
||||
{
|
||||
ToonDepthVaryings output;
|
||||
UNITY_SETUP_INSTANCE_ID(input);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
|
||||
output.positionCS = TransformObjectToHClip(input.positionOS.xyz);
|
||||
#if defined(PAL3_TOON_DEPTH_NORMALS)
|
||||
output.normalWS = TransformObjectToWorldNormal(input.normalOS);
|
||||
#endif
|
||||
#if defined(PAL3_TOON_CUTOUT)
|
||||
output.uv = TRANSFORM_TEX(input.uv, _MainTex);
|
||||
#endif
|
||||
return output;
|
||||
}
|
||||
|
||||
#if defined(PAL3_TOON_DEPTH_NORMALS)
|
||||
half4 ToonDepthFragment(ToonDepthVaryings input) : SV_Target
|
||||
#else
|
||||
half ToonDepthFragment(ToonDepthVaryings input) : SV_Target
|
||||
#endif
|
||||
{
|
||||
#if defined(PAL3_TOON_CUTOUT)
|
||||
clip(SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, input.uv).a - _Threshold);
|
||||
#endif
|
||||
#if defined(PAL3_TOON_DEPTH_NORMALS)
|
||||
float3 normalWS = SafeNormalize(input.normalWS);
|
||||
#if defined(_GBUFFER_NORMALS_OCT)
|
||||
float2 oct = saturate(PackNormalOctQuadEncode(normalWS) * 0.5 + 0.5);
|
||||
return half4(PackFloat2To888(oct), 0);
|
||||
#else
|
||||
return half4(normalWS, 0);
|
||||
#endif
|
||||
#else
|
||||
return input.positionCS.z;
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 96ecd7906a864113b94c845336992986
|
||||
@@ -0,0 +1,176 @@
|
||||
// ------------------------------------------------------------------------
|
||||
// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
#include "Pal3ToonInput.hlsl"
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
|
||||
|
||||
float _Pal3ToonCharacterLighting;
|
||||
float _Pal3ToonNightFireBoost;
|
||||
float4 _Pal3ToonSceneLighting;
|
||||
float4 _Pal3ToonEffectStrengths;
|
||||
|
||||
struct ToonVaryings
|
||||
{
|
||||
float4 positionCS : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
float2 lightmapUV : TEXCOORD1;
|
||||
float3 positionWS : TEXCOORD2;
|
||||
half3 normalWS : TEXCOORD3;
|
||||
float fogFactor : TEXCOORD4;
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
ToonVaryings ToonVertex(ToonAttributes input)
|
||||
{
|
||||
ToonVaryings output;
|
||||
UNITY_SETUP_INSTANCE_ID(input);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
|
||||
output.positionWS = TransformObjectToWorld(input.positionOS.xyz);
|
||||
output.positionCS = TransformWorldToHClip(output.positionWS);
|
||||
output.normalWS = TransformObjectToWorldNormal(input.normalOS);
|
||||
output.uv = TRANSFORM_TEX(input.uv, _MainTex);
|
||||
output.lightmapUV = TRANSFORM_TEX(input.lightmapUV, _ShadowTex);
|
||||
output.fogFactor = ComputeFogFactor(output.positionCS.z);
|
||||
return output;
|
||||
}
|
||||
|
||||
#if defined(_ADDITIONAL_LIGHTS)
|
||||
float3 ShadeToonFill(uint lightIndex, float3 positionWS, half3 normalWS)
|
||||
{
|
||||
Light light;
|
||||
#if defined(_ADDITIONAL_LIGHT_SHADOWS)
|
||||
if (_ReceiveShadows > 0.5)
|
||||
light = GetAdditionalLight(lightIndex, positionWS, half4(1, 1, 1, 1));
|
||||
else
|
||||
#endif
|
||||
light = GetAdditionalLight(lightIndex, positionWS);
|
||||
half weight = smoothstep(-0.16, 0.54, dot(normalWS, light.direction));
|
||||
return light.color * (weight * light.distanceAttenuation * light.shadowAttenuation);
|
||||
}
|
||||
#endif
|
||||
|
||||
half3 ShadeToon(half3 albedo, half3 baked, float4 positionCS, float3 positionWS, half3 normalWS)
|
||||
{
|
||||
Light key = GetMainLight();
|
||||
#if defined(MAIN_LIGHT_CALCULATE_SHADOWS)
|
||||
if (_ReceiveShadows > 0.5)
|
||||
key.shadowAttenuation = MainLightRealtimeShadow(TransformWorldToShadowCoord(positionWS));
|
||||
key.shadowAttenuation = lerp(key.shadowAttenuation, 1.0, GetMainLightShadowFade(positionWS));
|
||||
#endif
|
||||
half3 keyColor = key.color * key.distanceAttenuation;
|
||||
if (max(max(keyColor.r, keyColor.g), keyColor.b) <= 0.001)
|
||||
return albedo * baked;
|
||||
|
||||
half diffuse = dot(normalWS, key.direction);
|
||||
// Two narrow transitions give three value bands with softened edges.
|
||||
half bands = 0.19 * smoothstep(-0.18, -0.06, diffuse) + 0.38 * smoothstep(0.34, 0.46, diffuse);
|
||||
half3 viewDir = GetWorldSpaceNormalizeViewDir(positionWS);
|
||||
half rim = smoothstep(0.67, 0.87, 1.0 - saturate(dot(normalWS, viewDir)));
|
||||
rim *= 0.14 * smoothstep(0.03, 0.45, diffuse);
|
||||
half night = _Pal3ToonSceneLighting.x;
|
||||
half indoors = _Pal3ToonSceneLighting.y;
|
||||
half contrast = _Pal3ToonSceneLighting.z;
|
||||
half visibility = lerp(lerp(0.22, 0.10, contrast), 1.0, key.shadowAttenuation);
|
||||
half3 ambient = lerp(half3(0.58, 0.59, 0.63), half3(0.29, 0.32, 0.46), night);
|
||||
half3 dayAmbient = lerp(half3(0.46, 0.48, 0.53), half3(0.40, 0.39, 0.39), indoors);
|
||||
half3 nightAmbient = lerp(half3(0.22, 0.27, 0.41), half3(0.20, 0.235, 0.33), indoors);
|
||||
ambient = lerp(ambient, lerp(dayAmbient, nightAmbient, night), contrast);
|
||||
UNITY_BRANCH
|
||||
if (_IsCharacter > 0.5 && _Pal3ToonCharacterLighting > 0.0)
|
||||
{
|
||||
// Retain facial readability while allowing the body and cast shadows to have contrast.
|
||||
half fillStrength = _Pal3ToonCharacterLighting;
|
||||
half3 characterAmbient = lerp(half3(0.72, 0.73, 0.77), half3(0.50, 0.52, 0.64), night);
|
||||
ambient = lerp(ambient, characterAmbient, fillStrength);
|
||||
half characterBands = 0.17 * smoothstep(-0.39, -0.19, diffuse) + 0.26 * smoothstep(0.26, 0.42, diffuse);
|
||||
bands = lerp(bands, characterBands, fillStrength);
|
||||
visibility = lerp(visibility, lerp(0.40, 1.0, key.shadowAttenuation), fillStrength);
|
||||
}
|
||||
half3 direct = keyColor * ((bands + rim) * visibility);
|
||||
|
||||
#if defined(_ADDITIONAL_LIGHTS)
|
||||
float3 fill = 0;
|
||||
#if USE_CLUSTER_LIGHT_LOOP
|
||||
InputData inputData = (InputData)0;
|
||||
inputData.positionWS = positionWS;
|
||||
inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(positionCS);
|
||||
|
||||
// URP stores additional directional lights outside the punctual light clusters.
|
||||
[loop] for (uint lightIndex = 0; lightIndex < min(URP_FP_DIRECTIONAL_LIGHTS_COUNT, MAX_VISIBLE_LIGHTS); ++lightIndex)
|
||||
{
|
||||
CLUSTER_LIGHT_LOOP_SUBTRACTIVE_LIGHT_CHECK
|
||||
fill += ShadeToonFill(lightIndex, positionWS, normalWS);
|
||||
}
|
||||
#endif
|
||||
uint lightCount = GetAdditionalLightsCount();
|
||||
LIGHT_LOOP_BEGIN(lightCount)
|
||||
fill += ShadeToonFill(lightIndex, positionWS, normalWS);
|
||||
LIGHT_LOOP_END
|
||||
float3 scaledFill = fill * lerp(0.34, 0.42, night * contrast);
|
||||
if (_Pal3ToonNightFireBoost > 0.5)
|
||||
{
|
||||
// Limit the fill without clipping its red and green channels separately.
|
||||
float peak = max(max(scaledFill.r, scaledFill.g), scaledFill.b);
|
||||
direct += scaledFill * (0.90 / (0.90 + peak));
|
||||
}
|
||||
else
|
||||
{
|
||||
direct += min(scaledFill, 0.45);
|
||||
}
|
||||
#endif
|
||||
|
||||
half occlusion = 1.0;
|
||||
#if !defined(PAL3_TOON_TRANSPARENT) && !defined(PAL3_TOON_WATER)
|
||||
UNITY_BRANCH
|
||||
if (_Pal3ToonEffectStrengths.x > 0.0)
|
||||
{
|
||||
// The per-camera switch also controls the SSAO pass. Sampling directly avoids
|
||||
// depending on URP retaining an SSAO-off shader variant for runtime toggles.
|
||||
half sampledAO = saturate(SampleAmbientOcclusion(GetNormalizedScreenSpaceUV(positionCS)));
|
||||
half strength = _Pal3ToonEffectStrengths.x;
|
||||
occlusion = lerp(1.0, sampledAO, min(strength, 1.0));
|
||||
occlusion = lerp(occlusion, sampledAO * sampledAO, saturate(strength - 1.0));
|
||||
// Prevent strong AO from obscuring small facial features.
|
||||
occlusion = lerp(occlusion, lerp(1.0, occlusion, 0.70), _IsCharacter * _Pal3ToonCharacterLighting);
|
||||
}
|
||||
#endif
|
||||
|
||||
half3 bakedVisibility = lerp(1.0, saturate(baked), _Pal3ToonEffectStrengths.y);
|
||||
// Static occlusion shapes ambient lighting; direct candle light can still brighten dark corners.
|
||||
half3 lighting = ambient * bakedVisibility * occlusion;
|
||||
lighting += direct * lerp(1.0, bakedVisibility, 0.55) * lerp(1.0, occlusion, 0.15);
|
||||
return albedo * lighting;
|
||||
}
|
||||
|
||||
half4 ToonFragment(ToonVaryings input) : SV_Target
|
||||
{
|
||||
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
|
||||
half4 color = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, input.uv);
|
||||
#if defined(PAL3_TOON_CUTOUT)
|
||||
clip(color.a - _Threshold);
|
||||
#elif defined(PAL3_TOON_TRANSPARENT)
|
||||
if (color.a >= _Threshold || (color.a <= 0.0 && _Threshold <= 1.0))
|
||||
discard;
|
||||
#endif
|
||||
|
||||
half3 baked = 1.0;
|
||||
if (_HasShadowTex > 0.5)
|
||||
baked = SAMPLE_TEXTURE2D(_ShadowTex, sampler_ShadowTex, input.lightmapUV).rgb * _LightmapScale;
|
||||
|
||||
color *= _TintColor;
|
||||
#if defined(PAL3_TOON_WATER)
|
||||
// The first frame defines opacity for the full water animation.
|
||||
color.a = _Alpha;
|
||||
#endif
|
||||
#if defined(PAL3_TOON_TRANSPARENT)
|
||||
if (_ReceiveLighting < 0.5)
|
||||
color.rgb *= baked;
|
||||
else
|
||||
#endif
|
||||
color.rgb = ShadeToon(color.rgb, baked, input.positionCS, input.positionWS, SafeNormalize(input.normalWS));
|
||||
|
||||
color.rgb = MixFog(color.rgb, input.fogFactor);
|
||||
return color;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7acecdde760249099a8143bb40d37f00
|
||||
@@ -0,0 +1,40 @@
|
||||
// ------------------------------------------------------------------------
|
||||
// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
#ifndef PAL3_TOON_INPUT_INCLUDED
|
||||
#define PAL3_TOON_INPUT_INCLUDED
|
||||
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
|
||||
TEXTURE2D(_MainTex);
|
||||
SAMPLER(sampler_MainTex);
|
||||
TEXTURE2D(_ShadowTex);
|
||||
SAMPLER(sampler_ShadowTex);
|
||||
|
||||
CBUFFER_START(UnityPerMaterial)
|
||||
float4 _MainTex_ST;
|
||||
float4 _ShadowTex_ST;
|
||||
half4 _TintColor;
|
||||
float _Threshold;
|
||||
float _HasShadowTex;
|
||||
float _LightmapScale;
|
||||
float _ReceiveLighting;
|
||||
float _ReceiveShadows;
|
||||
float _IsCharacter;
|
||||
#if defined(PAL3_TOON_WATER)
|
||||
float _Alpha;
|
||||
#endif
|
||||
CBUFFER_END
|
||||
|
||||
struct ToonAttributes
|
||||
{
|
||||
float4 positionOS : POSITION;
|
||||
float3 normalOS : NORMAL;
|
||||
float2 uv : TEXCOORD0;
|
||||
float2 lightmapUV : TEXCOORD1;
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3bee6608024749edbf4c7da92644306f
|
||||
@@ -0,0 +1,44 @@
|
||||
// ------------------------------------------------------------------------
|
||||
// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
#include "Pal3ToonInput.hlsl"
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl"
|
||||
|
||||
float3 _LightDirection;
|
||||
float3 _LightPosition;
|
||||
|
||||
struct ToonShadowVaryings
|
||||
{
|
||||
float4 positionCS : SV_POSITION;
|
||||
#if defined(PAL3_TOON_CUTOUT)
|
||||
float2 uv : TEXCOORD0;
|
||||
#endif
|
||||
};
|
||||
|
||||
ToonShadowVaryings ToonShadowVertex(ToonAttributes input)
|
||||
{
|
||||
ToonShadowVaryings output;
|
||||
UNITY_SETUP_INSTANCE_ID(input);
|
||||
float3 positionWS = TransformObjectToWorld(input.positionOS.xyz);
|
||||
float3 normalWS = TransformObjectToWorldNormal(input.normalOS);
|
||||
#if defined(_CASTING_PUNCTUAL_LIGHT_SHADOW)
|
||||
float3 lightDirectionWS = normalize(_LightPosition - positionWS);
|
||||
#else
|
||||
float3 lightDirectionWS = _LightDirection;
|
||||
#endif
|
||||
output.positionCS = ApplyShadowClamping(TransformWorldToHClip(ApplyShadowBias(positionWS, normalWS, lightDirectionWS)));
|
||||
#if defined(PAL3_TOON_CUTOUT)
|
||||
output.uv = TRANSFORM_TEX(input.uv, _MainTex);
|
||||
#endif
|
||||
return output;
|
||||
}
|
||||
|
||||
half4 ToonShadowFragment(ToonShadowVaryings input) : SV_Target
|
||||
{
|
||||
#if defined(PAL3_TOON_CUTOUT)
|
||||
clip(SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, input.uv).a - _Threshold);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b0fa0b9b56f240acb66be2dbbcaf61a2
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9971a1796d9c4269808917bc978c7b96
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,96 @@
|
||||
// ------------------------------------------------------------------------
|
||||
// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
Shader "Pal3/ToonCutout"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex ("Texture", 2D) = "white" {}
|
||||
_TintColor ("Tint Color", Color) = (1, 1, 1, 1)
|
||||
_ShadowTex ("Baked Shadow", 2D) = "white" {}
|
||||
_HasShadowTex ("Has Baked Shadow", Float) = 0
|
||||
_LightmapScale ("Baked Light Scale", Float) = 1.666667
|
||||
_ReceiveShadows ("Receive Shadows", Float) = 1
|
||||
[HideInInspector] _IsCharacter ("Character", Float) = 0
|
||||
_Threshold ("Alpha Cutoff", Float) = 1
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags { "RenderPipeline" = "UniversalPipeline" "Queue" = "Geometry" }
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "ToonForward"
|
||||
Tags { "LightMode" = "UniversalForward" }
|
||||
ZWrite On
|
||||
|
||||
HLSLPROGRAM
|
||||
#pragma target 3.0
|
||||
#pragma vertex ToonVertex
|
||||
#pragma fragment ToonFragment
|
||||
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE
|
||||
#pragma multi_compile_fragment _ _ADDITIONAL_LIGHTS
|
||||
#pragma multi_compile _ _CLUSTER_LIGHT_LOOP
|
||||
#pragma multi_compile_fragment _ _ADDITIONAL_LIGHT_SHADOWS
|
||||
#pragma multi_compile_fragment _ _SHADOWS_SOFT _SHADOWS_SOFT_LOW _SHADOWS_SOFT_MEDIUM _SHADOWS_SOFT_HIGH
|
||||
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Fog.hlsl"
|
||||
#define PAL3_TOON_CUTOUT
|
||||
#include "Assets/Rendering/Toon/Pal3ToonForward.hlsl"
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "DepthOnly"
|
||||
Tags { "LightMode" = "DepthOnly" }
|
||||
ZWrite On
|
||||
ColorMask R
|
||||
|
||||
HLSLPROGRAM
|
||||
#pragma target 3.0
|
||||
#pragma vertex ToonDepthVertex
|
||||
#pragma fragment ToonDepthFragment
|
||||
#define PAL3_TOON_CUTOUT
|
||||
#include "Assets/Rendering/Toon/Pal3ToonDepth.hlsl"
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "DepthNormals"
|
||||
Tags { "LightMode" = "DepthNormals" }
|
||||
ZWrite On
|
||||
|
||||
HLSLPROGRAM
|
||||
#pragma target 3.0
|
||||
#pragma vertex ToonDepthVertex
|
||||
#pragma fragment ToonDepthFragment
|
||||
#pragma multi_compile_fragment _ _GBUFFER_NORMALS_OCT
|
||||
#define PAL3_TOON_DEPTH_NORMALS
|
||||
#define PAL3_TOON_CUTOUT
|
||||
#include "Assets/Rendering/Toon/Pal3ToonDepth.hlsl"
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "ShadowCaster"
|
||||
Tags { "LightMode" = "ShadowCaster" }
|
||||
ZWrite On
|
||||
ZTest LEqual
|
||||
ColorMask 0
|
||||
|
||||
HLSLPROGRAM
|
||||
#pragma target 3.0
|
||||
#pragma vertex ToonShadowVertex
|
||||
#pragma fragment ToonShadowFragment
|
||||
#pragma multi_compile_vertex _ _CASTING_PUNCTUAL_LIGHT_SHADOW
|
||||
#define PAL3_TOON_CUTOUT
|
||||
#include "Assets/Rendering/Toon/Pal3ToonShadow.hlsl"
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e57ba5c6fe0b42a98d2f373c67cc1e38
|
||||
@@ -0,0 +1,91 @@
|
||||
// ------------------------------------------------------------------------
|
||||
// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
Shader "Pal3/ToonOpaque"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex ("Texture", 2D) = "white" {}
|
||||
_TintColor ("Tint Color", Color) = (1, 1, 1, 1)
|
||||
_ShadowTex ("Baked Shadow", 2D) = "white" {}
|
||||
_HasShadowTex ("Has Baked Shadow", Float) = 0
|
||||
_LightmapScale ("Baked Light Scale", Float) = 1.666667
|
||||
_ReceiveShadows ("Receive Shadows", Float) = 1
|
||||
[HideInInspector] _IsCharacter ("Character", Float) = 0
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags { "RenderPipeline" = "UniversalPipeline" "Queue" = "Geometry" }
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "ToonForward"
|
||||
Tags { "LightMode" = "UniversalForward" }
|
||||
ZWrite On
|
||||
|
||||
HLSLPROGRAM
|
||||
#pragma target 3.0
|
||||
#pragma vertex ToonVertex
|
||||
#pragma fragment ToonFragment
|
||||
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE
|
||||
#pragma multi_compile_fragment _ _ADDITIONAL_LIGHTS
|
||||
#pragma multi_compile _ _CLUSTER_LIGHT_LOOP
|
||||
#pragma multi_compile_fragment _ _ADDITIONAL_LIGHT_SHADOWS
|
||||
#pragma multi_compile_fragment _ _SHADOWS_SOFT _SHADOWS_SOFT_LOW _SHADOWS_SOFT_MEDIUM _SHADOWS_SOFT_HIGH
|
||||
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Fog.hlsl"
|
||||
#include "Assets/Rendering/Toon/Pal3ToonForward.hlsl"
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "DepthOnly"
|
||||
Tags { "LightMode" = "DepthOnly" }
|
||||
ZWrite On
|
||||
ColorMask R
|
||||
|
||||
HLSLPROGRAM
|
||||
#pragma target 3.0
|
||||
#pragma vertex ToonDepthVertex
|
||||
#pragma fragment ToonDepthFragment
|
||||
#include "Assets/Rendering/Toon/Pal3ToonDepth.hlsl"
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "DepthNormals"
|
||||
Tags { "LightMode" = "DepthNormals" }
|
||||
ZWrite On
|
||||
|
||||
HLSLPROGRAM
|
||||
#pragma target 3.0
|
||||
#pragma vertex ToonDepthVertex
|
||||
#pragma fragment ToonDepthFragment
|
||||
#pragma multi_compile_fragment _ _GBUFFER_NORMALS_OCT
|
||||
#define PAL3_TOON_DEPTH_NORMALS
|
||||
#include "Assets/Rendering/Toon/Pal3ToonDepth.hlsl"
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "ShadowCaster"
|
||||
Tags { "LightMode" = "ShadowCaster" }
|
||||
ZWrite On
|
||||
ZTest LEqual
|
||||
ColorMask 0
|
||||
|
||||
HLSLPROGRAM
|
||||
#pragma target 3.0
|
||||
#pragma vertex ToonShadowVertex
|
||||
#pragma fragment ToonShadowFragment
|
||||
#pragma multi_compile_vertex _ _CASTING_PUNCTUAL_LIGHT_SHADOW
|
||||
#include "Assets/Rendering/Toon/Pal3ToonShadow.hlsl"
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bc6ca31ba7ce4c028c2f9d135a8f81f6
|
||||
@@ -0,0 +1,49 @@
|
||||
// ------------------------------------------------------------------------
|
||||
// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
Shader "Pal3/ToonTransparent"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex ("Texture", 2D) = "white" {}
|
||||
_TintColor ("Tint Color", Color) = (1, 1, 1, 1)
|
||||
_ShadowTex ("Baked Shadow", 2D) = "white" {}
|
||||
_HasShadowTex ("Has Baked Shadow", Float) = 0
|
||||
_LightmapScale ("Baked Light Scale", Float) = 1.666667
|
||||
_ReceiveShadows ("Receive Shadows", Float) = 1
|
||||
[HideInInspector] _IsCharacter ("Character", Float) = 0
|
||||
_Threshold ("Alpha Cutoff", Float) = 1
|
||||
_ReceiveLighting ("Receive Lighting", Float) = 1
|
||||
[Enum(UnityEngine.Rendering.BlendMode)] _BlendSrcFactor ("Source Blend Factor", Int) = 5
|
||||
[Enum(UnityEngine.Rendering.BlendMode)] _BlendDstFactor ("Destination Blend Factor", Int) = 10
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags { "RenderPipeline" = "UniversalPipeline" "Queue" = "Transparent" }
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "ToonForward"
|
||||
Tags { "LightMode" = "UniversalForward" }
|
||||
Blend [_BlendSrcFactor] [_BlendDstFactor]
|
||||
ZWrite Off
|
||||
|
||||
HLSLPROGRAM
|
||||
#pragma target 3.0
|
||||
#pragma vertex ToonVertex
|
||||
#pragma fragment ToonFragment
|
||||
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE
|
||||
#pragma multi_compile_fragment _ _ADDITIONAL_LIGHTS
|
||||
#pragma multi_compile _ _CLUSTER_LIGHT_LOOP
|
||||
#pragma multi_compile_fragment _ _ADDITIONAL_LIGHT_SHADOWS
|
||||
#pragma multi_compile_fragment _ _SHADOWS_SOFT _SHADOWS_SOFT_LOW _SHADOWS_SOFT_MEDIUM _SHADOWS_SOFT_HIGH
|
||||
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Fog.hlsl"
|
||||
#define PAL3_TOON_TRANSPARENT
|
||||
#include "Assets/Rendering/Toon/Pal3ToonForward.hlsl"
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 89695d596cab416a803088a5ce370c10
|
||||
@@ -0,0 +1,45 @@
|
||||
// ------------------------------------------------------------------------
|
||||
// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
Shader "Pal3/ToonWater"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex ("Texture", 2D) = "white" {}
|
||||
_ShadowTex ("Baked Shadow", 2D) = "white" {}
|
||||
_HasShadowTex ("Has Baked Shadow", Float) = 0
|
||||
_LightmapScale ("Baked Light Scale", Float) = 1.428571
|
||||
_Alpha ("Opacity", Range(0, 1)) = 0.5
|
||||
_ReceiveShadows ("Receive Shadows", Float) = 1
|
||||
[HideInInspector] _TintColor ("Tint Color", Color) = (1, 1, 1, 1)
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags { "RenderPipeline" = "UniversalPipeline" "Queue" = "Transparent-1" }
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "ToonForward"
|
||||
Tags { "LightMode" = "UniversalForward" }
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
ZWrite Off
|
||||
|
||||
HLSLPROGRAM
|
||||
#pragma target 3.0
|
||||
#pragma vertex ToonVertex
|
||||
#pragma fragment ToonFragment
|
||||
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE
|
||||
#pragma multi_compile_fragment _ _ADDITIONAL_LIGHTS
|
||||
#pragma multi_compile _ _CLUSTER_LIGHT_LOOP
|
||||
#pragma multi_compile_fragment _ _ADDITIONAL_LIGHT_SHADOWS
|
||||
#pragma multi_compile_fragment _ _SHADOWS_SOFT _SHADOWS_SOFT_LOW _SHADOWS_SOFT_MEDIUM _SHADOWS_SOFT_HIGH
|
||||
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Fog.hlsl"
|
||||
#define PAL3_TOON_WATER
|
||||
#include "Assets/Rendering/Toon/Pal3ToonForward.hlsl"
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2bfe8e4c75f54fd5b64a93adc46ef6fc
|
||||
@@ -0,0 +1,467 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 2ec995e51a6e251468d2a3fd8a686257, type: 3}
|
||||
m_Name: UniversalRenderPipelineGlobalSettings
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.UniversalRenderPipelineGlobalSettings
|
||||
m_ShaderStrippingSetting:
|
||||
m_Version: 0
|
||||
m_ExportShaderVariants: 1
|
||||
m_ShaderVariantLogLevel: 0
|
||||
m_StripRuntimeDebugShaders: 1
|
||||
m_URPShaderStrippingSetting:
|
||||
m_Version: 0
|
||||
m_StripUnusedPostProcessingVariantsAndResources: 0
|
||||
m_StripUnusedVariants: 1
|
||||
m_StripScreenCoordOverrideVariants: 1
|
||||
m_Strip2DUnusedVariants: 0
|
||||
m_ShaderVariantLogLevel: 0
|
||||
m_ExportShaderVariants: 1
|
||||
m_StripDebugVariants: 1
|
||||
m_StripUnusedPostProcessingVariants: 0
|
||||
m_StripUnusedVariants: 1
|
||||
m_StripScreenCoordOverrideVariants: 1
|
||||
supportRuntimeDebugDisplay: 0
|
||||
m_Settings:
|
||||
m_SettingsList:
|
||||
m_List:
|
||||
- rid: 4672219873250902016
|
||||
- rid: 4672219873250902017
|
||||
- rid: 4672219873250902018
|
||||
- rid: 4672219873250902019
|
||||
- rid: 4672219873250902020
|
||||
- rid: 4672219873250902021
|
||||
- rid: 4672219873250902022
|
||||
- rid: 4672219873250902023
|
||||
- rid: 4672219873250902024
|
||||
- rid: 4672219873250902025
|
||||
- rid: 4672219873250902026
|
||||
- rid: 4672219873250902027
|
||||
- rid: 4672219873250902028
|
||||
- rid: 4672219873250902029
|
||||
- rid: 4672219873250902030
|
||||
- rid: 4672219873250902031
|
||||
- rid: 4672219873250902032
|
||||
- rid: 4672219873250902033
|
||||
- rid: 4672219873250902034
|
||||
- rid: 4672219873250902035
|
||||
- rid: 4672219873250902036
|
||||
- rid: 4672219873250902037
|
||||
- rid: 4672219873250902038
|
||||
- rid: 4672219873250902039
|
||||
- rid: 4672219873250902040
|
||||
- rid: 4672219873250902041
|
||||
- rid: 4672219873250902042
|
||||
- rid: 4672219873250902043
|
||||
- rid: 4672219873250902044
|
||||
- rid: 4672219873250902045
|
||||
- rid: 4672219873250902046
|
||||
- rid: 4672219873250902047
|
||||
- rid: 4672219873250902048
|
||||
- rid: 4672219873250902049
|
||||
- rid: 4672219873250902050
|
||||
- rid: 4672219873250902051
|
||||
- rid: 4672219873250902052
|
||||
- rid: 4672219873250902053
|
||||
m_RuntimeSettings:
|
||||
m_List: []
|
||||
m_AssetVersion: 11
|
||||
m_ObsoleteDefaultVolumeProfile: {fileID: 0}
|
||||
m_RenderingLayerNames:
|
||||
- Default
|
||||
m_ValidRenderingLayers: 0
|
||||
lightLayerName0:
|
||||
lightLayerName1:
|
||||
lightLayerName2:
|
||||
lightLayerName3:
|
||||
lightLayerName4:
|
||||
lightLayerName5:
|
||||
lightLayerName6:
|
||||
lightLayerName7:
|
||||
apvScenesData:
|
||||
obsoleteSceneBounds:
|
||||
m_Keys: []
|
||||
m_Values: []
|
||||
obsoleteHasProbeVolumes:
|
||||
m_Keys: []
|
||||
m_Values:
|
||||
references:
|
||||
version: 2
|
||||
RefIds:
|
||||
- rid: 4672219873250902016
|
||||
type: {class: WorldRenderPipelineResources, ns: UnityEngine.PathTracing.Core, asm: Unity.PathTracing.Runtime}
|
||||
data:
|
||||
_version: 3
|
||||
_blitCubemap: {fileID: 7200000, guid: 5a992812cb320d146a66cc600200cce7, type: 3}
|
||||
_blitGrayScaleCookie: {fileID: 7200000, guid: 557fa399e33bf7647bda5697c5c158df, type: 3}
|
||||
_setAlphaChannelShader: {fileID: 7200000, guid: 5efaea0e81c66334aa9d062d6573e6fd, type: 3}
|
||||
_environmentImportanceSamplingBuild: {fileID: 7200000, guid: 5bb2534d2411d344cbc54f880232640f, type: 3}
|
||||
_skyBoxMesh: {fileID: 4300000, guid: 0529e6c5f6dea8c4a8c2835ed7de57cb, type: 2}
|
||||
_sixFaceSkyBoxMesh: {fileID: 4300000, guid: a80925ceebd011741b42509226cefc74, type: 2}
|
||||
_buildLightGridShader: {fileID: 7200000, guid: 16e47c1641bd0104e92b624601457bb0, type: 3}
|
||||
_solidColorShader: {fileID: 4800000, guid: 3765a7ac691541038de4d587b94ae768, type: 3}
|
||||
- rid: 4672219873250902017
|
||||
type: {class: RayTracingRenderPipelineResources, ns: UnityEngine.Rendering.UnifiedRayTracing, asm: Unity.UnifiedRayTracing.Runtime}
|
||||
data:
|
||||
m_Version: 1
|
||||
m_GeometryPoolKernels: {fileID: 7200000, guid: 98e3d58cae7210c4786f67f504c9e899, type: 3}
|
||||
m_CopyBuffer: {fileID: 7200000, guid: 1b95b5dcf48d1914c9e1e7405c7660e3, type: 3}
|
||||
m_CopyPositions: {fileID: 7200000, guid: 1ad53a96b58d3c3488dde4f14db1aaeb, type: 3}
|
||||
m_BitHistogram: {fileID: 7200000, guid: 8670f7ce4b60cef43bed36148aa1b0a2, type: 3}
|
||||
m_BlockReducePart: {fileID: 7200000, guid: 4e034cc8ea2635c4e9f063e5ddc7ea7a, type: 3}
|
||||
m_BlockScan: {fileID: 7200000, guid: 4d6d5de35fa45ef4a92119397a045cc9, type: 3}
|
||||
m_BuildHlbvh: {fileID: 7200000, guid: 2d70cd6be91bd7843a39a54b51c15b13, type: 3}
|
||||
m_RestructureBvh: {fileID: 7200000, guid: 56641cb88dcb31a4398a4997ef7a7a8c, type: 3}
|
||||
m_Scatter: {fileID: 7200000, guid: a2eaeefdac4637a44b734e85b7be9186, type: 3}
|
||||
- rid: 4672219873250902018
|
||||
type: {class: ScreenSpaceReflectionPersistentResources, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
m_Shader: {fileID: 4800000, guid: 7b3e6785f5f6b634794df3a85a2a35da, type: 3}
|
||||
m_BlitShader: {fileID: 4800000, guid: 815c625bb9d4fe240a4ccf42ca3899cb, type: 3}
|
||||
m_Version: 0
|
||||
- rid: 4672219873250902019
|
||||
type: {class: UniversalRenderPipelineDebugShaders, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
m_DebugReplacementPS: {fileID: 4800000, guid: cf852408f2e174538bcd9b7fda1c5ae7, type: 3}
|
||||
m_HdrDebugViewPS: {fileID: 4800000, guid: 573620ae32aec764abd4d728906d2587, type: 3}
|
||||
m_ProbeVolumeSamplingDebugComputeShader: {fileID: 7200000, guid: 53626a513ea68ce47b59dc1299fe3959, type: 3}
|
||||
- rid: 4672219873250902020
|
||||
type: {class: OnTilePostProcessResource, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
m_Version: 0
|
||||
m_UberPostShader: {fileID: 4800000, guid: fe4f13c1004a07d4ea1e30bfd0326d9e, type: 3}
|
||||
- rid: 4672219873250902021
|
||||
type: {class: UniversalRenderPipelineRuntimeShaders, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
m_Version: 0
|
||||
m_FallbackErrorShader: {fileID: 4800000, guid: e6e9a19c3678ded42a3bc431ebef7dbd, type: 3}
|
||||
m_BlitHDROverlay: {fileID: 4800000, guid: a89bee29cffa951418fc1e2da94d1959, type: 3}
|
||||
m_CoreBlitPS: {fileID: 4800000, guid: 93446b5c5339d4f00b85c159e1159b7c, type: 3}
|
||||
m_CoreBlitColorAndDepthPS: {fileID: 4800000, guid: d104b2fc1ca6445babb8e90b0758136b, type: 3}
|
||||
m_UIBackdropFilterCompositePS: {fileID: 4800000, guid: 8b3d1e6f4c5a4d219a72f8e1c0b3d4a7, type: 3}
|
||||
m_SamplingPS: {fileID: 4800000, guid: 04c410c9937594faa893a11dceb85f7e, type: 3}
|
||||
m_TerrainDetailLit: {fileID: 0}
|
||||
m_TerrainDetailGrassBillboard: {fileID: 0}
|
||||
m_TerrainDetailGrass: {fileID: 0}
|
||||
- rid: 4672219873250902022
|
||||
type: {class: PostProcessData/ShaderResources, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
stopNanPS: {fileID: 4800000, guid: 1121bb4e615ca3c48b214e79e841e823, type: 3}
|
||||
subpixelMorphologicalAntialiasingPS: {fileID: 4800000, guid: 63eaba0ebfb82cc43bde059b4a8c65f6, type: 3}
|
||||
gaussianDepthOfFieldPS: {fileID: 4800000, guid: 5e7134d6e63e0bc47a1dd2669cedb379, type: 3}
|
||||
bokehDepthOfFieldPS: {fileID: 4800000, guid: 2aed67ad60045d54ba3a00c91e2d2631, type: 3}
|
||||
cameraMotionBlurPS: {fileID: 4800000, guid: 1edcd131364091c46a17cbff0b1de97a, type: 3}
|
||||
paniniProjectionPS: {fileID: 4800000, guid: a15b78cf8ca26ca4fb2090293153c62c, type: 3}
|
||||
lutBuilderLdrPS: {fileID: 4800000, guid: 65df88701913c224d95fc554db28381a, type: 3}
|
||||
lutBuilderHdrPS: {fileID: 4800000, guid: ec9fec698a3456d4fb18cf8bacb7a2bc, type: 3}
|
||||
bloomPS: {fileID: 4800000, guid: 5f1864addb451f54bae8c86d230f736e, type: 3}
|
||||
temporalAntialiasingPS: {fileID: 4800000, guid: 9c70c1a35ff15f340b38ea84842358bf, type: 3}
|
||||
LensFlareDataDrivenPS: {fileID: 4800000, guid: 6cda457ac28612740adb23da5d39ea92, type: 3}
|
||||
LensFlareScreenSpacePS: {fileID: 4800000, guid: 701880fecb344ea4c9cd0db3407ab287, type: 3}
|
||||
scalingSetupPS: {fileID: 4800000, guid: e8ee25143a34b8c4388709ea947055d1, type: 3}
|
||||
easuPS: {fileID: 4800000, guid: 562b7ae4f629f144aa97780546fce7c6, type: 3}
|
||||
uberPostPS: {fileID: 4800000, guid: e7857e9d0c934dc4f83f270f8447b006, type: 3}
|
||||
finalPostPassPS: {fileID: 4800000, guid: c49e63ed1bbcb334780a3bd19dfed403, type: 3}
|
||||
m_ShaderResourcesVersion: 0
|
||||
- rid: 4672219873250902023
|
||||
type: {class: URPDefaultVolumeProfileSettings, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
m_Version: 0
|
||||
m_VolumeProfile: {fileID: 11400000, guid: 580f5421befb34b3bab2e8645d38d6b6, type: 2}
|
||||
- rid: 4672219873250902024
|
||||
type: {class: URPShaderStrippingSetting, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
m_Version: 0
|
||||
m_StripUnusedPostProcessingVariantsAndResources: 0
|
||||
m_StripUnusedVariants: 1
|
||||
m_StripScreenCoordOverrideVariants: 1
|
||||
m_Strip2DUnusedVariants: 0
|
||||
- rid: 4672219873250902025
|
||||
type: {class: ScreenSpaceAmbientOcclusionBlueNoiseResources, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
m_BlueNoise256Textures:
|
||||
- {fileID: 2800000, guid: 36f118343fc974119bee3d09e2111500, type: 3}
|
||||
- {fileID: 2800000, guid: 4b7b083e6b6734e8bb2838b0b50a0bc8, type: 3}
|
||||
- {fileID: 2800000, guid: c06cc21c692f94f5fb5206247191eeee, type: 3}
|
||||
- {fileID: 2800000, guid: cb76dd40fa7654f9587f6a344f125c9a, type: 3}
|
||||
- {fileID: 2800000, guid: e32226222ff144b24bf3a5a451de54bc, type: 3}
|
||||
- {fileID: 2800000, guid: 3302065f671a8450b82c9ddf07426f3a, type: 3}
|
||||
- {fileID: 2800000, guid: 56a77a3e8d64f47b6afe9e3c95cb57d5, type: 3}
|
||||
m_Version: 0
|
||||
- rid: 4672219873250902026
|
||||
type: {class: URPTerrainShaderSetting, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
m_Version: 0
|
||||
m_IncludeTerrainShaders: 1
|
||||
- rid: 4672219873250902027
|
||||
type: {class: Renderer2DResources, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
m_Version: 0
|
||||
m_LightShader: {fileID: 4800000, guid: 3f6c848ca3d7bca4bbe846546ac701a1, type: 3}
|
||||
m_RenderingLayerMaskShader: {fileID: 4800000, guid: 9ac9bae9f40d7dc4a80dbf809b9544aa, type: 3}
|
||||
m_ProjectedShadowShader: {fileID: 4800000, guid: ce09d4a80b88c5a4eb9768fab4f1ee00, type: 3}
|
||||
m_SpriteShadowShader: {fileID: 4800000, guid: 44fc62292b65ab04eabcf310e799ccf6, type: 3}
|
||||
m_SpriteUnshadowShader: {fileID: 4800000, guid: de02b375720b5c445afe83cd483bedf3, type: 3}
|
||||
m_GeometryShadowShader: {fileID: 4800000, guid: 19349a0f9a7ed4c48a27445bcf92e5e1, type: 3}
|
||||
m_GeometryUnshadowShader: {fileID: 4800000, guid: 77774d9009bb81447b048c907d4c6273, type: 3}
|
||||
m_CopyDepthPS: {fileID: 4800000, guid: d6dae50ee9e1bfa4db75f19f99355220, type: 3}
|
||||
m_DefaultLitMaterial: {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2}
|
||||
m_DefaultUnlitMaterial: {fileID: 2100000, guid: 9dfc825aed78fcd4ba02077103263b40, type: 2}
|
||||
m_DefaultMaskMaterial: {fileID: 2100000, guid: 15d0c3709176029428a0da2f8cecf0b5, type: 2}
|
||||
m_DefaultMesh2DLitMaterial: {fileID: 2100000, guid: 9452ae1262a74094f8a68013fbcd1834, type: 2}
|
||||
- rid: 4672219873250902028
|
||||
type: {class: UniversalRenderPipelineEditorAssets, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
m_DefaultSettingsVolumeProfile: {fileID: 11400000, guid: eda47df5b85f4f249abf7abd73db2cb2, type: 2}
|
||||
- rid: 4672219873250902029
|
||||
type: {class: MipGenRenderPipelineRuntimeResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
m_ColorPyramidPS: {fileID: 4800000, guid: 63b92baba208e314c8fdebe52ca0cc34, type: 3}
|
||||
m_ColorPyramidCS: {fileID: 7200000, guid: 28969cfddd9ef3f4e94b971690146a4f, type: 3}
|
||||
m_DepthPyramidCS: {fileID: 7200000, guid: 90a204702cd44e54cac7ed4fc6e5d86b, type: 3}
|
||||
- rid: 4672219873250902030
|
||||
type: {class: UniversalRenderPipelineEditorMaterials, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
m_DefaultMaterial: {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2}
|
||||
m_SimpleLitMaterial: {fileID: 2100000, guid: 6a1143ee683302f4aa628c052723efc1, type: 2}
|
||||
m_DefaultParticleMaterial: {fileID: 2100000, guid: e823cd5b5d27c0f4b8256e7c12ee3e6d, type: 2}
|
||||
m_DefaultLineMaterial: {fileID: 2100000, guid: e823cd5b5d27c0f4b8256e7c12ee3e6d, type: 2}
|
||||
m_DefaultTerrainMaterial: {fileID: 2100000, guid: 594ea882c5a793440b60ff72d896021e, type: 2}
|
||||
m_DefaultDecalMaterial: {fileID: 2100000, guid: 31d0dcc6f2dd4e4408d18036a2c93862, type: 2}
|
||||
m_DefaultSpriteMaterial: {fileID: 2100000, guid: 9dfc825aed78fcd4ba02077103263b40, type: 2}
|
||||
- rid: 4672219873250902031
|
||||
type: {class: UniversalRenderPipelineRuntimeTextures, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
m_Version: 1
|
||||
m_BlueNoise64LTex: {fileID: 2800000, guid: e3d24661c1e055f45a7560c033dbb837, type: 3}
|
||||
m_BayerMatrixTex: {fileID: 2800000, guid: f9ee4ed84c1d10c49aabb9b210b0fc44, type: 3}
|
||||
m_DebugFontTex: {fileID: 2800000, guid: 26a413214480ef144b2915d6ff4d0beb, type: 3}
|
||||
- rid: 4672219873250902032
|
||||
type: {class: RenderGraphSettings, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
m_Version: 0
|
||||
- rid: 4672219873250902033
|
||||
type: {class: UniversalRenderPipelineRuntimeTerrainShaders, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
m_Version: 0
|
||||
m_TerrainDetailLit: {fileID: 4800000, guid: f6783ab646d374f94b199774402a5144, type: 3}
|
||||
m_TerrainDetailGrassBillboard: {fileID: 4800000, guid: 29868e73b638e48ca99a19ea58c48d90, type: 3}
|
||||
m_TerrainDetailGrass: {fileID: 4800000, guid: e507fdfead5ca47e8b9a768b51c291a1, type: 3}
|
||||
- rid: 4672219873250902034
|
||||
type: {class: UniversalRenderPipelineEditorShaders, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
m_AutodeskInteractive: {fileID: 4800000, guid: 0e9d5a909a1f7e84882a534d0d11e49f, type: 3}
|
||||
m_AutodeskInteractiveTransparent: {fileID: 4800000, guid: 5c81372d981403744adbdda4433c9c11, type: 3}
|
||||
m_AutodeskInteractiveMasked: {fileID: 4800000, guid: 80aa867ac363ac043847b06ad71604cd, type: 3}
|
||||
m_DefaultSpeedTree7Shader: {fileID: 4800000, guid: 0f4122b9a743b744abe2fb6a0a88868b, type: 3}
|
||||
m_DefaultSpeedTree8Shader: {fileID: -6465566751694194690, guid: 9920c1f1781549a46ba081a2a15a16ec, type: 3}
|
||||
m_DefaultSpeedTree9Shader: {fileID: -6465566751694194690, guid: cbd3e1cc4ae141c42a30e33b4d666a61, type: 3}
|
||||
- rid: 4672219873250902035
|
||||
type: {class: ScreenSpaceAmbientOcclusionCoreResources, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
m_RasterizationShader: {fileID: 4800000, guid: 0849e84e3d62649e8882e9d6f056a017, type: 3}
|
||||
m_Version: 0
|
||||
- rid: 4672219873250902036
|
||||
type: {class: UniversalRendererResources, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
m_Version: 0
|
||||
m_CopyDepthPS: {fileID: 4800000, guid: d6dae50ee9e1bfa4db75f19f99355220, type: 3}
|
||||
m_CameraMotionVector: {fileID: 4800000, guid: c56b7e0d4c7cb484e959caeeedae9bbf, type: 3}
|
||||
m_StencilDeferredPS: {fileID: 4800000, guid: e9155b26e1bc55942a41e518703fe304, type: 3}
|
||||
m_ClusterDeferred: {fileID: 4800000, guid: 222cce62363a44a380c36bf03b392608, type: 3}
|
||||
m_StencilDitherMaskSeedPS: {fileID: 4800000, guid: 8c3ee818f2efa514c889881ccb2e95a2, type: 3}
|
||||
m_DBufferClear: {fileID: 4800000, guid: f056d8bd2a1c7e44e9729144b4c70395, type: 3}
|
||||
- rid: 4672219873250902037
|
||||
type: {class: UniversalRenderPipelineFilmGrainResources, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
m_Textures:
|
||||
- {fileID: 2800000, guid: 654c582f7f8a5a14dbd7d119cbde215d, type: 3}
|
||||
- {fileID: 2800000, guid: dd77ffd079630404e879388999033049, type: 3}
|
||||
- {fileID: 2800000, guid: 1097e90e1306e26439701489f391a6c0, type: 3}
|
||||
- {fileID: 2800000, guid: f0b67500f7fad3b4c9f2b13e8f41ba6e, type: 3}
|
||||
- {fileID: 2800000, guid: 9930fb4528622b34687b00bbe6883de7, type: 3}
|
||||
- {fileID: 2800000, guid: bd9e8c758250ef449a4b4bfaad7a2133, type: 3}
|
||||
- {fileID: 2800000, guid: 510a2f57334933e4a8dbabe4c30204e4, type: 3}
|
||||
- {fileID: 2800000, guid: b4db8180660810945bf8d55ab44352ad, type: 3}
|
||||
- {fileID: 2800000, guid: fd2fd78b392986e42a12df2177d3b89c, type: 3}
|
||||
- {fileID: 2800000, guid: 5cdee82a77d13994f83b8fdabed7c301, type: 3}
|
||||
m_Version: 0
|
||||
- rid: 4672219873250902038
|
||||
type: {class: UniversalRenderPipelineRuntimeXRResources, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
m_xrOcclusionMeshPS: {fileID: 4800000, guid: 4431b1f1f743fbf4eb310a967890cbea, type: 3}
|
||||
m_xrMirrorViewPS: {fileID: 4800000, guid: d5a307c014552314b9f560906d708772, type: 3}
|
||||
m_xrMotionVector: {fileID: 4800000, guid: f89aac1e4f84468418fe30e611dff395, type: 3}
|
||||
- rid: 4672219873250902039
|
||||
type: {class: PostProcessData/TextureResources, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
blueNoise16LTex:
|
||||
- {fileID: 2800000, guid: 81200413a40918d4d8702e94db29911c, type: 3}
|
||||
- {fileID: 2800000, guid: d50c5e07c9911a74982bddf7f3075e7b, type: 3}
|
||||
- {fileID: 2800000, guid: 1134690bf9216164dbc75050e35b7900, type: 3}
|
||||
- {fileID: 2800000, guid: 7ce2118f74614a94aa8a0cdf2e6062c3, type: 3}
|
||||
- {fileID: 2800000, guid: 2ca97df9d1801e84a8a8f2c53cb744f0, type: 3}
|
||||
- {fileID: 2800000, guid: e63eef8f54aa9dc4da9a5ac094b503b5, type: 3}
|
||||
- {fileID: 2800000, guid: 39451254daebd6d40b52899c1f1c0c1b, type: 3}
|
||||
- {fileID: 2800000, guid: c94ad916058dff743b0f1c969ddbe660, type: 3}
|
||||
- {fileID: 2800000, guid: ed5ea7ce59ca8ec4f9f14bf470a30f35, type: 3}
|
||||
- {fileID: 2800000, guid: 071e954febf155243a6c81e48f452644, type: 3}
|
||||
- {fileID: 2800000, guid: 96aaab9cc247d0b4c98132159688c1af, type: 3}
|
||||
- {fileID: 2800000, guid: fc3fa8f108657e14486697c9a84ccfc5, type: 3}
|
||||
- {fileID: 2800000, guid: bfed3e498947fcb4890b7f40f54d85b9, type: 3}
|
||||
- {fileID: 2800000, guid: d512512f4af60a442ab3458489412954, type: 3}
|
||||
- {fileID: 2800000, guid: 47a45908f6db0cb44a0d5e961143afec, type: 3}
|
||||
- {fileID: 2800000, guid: 4dcc0502f8586f941b5c4a66717205e8, type: 3}
|
||||
- {fileID: 2800000, guid: 9d92991794bb5864c8085468b97aa067, type: 3}
|
||||
- {fileID: 2800000, guid: 14381521ff11cb74abe3fe65401c23be, type: 3}
|
||||
- {fileID: 2800000, guid: d36f0fe53425e08499a2333cf423634c, type: 3}
|
||||
- {fileID: 2800000, guid: d4044ea2490d63b43aa1765f8efbf8a9, type: 3}
|
||||
- {fileID: 2800000, guid: c9bd74624d8070f429e3f46d161f9204, type: 3}
|
||||
- {fileID: 2800000, guid: d5c9b274310e5524ebe32a4e4da3df1f, type: 3}
|
||||
- {fileID: 2800000, guid: f69770e54f2823f43badf77916acad83, type: 3}
|
||||
- {fileID: 2800000, guid: 10b6c6d22e73dea46a8ab36b6eebd629, type: 3}
|
||||
- {fileID: 2800000, guid: a2ec5cbf5a9b64345ad3fab0912ddf7b, type: 3}
|
||||
- {fileID: 2800000, guid: 1c3c6d69a645b804fa232004b96b7ad3, type: 3}
|
||||
- {fileID: 2800000, guid: d18a24d7b4ed50f4387993566d9d3ae2, type: 3}
|
||||
- {fileID: 2800000, guid: c989e1ed85cf7154caa922fec53e6af6, type: 3}
|
||||
- {fileID: 2800000, guid: ff47e5a0f105eb34883b973e51f4db62, type: 3}
|
||||
- {fileID: 2800000, guid: fa042edbfc40fbd4bad0ab9d505b1223, type: 3}
|
||||
- {fileID: 2800000, guid: 896d9004736809c4fb5973b7c12eb8b9, type: 3}
|
||||
- {fileID: 2800000, guid: 179f794063d2a66478e6e726f84a65bc, type: 3}
|
||||
filmGrainTex: []
|
||||
smaaAreaTex: {fileID: 2800000, guid: d1f1048909d55cd4fa1126ab998f617e, type: 3}
|
||||
smaaSearchTex: {fileID: 2800000, guid: 51eee22c2a633ef4aada830eed57c3fd, type: 3}
|
||||
m_TexturesResourcesVersion: 0
|
||||
- rid: 4672219873250902040
|
||||
type: {class: URPReflectionProbeSettings, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||
data:
|
||||
version: 1
|
||||
useReflectionProbeRotation: 1
|
||||
- rid: 4672219873250902041
|
||||
type: {class: GPUResidentDrawerResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.GPUDriven.Runtime}
|
||||
data:
|
||||
m_Version: 0
|
||||
m_InstanceDataBufferCopyKernels: {fileID: 7200000, guid: f984aeb540ded8b4fbb8a2047ab5b2e2, type: 3}
|
||||
m_InstanceDataBufferUploadKernels: {fileID: 7200000, guid: 53864816eb00f2343b60e1a2c5a262ef, type: 3}
|
||||
m_TransformUpdaterKernels: {fileID: 7200000, guid: 2a567b9b2733f8d47a700c3c85bed75b, type: 3}
|
||||
m_WindDataUpdaterKernels: {fileID: 7200000, guid: fde76746e4fd0ed418c224f6b4084114, type: 3}
|
||||
m_OccluderDepthPyramidKernels: {fileID: 7200000, guid: 08b2b5fb307b0d249860612774a987da, type: 3}
|
||||
m_InstanceOcclusionCullingKernels: {fileID: 7200000, guid: f6d223acabc2f974795a5a7864b50e6c, type: 3}
|
||||
m_OcclusionCullingDebugKernels: {fileID: 7200000, guid: b23e766bcf50ca4438ef186b174557df, type: 3}
|
||||
m_DebugOcclusionTestPS: {fileID: 4800000, guid: d3f0849180c2d0944bc71060693df100, type: 3}
|
||||
m_DebugOccluderPS: {fileID: 4800000, guid: b3c92426a88625841ab15ca6a7917248, type: 3}
|
||||
- rid: 4672219873250902042
|
||||
type: {class: ShaderStrippingSetting, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
|
||||
data:
|
||||
m_Version: 0
|
||||
m_ExportShaderVariants: 1
|
||||
m_ShaderVariantLogLevel: 0
|
||||
m_StripRuntimeDebugShaders: 1
|
||||
- rid: 4672219873250902043
|
||||
type: {class: ProbeVolumeGlobalSettings, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
|
||||
data:
|
||||
m_Version: 1
|
||||
m_ProbeVolumeDisableStreamingAssets: 0
|
||||
- rid: 4672219873250902044
|
||||
type: {class: ProbeVolumeDebugResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
|
||||
data:
|
||||
m_Version: 1
|
||||
probeVolumeDebugShader: {fileID: 4800000, guid: 3b21275fd12d65f49babb5286f040f2d, type: 3}
|
||||
probeVolumeFragmentationDebugShader: {fileID: 4800000, guid: 3a80877c579b9144ebdcc6d923bca303, type: 3}
|
||||
probeVolumeSamplingDebugShader: {fileID: 4800000, guid: bf54e6528c79a224e96346799064c393, type: 3}
|
||||
probeVolumeOffsetDebugShader: {fileID: 4800000, guid: db8bd7436dc2c5f4c92655307d198381, type: 3}
|
||||
probeSamplingDebugMesh: {fileID: -3555484719484374845, guid: 20be25aac4e22ee49a7db76fb3df6de2, type: 3}
|
||||
numbersDisplayTex: {fileID: 2800000, guid: 73fe53b428c5b3440b7e87ee830b608a, type: 3}
|
||||
- rid: 4672219873250902045
|
||||
type: {class: IncludeAdditionalRPAssets, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
|
||||
data:
|
||||
m_version: 0
|
||||
m_IncludeReferencedInScenes: 0
|
||||
m_IncludeAssetsByLabel: 0
|
||||
m_LabelToInclude:
|
||||
- rid: 4672219873250902046
|
||||
type: {class: RenderingDebuggerRuntimeResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
|
||||
data:
|
||||
m_version: 0
|
||||
m_PanelSettings: {fileID: 11400000, guid: fa69697be3070b04a893666f5947f18c, type: 2}
|
||||
m_StyleSheets:
|
||||
- {fileID: 7433441132597879392, guid: 0ff99fd36f66f1a41bcc1d3c90e0922a, type: 3}
|
||||
- {fileID: 7433441132597879392, guid: 3a8aa4d508da46d4dace18b280f064aa, type: 3}
|
||||
m_VisualTreeAsset: {fileID: 9197481963319205126, guid: b647ceb1e15264943b9b439971e71110, type: 3}
|
||||
- rid: 4672219873250902047
|
||||
type: {class: RenderGraphUtilsResources, ns: UnityEngine.Rendering.RenderGraphModule.Util, asm: Unity.RenderPipelines.Core.Runtime}
|
||||
data:
|
||||
m_Version: 0
|
||||
m_CoreCopyPS: {fileID: 4800000, guid: 12dc59547ea167a4ab435097dd0f9add, type: 3}
|
||||
- rid: 4672219873250902048
|
||||
type: {class: RenderGraphGlobalSettings, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
|
||||
data:
|
||||
m_version: 0
|
||||
m_EnableCompilationCaching: 1
|
||||
m_EnableValidityChecks: 1
|
||||
- rid: 4672219873250902049
|
||||
type: {class: VrsRenderPipelineRuntimeResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
|
||||
data:
|
||||
m_TextureComputeShader: {fileID: 7200000, guid: cacb30de6c40c7444bbc78cb0a81fd2a, type: 3}
|
||||
m_VisualizationShader: {fileID: 4800000, guid: 620b55b8040a88d468e94abe55bed5ba, type: 3}
|
||||
m_VisualizationLookupTable:
|
||||
m_Data:
|
||||
- {r: 0.785, g: 0.23, b: 0.2, a: 1}
|
||||
- {r: 1, g: 0.8, b: 0.8, a: 1}
|
||||
- {r: 0.4, g: 0.2, b: 0.2, a: 1}
|
||||
- {r: 0.51, g: 0.8, b: 0.6, a: 1}
|
||||
- {r: 0.6, g: 0.8, b: 1, a: 1}
|
||||
- {r: 0.2, g: 0.4, b: 0.6, a: 1}
|
||||
- {r: 0.8, g: 1, b: 0.8, a: 1}
|
||||
- {r: 0.2, g: 0.4, b: 0.2, a: 1}
|
||||
- {r: 0.125, g: 0.22, b: 0.36, a: 1}
|
||||
m_ConversionLookupTable:
|
||||
m_Data:
|
||||
- {r: 0.785, g: 0.23, b: 0.2, a: 1}
|
||||
- {r: 1, g: 0.8, b: 0.8, a: 1}
|
||||
- {r: 0.4, g: 0.2, b: 0.2, a: 1}
|
||||
- {r: 0.51, g: 0.8, b: 0.6, a: 1}
|
||||
- {r: 0.6, g: 0.8, b: 1, a: 1}
|
||||
- {r: 0.2, g: 0.4, b: 0.6, a: 1}
|
||||
- {r: 0.8, g: 1, b: 0.8, a: 1}
|
||||
- {r: 0.2, g: 0.4, b: 0.2, a: 1}
|
||||
- {r: 0.125, g: 0.22, b: 0.36, a: 1}
|
||||
- rid: 4672219873250902050
|
||||
type: {class: LightmapSamplingSettings, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
|
||||
data:
|
||||
m_Version: 1
|
||||
m_UseBicubicLightmapSampling: 0
|
||||
- rid: 4672219873250902051
|
||||
type: {class: ProbeVolumeRuntimeResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
|
||||
data:
|
||||
m_Version: 1
|
||||
probeVolumeBlendStatesCS: {fileID: 7200000, guid: a3f7b8c99de28a94684cb1daebeccf5d, type: 3}
|
||||
probeVolumeUploadDataCS: {fileID: 7200000, guid: 0951de5992461754fa73650732c4954c, type: 3}
|
||||
probeVolumeUploadDataL2CS: {fileID: 7200000, guid: 6196f34ed825db14b81fb3eb0ea8d931, type: 3}
|
||||
- rid: 4672219873250902052
|
||||
type: {class: STP/RuntimeResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
|
||||
data:
|
||||
m_setupCS: {fileID: 7200000, guid: 33be2e9a5506b2843bdb2bdff9cad5e1, type: 3}
|
||||
m_preTaaCS: {fileID: 7200000, guid: a679dba8ec4d9ce45884a270b0e22dda, type: 3}
|
||||
m_taaCS: {fileID: 7200000, guid: 3923900e2b41b5e47bc25bfdcbcdc9e6, type: 3}
|
||||
- rid: 4672219873250902053
|
||||
type: {class: ProbeVolumeBakingResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
|
||||
data:
|
||||
m_Version: 1
|
||||
dilationShader: {fileID: 7200000, guid: 6bb382f7de370af41b775f54182e491d, type: 3}
|
||||
subdivideSceneCS: {fileID: 7200000, guid: bb86f1f0af829fd45b2ebddda1245c22, type: 3}
|
||||
voxelizeSceneShader: {fileID: 4800000, guid: c8b6a681c7b4e2e4785ffab093907f9e, type: 3}
|
||||
traceVirtualOffsetCS: {fileID: -6772857160820960102, guid: ff2cbab5da58bf04d82c5f34037ed123, type: 3}
|
||||
traceVirtualOffsetRT: {fileID: -5126288278712620388, guid: ff2cbab5da58bf04d82c5f34037ed123, type: 3}
|
||||
skyOcclusionCS: {fileID: -6772857160820960102, guid: 5a2a534753fbdb44e96c3c78b5a6999d, type: 3}
|
||||
skyOcclusionRT: {fileID: -5126288278712620388, guid: 5a2a534753fbdb44e96c3c78b5a6999d, type: 3}
|
||||
renderingLayerCS: {fileID: -6772857160820960102, guid: 94a070d33e408384bafc1dea4a565df9, type: 3}
|
||||
renderingLayerRT: {fileID: -5126288278712620388, guid: 94a070d33e408384bafc1dea4a565df9, type: 3}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a67b5f1a0a2d042b7ab35bfde91ca6e3
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e65c4b938f18e6c4a86dc379157fac65
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -166,7 +166,6 @@ GameObject:
|
||||
- component: {fileID: 311849592}
|
||||
- component: {fileID: 311849591}
|
||||
- component: {fileID: 311849595}
|
||||
- component: {fileID: 7927220425085558669}
|
||||
m_Layer: 0
|
||||
m_Name: GameCamera
|
||||
m_TagString: MainCamera
|
||||
@@ -345,70 +344,6 @@ AudioSource:
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
--- !u!114 &7927220425085558669
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 311849590}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 948f4100a11a5c24981795d21301da5c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
volumeTrigger: {fileID: 311849593}
|
||||
volumeLayer:
|
||||
serializedVersion: 2
|
||||
m_Bits: 136
|
||||
stopNaNPropagation: 0
|
||||
finalBlitToCameraTarget: 0
|
||||
antialiasingMode: 0
|
||||
temporalAntialiasing:
|
||||
jitterSpread: 0.75
|
||||
sharpness: 0.25
|
||||
stationaryBlending: 0.95
|
||||
motionBlending: 0.85
|
||||
subpixelMorphologicalAntialiasing:
|
||||
quality: 2
|
||||
fastApproximateAntialiasing:
|
||||
fastMode: 1
|
||||
keepAlpha: 0
|
||||
fog:
|
||||
enabled: 1
|
||||
excludeSkybox: 1
|
||||
debugLayer:
|
||||
lightMeter:
|
||||
width: 512
|
||||
height: 256
|
||||
showCurves: 1
|
||||
histogram:
|
||||
width: 512
|
||||
height: 256
|
||||
channel: 3
|
||||
waveform:
|
||||
exposure: 0.12
|
||||
height: 256
|
||||
vectorscope:
|
||||
size: 256
|
||||
exposure: 0.12
|
||||
overlaySettings:
|
||||
linearDepth: 0
|
||||
motionColorIntensity: 4
|
||||
motionGridSize: 64
|
||||
colorBlindnessType: 0
|
||||
colorBlindnessStrength: 1
|
||||
m_Resources: {fileID: 11400000, guid: d82512f9c8e5d4a4d938b575d47f88d4, type: 2}
|
||||
m_ShowToolkit: 0
|
||||
m_ShowCustomSorter: 0
|
||||
breakBeforeColorGrading: 0
|
||||
m_BeforeTransparentBundles: []
|
||||
m_BeforeStackBundles: []
|
||||
m_AfterStackBundles:
|
||||
- assemblyQualifiedName: Pal3.Game.Effect.PostProcessing.Distortion, Pal3.Game,
|
||||
Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
- assemblyQualifiedName: Pal3.Game.Effect.PostProcessing.Snow, Pal3.Game, Version=0.0.0.0,
|
||||
Culture=neutral, PublicKeyToken=null
|
||||
--- !u!1 &547426358569454562
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1734,11 +1669,11 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 47aa715050ab45e09496c366d4e11600, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
blurAmount: 4
|
||||
blurAmount: 5
|
||||
transparency: 1
|
||||
cornerRadius: 40
|
||||
additiveTintColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
|
||||
multiplyTintColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||
additiveTintColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||
multiplyTintColor: {r: 0.4, g: 0.4, b: 0.4, a: 1}
|
||||
image: {fileID: 6514349001384511054}
|
||||
--- !u!1 &2165102651006652904
|
||||
GameObject:
|
||||
@@ -2061,11 +1996,11 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 47aa715050ab45e09496c366d4e11600, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
blurAmount: 3
|
||||
blurAmount: 4
|
||||
transparency: 1
|
||||
cornerRadius: 35
|
||||
additiveTintColor: {r: 0.039215688, g: 0.039215688, b: 0.039215688, a: 1}
|
||||
multiplyTintColor: {r: 0.54901963, g: 0.54901963, b: 0.54901963, a: 1}
|
||||
additiveTintColor: {r: 0.03, g: 0.03, b: 0.03, a: 1}
|
||||
multiplyTintColor: {r: 0.46, g: 0.46, b: 0.46, a: 1}
|
||||
image: {fileID: 3596785283706710040}
|
||||
--- !u!1 &2430233534765130901
|
||||
GameObject:
|
||||
@@ -3149,55 +3084,6 @@ RectTransform:
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 220}
|
||||
m_Pivot: {x: 0.5, y: 0}
|
||||
--- !u!1 &4227195284865171261
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 5491488055271105370}
|
||||
- component: {fileID: 8346885185333560231}
|
||||
m_Layer: 3
|
||||
m_Name: PostProcessVolume
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &5491488055271105370
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4227195284865171261}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 8627381932629902483}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &8346885185333560231
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4227195284865171261}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 8b9a305e18de0c04dbd257a21cd47087, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
sharedProfile: {fileID: 11400000, guid: ff7231d545273e045a612dccba8a02ad, type: 2}
|
||||
isGlobal: 1
|
||||
blendDistance: 0
|
||||
weight: 1
|
||||
priority: 0
|
||||
--- !u!1 &4647852684174260219
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -3767,11 +3653,11 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 47aa715050ab45e09496c366d4e11600, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
blurAmount: 3
|
||||
blurAmount: 4
|
||||
transparency: 1
|
||||
cornerRadius: 20
|
||||
additiveTintColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
|
||||
multiplyTintColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||
additiveTintColor: {r: 0.16, g: 0.16, b: 0.16, a: 1}
|
||||
multiplyTintColor: {r: 0.7, g: 0.7, b: 0.7, a: 1}
|
||||
image: {fileID: 4638320210657625687}
|
||||
--- !u!1 &6400366477307100862
|
||||
GameObject:
|
||||
@@ -4964,7 +4850,6 @@ Transform:
|
||||
- {fileID: 4424067051843665300}
|
||||
- {fileID: 20216136}
|
||||
- {fileID: 9166793672834059380}
|
||||
- {fileID: 5491488055271105370}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &8627381932629902480
|
||||
@@ -5014,8 +4899,7 @@ MonoBehaviour:
|
||||
multiFunctionButton: {fileID: 416810473558055248}
|
||||
mainMenuButton: {fileID: 7186792160907318265}
|
||||
eventSystem: {fileID: 20216138}
|
||||
postProcessVolume: {fileID: 8346885185333560231}
|
||||
postProcessLayer: {fileID: 7927220425085558669}
|
||||
postProcessProfile: {fileID: 11400000, guid: ff7231d545273e045a612dccba8a02ad, type: 2}
|
||||
logoCanvas: {fileID: 6400366477307100862}
|
||||
logoImage: {fileID: 5537344167455247235}
|
||||
--- !u!114 &887733067292281693
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
因为当前特效的实现方式使用了第三方插件和素材,所以此文件夹内的所有prefab均添加进了gitignore里。
|
||||
请联系作者了解插件获取方式和特效prefab的获取方式。
|
||||
|
||||
0 => 传送法阵特效
|
||||
|
||||
15 => 单人传送特效
|
||||
98 => 重楼施法帮龙葵恢复肉身时的特效
|
||||
175 => 邪剑仙迷倒众人的特效
|
||||
224 => 丁小侠剧情狼妖受击特效
|
||||
251 => 邪剑仙变身特效
|
||||
252 => 邪剑仙传送离开时的特效
|
||||
254 => 重楼传送法术特效
|
||||
255 => 龙葵穿衣服的特效
|
||||
256 => 龙葵治疗他人特效
|
||||
257 => 治疗咒施法特效
|
||||
259 => 大型传送法施法前奏特效
|
||||
260 => 大型传送法阵特效收尾
|
||||
261 => 大型传送法阵特效开始
|
||||
262 => 重楼当剑的时候剑插入地面的火光特效
|
||||
263 => 火鬼王消失特效
|
||||
264 => 古藤精施法特效
|
||||
265 => 人物受到法术作用时候的特效
|
||||
266 => 邪剑仙施法特效
|
||||
270 => 天鬼皇复活后灵魂出窍特效
|
||||
275 => 重楼创建的用来禁锢雪见/龙葵的法阵特效
|
||||
276 => 迴魂施法结束特效
|
||||
277 => 迴魂施法完全结束特效
|
||||
278 => 迴魂施法特效
|
||||
290 => 雪见传送出现时特效
|
||||
295 => 重楼施法治疗特效
|
||||
297 => 紫萱施法召唤水灵特效
|
||||
337 => 古藤精风系法术特效
|
||||
341 => 邪剑仙给镇妖剑施法特效
|
||||
368 => 雷击单体施法特效
|
||||
369 => 雷击范围施法特效
|
||||
376 => 紫萱的土系法术特效
|
||||
389 => 紫萱给江姑娘施法特效
|
||||
452 => 花楹治疗他人特效
|
||||
453 => 人物施法蓄力时的特效
|
||||
454 => 龙葵施法让众人御剑飞行的特效
|
||||
456 => 老婆婆施法特效
|
||||
457 => 夕瑶给景天施法时的特效
|
||||
458 => 灵力溢出特效
|
||||
467 => 邪剑仙灰飞烟灭特效
|
||||
468 => 蓝龙葵变红龙葵的特效
|
||||
@@ -1,67 +0,0 @@
|
||||
因为当前特效的实现方式使用了第三方插件和素材,所以此文件夹内的所有prefab均添加进了gitignore里。
|
||||
请联系作者了解插件获取方式和特效prefab的获取方式。
|
||||
|
||||
0 => 传送法阵特效
|
||||
9 => 茅山道士封印法术特效
|
||||
40 => 单体风咒特效
|
||||
50 => 单体雷咒特效
|
||||
91 => 封印法术特效
|
||||
157 => 角色传送出现特效
|
||||
164 => 南宫煌变身狼形态时的特效
|
||||
170 => 王蓬絮变身特效
|
||||
171 => 人物施法特效
|
||||
172 => 人物受到法术作用时候的特效
|
||||
173 => 人物受到法术作用时候的特效
|
||||
174 => 治疗特效
|
||||
175 => 茅山术士打乱三杯盏特效
|
||||
176 => 南宫煌打乱三杯盏特效
|
||||
177 => 角色传送消失时的特效
|
||||
178 => 南宫煌使关桃子的笼子消失的特效
|
||||
179 => 南宫煌变出法桌的特效
|
||||
181 => 南宫煌变出小东西的特效
|
||||
182 => 南宫煌变出大东西的特效
|
||||
186 => 大石块砸下后的尘土特效
|
||||
189 => 地脉石门封印打开时的特效
|
||||
198 => 南宫煌变出东西的特效
|
||||
201 => 魁妖变小特效
|
||||
205 => 照妖镜发光的特效
|
||||
209 => 五灵轮特效
|
||||
211 => 洒金笺特效
|
||||
230 => 重楼施法消灭怪物的特效
|
||||
254 => 重楼传送特效
|
||||
257 => 隔空取物特效
|
||||
258 => 迴魂传送特效
|
||||
259 => 大型传送法施法前奏特效
|
||||
260 => 大型传送法阵特效收尾
|
||||
261 => 大型传送法阵特效开始
|
||||
281 => 角色传送消失时的特效
|
||||
282 => 雷咒特效
|
||||
283 => 物品消失时的特效
|
||||
285 => 南宫煌施法特效
|
||||
287 => 土灵珠特效
|
||||
289 => 血魂姬施法特效
|
||||
290 => 回复法阵特效
|
||||
292 => 五灵轮发光特效
|
||||
299 => 重楼传送众人特效
|
||||
314 => 倾国银弹波特效
|
||||
315 => 南宫煌切换为人形态特效
|
||||
316 => 魔物出现特效
|
||||
318 => 千凝魔艮特效
|
||||
320 => 幽娘变身特效
|
||||
322 => 幽娘吸收怨气特效
|
||||
323 => 幽娘收集怨气特效
|
||||
325 => 陆北亭变身特效
|
||||
328 => 风雅颂开心的特效
|
||||
333 => 感月出现特效
|
||||
355 => 王蓬絮治疗特效
|
||||
359 => 蝎魃消失特效
|
||||
360 => 星璇给南宫煌输入内力时的特效
|
||||
367 => 五毒珠治疗特效
|
||||
388 => 迴魂传送特效
|
||||
389 => 迴魂传送特效
|
||||
397 => 燎日变身特效
|
||||
401 => 魔尊帮星璇灵肉合一的特效
|
||||
404 => 思堂消失特效
|
||||
408 => 星璇燎日变换时特效
|
||||
424 => 王蓬絮对南宫煌施法特效
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// ------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
Shader "Pal3/Dev"
|
||||
{
|
||||
@@ -12,7 +12,7 @@ Shader "Pal3/Dev"
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags { "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" }
|
||||
Tags { "RenderPipeline" = "UniversalPipeline" "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" }
|
||||
LOD 100
|
||||
|
||||
ZWrite Off
|
||||
@@ -20,13 +20,14 @@ Shader "Pal3/Dev"
|
||||
|
||||
Pass
|
||||
{
|
||||
CGPROGRAM
|
||||
Tags { "LightMode" = "SRPDefaultUnlit" }
|
||||
HLSLPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma target 2.0
|
||||
#pragma multi_compile_fog
|
||||
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Fog.hlsl"
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
|
||||
struct appdata_t {
|
||||
float4 vertex : POSITION;
|
||||
@@ -37,32 +38,36 @@ Shader "Pal3/Dev"
|
||||
struct v2f {
|
||||
float4 vertex : SV_POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
UNITY_FOG_COORDS(7)
|
||||
float fogFactor : TEXCOORD7;
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
float4 _MainTex_ST;
|
||||
TEXTURE2D(_MainTex);
|
||||
SAMPLER(sampler_MainTex);
|
||||
|
||||
CBUFFER_START(UnityPerMaterial)
|
||||
float4 _MainTex_ST;
|
||||
CBUFFER_END
|
||||
|
||||
v2f vert (appdata_t v)
|
||||
{
|
||||
v2f o;
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.vertex = TransformObjectToHClip(v.vertex.xyz);
|
||||
o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
|
||||
UNITY_TRANSFER_FOG(o,o.vertex);
|
||||
o.fogFactor = ComputeFogFactor(o.vertex.z);
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag (v2f i) : SV_Target
|
||||
{
|
||||
half4 col = tex2D(_MainTex, i.texcoord);
|
||||
half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.texcoord);
|
||||
col.a = 0.5;
|
||||
UNITY_APPLY_FOG(i.fogCoord, col);
|
||||
col.rgb = MixFog(col.rgb, i.fogFactor);
|
||||
return col;
|
||||
}
|
||||
ENDCG
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// ------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
Shader "Pal3/Opaque"
|
||||
{
|
||||
@@ -12,27 +12,25 @@ Shader "Pal3/Opaque"
|
||||
|
||||
_HasShadowTex ("Has Shadow Texture", Range(0, 1)) = 0.0
|
||||
_ShadowTex ("Shadow Texture", 2D) = "white" {}
|
||||
_Exposure("Exposure Amount", Range(0.1, 1.0)) = 0.4
|
||||
_LightmapScale("Lightmap Scale", Float) = 1.666667
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
Lighting Off
|
||||
|
||||
Tags { "QUEUE" = "Geometry" }
|
||||
Tags { "RenderPipeline" = "UniversalPipeline" "Queue" = "Geometry" }
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags{ "Qeueue" = "Geometry" }
|
||||
Tags { "LightMode" = "SRPDefaultUnlit" }
|
||||
Blend Off
|
||||
ZWrite On
|
||||
|
||||
CGPROGRAM
|
||||
HLSLPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma target 2.0
|
||||
#pragma multi_compile_fog
|
||||
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Fog.hlsl"
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
|
||||
struct appdata_t
|
||||
{
|
||||
@@ -47,43 +45,47 @@ Shader "Pal3/Opaque"
|
||||
float4 vertex : SV_POSITION;
|
||||
float2 texcoord0 : TEXCOORD0;
|
||||
float2 texcoord1 : TEXCOORD1;
|
||||
UNITY_FOG_COORDS(7)
|
||||
float fogFactor : TEXCOORD7;
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
float4 _MainTex_ST;
|
||||
float4 _TintColor;
|
||||
TEXTURE2D(_MainTex);
|
||||
SAMPLER(sampler_MainTex);
|
||||
TEXTURE2D(_ShadowTex);
|
||||
SAMPLER(sampler_ShadowTex);
|
||||
|
||||
float _HasShadowTex;
|
||||
sampler2D _ShadowTex;
|
||||
float4 _ShadowTex_ST;
|
||||
float _Exposure;
|
||||
CBUFFER_START(UnityPerMaterial)
|
||||
float4 _MainTex_ST;
|
||||
float4 _TintColor;
|
||||
float _HasShadowTex;
|
||||
float4 _ShadowTex_ST;
|
||||
float _LightmapScale;
|
||||
CBUFFER_END
|
||||
|
||||
v2f vert(appdata_t v)
|
||||
{
|
||||
v2f o;
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.vertex = TransformObjectToHClip(v.vertex.xyz);
|
||||
o.texcoord0 = TRANSFORM_TEX(v.texcoord0, _MainTex);
|
||||
o.texcoord1 = TRANSFORM_TEX(v.texcoord1, _ShadowTex);
|
||||
UNITY_TRANSFER_FOG(o, o.vertex);
|
||||
o.fogFactor = ComputeFogFactor(o.vertex.z);
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag(v2f i) : SV_Target
|
||||
{
|
||||
half4 color = tex2D(_MainTex, i.texcoord0);
|
||||
half4 color = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.texcoord0);
|
||||
if(_HasShadowTex > 0.5f)
|
||||
{
|
||||
color *= tex2D(_ShadowTex, i.texcoord1) / (1 - _Exposure);
|
||||
color.rgb *= SAMPLE_TEXTURE2D(_ShadowTex, sampler_ShadowTex, i.texcoord1).rgb * _LightmapScale;
|
||||
}
|
||||
color *= _TintColor;
|
||||
UNITY_APPLY_FOG(i.fogCoord, color);
|
||||
color.rgb = MixFog(color.rgb, i.fogFactor);
|
||||
return color;
|
||||
}
|
||||
ENDCG
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
// ------------------------------------------------------------------------
|
||||
// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
Shader "Pal3/OriginalEffect"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex ("Texture", 2D) = "white" {}
|
||||
[Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend ("Source blend", Float) = 1
|
||||
[Enum(UnityEngine.Rendering.BlendMode)] _DstBlend ("Destination blend", Float) = 1
|
||||
[Enum(UnityEngine.Rendering.CompareFunction)] _ZTest ("Depth test", Float) = 4
|
||||
[Enum(UnityEngine.Rendering.CullMode)] _Cull ("Cull", Float) = 0
|
||||
_AlphaMode ("Original alpha operation", Float) = 0
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
Tags
|
||||
{
|
||||
"RenderPipeline" = "UniversalPipeline"
|
||||
"Queue" = "Transparent"
|
||||
"RenderType" = "Transparent"
|
||||
}
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "SRPDefaultUnlit" }
|
||||
Blend [_SrcBlend] [_DstBlend]
|
||||
ZTest [_ZTest]
|
||||
ZWrite Off
|
||||
Cull [_Cull]
|
||||
HLSLPROGRAM
|
||||
#pragma vertex Vert
|
||||
#pragma fragment Frag
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
struct Attributes
|
||||
{
|
||||
float3 positionOS : POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
half4 color : COLOR;
|
||||
};
|
||||
struct Varyings
|
||||
{
|
||||
float4 positionCS : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
half4 color : COLOR;
|
||||
};
|
||||
TEXTURE2D(_MainTex);
|
||||
SAMPLER(sampler_MainTex);
|
||||
CBUFFER_START(UnityPerMaterial)
|
||||
float _AlphaMode;
|
||||
CBUFFER_END
|
||||
Varyings Vert(Attributes i)
|
||||
{
|
||||
Varyings o;
|
||||
o.positionCS = TransformObjectToHClip(i.positionOS);
|
||||
o.uv = i.uv;
|
||||
o.color = i.color;
|
||||
return o;
|
||||
}
|
||||
half4 Frag(Varyings i) : SV_Target
|
||||
{
|
||||
half4 tex = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.uv);
|
||||
half4 col = tex * i.color;
|
||||
if (_AlphaMode > 1.5)
|
||||
{
|
||||
col.a = tex.a;
|
||||
}
|
||||
else if (_AlphaMode > 0.5)
|
||||
{
|
||||
col.a = saturate(tex.a + i.color.a);
|
||||
}
|
||||
return col;
|
||||
}
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dd7af60dc97334317a8bf7d560ba0f71
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,246 +0,0 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Based on cician's shader from https://forum.unity3d.com/threads/simple-optimized-blur-shader.185327/#post-1267642
|
||||
// Based on RoundedCorners.shader from https://github.com/kirevdokimov/Unity-UI-Rounded-Corners
|
||||
// with some modifications
|
||||
|
||||
Shader "Pal3/RoundedFrostedGlass"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_BlurAmount ("Blur", Range(0, 30)) = 1
|
||||
_Transparency ("Transparency", Range(0, 1)) = 1
|
||||
[HideInInspector] _MainTex ("Masking Texture", 2D) = "white" {}
|
||||
_AdditiveColor ("Additive Tint color", Color) = (0, 0, 0, 0)
|
||||
_MultiplyColor ("Multiply Tint color", Color) = (1, 1, 1, 1)
|
||||
_WidthHeightRadius ("WidthHeightRadius", Vector) = (0, 0, 0, 0)
|
||||
}
|
||||
|
||||
Category
|
||||
{
|
||||
// We must be transparent, so other objects are drawn before this one.
|
||||
Tags { "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" }
|
||||
|
||||
SubShader
|
||||
{
|
||||
Cull Off
|
||||
Lighting Off
|
||||
ZTest [unity_GUIZTestMode]
|
||||
ZWrite Off
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
|
||||
// Horizontal blur
|
||||
GrabPass
|
||||
{
|
||||
"_HBlur"
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma fragmentoption ARB_precision_hint_fastest
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct appdata_t {
|
||||
float4 vertex : POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct v2f {
|
||||
float4 vertex : POSITION;
|
||||
float4 uvgrab : TEXCOORD0;
|
||||
float2 uvmain : TEXCOORD1;
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_t v)
|
||||
{
|
||||
v2f o;
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
|
||||
#if UNITY_UV_STARTS_AT_TOP
|
||||
float scale = -1.0;
|
||||
#else
|
||||
float scale = 1.0;
|
||||
#endif
|
||||
|
||||
o.uvgrab.xy = (float2(o.vertex.x, o.vertex.y * scale) + o.vertex.w) * 0.5;
|
||||
o.uvgrab.zw = o.vertex.zw;
|
||||
|
||||
o.uvmain = TRANSFORM_TEX(v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
inline float roundedRectangle(float2 samplePosition, float absoluteRound, float2 halfSize){
|
||||
halfSize = halfSize - absoluteRound;
|
||||
float2 distanceToEdge = abs(samplePosition) - halfSize;
|
||||
const float outsideDistance = length(max(distanceToEdge, 0));
|
||||
const float insideDistance = min(max(distanceToEdge.x, distanceToEdge.y), 0);
|
||||
return outsideDistance + insideDistance - absoluteRound;
|
||||
}
|
||||
|
||||
inline float calcAlpha(float2 samplePosition, float2 size, float radius){
|
||||
const float2 samplePositionTranslated = (samplePosition - .5) * size;
|
||||
const float distToRect = roundedRectangle(samplePositionTranslated, radius * .5, size * .5);
|
||||
const float distanceChange = fwidth(distToRect) * 0.5;
|
||||
return smoothstep(distanceChange, -distanceChange, distToRect);
|
||||
}
|
||||
|
||||
inline fixed4 mixAlpha(fixed4 mainTexColor, fixed4 color, float sdfAlpha){
|
||||
fixed4 col = mainTexColor * color;
|
||||
col.a = min(col.a, sdfAlpha);
|
||||
return col;
|
||||
}
|
||||
|
||||
sampler2D _HBlur;
|
||||
float4 _HBlur_TexelSize;
|
||||
float _BlurAmount;
|
||||
float _Transparency;
|
||||
float4 _AdditiveColor;
|
||||
float4 _MultiplyColor;
|
||||
float4 _WidthHeightRadius;
|
||||
|
||||
half4 frag(v2f i) : COLOR
|
||||
{
|
||||
const float alpha = calcAlpha(i.uvmain, _WidthHeightRadius.xy, _WidthHeightRadius.z);
|
||||
half4 cutoffColor = mixAlpha(tex2D(_MainTex, i.uvmain), _AdditiveColor, alpha);
|
||||
clip(cutoffColor.a - 0.001);
|
||||
|
||||
half4 sum = half4(0,0,0,0);
|
||||
|
||||
#define GRABPIXEL(weight, kernelx) tex2Dproj( _HBlur, UNITY_PROJ_COORD(float4(i.uvgrab.x + _HBlur_TexelSize.x * kernelx * _BlurAmount, i.uvgrab.y, i.uvgrab.z, i.uvgrab.w))) * weight
|
||||
|
||||
sum += GRABPIXEL(0.05, -4.0);
|
||||
sum += GRABPIXEL(0.09, -3.0);
|
||||
sum += GRABPIXEL(0.12, -2.0);
|
||||
sum += GRABPIXEL(0.15, -1.0);
|
||||
sum += GRABPIXEL(0.18, 0.0);
|
||||
sum += GRABPIXEL(0.15, +1.0);
|
||||
sum += GRABPIXEL(0.12, +2.0);
|
||||
sum += GRABPIXEL(0.09, +3.0);
|
||||
sum += GRABPIXEL(0.05, +4.0);
|
||||
|
||||
|
||||
half4 result = half4(sum.r * _MultiplyColor.r + _AdditiveColor.r,
|
||||
sum.g * _MultiplyColor.g + _AdditiveColor.g,
|
||||
sum.b * _MultiplyColor.b + _AdditiveColor.b,
|
||||
tex2D(_MainTex, i.uvmain).a);
|
||||
result.a *= _Transparency;
|
||||
return result;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
|
||||
// Vertical blur
|
||||
GrabPass
|
||||
{
|
||||
"_VBlur"
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma fragmentoption ARB_precision_hint_fastest
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct appdata_t {
|
||||
float4 vertex : POSITION;
|
||||
float2 texcoord: TEXCOORD0;
|
||||
};
|
||||
|
||||
struct v2f {
|
||||
float4 vertex : POSITION;
|
||||
float4 uvgrab : TEXCOORD0;
|
||||
float2 uvmain : TEXCOORD1;
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert(appdata_t v) {
|
||||
v2f o;
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
|
||||
#if UNITY_UV_STARTS_AT_TOP
|
||||
const float scale = -1.0;
|
||||
#else
|
||||
const float scale = 1.0;
|
||||
#endif
|
||||
|
||||
o.uvgrab.xy = (float2(o.vertex.x, o.vertex.y * scale) + o.vertex.w) * 0.5;
|
||||
o.uvgrab.zw = o.vertex.zw;
|
||||
|
||||
o.uvmain = TRANSFORM_TEX(v.texcoord, _MainTex);
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
inline float roundedRectangle(float2 samplePosition, float absoluteRound, float2 halfSize){
|
||||
halfSize = halfSize - absoluteRound;
|
||||
float2 distanceToEdge = abs(samplePosition) - halfSize;
|
||||
const float outsideDistance = length(max(distanceToEdge, 0));
|
||||
const float insideDistance = min(max(distanceToEdge.x, distanceToEdge.y), 0);
|
||||
return outsideDistance + insideDistance - absoluteRound;
|
||||
}
|
||||
|
||||
inline float calcAlpha(float2 samplePosition, float2 size, float radius){
|
||||
const float2 samplePositionTranslated = (samplePosition - .5) * size;
|
||||
const float distToRect = roundedRectangle(samplePositionTranslated, radius * .5, size * .5);
|
||||
const float distanceChange = fwidth(distToRect) * 0.5;
|
||||
return smoothstep(distanceChange, -distanceChange, distToRect);
|
||||
}
|
||||
|
||||
inline fixed4 mixAlpha(fixed4 mainTexColor, fixed4 color, float sdfAlpha){
|
||||
fixed4 col = mainTexColor * color;
|
||||
col.a = min(col.a, sdfAlpha);
|
||||
return col;
|
||||
}
|
||||
|
||||
sampler2D _VBlur;
|
||||
float4 _VBlur_TexelSize;
|
||||
float _BlurAmount;
|
||||
float _Transparency;
|
||||
float4 _AdditiveColor;
|
||||
float4 _MultiplyColor;
|
||||
float4 _WidthHeightRadius;
|
||||
|
||||
half4 frag(v2f i) : COLOR
|
||||
{
|
||||
const float alpha = calcAlpha(i.uvmain, _WidthHeightRadius.xy, _WidthHeightRadius.z);
|
||||
half4 cutoffColor = mixAlpha(tex2D(_MainTex, i.uvmain), _AdditiveColor, alpha);
|
||||
clip(cutoffColor.a - 0.001);
|
||||
|
||||
half4 sum = half4(0,0,0,0);
|
||||
|
||||
#define GRABPIXEL(weight, kernely) tex2Dproj( _VBlur, UNITY_PROJ_COORD(float4(i.uvgrab.x, i.uvgrab.y + _VBlur_TexelSize.y * kernely * _BlurAmount, i.uvgrab.z, i.uvgrab.w))) * weight
|
||||
|
||||
sum += GRABPIXEL(0.05, -4.0);
|
||||
sum += GRABPIXEL(0.09, -3.0);
|
||||
sum += GRABPIXEL(0.12, -2.0);
|
||||
sum += GRABPIXEL(0.15, -1.0);
|
||||
sum += GRABPIXEL(0.18, 0.0);
|
||||
sum += GRABPIXEL(0.15, +1.0);
|
||||
sum += GRABPIXEL(0.12, +2.0);
|
||||
sum += GRABPIXEL(0.09, +3.0);
|
||||
sum += GRABPIXEL(0.05, +4.0);
|
||||
|
||||
half4 result = half4(sum.r * _MultiplyColor.r + _AdditiveColor.r,
|
||||
sum.g * _MultiplyColor.g + _AdditiveColor.g,
|
||||
sum.b * _MultiplyColor.b + _AdditiveColor.b,
|
||||
tex2D(_MainTex, i.uvmain).a);
|
||||
result.a *= _Transparency;
|
||||
return result;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// ------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
Shader "Pal3/Sprite"
|
||||
{
|
||||
@@ -11,19 +11,20 @@ Shader "Pal3/Sprite"
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
Tags { "Queue" = "Transparent" }
|
||||
Tags { "RenderPipeline" = "UniversalPipeline" "Queue" = "Transparent" }
|
||||
LOD 100
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "SRPDefaultUnlit" }
|
||||
Blend SrcAlpha One
|
||||
ZWrite Off
|
||||
|
||||
CGPROGRAM
|
||||
HLSLPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
|
||||
struct appdata
|
||||
{
|
||||
@@ -37,24 +38,28 @@ Shader "Pal3/Sprite"
|
||||
float4 vertex : SV_POSITION;
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
float4 _MainTex_ST;
|
||||
TEXTURE2D(_MainTex);
|
||||
SAMPLER(sampler_MainTex);
|
||||
|
||||
CBUFFER_START(UnityPerMaterial)
|
||||
float4 _MainTex_ST;
|
||||
CBUFFER_END
|
||||
|
||||
v2f vert (appdata v)
|
||||
{
|
||||
v2f o;
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.vertex = TransformObjectToHClip(v.vertex.xyz);
|
||||
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
fixed4 frag (v2f i) : SV_Target
|
||||
half4 frag (v2f i) : SV_Target
|
||||
{
|
||||
fixed4 col = tex2D(_MainTex, i.uv);
|
||||
half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.uv);
|
||||
col.a = 1.0f; // force alpha to 1 to avoid transparency
|
||||
return col;
|
||||
}
|
||||
ENDCG
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// ------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
Shader "Pal3/Transparent"
|
||||
{
|
||||
@@ -13,7 +13,7 @@ Shader "Pal3/Transparent"
|
||||
|
||||
_HasShadowTex ("Has Shadow Texture", Range(0, 1)) = 0.0
|
||||
_ShadowTex ("Shadow Texture", 2D) = "white" {}
|
||||
_Exposure("Exposure Amount", Range(0.1, 1.0)) = 0.4
|
||||
_LightmapScale("Lightmap Scale", Float) = 1.666667
|
||||
|
||||
[Enum(UnityEngine.Rendering.BlendMode)]
|
||||
_BlendSrcFactor("Source Blend Factor", int) = 5 // BlendMode.SrcAlpha as Default
|
||||
@@ -23,23 +23,22 @@ Shader "Pal3/Transparent"
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
Lighting Off
|
||||
|
||||
Tags { "Queue" = "Transparent" }
|
||||
Tags { "RenderPipeline" = "UniversalPipeline" "Queue" = "Transparent" }
|
||||
|
||||
// Pass 2 ,transparent part
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "SRPDefaultUnlit" }
|
||||
Blend [_BlendSrcFactor] [_BlendDstFactor]
|
||||
ZWrite Off
|
||||
|
||||
CGPROGRAM
|
||||
HLSLPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma target 2.0
|
||||
#pragma multi_compile_fog
|
||||
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Fog.hlsl"
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
|
||||
struct appdata_t
|
||||
{
|
||||
@@ -54,52 +53,53 @@ Shader "Pal3/Transparent"
|
||||
float4 vertex : SV_POSITION;
|
||||
float2 texcoord0 : TEXCOORD0;
|
||||
float2 texcoord1 : TEXCOORD1;
|
||||
UNITY_FOG_COORDS(7)
|
||||
float fogFactor : TEXCOORD7;
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
float4 _MainTex_ST;
|
||||
float _Threshold;
|
||||
TEXTURE2D(_MainTex);
|
||||
SAMPLER(sampler_MainTex);
|
||||
TEXTURE2D(_ShadowTex);
|
||||
SAMPLER(sampler_ShadowTex);
|
||||
|
||||
float _HasShadowTex;
|
||||
sampler2D _ShadowTex;
|
||||
float4 _ShadowTex_ST;
|
||||
float _Exposure;
|
||||
|
||||
float4 _TintColor;
|
||||
CBUFFER_START(UnityPerMaterial)
|
||||
float4 _MainTex_ST;
|
||||
float _Threshold;
|
||||
float _HasShadowTex;
|
||||
float4 _ShadowTex_ST;
|
||||
float _LightmapScale;
|
||||
float4 _TintColor;
|
||||
CBUFFER_END
|
||||
|
||||
v2f vert(appdata_t v)
|
||||
{
|
||||
v2f o;
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.vertex = TransformObjectToHClip(v.vertex.xyz);
|
||||
o.texcoord0 = TRANSFORM_TEX(v.texcoord0, _MainTex);
|
||||
o.texcoord1 = TRANSFORM_TEX(v.texcoord1, _ShadowTex);
|
||||
UNITY_TRANSFER_FOG(o, o.vertex);
|
||||
o.fogFactor = ComputeFogFactor(o.vertex.z);
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag(v2f i) : SV_Target
|
||||
{
|
||||
half4 color = tex2D(_MainTex, i.texcoord0);
|
||||
const float alpha = color.a;
|
||||
if(color.a >= _Threshold)
|
||||
half4 color = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.texcoord0);
|
||||
if (color.a >= _Threshold || (color.a <= 0.0 && _Threshold <= 1.0))
|
||||
{
|
||||
discard;
|
||||
}
|
||||
|
||||
if(_HasShadowTex > 0.5f)
|
||||
{
|
||||
color *= tex2D(_ShadowTex, i.texcoord1) / (1 - _Exposure);
|
||||
color.a = alpha;
|
||||
color.rgb *= SAMPLE_TEXTURE2D(_ShadowTex, sampler_ShadowTex, i.texcoord1).rgb * _LightmapScale;
|
||||
}
|
||||
color *= _TintColor;
|
||||
UNITY_APPLY_FOG(i.fogCoord, color);
|
||||
color.rgb = MixFog(color.rgb, i.fogFactor);
|
||||
return color;
|
||||
}
|
||||
ENDCG
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// ------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
Shader "Pal3/TransparentOpaquePart"
|
||||
{
|
||||
@@ -13,27 +13,26 @@ Shader "Pal3/TransparentOpaquePart"
|
||||
|
||||
_HasShadowTex ("Has Shadow Texture", Range(0, 1)) = 0.0
|
||||
_ShadowTex ("Shadow Texture", 2D) = "white" {}
|
||||
_Exposure("Exposure Amount", Range(0.1, 1.0)) = 0.4
|
||||
_LightmapScale("Lightmap Scale", Float) = 1.666667
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
Lighting Off
|
||||
|
||||
Tags { "Qeueue" = "Geometry" }
|
||||
Tags { "RenderPipeline" = "UniversalPipeline" "Queue" = "Geometry" }
|
||||
|
||||
// pass 1 , opaque part
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "SRPDefaultUnlit" }
|
||||
Blend Off
|
||||
ZWrite On
|
||||
|
||||
CGPROGRAM
|
||||
HLSLPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma target 2.0
|
||||
#pragma multi_compile_fog
|
||||
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Fog.hlsl"
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
|
||||
struct appdata_t
|
||||
{
|
||||
@@ -48,47 +47,50 @@ Shader "Pal3/TransparentOpaquePart"
|
||||
float4 vertex : SV_POSITION;
|
||||
float2 texcoord0 : TEXCOORD0;
|
||||
float2 texcoord1 : TEXCOORD1;
|
||||
UNITY_FOG_COORDS(7)
|
||||
float fogFactor : TEXCOORD7;
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
float4 _MainTex_ST;
|
||||
float _Threshold;
|
||||
TEXTURE2D(_MainTex);
|
||||
SAMPLER(sampler_MainTex);
|
||||
TEXTURE2D(_ShadowTex);
|
||||
SAMPLER(sampler_ShadowTex);
|
||||
|
||||
float _HasShadowTex;
|
||||
sampler2D _ShadowTex;
|
||||
float4 _ShadowTex_ST;
|
||||
float _Exposure;
|
||||
|
||||
float4 _TintColor;
|
||||
CBUFFER_START(UnityPerMaterial)
|
||||
float4 _MainTex_ST;
|
||||
float _Threshold;
|
||||
float _HasShadowTex;
|
||||
float4 _ShadowTex_ST;
|
||||
float _LightmapScale;
|
||||
float4 _TintColor;
|
||||
CBUFFER_END
|
||||
|
||||
v2f vert(appdata_t v)
|
||||
{
|
||||
v2f o;
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.vertex = TransformObjectToHClip(v.vertex.xyz);
|
||||
o.texcoord0 = TRANSFORM_TEX(v.texcoord0, _MainTex);
|
||||
o.texcoord1 = TRANSFORM_TEX(v.texcoord1, _ShadowTex);
|
||||
UNITY_TRANSFER_FOG(o, o.vertex);
|
||||
o.fogFactor = ComputeFogFactor(o.vertex.z);
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag(v2f i) : SV_Target
|
||||
{
|
||||
half4 color = tex2D(_MainTex, i.texcoord0);
|
||||
half4 color = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.texcoord0);
|
||||
clip(color.a - _Threshold);
|
||||
|
||||
if(_HasShadowTex > 0.5f)
|
||||
{
|
||||
color *= tex2D(_ShadowTex, i.texcoord1) / (1 - _Exposure);
|
||||
color.rgb *= SAMPLE_TEXTURE2D(_ShadowTex, sampler_ShadowTex, i.texcoord1).rgb * _LightmapScale;
|
||||
}
|
||||
color *= _TintColor;
|
||||
UNITY_APPLY_FOG(i.fogCoord, color);
|
||||
color.rgb = MixFog(color.rgb, i.fogFactor);
|
||||
return color;
|
||||
}
|
||||
ENDCG
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// ------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
Shader "Pal3/Water"
|
||||
{
|
||||
@@ -13,7 +13,7 @@ Shader "Pal3/Water"
|
||||
// alpha value
|
||||
_Alpha ("Alpha",Range(0, 1)) = 0.5
|
||||
|
||||
_Exposure("Exposure Amount", Range(0.1, 1.0)) = 0.3
|
||||
_LightmapScale("Lightmap Scale", Float) = 1.428571
|
||||
|
||||
// pre baked shadow texture
|
||||
_ShadowTex ("Shadow texture", 2D) = "white" {}
|
||||
@@ -28,22 +28,21 @@ Shader "Pal3/Water"
|
||||
|
||||
SubShader
|
||||
{
|
||||
Lighting Off
|
||||
|
||||
Tags { "QUEUE" = "Transparent-1" } // -1 to fix sorting order issue with semi-transparent trees etc.
|
||||
Tags { "RenderPipeline" = "UniversalPipeline" "Queue" = "Transparent-1" } // -1 to fix sorting order issue with semi-transparent trees etc.
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "SRPDefaultUnlit" }
|
||||
Blend [_BlendSrcFactor] [_BlendDstFactor]
|
||||
ZWrite Off
|
||||
|
||||
CGPROGRAM
|
||||
HLSLPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma target 2.0
|
||||
#pragma multi_compile_fog
|
||||
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Fog.hlsl"
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
|
||||
struct appdata_t
|
||||
{
|
||||
@@ -58,42 +57,48 @@ Shader "Pal3/Water"
|
||||
float4 vertex : SV_POSITION;
|
||||
float2 texcoord0 : TEXCOORD0;
|
||||
float2 texcoord1 : TEXCOORD1;
|
||||
UNITY_FOG_COORDS(7)
|
||||
float fogFactor : TEXCOORD7;
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
float4 _MainTex_ST;
|
||||
TEXTURE2D(_MainTex);
|
||||
SAMPLER(sampler_MainTex);
|
||||
TEXTURE2D(_ShadowTex);
|
||||
SAMPLER(sampler_ShadowTex);
|
||||
|
||||
float _Alpha;
|
||||
float _Exposure;
|
||||
|
||||
float _HasShadowTex;
|
||||
sampler2D _ShadowTex;
|
||||
float4 _ShadowTex_ST;
|
||||
CBUFFER_START(UnityPerMaterial)
|
||||
float4 _MainTex_ST;
|
||||
float _Alpha;
|
||||
float _LightmapScale;
|
||||
float _HasShadowTex;
|
||||
float4 _ShadowTex_ST;
|
||||
CBUFFER_END
|
||||
|
||||
v2f vert(appdata_t v)
|
||||
{
|
||||
v2f o;
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.vertex = TransformObjectToHClip(v.vertex.xyz);
|
||||
o.texcoord0 = TRANSFORM_TEX(v.texcoord0, _MainTex);
|
||||
o.texcoord1 = TRANSFORM_TEX(v.texcoord1, _ShadowTex);
|
||||
UNITY_TRANSFER_FOG(o, o.vertex);
|
||||
o.fogFactor = ComputeFogFactor(o.vertex.z);
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag(v2f i) : SV_Target
|
||||
{
|
||||
const half4 color = tex2D(_MainTex, i.texcoord0);
|
||||
const half4 colorShadow = tex2D(_ShadowTex, i.texcoord1);
|
||||
half4 mixedColor = color * colorShadow / (1 - _Exposure);
|
||||
mixedColor.a = _Alpha; // use global alpha
|
||||
UNITY_APPLY_FOG(i.fogCoord, mixedColor);
|
||||
half4 mixedColor = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.texcoord0);
|
||||
if (_HasShadowTex > 0.5)
|
||||
{
|
||||
mixedColor.rgb *= SAMPLE_TEXTURE2D(_ShadowTex, sampler_ShadowTex, i.texcoord1).rgb;
|
||||
}
|
||||
mixedColor.rgb *= _LightmapScale;
|
||||
mixedColor.a = _Alpha;
|
||||
mixedColor.rgb = MixFog(mixedColor.rgb, i.fogFactor);
|
||||
return mixedColor;
|
||||
}
|
||||
ENDCG
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
// ------------------------------------------------------------------------
|
||||
// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
Shader "Pal3/SkyboxEffect"
|
||||
{
|
||||
Properties { _MainTex ("Sequence frame", 2D) = "black" {} }
|
||||
SubShader
|
||||
{
|
||||
Tags { "RenderPipeline"="UniversalPipeline" "Queue"="Transparent-10" "RenderType"="Transparent" }
|
||||
Pass
|
||||
{
|
||||
Blend SrcAlpha One
|
||||
ZWrite Off
|
||||
Cull Off
|
||||
HLSLPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
TEXTURE2D(_MainTex); SAMPLER(sampler_MainTex);
|
||||
struct Attributes { float4 positionOS : POSITION; float2 uv : TEXCOORD0; };
|
||||
struct Varyings { float4 positionCS : SV_POSITION; float2 uv : TEXCOORD0; };
|
||||
Varyings vert(Attributes input)
|
||||
{
|
||||
Varyings output;
|
||||
output.positionCS = TransformObjectToHClip(input.positionOS.xyz);
|
||||
// Sky effects must remain behind all scene geometry, including
|
||||
// mountains farther away than the effect cube's actual mesh.
|
||||
#if UNITY_REVERSED_Z
|
||||
output.positionCS.z = 0.0;
|
||||
#else
|
||||
output.positionCS.z = output.positionCS.w;
|
||||
#endif
|
||||
output.uv = input.uv;
|
||||
return output;
|
||||
}
|
||||
half4 frag(Varyings input) : SV_Target { return SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, input.uv); }
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0d3ce4f585ff416caf911181f6f5dd56
|
||||
@@ -1,539 +0,0 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!29 &1
|
||||
OcclusionCullingSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_OcclusionBakeSettings:
|
||||
smallestOccluder: 5
|
||||
smallestHole: 0.25
|
||||
backfaceThreshold: 100
|
||||
m_SceneGUID: 00000000000000000000000000000000
|
||||
m_OcclusionCullingData: {fileID: 0}
|
||||
--- !u!104 &2
|
||||
RenderSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 9
|
||||
m_Fog: 0
|
||||
m_FogColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_FogMode: 3
|
||||
m_FogDensity: 0.002
|
||||
m_LinearFogStart: 0
|
||||
m_LinearFogEnd: 300
|
||||
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
|
||||
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
|
||||
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
|
||||
m_AmbientIntensity: 1.3
|
||||
m_AmbientMode: 0
|
||||
m_SubtractiveShadowColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_SkyboxMaterial: {fileID: 0}
|
||||
m_HaloStrength: 0.5
|
||||
m_FlareStrength: 1
|
||||
m_FlareFadeSpeed: 3
|
||||
m_HaloTexture: {fileID: 0}
|
||||
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_DefaultReflectionMode: 0
|
||||
m_DefaultReflectionResolution: 128
|
||||
m_ReflectionBounces: 1
|
||||
m_ReflectionIntensity: 1
|
||||
m_CustomReflection: {fileID: 0}
|
||||
m_Sun: {fileID: 0}
|
||||
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_UseRadianceAmbientProbe: 0
|
||||
--- !u!157 &3
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 12
|
||||
m_GIWorkflowMode: 1
|
||||
m_GISettings:
|
||||
serializedVersion: 2
|
||||
m_BounceScale: 1
|
||||
m_IndirectOutputScale: 1
|
||||
m_AlbedoBoost: 1
|
||||
m_EnvironmentLightingMode: 0
|
||||
m_EnableBakedLightmaps: 1
|
||||
m_EnableRealtimeLightmaps: 0
|
||||
m_LightmapEditorSettings:
|
||||
serializedVersion: 12
|
||||
m_Resolution: 2
|
||||
m_BakeResolution: 40
|
||||
m_AtlasSize: 1024
|
||||
m_AO: 0
|
||||
m_AOMaxDistance: 1
|
||||
m_CompAOExponent: 1
|
||||
m_CompAOExponentDirect: 0
|
||||
m_ExtractAmbientOcclusion: 0
|
||||
m_Padding: 2
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_LightmapsBakeMode: 1
|
||||
m_TextureCompression: 1
|
||||
m_FinalGather: 0
|
||||
m_FinalGatherFiltering: 1
|
||||
m_FinalGatherRayCount: 256
|
||||
m_ReflectionCompression: 2
|
||||
m_MixedBakeMode: 2
|
||||
m_BakeBackend: 1
|
||||
m_PVRSampling: 1
|
||||
m_PVRDirectSampleCount: 32
|
||||
m_PVRSampleCount: 500
|
||||
m_PVRBounces: 2
|
||||
m_PVREnvironmentSampleCount: 500
|
||||
m_PVREnvironmentReferencePointCount: 2048
|
||||
m_PVRFilteringMode: 2
|
||||
m_PVRDenoiserTypeDirect: 0
|
||||
m_PVRDenoiserTypeIndirect: 0
|
||||
m_PVRDenoiserTypeAO: 0
|
||||
m_PVRFilterTypeDirect: 0
|
||||
m_PVRFilterTypeIndirect: 0
|
||||
m_PVRFilterTypeAO: 0
|
||||
m_PVREnvironmentMIS: 0
|
||||
m_PVRCulling: 1
|
||||
m_PVRFilteringGaussRadiusDirect: 1
|
||||
m_PVRFilteringGaussRadiusIndirect: 5
|
||||
m_PVRFilteringGaussRadiusAO: 2
|
||||
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||
m_PVRFilteringAtrousPositionSigmaAO: 1
|
||||
m_ExportTrainingData: 0
|
||||
m_TrainingDataDestination: TrainingData
|
||||
m_LightProbeSampleCountMultiplier: 4
|
||||
m_LightingDataAsset: {fileID: 112000000, guid: c9e1768594f6afd479e0380c47ec2784, type: 2}
|
||||
m_LightingSettings: {fileID: 4890085278179872738, guid: c3e8b810b348ed54ba97c7a4ee44d9eb, type: 2}
|
||||
--- !u!196 &4
|
||||
NavMeshSettings:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
serializedVersion: 2
|
||||
agentTypeID: 0
|
||||
agentRadius: 0.5
|
||||
agentHeight: 2
|
||||
agentSlope: 45
|
||||
agentClimb: 0.4
|
||||
ledgeDropHeight: 0
|
||||
maxJumpAcrossDistance: 0
|
||||
minRegionArea: 2
|
||||
manualCellSize: 0
|
||||
cellSize: 0.16666667
|
||||
manualTileSize: 0
|
||||
tileSize: 256
|
||||
accuratePlacement: 0
|
||||
maxJobWorkers: 0
|
||||
preserveTilesOutsideBounds: 0
|
||||
debug:
|
||||
m_Flags: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1 &806768031
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 806768034}
|
||||
- component: {fileID: 806768033}
|
||||
- component: {fileID: 806768032}
|
||||
m_Layer: 0
|
||||
m_Name: EventSystem
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &806768032
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 806768031}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 01614664b831546d2ae94a42149d80ac, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_MoveRepeatDelay: 0.5
|
||||
m_MoveRepeatRate: 0.1
|
||||
m_XRTrackingOrigin: {fileID: 0}
|
||||
m_ActionsAsset: {fileID: -944628639613478452, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
|
||||
m_PointAction: {fileID: -1654692200621890270, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
|
||||
m_MoveAction: {fileID: -8784545083839296357, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
|
||||
m_SubmitAction: {fileID: 392368643174621059, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
|
||||
m_CancelAction: {fileID: 7727032971491509709, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
|
||||
m_LeftClickAction: {fileID: 3001919216989983466, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
|
||||
m_MiddleClickAction: {fileID: -2185481485913320682, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
|
||||
m_RightClickAction: {fileID: -4090225696740746782, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
|
||||
m_ScrollWheelAction: {fileID: 6240969308177333660, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
|
||||
m_TrackedDevicePositionAction: {fileID: 6564999863303420839, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
|
||||
m_TrackedDeviceOrientationAction: {fileID: 7970375526676320489, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
|
||||
m_DeselectOnBackgroundClick: 1
|
||||
m_PointerBehavior: 0
|
||||
--- !u!114 &806768033
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 806768031}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_FirstSelected: {fileID: 0}
|
||||
m_sendNavigationEvents: 1
|
||||
m_DragThreshold: 10
|
||||
--- !u!4 &806768034
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 806768031}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1001 &2755888771526933938
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 2675203688159455099, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2675203688159455099, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2675203688159455099, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2675203688159455099, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2675203688159455099, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2675203688159455099, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2675384619832620949, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2675384619832620949, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2675384619832620949, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2675384619832620949, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2675384619832620949, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2675384619832620949, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773260843717, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: IngameDebugConsole
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773280878983, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773280971043, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773280971043, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773280971043, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773280971043, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773280971043, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773280971043, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773280980657, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773280980657, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773280980657, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773280980657, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773280980657, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773280980657, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281030725, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281030725, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281030725, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281030725, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281030725, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281030725, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281033885, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281033885, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281068093, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_Pivot.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281068093, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_Pivot.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281068093, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_RootOrder
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281068093, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281068093, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281068093, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_AnchorMin.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281068093, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281068093, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281068093, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281068093, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281068093, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281068093, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281068093, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281068093, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281068093, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281068093, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281068093, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281068093, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281068093, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281068093, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281068093, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281069695, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281069695, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281069695, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281069695, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281069695, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281069695, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281072733, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281072733, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281072733, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281072733, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281072733, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2755888773281072733, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
--- !u!1001 &6005496283450936117
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 6005496284174148228, guid: 23121fd589eec48458b9201ba9cfc3f7, type: 3}
|
||||
propertyPath: startingComponent
|
||||
value:
|
||||
objectReference: {fileID: 4717529239480754811, guid: e65c4b938f18e6c4a86dc379157fac65, type: 3}
|
||||
- target: {fileID: 6005496284174148229, guid: 23121fd589eec48458b9201ba9cfc3f7, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Resource Initializer
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6005496284174148231, guid: 23121fd589eec48458b9201ba9cfc3f7, type: 3}
|
||||
propertyPath: m_RootOrder
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6005496284174148231, guid: 23121fd589eec48458b9201ba9cfc3f7, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6005496284174148231, guid: 23121fd589eec48458b9201ba9cfc3f7, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6005496284174148231, guid: 23121fd589eec48458b9201ba9cfc3f7, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6005496284174148231, guid: 23121fd589eec48458b9201ba9cfc3f7, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6005496284174148231, guid: 23121fd589eec48458b9201ba9cfc3f7, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6005496284174148231, guid: 23121fd589eec48458b9201ba9cfc3f7, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6005496284174148231, guid: 23121fd589eec48458b9201ba9cfc3f7, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6005496284174148231, guid: 23121fd589eec48458b9201ba9cfc3f7, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6005496284174148231, guid: 23121fd589eec48458b9201ba9cfc3f7, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6005496284174148231, guid: 23121fd589eec48458b9201ba9cfc3f7, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 23121fd589eec48458b9201ba9cfc3f7, type: 3}
|
||||
@@ -1,7 +1,7 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// ------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
#if UNITY_EDITOR_OSX && UNITY_IOS
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// ------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
#if UNITY_EDITOR_OSX && UNITY_STANDALONE_OSX
|
||||
|
||||
|
||||
@@ -0,0 +1,696 @@
|
||||
// ------------------------------------------------------------------------
|
||||
// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
namespace Editor
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Pal3.Core.DataReader.Cpk;
|
||||
using Pal3.Core.DataReader.Data;
|
||||
using Pal3.Core.DataReader.Par;
|
||||
using Pal3.Core.FileSystem;
|
||||
using Pal3.Game.Effect.Original;
|
||||
using UnityEditor;
|
||||
using UnityEditor.SceneManagement;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Rendering.Universal;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
public sealed class EffectEditor : EditorWindow
|
||||
{
|
||||
private OriginalEffectResources _resources;
|
||||
private OriginalEffectPlayer _player;
|
||||
private OriginalPortalEffect _portal;
|
||||
private uint _portalType;
|
||||
[SerializeField] private OriginalEffectOverrides _edits;
|
||||
[SerializeField] private string _assetPath = "", _savedJson;
|
||||
private GameObject _root;
|
||||
private Scene _scene;
|
||||
private Camera _camera;
|
||||
private RenderTexture _target;
|
||||
private string _dataPath, _search = "", _error;
|
||||
[SerializeField] private bool _pal3a;
|
||||
|
||||
private string Variant => _pal3a ? "PAL3A" : "PAL3";
|
||||
|
||||
private int _codepage = 936;
|
||||
[SerializeField] private int _id = 98, _objectIndex;
|
||||
private Vector2 _listScroll, _inspectorScroll, _orbit = new(135, 15);
|
||||
private float _distance = 14, _speed = 1, _duration = 15;
|
||||
[SerializeField] private float _time;
|
||||
private bool _playing, _loop;
|
||||
private uint _seed = 1;
|
||||
private bool _emitterCurve;
|
||||
private int _particleIndex, _curveIndex;
|
||||
private double _lastUpdate;
|
||||
private string _previewJson;
|
||||
private float? _pendingSeek;
|
||||
private double _seekAfter;
|
||||
|
||||
#if PAL3
|
||||
[MenuItem("PAL3/Effect Editor")]
|
||||
#endif
|
||||
public static void Open()
|
||||
{
|
||||
var window = GetWindow<EffectEditor>("Effects");
|
||||
window.ChangeVariant(false);
|
||||
}
|
||||
|
||||
#if PAL3A
|
||||
[MenuItem("PAL3A/Effect Editor")]
|
||||
#endif
|
||||
public static void OpenPal3A()
|
||||
{
|
||||
var window = GetWindow<EffectEditor>("Effects");
|
||||
window.ChangeVariant(true);
|
||||
}
|
||||
|
||||
private void ChangeVariant(bool pal3a)
|
||||
{
|
||||
if (_pal3a == pal3a)
|
||||
{
|
||||
string path = EditorPrefs.GetString($"{Variant}.OriginalEffect.DataPath", _dataPath);
|
||||
int codepage = EditorPrefs.GetInt($"{Variant}.OriginalEffect.Codepage", 936) == 950 ? 950 : 936;
|
||||
if (path == _dataPath && codepage == _codepage || !CanReplaceEdits())
|
||||
return;
|
||||
LoadOverrides(Resources.Load<OriginalEffectOverrides>($"Effects/{Variant}Overrides"));
|
||||
LoadPreferences();
|
||||
LoadData();
|
||||
return;
|
||||
}
|
||||
if (!CanReplaceEdits())
|
||||
return;
|
||||
_pal3a = pal3a;
|
||||
_id = pal3a ? 160 : 98;
|
||||
_time = 0;
|
||||
LoadOverrides(Resources.Load<OriginalEffectOverrides>($"Effects/{Variant}Overrides"));
|
||||
LoadPreferences();
|
||||
LoadData();
|
||||
}
|
||||
|
||||
private void LoadPreferences()
|
||||
{
|
||||
_dataPath = EditorPrefs.GetString($"{Variant}.OriginalEffect.DataPath", Path.GetFullPath(Path.Combine(Application.dataPath, $"../../Game Data/{Variant}")));
|
||||
_codepage = EditorPrefs.GetInt($"{Variant}.OriginalEffect.Codepage", 936) == 950 ? 950 : 936;
|
||||
}
|
||||
|
||||
public void CreateGUI() => rootVisualElement.Add(new IMGUIContainer(DrawWindow) { style = { flexGrow = 1 } });
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
minSize = new Vector2(1050, 640);
|
||||
LoadPreferences();
|
||||
if (_edits == null)
|
||||
LoadOverrides(Resources.Load<OriginalEffectOverrides>($"Effects/{Variant}Overrides"));
|
||||
_edits.hideFlags = HideFlags.HideInHierarchy | HideFlags.DontSave;
|
||||
saveChangesMessage = "Save the original effect overrides before closing?";
|
||||
_scene = EditorSceneManager.NewPreviewScene();
|
||||
var cameraObject = new GameObject("Effect preview camera") { hideFlags = HideFlags.HideAndDontSave };
|
||||
SceneManager.MoveGameObjectToScene(cameraObject, _scene);
|
||||
_camera = cameraObject.AddComponent<Camera>();
|
||||
_camera.enabled = false;
|
||||
_camera.clearFlags = CameraClearFlags.SolidColor;
|
||||
_camera.backgroundColor = new Color(0.07f, 0.08f, 0.1f);
|
||||
_camera.fieldOfView = 40;
|
||||
_camera.nearClipPlane = 0.01f;
|
||||
_camera.farClipPlane = 500;
|
||||
_camera.scene = _scene;
|
||||
_lastUpdate = EditorApplication.timeSinceStartup;
|
||||
EditorApplication.update += Tick;
|
||||
Undo.undoRedoPerformed += RefreshAfterUndo;
|
||||
if (Directory.Exists(_dataPath))
|
||||
LoadData();
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
EditorApplication.update -= Tick;
|
||||
Undo.undoRedoPerformed -= RefreshAfterUndo;
|
||||
ClearPreview();
|
||||
_resources?.Dispose();
|
||||
_resources = null;
|
||||
if (_target != null)
|
||||
{
|
||||
_target.Release();
|
||||
DestroyImmediate(_target);
|
||||
}
|
||||
if (_scene.IsValid())
|
||||
EditorSceneManager.ClosePreviewScene(_scene);
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
if (_edits != null)
|
||||
{
|
||||
Undo.ClearUndo(_edits);
|
||||
DestroyImmediate(_edits);
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadOverrides(OriginalEffectOverrides asset)
|
||||
{
|
||||
if (_edits != null)
|
||||
{
|
||||
Undo.ClearUndo(_edits);
|
||||
DestroyImmediate(_edits);
|
||||
}
|
||||
_edits = asset != null ? Instantiate(asset) : CreateInstance<OriginalEffectOverrides>();
|
||||
_edits.hideFlags = HideFlags.HideInHierarchy | HideFlags.DontSave;
|
||||
_assetPath = asset != null ? AssetDatabase.GetAssetPath(asset) : "";
|
||||
_savedJson = JsonUtility.ToJson(_edits);
|
||||
hasUnsavedChanges = false;
|
||||
}
|
||||
|
||||
private void MarkChanged() => hasUnsavedChanges = JsonUtility.ToJson(_edits) != _savedJson;
|
||||
|
||||
public override void SaveChanges()
|
||||
{
|
||||
if (SaveOverrides())
|
||||
base.SaveChanges();
|
||||
}
|
||||
|
||||
public override void DiscardChanges()
|
||||
{
|
||||
LoadOverrides(_assetPath.Length > 0 ? AssetDatabase.LoadAssetAtPath<OriginalEffectOverrides>(_assetPath) : null);
|
||||
base.DiscardChanges();
|
||||
RefreshAfterUndo();
|
||||
}
|
||||
|
||||
private bool CanReplaceEdits()
|
||||
{
|
||||
if (!hasUnsavedChanges)
|
||||
return true;
|
||||
int choice = EditorUtility.DisplayDialogComplex("Original effect overrides", "Save your current edits before loading another asset?", "Save", "Cancel", "Discard");
|
||||
return choice == 2 || choice == 0 && SaveOverrides();
|
||||
}
|
||||
|
||||
private bool SaveOverrides()
|
||||
{
|
||||
string path = EditorUtility.SaveFilePanelInProject($"Save {Variant} effect overrides",
|
||||
_assetPath.Length > 0 ? Path.GetFileNameWithoutExtension(_assetPath) : $"{Variant}Overrides", "asset",
|
||||
$"Use Assets/Resources/Effects/{Variant}Overrides.asset for runtime loading.");
|
||||
if (path.Length == 0)
|
||||
return false;
|
||||
var existing = AssetDatabase.LoadMainAssetAtPath(path);
|
||||
if (existing != null && existing is not OriginalEffectOverrides)
|
||||
{
|
||||
_error = "Choose an OriginalEffectOverrides asset or a new path.";
|
||||
return false;
|
||||
}
|
||||
var saved = existing as OriginalEffectOverrides;
|
||||
if (saved != null)
|
||||
{
|
||||
Undo.RecordObject(saved, $"Save {Variant} effect overrides");
|
||||
EditorUtility.CopySerialized(_edits, saved);
|
||||
saved.hideFlags = HideFlags.None;
|
||||
EditorUtility.SetDirty(saved);
|
||||
}
|
||||
else
|
||||
{
|
||||
saved = Instantiate(_edits);
|
||||
saved.hideFlags = HideFlags.None;
|
||||
AssetDatabase.CreateAsset(saved, path);
|
||||
}
|
||||
saved.name = Path.GetFileNameWithoutExtension(path);
|
||||
EditorUtility.SetDirty(saved);
|
||||
AssetDatabase.SaveAssets();
|
||||
_assetPath = path;
|
||||
_savedJson = JsonUtility.ToJson(_edits);
|
||||
hasUnsavedChanges = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
private void LoadData()
|
||||
{
|
||||
float time = _time;
|
||||
ClearPreview();
|
||||
_resources?.Dispose();
|
||||
_resources = null;
|
||||
_error = null;
|
||||
try
|
||||
{
|
||||
var hash = new Crc32Hash();
|
||||
hash.Init();
|
||||
var fs = new CpkFileSystem(_dataPath, hash, _codepage);
|
||||
fs.Mount("basedata/basedata.cpk", _codepage);
|
||||
_resources = new OriginalEffectResources(fs, _codepage);
|
||||
if (_resources.GameVariant != Variant)
|
||||
throw new InvalidDataException($"The selected directory contains {_resources.GameVariant} data; select the matching variant first.");
|
||||
EditorPrefs.SetString($"{Variant}.OriginalEffect.DataPath", _dataPath);
|
||||
Restart();
|
||||
Seek(time);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_resources?.Dispose();
|
||||
_resources = null;
|
||||
_error = ex.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private void ClearPreview()
|
||||
{
|
||||
if (_root != null)
|
||||
DestroyImmediate(_root);
|
||||
_player = null;
|
||||
_portal = null;
|
||||
}
|
||||
|
||||
private void Restart()
|
||||
{
|
||||
ClearPreview();
|
||||
_time = 0;
|
||||
_pendingSeek = null;
|
||||
_error = null;
|
||||
_previewJson = JsonUtility.ToJson(_edits);
|
||||
if (_resources == null)
|
||||
return;
|
||||
try
|
||||
{
|
||||
_root = new GameObject("Original effect preview") { hideFlags = HideFlags.HideAndDontSave };
|
||||
SceneManager.MoveGameObjectToScene(_root, _scene);
|
||||
if (_id < 0)
|
||||
{
|
||||
_portal = _root.AddComponent<OriginalPortalEffect>();
|
||||
_portal.AutoAdvance = false;
|
||||
_portal.Initialize(_resources, _portalType);
|
||||
}
|
||||
else
|
||||
{
|
||||
string[] issues = _resources.Diagnose(_id, _edits);
|
||||
if (issues.Length > 0)
|
||||
_error = string.Join("\n", issues);
|
||||
else
|
||||
{
|
||||
_player = _root.AddComponent<OriginalEffectPlayer>();
|
||||
_player.AutoAdvance = false;
|
||||
_player.Initialize(_resources, _id, _seed, _edits);
|
||||
_player.Loop = false;
|
||||
if (_player.Error != null)
|
||||
_error = _player.Error;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ClearPreview();
|
||||
_error = ex.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private void Tick()
|
||||
{
|
||||
double now = EditorApplication.timeSinceStartup;
|
||||
float dt = Mathf.Min(0.1f, (float)(now - _lastUpdate));
|
||||
_lastUpdate = now;
|
||||
if (_pendingSeek.HasValue && now >= _seekAfter)
|
||||
{
|
||||
Seek(_pendingSeek.Value);
|
||||
Repaint();
|
||||
}
|
||||
if (_playing)
|
||||
{
|
||||
Advance(dt * _speed);
|
||||
if (_time >= _duration)
|
||||
{
|
||||
if (_loop)
|
||||
Restart();
|
||||
else
|
||||
_playing = false;
|
||||
}
|
||||
Repaint();
|
||||
}
|
||||
}
|
||||
|
||||
private void Advance(float delta)
|
||||
{
|
||||
_time += delta;
|
||||
_player?.Advance(delta);
|
||||
_portal?.Sample(_time);
|
||||
}
|
||||
|
||||
private void Seek(float time)
|
||||
{
|
||||
_pendingSeek = null;
|
||||
_time = time;
|
||||
_player?.Seek(time);
|
||||
_portal?.Sample(time);
|
||||
}
|
||||
|
||||
private void QueueSeek(float time)
|
||||
{
|
||||
_playing = false;
|
||||
_pendingSeek = time;
|
||||
_seekAfter = EditorApplication.timeSinceStartup + 0.05;
|
||||
Repaint();
|
||||
}
|
||||
|
||||
private void RefreshAfterUndo()
|
||||
{
|
||||
MarkChanged();
|
||||
if (_previewJson == JsonUtility.ToJson(_edits))
|
||||
return;
|
||||
float time = _time;
|
||||
Restart();
|
||||
Seek(time);
|
||||
Repaint();
|
||||
}
|
||||
|
||||
private void DrawWindow()
|
||||
{
|
||||
using (new EditorGUILayout.HorizontalScope(EditorStyles.toolbar))
|
||||
{
|
||||
int variant = EditorGUILayout.Popup(_pal3a ? 1 : 0, new[] { "PAL3", "PAL3A" }, GUILayout.Width(80));
|
||||
if ((variant == 1) != _pal3a)
|
||||
ChangeVariant(variant == 1);
|
||||
_dataPath = EditorGUILayout.TextField(_dataPath);
|
||||
int codepage = EditorGUILayout.Popup(_codepage == 950 ? 1 : 0, new[] { "GBK (936)", "Big5 (950)" }, GUILayout.Width(105)) == 0 ? 936 : 950;
|
||||
if (codepage != _codepage)
|
||||
{
|
||||
_codepage = codepage;
|
||||
EditorPrefs.SetInt($"{Variant}.OriginalEffect.Codepage", _codepage);
|
||||
LoadData();
|
||||
}
|
||||
if (GUILayout.Button("Browse", EditorStyles.toolbarButton, GUILayout.Width(60)))
|
||||
{
|
||||
string path = EditorUtility.OpenFolderPanel($"{Variant} data (contains basedata)", _dataPath, "");
|
||||
if (path.Length > 0)
|
||||
{
|
||||
_dataPath = path;
|
||||
LoadData();
|
||||
}
|
||||
}
|
||||
if (GUILayout.Button("Reload", EditorStyles.toolbarButton, GUILayout.Width(55)))
|
||||
LoadData();
|
||||
}
|
||||
var asset = _assetPath.Length > 0 ? AssetDatabase.LoadAssetAtPath<OriginalEffectOverrides>(_assetPath) : null;
|
||||
var selected = (OriginalEffectOverrides)EditorGUILayout.ObjectField("Overrides", asset, typeof(OriginalEffectOverrides), false);
|
||||
if (selected != asset && CanReplaceEdits())
|
||||
{
|
||||
LoadOverrides(selected);
|
||||
Restart();
|
||||
}
|
||||
if (_resources == null)
|
||||
{
|
||||
EditorGUILayout.HelpBox(_error ?? "Choose the PAL3 game data directory.", MessageType.Info);
|
||||
return;
|
||||
}
|
||||
using (new EditorGUILayout.HorizontalScope())
|
||||
{
|
||||
using (new EditorGUILayout.VerticalScope(GUILayout.Width(185)))
|
||||
{
|
||||
_search = EditorGUILayout.TextField(_search, EditorStyles.toolbarSearchField);
|
||||
_listScroll = EditorGUILayout.BeginScrollView(_listScroll);
|
||||
if (GUILayout.Button("Scene: Transport point"))
|
||||
Select(-1);
|
||||
for (int id = 0; id < _resources.Definitions.Groups.Length; id++)
|
||||
{
|
||||
EffectGroup g = _resources.Definitions.Groups[id];
|
||||
if (g.Objects.Length == 0)
|
||||
continue;
|
||||
string label = $"{id} ({g.Objects.Length})";
|
||||
if (_search.Length > 0 && !label.Contains(_search) && !g.Objects.Any(o => _resources.Definitions.TryGetType(o.TypeCrc, out var d) && d.TypeName.Contains(_search)))
|
||||
continue;
|
||||
if (GUILayout.Toggle(_id == id, label, "Button") && _id != id)
|
||||
Select(id);
|
||||
}
|
||||
EditorGUILayout.EndScrollView();
|
||||
}
|
||||
using (new EditorGUILayout.VerticalScope())
|
||||
{
|
||||
if (_id < 0 && _pal3a)
|
||||
{
|
||||
int style = EditorGUILayout.Popup("Transport style", (int)_portalType, new[] { "Default", "1 (trans_s)", "2 (trans_m)", "3 (trans_l)", "4 (trans_f)", "5 (trans_t)", "6 (trans_p)" });
|
||||
if ((uint)style != _portalType)
|
||||
{
|
||||
_portalType = (uint)style;
|
||||
Restart();
|
||||
}
|
||||
}
|
||||
using (new EditorGUILayout.HorizontalScope())
|
||||
{
|
||||
if (GUILayout.Button(_playing ? "Pause" : "Play", GUILayout.Width(60)))
|
||||
_playing = !_playing;
|
||||
if (GUILayout.Button("Reset", GUILayout.Width(55)))
|
||||
Restart();
|
||||
if (GUILayout.Button("Step", GUILayout.Width(50)))
|
||||
{
|
||||
_playing = false;
|
||||
Advance(OriginalEffectPlayer.FixedStep);
|
||||
Repaint();
|
||||
}
|
||||
GUILayout.Label("Speed", GUILayout.Width(40));
|
||||
_speed = EditorGUILayout.FloatField(_speed, GUILayout.Width(45));
|
||||
_speed = float.IsFinite(_speed) ? Mathf.Clamp(_speed, 0, 16) : 1;
|
||||
_loop = GUILayout.Toggle(_loop, "Loop");
|
||||
}
|
||||
Rect preview = GUILayoutUtility.GetRect(200, 200, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true));
|
||||
DrawPreview(preview);
|
||||
float displayedTime = _pendingSeek ?? _time;
|
||||
float time = EditorGUILayout.Slider("Time", displayedTime, 0, _duration);
|
||||
if (Mathf.Abs(time - displayedTime) > 0.00001f)
|
||||
QueueSeek(time);
|
||||
using (new EditorGUILayout.HorizontalScope())
|
||||
{
|
||||
_duration = EditorGUILayout.FloatField("Preview duration", _duration);
|
||||
_duration = float.IsFinite(_duration) ? Mathf.Clamp(_duration, 0.1f, 600) : 15;
|
||||
uint seed = (uint)Mathf.Max(1, EditorGUILayout.IntField("Seed", (int)_seed));
|
||||
if (seed != _seed)
|
||||
{
|
||||
_seed = seed;
|
||||
Restart();
|
||||
}
|
||||
}
|
||||
EditorGUILayout.LabelField($"Objects: {_player?.NodeCount ?? 0} Quads/particles: {_player?.QuadCount ?? 0} {_player?.Error}");
|
||||
EditorGUILayout.LabelField("Drag to orbit · Scroll to zoom", EditorStyles.miniLabel);
|
||||
if (_error != null)
|
||||
EditorGUILayout.HelpBox(_error, MessageType.Warning);
|
||||
}
|
||||
using (new EditorGUILayout.VerticalScope(GUILayout.Width(310)))
|
||||
DrawInspector();
|
||||
}
|
||||
}
|
||||
|
||||
private void Select(int id)
|
||||
{
|
||||
_id = id;
|
||||
_objectIndex = 0;
|
||||
Restart();
|
||||
}
|
||||
|
||||
private void DrawPreview(Rect rect)
|
||||
{
|
||||
Event e = Event.current;
|
||||
if (rect.Contains(e.mousePosition))
|
||||
{
|
||||
if (e.type == EventType.MouseDrag && e.button == 0)
|
||||
{
|
||||
_orbit += e.delta * new Vector2(0.5f, -0.5f);
|
||||
e.Use();
|
||||
Repaint();
|
||||
}
|
||||
if (e.type == EventType.ScrollWheel)
|
||||
{
|
||||
_distance = Mathf.Clamp(_distance * Mathf.Exp(e.delta.y * 0.08f), 0.3f, 200);
|
||||
e.Use();
|
||||
Repaint();
|
||||
}
|
||||
}
|
||||
if (e.type != EventType.Repaint || rect.width < 1 || rect.height < 1)
|
||||
return;
|
||||
int w = Mathf.Max(1, (int)rect.width), h = Mathf.Max(1, (int)rect.height);
|
||||
if (_target == null || _target.width != w || _target.height != h)
|
||||
{
|
||||
if (_target != null)
|
||||
{
|
||||
_target.Release();
|
||||
DestroyImmediate(_target);
|
||||
}
|
||||
_target = new RenderTexture(w, h, 24) { hideFlags = HideFlags.HideAndDontSave };
|
||||
_target.Create();
|
||||
}
|
||||
_camera.transform.position = Quaternion.Euler(_orbit.y, _orbit.x, 0) * new Vector3(0, 0, -_distance) + Vector3.up * 1.5f;
|
||||
_camera.transform.LookAt(Vector3.up * 1.5f);
|
||||
_camera.aspect = (float)w / h;
|
||||
_player?.Render(_camera);
|
||||
RenderPipeline.SubmitRenderRequest(_camera, new UniversalRenderPipeline.SingleCameraRequest { destination = _target });
|
||||
GUI.DrawTexture(rect, _target, ScaleMode.StretchToFill, false);
|
||||
GUI.Label(new Rect(rect.x + 8, rect.y + 8, rect.width - 16, 25), $"{Variant} effect data", EditorStyles.whiteBoldLabel);
|
||||
}
|
||||
|
||||
private void DrawInspector()
|
||||
{
|
||||
EditorGUILayout.LabelField("Object / task parameters", EditorStyles.boldLabel);
|
||||
if (_id < 0)
|
||||
{
|
||||
EditorGUILayout.HelpBox("MXTransport: original two cones and rotating plane. This is separate from flexeff group 0.", MessageType.Info);
|
||||
return;
|
||||
}
|
||||
EffectGroup group = _resources.Definitions.Groups[_id];
|
||||
if (group.Objects.Length == 0)
|
||||
return;
|
||||
_objectIndex = EditorGUILayout.IntSlider("Object", _objectIndex, 0, group.Objects.Length - 1);
|
||||
EffectGroupObject source = group.Objects[_objectIndex];
|
||||
_resources.Definitions.TryGetType(source.TypeCrc, out EffectDefinition d);
|
||||
EditorGUILayout.LabelField($"{d.TypeName} / {EffectClass.Name(d.ClassNameCrc)}");
|
||||
EditorGUILayout.SelectableLabel(d.TextureName ?? "", GUILayout.Height(35));
|
||||
OriginalEffectObjectOverride edit = _edits.Find(_id, _objectIndex);
|
||||
if (edit == null && GUILayout.Button("Edit this object"))
|
||||
{
|
||||
Undo.RecordObject(_edits, "Edit original effect");
|
||||
edit = new OriginalEffectObjectOverride
|
||||
{
|
||||
GroupId = _id,
|
||||
ObjectIndex = _objectIndex,
|
||||
Definition = JsonUtility.FromJson<EffectDefinition>(JsonUtility.ToJson(d)),
|
||||
Tasks = source.Tasks.Select(t => JsonUtility.FromJson<EffectTask>(JsonUtility.ToJson(t))).ToArray()
|
||||
};
|
||||
_edits.Objects.Add(edit);
|
||||
MarkChanged();
|
||||
}
|
||||
_inspectorScroll = EditorGUILayout.BeginScrollView(_inspectorScroll);
|
||||
if (edit != null)
|
||||
{
|
||||
var so = new SerializedObject(_edits);
|
||||
so.Update();
|
||||
SerializedProperty entry = so.FindProperty("Objects").GetArrayElementAtIndex(_edits.Objects.IndexOf(edit));
|
||||
EditorGUILayout.PropertyField(entry.FindPropertyRelative("Hidden"));
|
||||
EditorGUILayout.PropertyField(entry.FindPropertyRelative("Definition"), true);
|
||||
EditorGUILayout.PropertyField(entry.FindPropertyRelative("Tasks"), true);
|
||||
if (so.ApplyModifiedProperties())
|
||||
{
|
||||
MarkChanged();
|
||||
float time = _time;
|
||||
Restart();
|
||||
Seek(time);
|
||||
}
|
||||
}
|
||||
else
|
||||
foreach (EffectTask t in source.Tasks)
|
||||
EditorGUILayout.LabelField($"{t.StartTime:0.###}s + {t.Duration:0.###}s loops={t.RequireLoops}");
|
||||
EffectDefinition effective = edit?.Definition ?? d;
|
||||
if (EffectClass.Name(effective.ClassNameCrc) == "S-Particle")
|
||||
{
|
||||
try
|
||||
{
|
||||
SparFile spar = _resources.Spar(effective.ParticleFileName);
|
||||
EditorGUILayout.LabelField($"SPar: {spar.Groups.Length} groups / shader {spar.Shader}");
|
||||
foreach (SparGroup sg in spar.Groups)
|
||||
{
|
||||
EditorGUILayout.LabelField($"{sg.Name}: capacity {sg.Capacity}, {sg.Keyframes.Length} keys", EditorStyles.wordWrappedLabel);
|
||||
EditorGUILayout.SelectableLabel(sg.Texture, GUILayout.Height(30));
|
||||
}
|
||||
EditorGUILayout.HelpBox("Native SPar playback: keyframes, emitter paths, particle controllers and original shader blending. SPar fields are read-only here.", MessageType.Info);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
EditorGUILayout.HelpBox(ex.Message, MessageType.Warning);
|
||||
}
|
||||
}
|
||||
if (EffectClass.Name(effective.ClassNameCrc) == "particle")
|
||||
DrawParticleCurves(effective.ParticleFileName);
|
||||
EditorGUILayout.EndScrollView();
|
||||
if (GUILayout.Button("Save overrides for game…"))
|
||||
SaveOverrides();
|
||||
if (GUILayout.Button("Discard edits for this object") && edit != null)
|
||||
{
|
||||
Undo.RecordObject(_edits, "Discard original effect override");
|
||||
_edits.Objects.Remove(edit);
|
||||
MarkChanged();
|
||||
Restart();
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawParticleCurves(string path)
|
||||
{
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.LabelField("Particle resource curves", EditorStyles.boldLabel);
|
||||
ParticleFile file;
|
||||
try
|
||||
{
|
||||
file = _resources.Particle(path);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
EditorGUILayout.HelpBox(ex.Message, MessageType.Warning);
|
||||
return;
|
||||
}
|
||||
_emitterCurve = EditorGUILayout.Toggle("Emitter curves", _emitterCurve);
|
||||
int count = _emitterCurve ? file.Emitters.Length : file.Particles.Length;
|
||||
if (count == 0)
|
||||
return;
|
||||
_particleIndex = EditorGUILayout.IntSlider("Resource index", _particleIndex, 0, count - 1);
|
||||
string[] names = _emitterCurve ? new[] { "Direction", "RandomVelocity", "Emission", "Life" } : new[] { "Size", "Rotation", "Alpha", "Color" };
|
||||
_curveIndex = EditorGUILayout.Popup("Curve", Mathf.Clamp(_curveIndex, 0, names.Length - 1), names);
|
||||
string name = names[_curveIndex];
|
||||
ParticleCurve source = OriginalEffectOverrides.FindCurve(file, _emitterCurve, _particleIndex, name);
|
||||
var entry = _edits.ParticleCurves.Find(c => string.Equals(c.File, path, StringComparison.OrdinalIgnoreCase)
|
||||
&& c.Emitter == _emitterCurve && c.Index == _particleIndex && c.Parameter == name);
|
||||
bool validEntry = entry == null || entry.Channels != null && entry.Channels.Length == source.Channels && entry.Channels.All(c => c != null);
|
||||
if (!validEntry)
|
||||
EditorGUILayout.HelpBox("This curve override has invalid channels. Restore the original curve to repair it.", MessageType.Warning);
|
||||
for (int channel = 0; channel < source.Channels; channel++)
|
||||
{
|
||||
if (!validEntry)
|
||||
break;
|
||||
AnimationCurve curve = entry != null ? CopyCurve(entry.Channels[channel]) : SampleCurve(source, channel);
|
||||
EditorGUI.BeginChangeCheck();
|
||||
AnimationCurve changed = EditorGUILayout.CurveField($"Channel {channel}", curve);
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
Undo.RecordObject(_edits, "Edit particle curve");
|
||||
if (entry == null)
|
||||
{
|
||||
entry = new OriginalParticleCurveOverride
|
||||
{
|
||||
File = path,
|
||||
Parameter = name,
|
||||
Index = _particleIndex,
|
||||
Emitter = _emitterCurve,
|
||||
Channels = Enumerable.Range(0, source.Channels).Select(c => SampleCurve(source, c)).ToArray()
|
||||
};
|
||||
_edits.ParticleCurves.Add(entry);
|
||||
}
|
||||
entry.Channels[channel] = CopyCurve(changed);
|
||||
MarkChanged();
|
||||
float time = _time;
|
||||
Restart();
|
||||
Seek(time);
|
||||
}
|
||||
}
|
||||
EditorGUILayout.LabelField(entry == null ? "Original sampled curve (unchanged)" : "Unity curve override for this particle resource", EditorStyles.wordWrappedMiniLabel);
|
||||
if (entry != null && GUILayout.Button("Restore original particle curve"))
|
||||
{
|
||||
Undo.RecordObject(_edits, "Restore particle curve");
|
||||
_edits.ParticleCurves.Remove(entry);
|
||||
MarkChanged();
|
||||
float time = _time;
|
||||
Restart();
|
||||
Seek(time);
|
||||
}
|
||||
}
|
||||
|
||||
private static AnimationCurve CopyCurve(AnimationCurve curve) =>
|
||||
new(curve.keys)
|
||||
{
|
||||
preWrapMode = curve.preWrapMode,
|
||||
postWrapMode = curve.postWrapMode
|
||||
};
|
||||
|
||||
private static AnimationCurve SampleCurve(ParticleCurve source, int channel)
|
||||
{
|
||||
var curve = new AnimationCurve(Enumerable.Range(0, 101).Select(i => new Keyframe(i / 100f, source.Evaluate(i / 100f, channel))).ToArray());
|
||||
for (int i = 0; i < curve.length; i++)
|
||||
{
|
||||
AnimationUtility.SetKeyLeftTangentMode(curve, i, AnimationUtility.TangentMode.Linear);
|
||||
AnimationUtility.SetKeyRightTangentMode(curve, i, AnimationUtility.TangentMode.Linear);
|
||||
}
|
||||
return curve;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 28e20becd27fe4cc3b3151897935cd30
|
||||
@@ -1,7 +1,7 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// ------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
namespace Editor
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// ------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
namespace Editor
|
||||
{
|
||||
@@ -137,7 +137,8 @@ namespace Editor
|
||||
string buildOutputPath = EditorUtility.SaveFolderPanel("Choose Location of Built Game", "", "");
|
||||
if (string.IsNullOrWhiteSpace(buildOutputPath)) return;
|
||||
|
||||
buildOutputPath += $"{DirSeparator}{PlayerSettings.bundleVersion}{DirSeparator}";
|
||||
string versionFolder = GetVersionFolderName();
|
||||
buildOutputPath += $"{DirSeparator}{versionFolder}{DirSeparator}";
|
||||
|
||||
var buildConfigurations = new[]
|
||||
{
|
||||
@@ -268,16 +269,28 @@ namespace Editor
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetVersionFolderName()
|
||||
{
|
||||
return PlayerSettings.bundleVersion;
|
||||
}
|
||||
|
||||
private static void ZipReleaseFiles()
|
||||
{
|
||||
string versionFolder = GetVersionFolderName();
|
||||
string buildOutputPath = EditorUtility.SaveFolderPanel("Choose Location of Built Game",
|
||||
$"{PlayerSettings.bundleVersion}", $"{PlayerSettings.bundleVersion}");
|
||||
versionFolder, versionFolder);
|
||||
if (string.IsNullOrWhiteSpace(buildOutputPath)) return;
|
||||
ZipReleaseFiles(buildOutputPath);
|
||||
}
|
||||
|
||||
if (!buildOutputPath.EndsWith($"{PlayerSettings.bundleVersion}"))
|
||||
private static void ZipReleaseFiles(string buildOutputPath)
|
||||
{
|
||||
string selectedFolder = Path.GetFileName(buildOutputPath.TrimEnd(
|
||||
Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar));
|
||||
if (selectedFolder != GetVersionFolderName())
|
||||
{
|
||||
Debug.LogError($"Invalid build output path: {buildOutputPath}. " +
|
||||
$"Please choose the current release build folder \"{PlayerSettings.bundleVersion}\"");
|
||||
$"Please choose the current release build folder \"{GetVersionFolderName()}\".");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -296,7 +309,7 @@ namespace Editor
|
||||
foreach ((string folderPath, Pal3BuildTarget target) in buildTargets)
|
||||
{
|
||||
string fullPath = $"{buildOutputPath}{DirSeparator}{folderPath}";
|
||||
string zipFileName = $"{GameConstants.AppName}_v{PlayerSettings.bundleVersion}_{target.ToString()}.zip";
|
||||
string zipFileName = $"{GameConstants.AppName}_v{GetVersionFolderName()}_{target.ToString()}.zip";
|
||||
string zipFilePath = $"{releaseDirPath}{DirSeparator}{zipFileName}";
|
||||
|
||||
if (File.Exists(fullPath) || Directory.Exists(fullPath))
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0b0b27c9e5e4d2e4fbc9b6584f828f7b
|
||||
guid: 7f8f503fe8584c3e887350c2988f8a22
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "Pal3.ResourceBrowser.Editor",
|
||||
"rootNamespace": "Pal3.ResourceBrowser",
|
||||
"references": ["Pal3.Core", "Pal3.Game", "Engine", "Unity.RenderPipelines.Core.Runtime", "Unity.RenderPipelines.Universal.Runtime"],
|
||||
"includePlatforms": ["Editor"],
|
||||
"autoReferenced": true
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7f7e3be4da704be9bacbd3af0989bb5b
|
||||
@@ -0,0 +1,565 @@
|
||||
// ------------------------------------------------------------------------
|
||||
// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
namespace Pal3.ResourceBrowser
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
public sealed partial class ResourceBrowserWindow : EditorWindow
|
||||
{
|
||||
#if PAL3A
|
||||
public const string Variant = "PAL3A";
|
||||
#else
|
||||
public const string Variant = "PAL3";
|
||||
#endif
|
||||
[SerializeField] private string _dataPath, _query = "";
|
||||
[SerializeField] private int _codepage = 936, _categoryIndex, _sourceIndex;
|
||||
private ResourceCatalog _catalog;
|
||||
|
||||
private float DetailWidth => position.width - Mathf.Clamp(position.width * 0.34f, 240, 460) - 12;
|
||||
|
||||
private bool SelectedCatalogMatches => _catalog != null && (_textDraft == null || _textDraft.CanReadFrom(_catalog.Root));
|
||||
|
||||
private Task<ResourceCatalog> _scan;
|
||||
private CancellationTokenSource _scanCancellation;
|
||||
private volatile string _scanStatus;
|
||||
private readonly List<ResourceEntry> _visible = new();
|
||||
private string[] _sources = { "All" };
|
||||
private ResourceEntry _selected;
|
||||
private byte[] _bytes;
|
||||
private ResourceTexturePreview _texture;
|
||||
private ResourceMediaPreview _media;
|
||||
private ResourceExportMode _exportMode;
|
||||
private string _selectedMetadata;
|
||||
private string _error, _status;
|
||||
private Vector2 _listScroll, _detailScroll;
|
||||
private int _hexPage;
|
||||
private string _hex;
|
||||
private Task<string> _export;
|
||||
private CancellationTokenSource _exportCancellation;
|
||||
private volatile string _exportStatus;
|
||||
|
||||
[MenuItem(Variant + "/Resource Browser", priority = 30)]
|
||||
public static void Open() => GetWindow<ResourceBrowserWindow>("Resources");
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
minSize = new Vector2(900, 580);
|
||||
wantsMouseMove = true;
|
||||
_dataPath = EditorPrefs.GetString(Variant + ".ResourceBrowser.Path",
|
||||
Path.GetFullPath(Path.Combine(Application.dataPath, "../../Game Data", Variant)));
|
||||
_codepage = EditorPrefs.GetInt(Variant + ".ResourceBrowser.Codepage", 936);
|
||||
saveChangesMessage = "Save the edited resource text as a new file before closing?";
|
||||
ResourceMediaPreview.CleanupStaleTemporaryFiles();
|
||||
Undo.undoRedoPerformed += UpdateTextDirty;
|
||||
EditorApplication.update += Tick;
|
||||
EditorApplication.playModeStateChanged += OnPlayModeChanged;
|
||||
if (Directory.Exists(_dataPath))
|
||||
StartScan(restoreDraft: true);
|
||||
RestoreTextDraft();
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
Undo.undoRedoPerformed -= UpdateTextDirty;
|
||||
EditorApplication.update -= Tick;
|
||||
EditorApplication.playModeStateChanged -= OnPlayModeChanged;
|
||||
CancelScan();
|
||||
_exportCancellation?.Cancel();
|
||||
_exportCancellation?.Dispose();
|
||||
_exportCancellation = null;
|
||||
if (_export != null)
|
||||
_ = _export.ContinueWith(task => { _ = task.Exception; }, TaskScheduler.Default);
|
||||
_export = null;
|
||||
ClearSelection();
|
||||
_catalog?.Dispose();
|
||||
_catalog = null;
|
||||
}
|
||||
|
||||
private void OnPlayModeChanged(PlayModeStateChange state)
|
||||
{
|
||||
if (state is PlayModeStateChange.ExitingEditMode or PlayModeStateChange.ExitingPlayMode)
|
||||
ClearSelection();
|
||||
if (state == PlayModeStateChange.EnteredEditMode)
|
||||
RestoreTextDraft();
|
||||
Repaint();
|
||||
}
|
||||
|
||||
private void CancelScan()
|
||||
{
|
||||
_scanCancellation?.Cancel();
|
||||
_scanCancellation?.Dispose();
|
||||
_scanCancellation = null;
|
||||
if (_scan != null)
|
||||
{
|
||||
_ = _scan.ContinueWith(task =>
|
||||
{
|
||||
if (task.Status == TaskStatus.RanToCompletion)
|
||||
task.Result.Dispose();
|
||||
_ = task.Exception;
|
||||
}, TaskScheduler.Default);
|
||||
_scan = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void StartScan(bool restoreDraft = false)
|
||||
{
|
||||
if (!restoreDraft)
|
||||
{
|
||||
if (!CanReplaceSelection())
|
||||
return;
|
||||
DestroyTextDraft();
|
||||
}
|
||||
CancelScan();
|
||||
ClearSelection();
|
||||
_catalog?.Dispose();
|
||||
_catalog = null;
|
||||
_visible.Clear();
|
||||
_error = null;
|
||||
_status = null;
|
||||
string path = _dataPath;
|
||||
int codepage = _codepage;
|
||||
_scanCancellation = new CancellationTokenSource();
|
||||
CancellationToken token = _scanCancellation.Token;
|
||||
_scan = Task.Run(() => ResourceCatalog.Load(path, codepage, Variant, token, message => _scanStatus = message), token);
|
||||
}
|
||||
|
||||
private void Tick()
|
||||
{
|
||||
TickModel();
|
||||
if (_media != null && _media.Tick())
|
||||
Repaint();
|
||||
if (_scan is { IsCompleted: true })
|
||||
{
|
||||
try
|
||||
{
|
||||
_catalog = _scan.GetAwaiter().GetResult();
|
||||
_sources = new[] { "All" }.Concat(_catalog.Entries.Select(e => e.Source).Distinct().OrderBy(s => s)).ToArray();
|
||||
_sourceIndex = 0;
|
||||
EditorPrefs.SetString(Variant + ".ResourceBrowser.Path", _catalog.Root);
|
||||
EditorPrefs.SetInt(Variant + ".ResourceBrowser.Codepage", _codepage);
|
||||
Filter();
|
||||
RestoreTextDraft();
|
||||
_status = $"{_catalog.Entries.Count:N0} resources indexed";
|
||||
if (_catalog.Diagnostics.Count > 0)
|
||||
_error = string.Join("\n", _catalog.Diagnostics);
|
||||
}
|
||||
catch (OperationCanceledException) { _status = "Indexing cancelled."; }
|
||||
catch (Exception ex) { _error = ex.Message; }
|
||||
_scan = null;
|
||||
_scanCancellation?.Dispose();
|
||||
_scanCancellation = null;
|
||||
Repaint();
|
||||
}
|
||||
if (_export is { IsCompleted: true })
|
||||
{
|
||||
try
|
||||
{
|
||||
_status = _export.GetAwaiter().GetResult();
|
||||
}
|
||||
catch (Exception ex) { _error = ex.Message; }
|
||||
_export = null;
|
||||
_exportCancellation?.Dispose();
|
||||
_exportCancellation = null;
|
||||
Repaint();
|
||||
}
|
||||
if (_scan != null || _export != null)
|
||||
Repaint();
|
||||
}
|
||||
|
||||
private void Filter()
|
||||
{
|
||||
_visible.Clear();
|
||||
_categoryIndex = Mathf.Clamp(_categoryIndex, 0, ResourceFormats.Categories.Length - 1);
|
||||
_sourceIndex = Mathf.Clamp(_sourceIndex, 0, _sources.Length - 1);
|
||||
string[] terms = ResourceCatalog.SplitQuery(_query);
|
||||
if (_catalog != null)
|
||||
_visible.AddRange(_catalog.Entries.Where(e => ResourceCatalog.Matches(e, terms,
|
||||
ResourceFormats.Categories[_categoryIndex], _sources[_sourceIndex])));
|
||||
_listScroll = Vector2.zero;
|
||||
}
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
int listControl = GUIUtility.GetControlID(FocusType.Keyboard);
|
||||
HandleListKeys(listControl);
|
||||
using (new EditorGUILayout.HorizontalScope(EditorStyles.toolbar))
|
||||
{
|
||||
GUILayout.Label(Variant, EditorStyles.boldLabel, GUILayout.Width(50));
|
||||
using (new EditorGUI.DisabledScope(_scan != null || _export != null))
|
||||
{
|
||||
_dataPath = EditorGUILayout.TextField(_dataPath, EditorStyles.toolbarTextField);
|
||||
if (GUILayout.Button("Folder…", EditorStyles.toolbarButton, GUILayout.Width(65)))
|
||||
{
|
||||
string path = EditorUtility.OpenFolderPanel("Select " + Variant + " game data", _dataPath, "");
|
||||
if (path.Length > 0)
|
||||
_dataPath = path;
|
||||
}
|
||||
_codepage = EditorGUILayout.Popup(_codepage == 950 ? 1 : 0, new[] { "简体 936", "繁體 950" }, GUILayout.Width(90)) == 0 ? 936 : 950;
|
||||
if (GUILayout.Button("Index / Reload", EditorStyles.toolbarButton, GUILayout.Width(100)))
|
||||
StartScan();
|
||||
}
|
||||
if (_scan != null && GUILayout.Button("Cancel", EditorStyles.toolbarButton, GUILayout.Width(60)))
|
||||
{
|
||||
CancelScan();
|
||||
_status = "Indexing cancelled.";
|
||||
}
|
||||
}
|
||||
using (new EditorGUILayout.HorizontalScope(EditorStyles.toolbar))
|
||||
{
|
||||
EditorGUI.BeginChangeCheck();
|
||||
GUI.SetNextControlName("ResourceSearch");
|
||||
_query = EditorGUILayout.TextField(_query, EditorStyles.toolbarSearchField);
|
||||
_categoryIndex = EditorGUILayout.Popup(_categoryIndex, ResourceFormats.Categories, GUILayout.Width(110));
|
||||
_sourceIndex = EditorGUILayout.Popup(_sourceIndex, _sources, GUILayout.Width(150));
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
Filter();
|
||||
_exportMode = (ResourceExportMode)EditorGUILayout.EnumPopup(_exportMode, EditorStyles.toolbarPopup, GUILayout.Width(75));
|
||||
using (new EditorGUI.DisabledScope(_visible.Count == 0 || _export != null || _scan != null))
|
||||
{
|
||||
if (GUILayout.Button("Export filtered…", EditorStyles.toolbarButton, GUILayout.Width(115)))
|
||||
ExportFiltered();
|
||||
}
|
||||
}
|
||||
GUILayout.Label($"{_visible.Count:N0} matches · Search: words, -exclude, ext:dds · {_status}", EditorStyles.miniLabel);
|
||||
if (_scan != null)
|
||||
EditorGUILayout.HelpBox("Indexing: " + _scanStatus, MessageType.Info);
|
||||
if (_export != null)
|
||||
{
|
||||
using (new EditorGUILayout.HorizontalScope())
|
||||
{
|
||||
GUILayout.Label(_exportStatus);
|
||||
if (GUILayout.Button("Cancel export", GUILayout.Width(110)))
|
||||
_exportCancellation?.Cancel();
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(_error))
|
||||
{
|
||||
using (new EditorGUILayout.HorizontalScope())
|
||||
{
|
||||
EditorGUILayout.HelpBox(_error, MessageType.Warning);
|
||||
if (GUILayout.Button("×", GUILayout.Width(22)))
|
||||
_error = null;
|
||||
}
|
||||
}
|
||||
using (new EditorGUILayout.HorizontalScope())
|
||||
{
|
||||
float width = Mathf.Clamp(position.width * 0.34f, 240, 460);
|
||||
Rect listRect = GUILayoutUtility.GetRect(width, width, 100, 100000, GUILayout.ExpandHeight(true));
|
||||
DrawList(listRect, listControl);
|
||||
using (new EditorGUILayout.VerticalScope(GUILayout.ExpandWidth(true)))
|
||||
DrawDetail();
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawList(Rect rect, int listControl)
|
||||
{
|
||||
const float rowHeight = 38;
|
||||
ResourceEntry clicked = null;
|
||||
_listScroll = GUI.BeginScrollView(rect, _listScroll, new Rect(0, 0, rect.width - 18, _visible.Count * rowHeight));
|
||||
int first = Mathf.Max(0, (int)(_listScroll.y / rowHeight));
|
||||
int last = Mathf.Min(_visible.Count, first + Mathf.CeilToInt(rect.height / rowHeight) + 1);
|
||||
for (int i = first; i < last; i++)
|
||||
{
|
||||
ResourceEntry entry = _visible[i];
|
||||
Rect row = new(0, i * rowHeight, rect.width - 18, rowHeight);
|
||||
if (entry == _selected)
|
||||
EditorGUI.DrawRect(row, new Color(0.2f, 0.4f, 0.6f, 0.5f));
|
||||
GUI.Label(new Rect(row.x + 6, row.y, row.width - 6, 19), entry.Name, EditorStyles.boldLabel);
|
||||
GUI.Label(new Rect(row.x + 6, row.y + 18, row.width - 6, 18), new GUIContent(entry.Path, entry.Path), EditorStyles.miniLabel);
|
||||
if (Event.current.type == EventType.MouseDown && row.Contains(Event.current.mousePosition))
|
||||
{
|
||||
clicked = entry;
|
||||
GUIUtility.keyboardControl = listControl;
|
||||
Event.current.Use();
|
||||
break;
|
||||
}
|
||||
}
|
||||
GUI.EndScrollView();
|
||||
if (clicked != null)
|
||||
{
|
||||
Select(clicked);
|
||||
GUIUtility.ExitGUI();
|
||||
}
|
||||
}
|
||||
|
||||
private void HandleListKeys(int listControl)
|
||||
{
|
||||
if (Event.current.type != EventType.KeyDown || Event.current.keyCode is not (KeyCode.UpArrow or KeyCode.DownArrow) ||
|
||||
GUIUtility.keyboardControl != listControl && GUI.GetNameOfFocusedControl() != "ResourceSearch" || _visible.Count == 0)
|
||||
return;
|
||||
const float rowHeight = 38;
|
||||
int index = Mathf.Clamp(_visible.IndexOf(_selected) + (Event.current.keyCode == KeyCode.DownArrow ? 1 : -1), 0, _visible.Count - 1);
|
||||
Select(_visible[index]);
|
||||
float bottom = _listScroll.y + Mathf.Max(100, position.height - 180);
|
||||
if (index * rowHeight < _listScroll.y)
|
||||
_listScroll.y = index * rowHeight;
|
||||
else if ((index + 1) * rowHeight > bottom)
|
||||
_listScroll.y += (index + 1) * rowHeight - bottom;
|
||||
Event.current.Use();
|
||||
GUIUtility.ExitGUI();
|
||||
}
|
||||
|
||||
private void ClearSelection()
|
||||
{
|
||||
_media?.Dispose();
|
||||
_media = null;
|
||||
_selectedMetadata = null;
|
||||
ClearModelView();
|
||||
ClearSceneView();
|
||||
ClearDataView();
|
||||
_texture?.Dispose();
|
||||
_texture = null;
|
||||
_selected = null;
|
||||
_bytes = null;
|
||||
_hex = null;
|
||||
_hexPage = 0;
|
||||
_detailScroll = Vector2.zero;
|
||||
}
|
||||
|
||||
private void Select(ResourceEntry entry)
|
||||
{
|
||||
if (entry == null || !CanReplaceSelection())
|
||||
return;
|
||||
DestroyTextDraft();
|
||||
ClearSelection();
|
||||
_selected = entry;
|
||||
_error = null;
|
||||
if (EditorApplication.isPlayingOrWillChangePlaymode)
|
||||
return;
|
||||
try
|
||||
{
|
||||
var sizes = _catalog.GetSizes(entry);
|
||||
_selectedMetadata = $"{entry.Source} · {sizes.length:N0} bytes" + (entry.IsArchived ? $" · packed {sizes.packedLength:N0} bytes" : "");
|
||||
if (entry.Category is "Audio" or "Video")
|
||||
{
|
||||
_media = new ResourceMediaPreview(_catalog, entry);
|
||||
return;
|
||||
}
|
||||
_bytes = _catalog.Read(entry, entry.Category == "Text" ? 4 * 1024 * 1024 : ResourceCatalog.PreviewByteLimit);
|
||||
if (entry.Category == "Textures")
|
||||
_texture = new ResourceTexturePreview(entry, _bytes);
|
||||
else if (entry.Category == "Models")
|
||||
LoadModelView(entry);
|
||||
else if (entry.Category == "Text")
|
||||
LoadText(entry);
|
||||
else
|
||||
_decoded = ResourceFormats.Read(entry, _bytes, _catalog.Codepage);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (_textDraft != null && _textDraft.Text == null)
|
||||
DestroyTextDraft();
|
||||
_error = entry.Path + "\n" + ex.Message;
|
||||
}
|
||||
Repaint();
|
||||
}
|
||||
|
||||
private void DrawDetail()
|
||||
{
|
||||
if (_selected == null)
|
||||
{
|
||||
EditorGUILayout.HelpBox("Choose a resource. Models, textures, scripts, scenes and data use dedicated views. No Play Mode is required.", MessageType.Info);
|
||||
return;
|
||||
}
|
||||
GUILayout.Label(_selected.Name, EditorStyles.boldLabel);
|
||||
if (_selectedMetadata != null)
|
||||
GUILayout.Label(_selectedMetadata, EditorStyles.miniLabel);
|
||||
EditorGUILayout.SelectableLabel(_selected.Path, GUILayout.Height(32));
|
||||
using (new EditorGUILayout.HorizontalScope(EditorStyles.toolbar))
|
||||
{
|
||||
if (GUILayout.Button("Copy path", EditorStyles.toolbarButton))
|
||||
EditorGUIUtility.systemCopyBuffer = _selected.Path;
|
||||
using (new EditorGUI.DisabledScope(!SelectedCatalogMatches))
|
||||
{
|
||||
if (GUILayout.Button("Export original…", EditorStyles.toolbarButton))
|
||||
ExportSelected();
|
||||
if (_decoded != null)
|
||||
{
|
||||
_inspectData = GUILayout.Toggle(_inspectData, "Fields", EditorStyles.toolbarButton);
|
||||
if (GUILayout.Button("Export JSON…", EditorStyles.toolbarButton))
|
||||
ExportJson();
|
||||
}
|
||||
}
|
||||
if (_texture != null && GUILayout.Button("Export PNG…", EditorStyles.toolbarButton))
|
||||
ExportPng();
|
||||
}
|
||||
if (EditorApplication.isPlayingOrWillChangePlaymode)
|
||||
{
|
||||
EditorGUILayout.HelpBox("Resource previews are available in Edit Mode.", MessageType.Info);
|
||||
return;
|
||||
}
|
||||
if (_inspectData && _decoded != null)
|
||||
{
|
||||
_objectView.Draw(_decoded, DetailWidth);
|
||||
return;
|
||||
}
|
||||
if (_selected.Category == "Effects")
|
||||
{
|
||||
if (GUILayout.Button("Open Effect Editor"))
|
||||
OpenEffectEditor();
|
||||
}
|
||||
if (_media != null)
|
||||
_media.Draw();
|
||||
else if (_texture != null)
|
||||
{
|
||||
GUILayout.Label($"{_texture.Texture.width} × {_texture.Texture.height} · {_texture.Texture.format}", EditorStyles.miniLabel);
|
||||
using (new EditorGUILayout.HorizontalScope(EditorStyles.toolbar))
|
||||
_texture.DrawSettings();
|
||||
_texture.Draw(GUILayoutUtility.GetRect(100, 10000, 100, 10000, GUILayout.ExpandHeight(true)));
|
||||
}
|
||||
else if (_selected.Category == "Models")
|
||||
DrawModelView();
|
||||
else if (_decoded is Core.DataReader.Scn.ScnFile scene)
|
||||
DrawSceneView(scene);
|
||||
else if (_decoded is Core.DataReader.Nav.NavFile nav)
|
||||
DrawNavigationView(nav);
|
||||
else if (_decoded is Core.DataReader.Lgt.LgtFile lights)
|
||||
DrawLightView(lights);
|
||||
else if (_decoded is Core.DataReader.Sce.SceFile script)
|
||||
DrawScriptView(script);
|
||||
else if (_decoded is Core.DataReader.Gdb.GdbFile database)
|
||||
DrawDatabaseView(database);
|
||||
else if (_selected.Category == "Text")
|
||||
DrawTextView();
|
||||
else if (_decoded != null)
|
||||
_objectView.Draw(_decoded, DetailWidth);
|
||||
else
|
||||
DrawHex();
|
||||
}
|
||||
|
||||
private void DrawHex()
|
||||
{
|
||||
if (_bytes == null)
|
||||
return;
|
||||
int pages = Mathf.Max(1, (_bytes.Length + 4095) / 4096);
|
||||
using (new EditorGUILayout.HorizontalScope())
|
||||
{
|
||||
GUILayout.Label($"{_bytes.Length:N0} bytes · Hex page", GUILayout.Width(170));
|
||||
int page = Mathf.Clamp(EditorGUILayout.IntField(_hexPage + 1, GUILayout.Width(60)) - 1, 0, pages - 1);
|
||||
if (page != _hexPage)
|
||||
{
|
||||
_hexPage = page;
|
||||
_hex = null;
|
||||
_detailScroll = Vector2.zero;
|
||||
}
|
||||
GUILayout.Label($"/ {pages}");
|
||||
}
|
||||
if (_hex == null)
|
||||
{
|
||||
var text = new StringBuilder();
|
||||
for (int offset = _hexPage * 4096; offset < Mathf.Min(_bytes.Length, (_hexPage + 1) * 4096); offset += 16)
|
||||
{
|
||||
text.Append(offset.ToString("X8")).Append(" ");
|
||||
for (int i = offset; i < Mathf.Min(offset + 16, _bytes.Length); i++)
|
||||
text.Append(_bytes[i].ToString("X2")).Append(' ');
|
||||
text.AppendLine();
|
||||
}
|
||||
_hex = text.ToString();
|
||||
}
|
||||
_detailScroll = EditorGUILayout.BeginScrollView(_detailScroll);
|
||||
EditorGUILayout.TextArea(_hex, GUILayout.ExpandWidth(true));
|
||||
EditorGUILayout.EndScrollView();
|
||||
}
|
||||
|
||||
private void ExportSelected()
|
||||
{
|
||||
if (!SelectedCatalogMatches)
|
||||
return;
|
||||
string path = EditorUtility.SaveFilePanel("Export original (existing files are kept)", "", _selected.Name, _selected.Extension.TrimStart('.'));
|
||||
if (path.Length == 0)
|
||||
return;
|
||||
try
|
||||
{
|
||||
var sizes = _catalog.GetSizes(_selected);
|
||||
if (_selected.IsArchived && sizes.length + sizes.packedLength > ResourceCatalog.PreviewByteLimit &&
|
||||
!EditorUtility.DisplayDialog("Large archive resource", $"Extraction needs about {(sizes.length + sizes.packedLength) / 1024 / 1024:N0} MiB of byte buffers. Continue?", "Export", "Cancel"))
|
||||
return;
|
||||
_catalog.ExportOriginal(_selected, path);
|
||||
_status = "Exported " + path;
|
||||
}
|
||||
catch (Exception ex) { _error = ex.Message; }
|
||||
}
|
||||
|
||||
private void ExportPng()
|
||||
{
|
||||
string path = EditorUtility.SaveFilePanel("Export PNG (existing files are kept)", "", Path.GetFileNameWithoutExtension(_selected.Name), "png");
|
||||
if (path.Length == 0)
|
||||
return;
|
||||
try
|
||||
{
|
||||
_catalog.CheckExportDestination(path);
|
||||
path = ResourceCatalog.ExportPath(Path.GetDirectoryName(path), Path.GetFileName(path));
|
||||
_texture.SavePng(path);
|
||||
_status = "Exported " + path;
|
||||
}
|
||||
catch (Exception ex) { _error = ex.Message; }
|
||||
}
|
||||
|
||||
private void ExportFiltered()
|
||||
{
|
||||
string folder = EditorUtility.OpenFolderPanel("Export filtered resources (existing files are skipped)", "", "");
|
||||
if (folder.Length == 0)
|
||||
return;
|
||||
try
|
||||
{
|
||||
_catalog.CheckExportDestination(folder);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_error = ex.Message;
|
||||
return;
|
||||
}
|
||||
ResourceExportMode mode = _exportMode;
|
||||
ResourceEntry[] entries = _visible.Where(entry => ResourceExport.Supports(entry, mode)).ToArray();
|
||||
ResourceCatalog catalog = _catalog;
|
||||
_exportCancellation = new CancellationTokenSource();
|
||||
CancellationToken token = _exportCancellation.Token;
|
||||
_export = Task.Run(() =>
|
||||
{
|
||||
int saved = 0, skipped = 0, failed = 0;
|
||||
var failures = new List<string>();
|
||||
foreach (ResourceEntry entry in entries)
|
||||
{
|
||||
if (token.IsCancellationRequested)
|
||||
break;
|
||||
_exportStatus = $"{saved + skipped + failed + 1:N0}/{entries.Length:N0} · {entry.Path}";
|
||||
try
|
||||
{
|
||||
string destination = ResourceCatalog.ExportPath(folder, entry.Path + ResourceExport.Suffix(mode));
|
||||
if (File.Exists(destination))
|
||||
{
|
||||
skipped++;
|
||||
continue;
|
||||
}
|
||||
var sizes = catalog.GetSizes(entry);
|
||||
if ((entry.IsArchived || mode != ResourceExportMode.Original) && sizes.length + sizes.packedLength > ResourceCatalog.PreviewByteLimit)
|
||||
{
|
||||
skipped++;
|
||||
continue;
|
||||
}
|
||||
ResourceExport.Write(catalog, entry, mode, destination);
|
||||
saved++;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
failed++;
|
||||
if (failures.Count < 10)
|
||||
failures.Add(entry.Path + ": " + ex.Message);
|
||||
}
|
||||
}
|
||||
return $"{(token.IsCancellationRequested ? "Cancelled. " : "")}Exported {saved:N0}, skipped {skipped:N0}, failed {failed:N0}. Existing files and entries requiring more than 64 MiB to decode are skipped; export large originals individually. " + string.Join(" · ", failures);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2315df6f0d2b4c42bba962b8c7cfd757
|
||||
@@ -0,0 +1,275 @@
|
||||
// ------------------------------------------------------------------------
|
||||
// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
namespace Pal3.ResourceBrowser
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using Core.DataReader.Cpk;
|
||||
using Core.FileSystem;
|
||||
using Game.Effect.Original;
|
||||
|
||||
public sealed class ResourceEntry
|
||||
{
|
||||
public string Path
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public string PhysicalPath
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public string Extension
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public string Source
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public string Category
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public bool IsArchived => PhysicalPath == null;
|
||||
|
||||
public ResourceEntry(string path, string physicalPath = null)
|
||||
{
|
||||
Path = path.Replace('/', '\\');
|
||||
PhysicalPath = physicalPath;
|
||||
Name = Path[(Path.LastIndexOf('\\') + 1)..];
|
||||
Extension = System.IO.Path.GetExtension(Name).ToLowerInvariant();
|
||||
Source = physicalPath == null ? Path.Split('\\')[0] : "Loose files";
|
||||
Category = ResourceFormats.Category(Extension);
|
||||
}
|
||||
}
|
||||
|
||||
// No runtime service registrations, Unity objects, or archive preloads. Safe to index off-thread.
|
||||
public sealed class ResourceCatalog : IDisposable
|
||||
{
|
||||
public string Root
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public int Codepage
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public CpkFileSystem FileSystem
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public List<ResourceEntry> Entries { get; } = new();
|
||||
public List<string> Diagnostics { get; } = new();
|
||||
|
||||
private readonly Dictionary<string, ResourceEntry> _lookup = new(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
private ResourceCatalog(string root, int codepage)
|
||||
{
|
||||
Root = System.IO.Path.GetFullPath(root);
|
||||
CheckNoLinks(Root, "The source data folder contains a symbolic link. Select its real target folder to preserve original-data export protection");
|
||||
Codepage = codepage;
|
||||
var hash = new Crc32Hash();
|
||||
hash.Init();
|
||||
FileSystem = new CpkFileSystem(Root, hash, codepage);
|
||||
}
|
||||
|
||||
public static ResourceCatalog Load(string root, int codepage, string variant,
|
||||
CancellationToken cancellation = default, Action<string> progress = null)
|
||||
{
|
||||
var catalog = new ResourceCatalog(root, codepage);
|
||||
try
|
||||
{
|
||||
var archives = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||
foreach (string file in Directory.EnumerateFiles(catalog.Root, "*", new EnumerationOptions { RecurseSubdirectories = true, AttributesToSkip = FileAttributes.ReparsePoint, IgnoreInaccessible = false }))
|
||||
{
|
||||
cancellation.ThrowIfCancellationRequested();
|
||||
string relative = System.IO.Path.GetRelativePath(catalog.Root, file);
|
||||
if (string.Equals(System.IO.Path.GetExtension(file), ".cpk", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
progress?.Invoke(relative);
|
||||
if (!archives.Add(System.IO.Path.GetFileName(file)))
|
||||
throw new InvalidDataException($"Duplicate archive name: {relative}. Select a single game's data directory.");
|
||||
try
|
||||
{
|
||||
catalog.FileSystem.Mount(relative, codepage);
|
||||
}
|
||||
catch (Exception ex) { catalog.Diagnostics.Add($"{relative}: {ex.Message}"); }
|
||||
}
|
||||
else
|
||||
catalog.Entries.Add(new ResourceEntry(relative, file));
|
||||
}
|
||||
using (var effects = new OriginalEffectResources(catalog.FileSystem, codepage))
|
||||
{
|
||||
if (effects.GameVariant != variant)
|
||||
throw new InvalidDataException($"This folder contains {effects.GameVariant}. Use {variant} data, or Switch Variant in the Unity menu.");
|
||||
}
|
||||
progress?.Invoke("Reading archive directory indexes…");
|
||||
foreach (string path in catalog.FileSystem.Search())
|
||||
{
|
||||
cancellation.ThrowIfCancellationRequested();
|
||||
catalog.Entries.Add(new ResourceEntry(path));
|
||||
}
|
||||
catalog.Entries.Sort((a, b) => StringComparer.OrdinalIgnoreCase.Compare(a.Path, b.Path));
|
||||
foreach (ResourceEntry entry in catalog.Entries)
|
||||
catalog._lookup.TryAdd(entry.Path, entry);
|
||||
return catalog;
|
||||
}
|
||||
catch
|
||||
{
|
||||
catalog.Dispose();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public ResourceEntry Find(string path)
|
||||
{
|
||||
path = path.Replace('/', '\\');
|
||||
if (_lookup.TryGetValue(path, out ResourceEntry entry))
|
||||
return entry;
|
||||
// PAL3A logical archive names (q02.cpk) resolve through q02_01/02/03.cpk.
|
||||
int separator = path.IndexOf('\\');
|
||||
return separator > 0 && path[..separator].EndsWith(".cpk", StringComparison.OrdinalIgnoreCase) && FileSystem.FileExists(path)
|
||||
? new ResourceEntry(path) : null;
|
||||
}
|
||||
|
||||
public const long PreviewByteLimit = 64 * 1024 * 1024;
|
||||
|
||||
public (long length, long packedLength) GetSizes(ResourceEntry entry)
|
||||
{
|
||||
if (entry.IsArchived)
|
||||
return FileSystem.GetFileSizes(entry.Path);
|
||||
long length = new FileInfo(entry.PhysicalPath).Length;
|
||||
return (length, 0);
|
||||
}
|
||||
|
||||
public byte[] Read(ResourceEntry entry, long byteLimit = PreviewByteLimit)
|
||||
{
|
||||
var sizes = GetSizes(entry);
|
||||
if (sizes.length > byteLimit || sizes.packedLength > byteLimit)
|
||||
throw new InvalidDataException($"This resource exceeds the {byteLimit / 1024 / 1024} MiB preview limit. Export the original file instead.");
|
||||
return entry.IsArchived ? FileSystem.ReadAllBytes(entry.Path) : File.ReadAllBytes(entry.PhysicalPath);
|
||||
}
|
||||
|
||||
public void CheckExportDestination(string destination) => CheckOutsideRoot(Root, destination);
|
||||
|
||||
public static void CheckOutsideRoot(string root, string destination)
|
||||
{
|
||||
string path = System.IO.Path.GetFullPath(destination);
|
||||
string source = System.IO.Path.GetFullPath(root).TrimEnd(System.IO.Path.DirectorySeparatorChar);
|
||||
if (path.Equals(source, StringComparison.OrdinalIgnoreCase) ||
|
||||
path.StartsWith(source + System.IO.Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase))
|
||||
throw new IOException("Choose an output outside the original game data directory.");
|
||||
}
|
||||
|
||||
public void ExportOriginal(ResourceEntry entry, string destination)
|
||||
{
|
||||
CheckExportDestination(destination);
|
||||
// Check symlink ancestors even for a user-selected single-file destination.
|
||||
destination = ExportPath(System.IO.Path.GetDirectoryName(destination), System.IO.Path.GetFileName(destination));
|
||||
WriteNewFile(destination, stream =>
|
||||
{
|
||||
if (entry.IsArchived)
|
||||
{
|
||||
byte[] bytes = Read(entry, int.MaxValue);
|
||||
stream.Write(bytes, 0, bytes.Length);
|
||||
}
|
||||
else
|
||||
{
|
||||
using var input = File.OpenRead(entry.PhysicalPath);
|
||||
input.CopyTo(stream);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void WriteNewFile(string destination, Action<Stream> write)
|
||||
{
|
||||
CheckNoLinks(destination);
|
||||
if (File.Exists(destination))
|
||||
throw new IOException("Destination already exists: " + destination);
|
||||
Directory.CreateDirectory(System.IO.Path.GetDirectoryName(destination));
|
||||
string temporary = destination + "." + Guid.NewGuid().ToString("N") + ".partial";
|
||||
try
|
||||
{
|
||||
using (var stream = new FileStream(temporary, FileMode.CreateNew, FileAccess.Write))
|
||||
write(stream);
|
||||
File.Move(temporary, destination);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (File.Exists(temporary))
|
||||
File.Delete(temporary);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool Matches(ResourceEntry entry, string query, string category = "All", string source = "All")
|
||||
{
|
||||
if (category != "All" && entry.Category != category || source != "All" && entry.Source != source)
|
||||
return false;
|
||||
return Matches(entry, SplitQuery(query), category, source);
|
||||
}
|
||||
|
||||
public static string[] SplitQuery(string query) => (query ?? "").Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
public static bool Matches(ResourceEntry entry, string[] terms, string category, string source)
|
||||
{
|
||||
if (category != "All" && entry.Category != category || source != "All" && entry.Source != source)
|
||||
return false;
|
||||
foreach (string word in terms)
|
||||
{
|
||||
bool exclude = word.StartsWith("-", StringComparison.Ordinal);
|
||||
string term = exclude ? word[1..] : word;
|
||||
bool match = term.StartsWith("ext:", StringComparison.OrdinalIgnoreCase)
|
||||
? entry.Extension.Equals("." + term[4..].TrimStart('.'), StringComparison.OrdinalIgnoreCase)
|
||||
: entry.Path.IndexOf(term.Replace('/', '\\'), StringComparison.OrdinalIgnoreCase) >= 0;
|
||||
if (match == exclude)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static string ExportPath(string root, string virtualPath)
|
||||
{
|
||||
string[] parts = virtualPath.Replace('\\', '/').Split('/');
|
||||
if (parts.Any(p => string.IsNullOrWhiteSpace(p) || p is "." or ".." || p.IndexOfAny(System.IO.Path.GetInvalidFileNameChars()) >= 0 || p.Contains(':')))
|
||||
throw new InvalidDataException($"Unsafe resource path: {virtualPath}");
|
||||
string destination = System.IO.Path.GetFullPath(System.IO.Path.Combine(root, System.IO.Path.Combine(parts)));
|
||||
string prefix = System.IO.Path.GetFullPath(root).TrimEnd(System.IO.Path.DirectorySeparatorChar) + System.IO.Path.DirectorySeparatorChar;
|
||||
if (!destination.StartsWith(prefix, StringComparison.Ordinal))
|
||||
throw new InvalidDataException("Export path escapes its destination.");
|
||||
CheckNoLinks(destination);
|
||||
return destination;
|
||||
}
|
||||
|
||||
public static void CheckNoLinks(string fullPath, string message = "Use a path without symbolic links")
|
||||
{
|
||||
for (string path = System.IO.Path.GetFullPath(fullPath); path != null; path = System.IO.Path.GetDirectoryName(path))
|
||||
{
|
||||
if ((File.Exists(path) || Directory.Exists(path)) && (File.GetAttributes(path) & FileAttributes.ReparsePoint) != 0)
|
||||
throw new IOException($"{message}: {path}");
|
||||
if (path == System.IO.Path.GetPathRoot(path))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose() => FileSystem.DisposeAllInMemoryArchives();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3015cba398a642f8b59df6ba01e3957e
|
||||
@@ -0,0 +1,182 @@
|
||||
// ------------------------------------------------------------------------
|
||||
// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
namespace Pal3.ResourceBrowser
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Core.DataReader.Gdb;
|
||||
using Core.DataReader.Sce;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
public sealed partial class ResourceBrowserWindow
|
||||
{
|
||||
private bool _inspectData, _dialogueOnly, _showVariables;
|
||||
private int _databaseTable, _scriptPage;
|
||||
private uint? _pendingScriptBlock;
|
||||
private uint _listedBlock = uint.MaxValue;
|
||||
private List<ResourceScriptLine> _scriptLines;
|
||||
private string _scriptFind = "";
|
||||
|
||||
private void ClearDataView()
|
||||
{
|
||||
_inspectData = false;
|
||||
_databaseTable = 0;
|
||||
_scriptPage = 0;
|
||||
_scriptLines = null;
|
||||
_listedBlock = uint.MaxValue;
|
||||
_pendingScriptBlock = null;
|
||||
_scriptFind = "";
|
||||
_showVariables = false;
|
||||
}
|
||||
|
||||
private void DrawScriptView(SceFile file)
|
||||
{
|
||||
SceScriptBlock[] blocks = file.ScriptBlocks.Values.OrderBy(b => b.Id).ToArray();
|
||||
if (_pendingScriptBlock is { } requested)
|
||||
{
|
||||
int index = Array.FindIndex(blocks, b => b.Id == requested);
|
||||
if (index >= 0)
|
||||
{
|
||||
_recordIndex = index;
|
||||
_recordQuery = "";
|
||||
}
|
||||
else
|
||||
_error = $"Script block {requested} is not present in {_selected.Path}.";
|
||||
_pendingScriptBlock = null;
|
||||
}
|
||||
int picked = PickRecord(blocks.Select(b => $"Block {b.Id} · {b.Description}").ToArray());
|
||||
if (picked < 0)
|
||||
return;
|
||||
SceScriptBlock block = blocks[picked];
|
||||
using (new EditorGUILayout.HorizontalScope(EditorStyles.toolbar))
|
||||
{
|
||||
_dialogueOnly = GUILayout.Toggle(_dialogueOnly, "Dialogue only", EditorStyles.toolbarButton);
|
||||
_showVariables = GUILayout.Toggle(_showVariables, $"Locals ({block.UserVariables.Length})", EditorStyles.toolbarButton);
|
||||
if (GUILayout.Button("Export script…", EditorStyles.toolbarButton))
|
||||
ExportScript(file);
|
||||
}
|
||||
GUILayout.Label("Block-relative byte offsets · mask bits denote variable parameters · inspection listing", EditorStyles.wordWrappedMiniLabel);
|
||||
if (_showVariables)
|
||||
{
|
||||
_objectView.Draw(block.UserVariables, DetailWidth);
|
||||
return;
|
||||
}
|
||||
if (_scriptLines == null || _listedBlock != block.Id)
|
||||
{
|
||||
_scriptLines = ResourceScriptListing.Decode(block, file.Codepage);
|
||||
_listedBlock = block.Id;
|
||||
_scriptPage = 0;
|
||||
}
|
||||
_scriptFind = EditorGUILayout.TextField("Find in block", _scriptFind);
|
||||
string[] lines = _scriptLines.Where(line => !_dialogueOnly || line.Dialogue != null || line.IsError)
|
||||
.Select(line => _dialogueOnly && !line.IsError ? $"{line.Offset:X6} {line.Dialogue}" : line.Text)
|
||||
.Where(line => line.IndexOf(_scriptFind, StringComparison.OrdinalIgnoreCase) >= 0).ToArray();
|
||||
int pages = Mathf.Max(1, (lines.Length + 99) / 100);
|
||||
_scriptPage = Mathf.Clamp(EditorGUILayout.IntField($"Page / {pages} · {lines.Length} lines", _scriptPage + 1) - 1, 0, pages - 1);
|
||||
string text = string.Join("\n", lines.Skip(_scriptPage * 100).Take(100));
|
||||
if (text.Length > 60000)
|
||||
text = text[..60000] + "\n[Display limit reached. Export the script for complete text.]";
|
||||
_detailScroll = EditorGUILayout.BeginScrollView(_detailScroll);
|
||||
var style = new GUIStyle(EditorStyles.textArea) { wordWrap = true };
|
||||
float height = Mathf.Max(100, style.CalcHeight(new GUIContent(text), Mathf.Max(100, DetailWidth - 30)));
|
||||
EditorGUILayout.SelectableLabel(text, style, GUILayout.Height(height), GUILayout.ExpandWidth(true));
|
||||
EditorGUILayout.EndScrollView();
|
||||
}
|
||||
|
||||
private void ExportScript(SceFile file)
|
||||
{
|
||||
string path = EditorUtility.SaveFilePanel("Export inspection listing", "", _selected.Name + (_dialogueOnly ? ".dialogue" : ""), "txt");
|
||||
if (path.Length == 0)
|
||||
return;
|
||||
try
|
||||
{
|
||||
_catalog.CheckExportDestination(path);
|
||||
ResourceCatalog.WriteNewFile(path, stream =>
|
||||
{
|
||||
using var writer = new StreamWriter(stream, new UTF8Encoding(false), 4096, leaveOpen: true);
|
||||
ResourceScriptListing.Export(file, writer, _dialogueOnly);
|
||||
});
|
||||
_status = "Exported " + path;
|
||||
}
|
||||
catch (Exception ex) { _error = ex.Message; }
|
||||
}
|
||||
|
||||
private void DrawDatabaseView(GdbFile database)
|
||||
{
|
||||
int table = GUILayout.Toolbar(_databaseTable, new[] { "Items", "Actors", "Skills", "Combos" });
|
||||
if (table != _databaseTable)
|
||||
{
|
||||
_databaseTable = table;
|
||||
_recordIndex = 0;
|
||||
_recordQuery = "";
|
||||
_objectView.Reset();
|
||||
}
|
||||
(string label, object record)[] records = table switch
|
||||
{
|
||||
0 => database.GameItemInfos.OrderBy(p => p.Key).Select(p => ($"{p.Key} · {p.Value.Name} · {p.Value.Type}", (object)p.Value)).ToArray(),
|
||||
1 => database.CombatActorInfos.OrderBy(p => p.Key).Select(p => ($"{p.Key} · {p.Value.Name} · {p.Value.ModelId}", (object)p.Value)).ToArray(),
|
||||
2 => database.SkillInfos.OrderBy(p => p.Key).Select(p => ($"{p.Key} · {p.Value.Name}", (object)p.Value)).ToArray(),
|
||||
_ => database.ComboSkillInfos.OrderBy(p => p.Key).Select(p => ($"{p.Key} · {p.Value.Name}", (object)p.Value)).ToArray(),
|
||||
};
|
||||
int index = PickRecord(records.Select(r => r.label).ToArray());
|
||||
if (index >= 0)
|
||||
_objectView.Draw(records[index].record, DetailWidth);
|
||||
}
|
||||
|
||||
private void ExportJson()
|
||||
{
|
||||
string path = EditorUtility.SaveFilePanel("Export decoded resource JSON", "", _selected.Name, "json");
|
||||
if (path.Length == 0)
|
||||
return;
|
||||
try
|
||||
{
|
||||
_catalog.CheckExportDestination(path);
|
||||
WriteJson(_decoded, path);
|
||||
_status = "Exported " + path;
|
||||
}
|
||||
catch (Exception ex) { _error = ex.Message; }
|
||||
}
|
||||
|
||||
public static void WriteJson(object value, string path)
|
||||
{
|
||||
ResourceCatalog.WriteNewFile(path, stream =>
|
||||
{
|
||||
using var writer = new StreamWriter(stream, new UTF8Encoding(false), 4096, leaveOpen: true);
|
||||
var serializer = new JsonSerializer { Formatting = Formatting.Indented, ReferenceLoopHandling = ReferenceLoopHandling.Ignore };
|
||||
serializer.Converters.Add(new StringEnumConverter());
|
||||
serializer.Serialize(writer, value);
|
||||
});
|
||||
}
|
||||
|
||||
private void OpenSceneScript(string city, uint block)
|
||||
{
|
||||
ResourceEntry script = _catalog.Find(Core.Contract.Constants.FileConstants.GetSceneSceFileVirtualPath(city));
|
||||
using (new EditorGUI.DisabledScope(script == null))
|
||||
{
|
||||
if (GUILayout.Button("Open script block " + block))
|
||||
{
|
||||
Select(script);
|
||||
if (_selected == script)
|
||||
_pendingScriptBlock = block;
|
||||
GUIUtility.ExitGUI();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OpenEffectEditor()
|
||||
{
|
||||
EditorPrefs.SetString(Variant + ".OriginalEffect.DataPath", _catalog.Root);
|
||||
EditorPrefs.SetInt(Variant + ".OriginalEffect.Codepage", _catalog.Codepage);
|
||||
EditorApplication.ExecuteMenuItem(Variant + "/Effect Editor");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 14551be0f098418692a6ae69db532a53
|
||||
@@ -0,0 +1,56 @@
|
||||
// ------------------------------------------------------------------------
|
||||
// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
namespace Pal3.ResourceBrowser
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using Core.DataReader.Sce;
|
||||
|
||||
public enum ResourceExportMode
|
||||
{
|
||||
Original, Script, Dialogue, Json
|
||||
}
|
||||
|
||||
public static class ResourceExport
|
||||
{
|
||||
public static bool Supports(ResourceEntry entry, ResourceExportMode mode) => mode switch
|
||||
{
|
||||
ResourceExportMode.Original => true,
|
||||
ResourceExportMode.Script or ResourceExportMode.Dialogue => entry.Extension == ".sce",
|
||||
_ => entry.Category is "Models" or "Scenes" or "Navigation" or "Lights" or "Scripts" or "Database" or "Effects",
|
||||
};
|
||||
|
||||
public static string Suffix(ResourceExportMode mode) => mode switch
|
||||
{
|
||||
ResourceExportMode.Script => ".txt",
|
||||
ResourceExportMode.Dialogue => ".dialogue.txt",
|
||||
ResourceExportMode.Json => ".json",
|
||||
_ => "",
|
||||
};
|
||||
|
||||
public static void Write(ResourceCatalog catalog, ResourceEntry entry, ResourceExportMode mode, string destination)
|
||||
{
|
||||
catalog.CheckExportDestination(destination);
|
||||
if (mode == ResourceExportMode.Original)
|
||||
{
|
||||
catalog.ExportOriginal(entry, destination);
|
||||
return;
|
||||
}
|
||||
object data = ResourceFormats.Read(entry, catalog.Read(entry), catalog.Codepage);
|
||||
if (data == null)
|
||||
throw new InvalidDataException("No decoder is available for this resource.");
|
||||
if (mode == ResourceExportMode.Json)
|
||||
ResourceBrowserWindow.WriteJson(data, destination);
|
||||
else
|
||||
ResourceCatalog.WriteNewFile(destination, stream =>
|
||||
{
|
||||
using var writer = new StreamWriter(stream, new UTF8Encoding(false), 4096, leaveOpen: true);
|
||||
ResourceScriptListing.Export((SceFile)data, writer, mode == ResourceExportMode.Dialogue);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e49eeacb8c8b4a6a94e1160cb9331f16
|
||||
@@ -0,0 +1,68 @@
|
||||
// ------------------------------------------------------------------------
|
||||
// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
namespace Pal3.ResourceBrowser
|
||||
{
|
||||
using System;
|
||||
using Core.DataReader;
|
||||
using Core.DataReader.Cvd;
|
||||
using Core.DataReader.Mov;
|
||||
using Core.DataReader.Scn;
|
||||
using Core.DataReader.Nav;
|
||||
using Core.DataReader.Lgt;
|
||||
using Core.DataReader.Msh;
|
||||
using Core.DataReader.Mtl;
|
||||
using Core.DataReader.Mv3;
|
||||
using Core.DataReader.Pol;
|
||||
using Core.DataReader.Sce;
|
||||
using Core.DataReader.Gdb;
|
||||
using Core.DataReader.Data;
|
||||
using Core.DataReader.Dat;
|
||||
using Core.DataReader.Par;
|
||||
|
||||
public static class ResourceFormats
|
||||
{
|
||||
public static object Read(ResourceEntry entry, byte[] bytes, int codepage) => entry.Extension switch
|
||||
{
|
||||
".sce" => Read(new SceFileReader(), bytes, codepage),
|
||||
".gdb" => Read(new GdbFileReader(), bytes, codepage),
|
||||
".data" when entry.Name.Equals("flexeff.data", StringComparison.OrdinalIgnoreCase) => Read(new EffectDefinitionFileReader(), bytes, codepage),
|
||||
".dat" when entry.Name.Equals("efflinker.dat", StringComparison.OrdinalIgnoreCase) => Read(new EffectLinkerFileReader(), bytes, codepage),
|
||||
".par" when bytes.Length >= 6 && System.Text.Encoding.ASCII.GetString(bytes, 0, 6) == "sgpar\0" => Read(new ParticleFileReader(), bytes, codepage),
|
||||
".par" or ".spar" when bytes.Length >= 48 && System.Text.Encoding.ASCII.GetString(bytes, 8, 40) == "__PARTICLE_EFFECT(Softstar_Ltd)_EXPORT__" => Read(new SparFileReader(), bytes, codepage),
|
||||
".csf" => Read(new ParticleShapeFileReader(), bytes, codepage),
|
||||
".scn" => Read(new ScnFileReader(), bytes, codepage),
|
||||
".nav" => Read(new NavFileReader(), bytes, codepage),
|
||||
".lgt" => Read(new LgtFileReader(), bytes, codepage),
|
||||
".pol" => Read(new PolFileReader(), bytes, codepage),
|
||||
".cvd" => Read(new CvdFileReader(), bytes, codepage),
|
||||
".mv3" => Read(new Mv3FileReader(), bytes, codepage),
|
||||
".msh" => Read(new MshFileReader(), bytes, codepage),
|
||||
".mov" => Read(new MovFileReader(), bytes, codepage),
|
||||
".mtl" => Read(new MtlFileReader(), bytes, codepage),
|
||||
_ => null,
|
||||
};
|
||||
|
||||
public static T Read<T>(IFileReader<T> reader, byte[] bytes, int codepage) => reader.Read(bytes, codepage);
|
||||
|
||||
public static readonly string[] Categories = { "All", "Models", "Textures", "Scenes", "Navigation", "Scripts", "Database", "Effects", "Lights", "Text", "Audio", "Video", "Other" };
|
||||
|
||||
public static string Category(string extension) => extension.ToLowerInvariant() switch
|
||||
{
|
||||
".pol" or ".cvd" or ".mv3" or ".msh" or ".mov" or ".mtl" => "Models",
|
||||
".dds" or ".tga" or ".bmp" or ".bm" or ".png" or ".jpg" or ".jpeg" => "Textures",
|
||||
".scn" => "Scenes",
|
||||
".nav" => "Navigation",
|
||||
".sce" => "Scripts",
|
||||
".gdb" => "Database",
|
||||
".par" or ".spar" or ".csf" or ".data" or ".dat" => "Effects",
|
||||
".lgt" => "Lights",
|
||||
".ini" or ".txt" or ".gbf" or ".cfg" or ".csv" or ".xml" or ".json" or ".log" => "Text",
|
||||
".wav" or ".mp3" or ".ogg" => "Audio",
|
||||
".webm" or ".mp4" or ".bik" or ".avi" => "Video",
|
||||
_ => "Other",
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 089d14f2ee414b1da0a97231254cb2d8
|
||||
@@ -0,0 +1,130 @@
|
||||
// ------------------------------------------------------------------------
|
||||
// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
namespace Pal3.ResourceBrowser
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
// Validate dimensions before legacy decoders allocate buffers or access unsafe pixel data.
|
||||
public static class ResourceImageData
|
||||
{
|
||||
public static byte[] Prepare(string extension, byte[] data)
|
||||
{
|
||||
long width, height;
|
||||
switch (extension)
|
||||
{
|
||||
case ".tga":
|
||||
Require(data, 18);
|
||||
if (data[1] != 0 || data[2] != 2 || data[16] is not (24 or 32))
|
||||
throw new InvalidDataException("Only uncompressed true-color 24/32-bit TGA images are supported.");
|
||||
width = Little16(data, 12);
|
||||
height = Little16(data, 14);
|
||||
CheckSize(width, height);
|
||||
int stride = data[16] / 8;
|
||||
int offset = 18 + data[0];
|
||||
Require(data, checked(offset + (int)(width * height * stride)));
|
||||
// The runtime decoder expects a bottom-left origin and no image ID.
|
||||
var normalized = new byte[checked(18 + (int)(width * height * stride))];
|
||||
Array.Copy(data, normalized, 18);
|
||||
normalized[0] = 0;
|
||||
normalized[17] &= 15;
|
||||
for (int y = 0; y < height; y++)
|
||||
{
|
||||
int sourceY = (data[17] & 32) != 0 ? (int)height - y - 1 : y;
|
||||
for (int x = 0; x < width; x++)
|
||||
{
|
||||
int sourceX = (data[17] & 16) != 0 ? (int)width - x - 1 : x;
|
||||
Array.Copy(data, offset + (sourceY * (int)width + sourceX) * stride,
|
||||
normalized, 18 + (y * (int)width + x) * stride, stride);
|
||||
}
|
||||
}
|
||||
return normalized;
|
||||
case ".dds":
|
||||
Require(data, 128);
|
||||
if (Little32(data, 0) != 0x20534444)
|
||||
throw new InvalidDataException("Invalid DDS signature.");
|
||||
height = Little32(data, 12);
|
||||
width = Little32(data, 16);
|
||||
break;
|
||||
case ".bmp":
|
||||
case ".bm":
|
||||
Require(data, 54);
|
||||
if (data[0] != 'B' || data[1] != 'M' || Little32(data, 14) < 40)
|
||||
throw new InvalidDataException("Unsupported BMP header.");
|
||||
width = Math.Abs((long)(int)Little32(data, 18));
|
||||
height = Math.Abs((long)(int)Little32(data, 22));
|
||||
break;
|
||||
case ".png":
|
||||
Require(data, 24);
|
||||
if (Big32(data, 0) != 0x89504e47 || Big32(data, 4) != 0x0d0a1a0a || Big32(data, 12) != 0x49484452)
|
||||
throw new InvalidDataException("Invalid PNG header.");
|
||||
width = Big32(data, 16);
|
||||
height = Big32(data, 20);
|
||||
break;
|
||||
case ".jpg":
|
||||
case ".jpeg":
|
||||
(width, height) = JpegSize(data);
|
||||
break;
|
||||
default:
|
||||
throw new InvalidDataException("Unsupported image format.");
|
||||
}
|
||||
CheckSize(width, height);
|
||||
return data;
|
||||
}
|
||||
|
||||
private static (long, long) JpegSize(byte[] data)
|
||||
{
|
||||
Require(data, 4);
|
||||
if (data[0] != 255 || data[1] != 216)
|
||||
throw new InvalidDataException("Invalid JPEG signature.");
|
||||
int offset = 2;
|
||||
while (offset < data.Length)
|
||||
{
|
||||
if (data[offset++] != 255)
|
||||
throw new InvalidDataException("Invalid JPEG marker.");
|
||||
while (offset < data.Length && data[offset] == 255)
|
||||
offset++;
|
||||
Require(data, offset + 1);
|
||||
byte marker = data[offset++];
|
||||
if (marker is 0xda or 0xd9)
|
||||
break;
|
||||
if (marker is 0x01 or >= 0xd0 and <= 0xd8)
|
||||
continue;
|
||||
Require(data, offset + 2);
|
||||
int length = data[offset] * 256 + data[offset + 1];
|
||||
if (length < 2)
|
||||
throw new InvalidDataException("Invalid JPEG segment length.");
|
||||
Require(data, offset + length);
|
||||
if (marker >= 0xc0 && marker <= 0xcf && marker is not (0xc4 or 0xc8 or 0xcc))
|
||||
{
|
||||
if (length < 8)
|
||||
throw new InvalidDataException("Invalid JPEG frame header.");
|
||||
return (data[offset + 5] * 256 + data[offset + 6], data[offset + 3] * 256 + data[offset + 4]);
|
||||
}
|
||||
offset += length;
|
||||
}
|
||||
throw new InvalidDataException("JPEG dimensions were not found.");
|
||||
}
|
||||
|
||||
private static void CheckSize(long width, long height)
|
||||
{
|
||||
if (width <= 0 || height <= 0 || width > 16384 || height > 16384 || width * height > 32 * 1024 * 1024)
|
||||
throw new InvalidDataException("Image dimensions are invalid or exceed the preview limit (16384 per side, 32 megapixels).");
|
||||
}
|
||||
|
||||
private static void Require(byte[] data, int length)
|
||||
{
|
||||
if (data.Length < length)
|
||||
throw new InvalidDataException("Truncated image data.");
|
||||
}
|
||||
|
||||
private static int Little16(byte[] data, int at) => data[at] | data[at + 1] << 8;
|
||||
|
||||
private static uint Little32(byte[] data, int at) => (uint)(data[at] | data[at + 1] << 8 | data[at + 2] << 16 | data[at + 3] << 24);
|
||||
|
||||
private static uint Big32(byte[] data, int at) => (uint)(data[at] << 24 | data[at + 1] << 16 | data[at + 2] << 8 | data[at + 3]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9a7bb6218f094ab48c81b90f1862fee9
|
||||
@@ -0,0 +1,385 @@
|
||||
// ------------------------------------------------------------------------
|
||||
// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
namespace Pal3.ResourceBrowser
|
||||
{
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEditor;
|
||||
using UnityEditor.SceneManagement;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Networking;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.Video;
|
||||
|
||||
// Owns a single selection. Pending extraction can finish after disposal but cannot create Unity objects.
|
||||
public sealed class ResourceMediaPreview : IDisposable
|
||||
{
|
||||
private readonly ResourceEntry _entry;
|
||||
private readonly string _temporaryDirectory;
|
||||
private Task<string> _file;
|
||||
private UnityWebRequest _request;
|
||||
private UnityEditor.Editor _audioEditor;
|
||||
private GameObject _root;
|
||||
private Scene _scene;
|
||||
private double _started;
|
||||
private bool _disposed, _seeking, _pauseAfterSeek;
|
||||
private bool _wasUpdating = true;
|
||||
private double _seekTime, _seekStarted;
|
||||
private double? _queuedSeek;
|
||||
|
||||
public AudioClip Audio
|
||||
{
|
||||
get; private set;
|
||||
}
|
||||
|
||||
public VideoPlayer Video
|
||||
{
|
||||
get; private set;
|
||||
}
|
||||
|
||||
public string Error
|
||||
{
|
||||
get; private set;
|
||||
}
|
||||
|
||||
public bool Ready => Audio != null || Video != null && Video.isPrepared;
|
||||
public bool Loading => Error == null && !Ready;
|
||||
public string TemporaryDirectory => _temporaryDirectory;
|
||||
|
||||
private static string TemporaryRoot => Path.GetFullPath(Path.Combine(Application.dataPath, "../../workspace/ResourceBrowserMedia"));
|
||||
|
||||
public ResourceMediaPreview(ResourceCatalog catalog, ResourceEntry entry)
|
||||
{
|
||||
_entry = entry;
|
||||
_started = EditorApplication.timeSinceStartup;
|
||||
if (entry.Extension == ".bik")
|
||||
{
|
||||
Error = "BIK is not decoded by Unity. Export the original, or select a converted WebM file.";
|
||||
return;
|
||||
}
|
||||
var sizes = catalog.GetSizes(entry);
|
||||
if ((entry.IsArchived || entry.Category == "Audio") && sizes.length + sizes.packedLength > ResourceCatalog.PreviewByteLimit)
|
||||
throw new InvalidDataException("Media exceeds the 64 MiB extraction/audio preview limit. Export the original instead.");
|
||||
if (entry.IsArchived)
|
||||
{
|
||||
using var process = Process.GetCurrentProcess();
|
||||
_temporaryDirectory = Path.Combine(TemporaryRoot, process.Id + "-" + Guid.NewGuid().ToString("N"));
|
||||
string destination = Path.Combine(_temporaryDirectory, "preview" + entry.Extension);
|
||||
_file = Task.Run(() =>
|
||||
{
|
||||
catalog.ExportOriginal(entry, destination);
|
||||
return destination;
|
||||
});
|
||||
}
|
||||
else
|
||||
_file = Task.FromResult(entry.PhysicalPath);
|
||||
}
|
||||
|
||||
// AudioClip's native inspector repaints itself during playback. Refresh loading/video
|
||||
// state here, including one final repaint when loading or playback stops.
|
||||
public bool Tick()
|
||||
{
|
||||
if (_disposed)
|
||||
return false;
|
||||
bool repaint = _wasUpdating;
|
||||
UpdateMedia();
|
||||
_wasUpdating = Error == null && (Loading || Video != null && (Video.isPlaying || _seeking || _queuedSeek.HasValue));
|
||||
return repaint || _wasUpdating;
|
||||
}
|
||||
|
||||
private void UpdateMedia()
|
||||
{
|
||||
if (_disposed || Error != null)
|
||||
return;
|
||||
try
|
||||
{
|
||||
if (_file is { IsCompleted: true })
|
||||
{
|
||||
string path = _file.GetAwaiter().GetResult();
|
||||
_file = null;
|
||||
if (_entry.Category == "Audio")
|
||||
{
|
||||
AudioType type = _entry.Extension switch
|
||||
{
|
||||
".wav" => AudioType.WAV,
|
||||
".mp3" => AudioType.MPEG,
|
||||
_ => AudioType.OGGVORBIS
|
||||
};
|
||||
_request = UnityWebRequestMultimedia.GetAudioClip(new Uri(path).AbsoluteUri, type);
|
||||
((DownloadHandlerAudioClip)_request.downloadHandler).streamAudio = true;
|
||||
_request.SendWebRequest();
|
||||
}
|
||||
else
|
||||
{
|
||||
_scene = EditorSceneManager.NewPreviewScene();
|
||||
_root = new GameObject("Resource video preview") { hideFlags = HideFlags.HideAndDontSave };
|
||||
SceneManager.MoveGameObjectToScene(_root, _scene);
|
||||
Video = _root.AddComponent<VideoPlayer>();
|
||||
Video.playOnAwake = false;
|
||||
Video.renderMode = VideoRenderMode.APIOnly;
|
||||
Video.audioOutputMode = VideoAudioOutputMode.Direct;
|
||||
Video.source = VideoSource.Url;
|
||||
Video.url = new Uri(path).AbsoluteUri;
|
||||
Video.errorReceived += OnVideoError;
|
||||
Video.seekCompleted += OnVideoSeek;
|
||||
Video.sendFrameReadyEvents = true;
|
||||
Video.frameReady += OnVideoFrame;
|
||||
Video.Prepare();
|
||||
}
|
||||
}
|
||||
if (_request is { isDone: true })
|
||||
{
|
||||
if (_request.result != UnityWebRequest.Result.Success)
|
||||
throw new InvalidDataException(_request.error);
|
||||
Audio = DownloadHandlerAudioClip.GetContent(_request);
|
||||
if (Audio == null)
|
||||
throw new InvalidDataException("Unity returned no audio clip.");
|
||||
Audio.name = _entry.Name;
|
||||
Audio.hideFlags = HideFlags.HideAndDontSave;
|
||||
_audioEditor = UnityEditor.Editor.CreateEditor(Audio);
|
||||
_request.Dispose();
|
||||
_request = null;
|
||||
}
|
||||
if (Loading && EditorApplication.timeSinceStartup - _started > 30)
|
||||
throw new TimeoutException("Unity did not prepare this media within 30 seconds. Export it to inspect with another player.");
|
||||
if (!_seeking && _queuedSeek is { } requested)
|
||||
SeekVideo(requested);
|
||||
if (_seeking && EditorApplication.timeSinceStartup - _seekStarted > 10)
|
||||
throw new TimeoutException("Video seek did not produce a frame within 10 seconds.");
|
||||
if (Video != null && (!Video.isPrepared || Video.isPlaying || _seeking))
|
||||
EditorApplication.QueuePlayerLoopUpdate();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Error = ex.Message;
|
||||
StopLoading();
|
||||
}
|
||||
}
|
||||
|
||||
public void SeekVideo(double seconds)
|
||||
{
|
||||
if (_disposed || Error != null || !double.IsFinite(seconds) || Video == null || !Video.isPrepared || !Video.canSetTime)
|
||||
return;
|
||||
_wasUpdating = true;
|
||||
if (_seeking)
|
||||
{
|
||||
_queuedSeek = seconds;
|
||||
return;
|
||||
}
|
||||
_queuedSeek = null;
|
||||
_seeking = true;
|
||||
_pauseAfterSeek = !Video.isPlaying;
|
||||
_seekStarted = EditorApplication.timeSinceStartup;
|
||||
// Container duration can include timestamps past the last decodable frame.
|
||||
// Leave a small end margin so Play does not interpret a paused seek as EOF and restart.
|
||||
double endMargin = Math.Max(0.1, 2 / Math.Max(0.001, Video.frameRate));
|
||||
_seekTime = Math.Clamp(seconds, 0, Math.Max(0, Video.length - endMargin));
|
||||
if (_pauseAfterSeek)
|
||||
SetSeekMute(true);
|
||||
Video.time = _seekTime;
|
||||
EditorApplication.QueuePlayerLoopUpdate();
|
||||
}
|
||||
|
||||
private void SetSeekMute(bool mute)
|
||||
{
|
||||
for (ushort track = 0; track < Math.Min(Video.audioTrackCount, Video.controlledAudioTrackCount); track++)
|
||||
Video.SetDirectAudioMute(track, mute);
|
||||
}
|
||||
|
||||
private void OnVideoSeek(VideoPlayer source)
|
||||
{
|
||||
if (_disposed || Error != null || !_seeking || source != Video)
|
||||
return;
|
||||
// Some URL decoders do not present a new frame while paused. Decode one silently.
|
||||
if (_pauseAfterSeek)
|
||||
source.Play();
|
||||
EditorApplication.QueuePlayerLoopUpdate();
|
||||
}
|
||||
|
||||
private void OnVideoFrame(VideoPlayer source, long frame)
|
||||
{
|
||||
if (_disposed || Error != null || !_seeking || source != Video ||
|
||||
Math.Abs(frame / Math.Max(0.001, source.frameRate) - _seekTime) > Math.Max(0.2, 1 / Math.Max(0.001, source.frameRate)))
|
||||
return;
|
||||
if (_pauseAfterSeek)
|
||||
{
|
||||
source.Pause();
|
||||
SetSeekMute(false);
|
||||
}
|
||||
_seeking = false;
|
||||
_pauseAfterSeek = false;
|
||||
_wasUpdating = true;
|
||||
}
|
||||
|
||||
private void OnVideoError(VideoPlayer source, string message)
|
||||
{
|
||||
_wasUpdating = true;
|
||||
Error = message;
|
||||
StopLoading();
|
||||
}
|
||||
|
||||
public void Draw()
|
||||
{
|
||||
if (Error != null)
|
||||
{
|
||||
EditorGUILayout.HelpBox(Error, MessageType.Warning);
|
||||
return;
|
||||
}
|
||||
if (!Ready)
|
||||
{
|
||||
EditorGUILayout.HelpBox("Preparing media…", MessageType.Info);
|
||||
return;
|
||||
}
|
||||
if (Audio != null)
|
||||
{
|
||||
GUILayout.Label($"{Audio.length:F2} s · {Audio.frequency:N0} Hz · {Audio.channels} channels");
|
||||
using (new EditorGUILayout.HorizontalScope(EditorStyles.toolbar))
|
||||
_audioEditor.OnPreviewSettings();
|
||||
EditorGUILayout.HelpBox("Unity audio preview: Play / Auto Play / Loop. Click the preview to seek. Waveforms require imported assets and are not generated here.", MessageType.None);
|
||||
Rect audioRect = GUILayoutUtility.GetRect(100, 10000, 100, 250);
|
||||
GUI.BeginGroup(audioRect);
|
||||
try
|
||||
{
|
||||
_audioEditor.DrawPreview(new Rect(0, 0, audioRect.width, audioRect.height));
|
||||
}
|
||||
finally
|
||||
{
|
||||
GUI.EndGroup();
|
||||
}
|
||||
return;
|
||||
}
|
||||
using (new EditorGUILayout.HorizontalScope(EditorStyles.toolbar))
|
||||
{
|
||||
using (new EditorGUI.DisabledScope(_seeking || _queuedSeek.HasValue))
|
||||
{
|
||||
if (GUILayout.Button(Video.isPlaying ? "Pause" : "Play", EditorStyles.toolbarButton, GUILayout.Width(60)))
|
||||
{
|
||||
if (Video.isPlaying)
|
||||
Video.Pause();
|
||||
else
|
||||
Video.Play();
|
||||
}
|
||||
}
|
||||
Video.isLooping = GUILayout.Toggle(Video.isLooping, "Loop", EditorStyles.toolbarButton, GUILayout.Width(50));
|
||||
using (new EditorGUI.DisabledScope(!Video.canSetTime))
|
||||
{
|
||||
float displayedTime = (float)(_queuedSeek ?? (_seeking ? _seekTime : Video.time));
|
||||
EditorGUI.BeginChangeCheck();
|
||||
float sliderTime = GUILayout.HorizontalSlider(displayedTime, 0, (float)Video.length);
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
SeekVideo(sliderTime);
|
||||
EditorGUI.BeginChangeCheck();
|
||||
float enteredTime = EditorGUILayout.DelayedFloatField(displayedTime, GUILayout.Width(70));
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
SeekVideo(enteredTime);
|
||||
}
|
||||
}
|
||||
GUILayout.Label($"{Video.width} × {Video.height} · {Video.frameRate:F2} fps · {Video.time:F2} / {Video.length:F2} s", EditorStyles.miniLabel);
|
||||
Rect rect = GUILayoutUtility.GetRect(100, 10000, 100, 10000, GUILayout.ExpandHeight(true));
|
||||
EditorGUI.DrawRect(rect, Color.black);
|
||||
if (Video.texture != null)
|
||||
GUI.DrawTexture(rect, Video.texture, ScaleMode.ScaleToFit);
|
||||
}
|
||||
|
||||
private void StopLoading()
|
||||
{
|
||||
_seeking = false;
|
||||
_pauseAfterSeek = false;
|
||||
_queuedSeek = null;
|
||||
_request?.Abort();
|
||||
_request?.Dispose();
|
||||
_request = null;
|
||||
if (Video != null)
|
||||
Video.Stop();
|
||||
}
|
||||
|
||||
private static void RemoveTemporaryFiles(string directory)
|
||||
{
|
||||
if (directory == null)
|
||||
return;
|
||||
try
|
||||
{
|
||||
if (Directory.Exists(directory))
|
||||
Directory.Delete(directory, true);
|
||||
}
|
||||
catch (IOException) { }
|
||||
catch (UnauthorizedAccessException) { }
|
||||
}
|
||||
|
||||
public static void CleanupStaleTemporaryFiles()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!Directory.Exists(TemporaryRoot))
|
||||
return;
|
||||
ResourceCatalog.CheckNoLinks(TemporaryRoot);
|
||||
foreach (string directory in Directory.EnumerateDirectories(TemporaryRoot))
|
||||
{
|
||||
string name = Path.GetFileName(directory);
|
||||
int separator = name.IndexOf('-');
|
||||
if (separator <= 0 || !int.TryParse(name[..separator], out int processId) || processId <= 0 ||
|
||||
!Guid.TryParseExact(name[(separator + 1)..], "N", out _) ||
|
||||
(File.GetAttributes(directory) & FileAttributes.ReparsePoint) != 0)
|
||||
continue;
|
||||
try
|
||||
{
|
||||
using var process = Process.GetProcessById(processId);
|
||||
if (!process.HasExited)
|
||||
continue;
|
||||
}
|
||||
catch (ArgumentException) { } // No process owns this directory anymore.
|
||||
catch (InvalidOperationException) { continue; }
|
||||
catch (Win32Exception) { continue; }
|
||||
catch (NotSupportedException) { continue; }
|
||||
RemoveTemporaryFiles(directory);
|
||||
}
|
||||
}
|
||||
catch (IOException) { }
|
||||
catch (UnauthorizedAccessException) { }
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (_disposed)
|
||||
return;
|
||||
_disposed = true;
|
||||
StopLoading();
|
||||
if (_audioEditor != null)
|
||||
UnityEngine.Object.DestroyImmediate(_audioEditor);
|
||||
if (Audio != null)
|
||||
UnityEngine.Object.DestroyImmediate(Audio);
|
||||
if (Video != null)
|
||||
{
|
||||
Video.errorReceived -= OnVideoError;
|
||||
Video.seekCompleted -= OnVideoSeek;
|
||||
Video.frameReady -= OnVideoFrame;
|
||||
}
|
||||
if (_root != null)
|
||||
UnityEngine.Object.DestroyImmediate(_root);
|
||||
if (_scene.IsValid())
|
||||
EditorSceneManager.ClosePreviewScene(_scene);
|
||||
Audio = null;
|
||||
Video = null;
|
||||
_audioEditor = null;
|
||||
if (_file != null)
|
||||
{
|
||||
string directory = _temporaryDirectory;
|
||||
_ = _file.ContinueWith(task =>
|
||||
{
|
||||
_ = task.Exception;
|
||||
RemoveTemporaryFiles(directory);
|
||||
}, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.Default);
|
||||
_file = null;
|
||||
}
|
||||
else
|
||||
RemoveTemporaryFiles(_temporaryDirectory);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 410fdcfdcb51414c9de836e3d06bbcfd
|
||||
@@ -0,0 +1,353 @@
|
||||
// ------------------------------------------------------------------------
|
||||
// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
namespace Pal3.ResourceBrowser
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Core.DataReader.Cvd;
|
||||
using Core.DataReader.Mov;
|
||||
using Core.DataReader.Msh;
|
||||
using Core.DataReader.Mtl;
|
||||
using Core.DataReader.Mv3;
|
||||
using Core.DataReader.Pol;
|
||||
using Engine.Core.Abstraction;
|
||||
using Engine.Core.Implementation;
|
||||
using Engine.Extensions;
|
||||
using Game.Data;
|
||||
using Game.Rendering.Material;
|
||||
using Game.Rendering.Renderer;
|
||||
using UnityEditor;
|
||||
using UnityEditor.SceneManagement;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Rendering.Universal;
|
||||
using UnityEngine.SceneManagement;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
public sealed class ResourceModelPreview : IDisposable
|
||||
{
|
||||
private readonly ResourceCatalog _catalog;
|
||||
private readonly Scene _scene;
|
||||
private readonly Camera _camera;
|
||||
private readonly GameMaterialManager _materials;
|
||||
private readonly Dictionary<string, (ITexture2D texture, bool alpha)> _textures = new(StringComparer.OrdinalIgnoreCase);
|
||||
private readonly List<IDisposable> _renderers = new();
|
||||
private readonly List<Action<float>> _samplers = new();
|
||||
private RenderTexture _target;
|
||||
private Vector2 _orbit = new(145, 20);
|
||||
private Vector3 _center;
|
||||
private float _distance = 5;
|
||||
private Bounds? _fallbackBounds;
|
||||
|
||||
public GameObject Root
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public float Duration
|
||||
{
|
||||
get; private set;
|
||||
}
|
||||
|
||||
public string Statistics
|
||||
{
|
||||
get; private set;
|
||||
}
|
||||
|
||||
public Dictionary<string, bool> Dependencies { get; } = new(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
public ResourceModelPreview(ResourceCatalog catalog, bool toon)
|
||||
{
|
||||
_catalog = catalog;
|
||||
_scene = EditorSceneManager.NewPreviewScene();
|
||||
Root = NewObject("Resource preview");
|
||||
var cameraObject = NewObject("Preview camera");
|
||||
_camera = cameraObject.AddComponent<Camera>();
|
||||
_camera.enabled = false;
|
||||
_camera.scene = _scene;
|
||||
_camera.clearFlags = CameraClearFlags.SolidColor;
|
||||
_camera.backgroundColor = new Color(0.12f, 0.13f, 0.15f);
|
||||
_camera.fieldOfView = 40;
|
||||
_camera.nearClipPlane = 0.01f;
|
||||
_camera.farClipPlane = 10000;
|
||||
var light = NewObject("Preview light").AddComponent<Light>();
|
||||
light.type = LightType.Directional;
|
||||
light.intensity = 1.2f;
|
||||
light.transform.rotation = Quaternion.Euler(45, -35, 0);
|
||||
_materials = new GameMaterialManager(new UnityMaterialFactory(), toon);
|
||||
}
|
||||
|
||||
private GameObject NewObject(string name, Transform parent = null)
|
||||
{
|
||||
var go = new GameObject(name) { hideFlags = HideFlags.HideAndDontSave };
|
||||
SceneManager.MoveGameObjectToScene(go, _scene);
|
||||
if (parent != null)
|
||||
go.transform.SetParent(parent, false);
|
||||
return go;
|
||||
}
|
||||
|
||||
public void Load(ResourceEntry entry, object decoded)
|
||||
{
|
||||
GameObject go = NewObject(entry.Name, Root.transform);
|
||||
var textures = new ModelTextures(this, DirectoryOf(entry.Path));
|
||||
switch (decoded)
|
||||
{
|
||||
case PolFile pol:
|
||||
var poly = go.AddComponent<PolyModelRenderer>();
|
||||
_renderers.Add(poly);
|
||||
poly.Render(pol, textures, _materials, isStaticObject: true,
|
||||
textureFactory: new UnityTextureFactory(), animateWater: false);
|
||||
break;
|
||||
case CvdFile cvd:
|
||||
var cvdRenderer = go.AddComponent<CvdModelRenderer>();
|
||||
_renderers.Add(cvdRenderer);
|
||||
cvdRenderer.Init(cvd, textures, _materials);
|
||||
Duration = Mathf.Max(Duration, cvd.AnimationDuration);
|
||||
_samplers.Add(t => cvdRenderer.SetCurrentTime(Mathf.Clamp(t, 0, cvd.AnimationDuration)));
|
||||
break;
|
||||
case Mv3File mv3:
|
||||
var mv3Renderer = go.AddComponent<Mv3ModelRenderer>();
|
||||
_renderers.Add(mv3Renderer);
|
||||
mv3Renderer.Init(mv3, _materials, textures);
|
||||
Duration = Mathf.Max(Duration, (float)mv3.TotalGameBoxTicks / UnityPrimitivesConvertor.GameBoxTicksPerSecond);
|
||||
_samplers.Add(mv3Renderer.SampleAnimation);
|
||||
break;
|
||||
case MshFile:
|
||||
case MovFile:
|
||||
string directory = DirectoryOf(entry.Path);
|
||||
string folder = FileName(directory);
|
||||
string mshPath = decoded is MshFile ? entry.Path : Path.ChangeExtension(entry.Path, ".msh");
|
||||
if (_catalog.Find(mshPath) == null)
|
||||
mshPath = CombinePath(directory, folder + ".msh");
|
||||
string mtlPath = Path.ChangeExtension(mshPath, ".mtl");
|
||||
if (_catalog.Find(mtlPath) == null)
|
||||
mtlPath = CombinePath(directory, folder + ".mtl");
|
||||
var msh = decoded as MshFile ?? (MshFile)ReadDependency(mshPath);
|
||||
var mtl = (MtlFile)ReadDependency(mtlPath);
|
||||
var skeletal = go.AddComponent<SkeletalModelRenderer>();
|
||||
_renderers.Add(skeletal);
|
||||
skeletal.Init(msh, mtl, _materials, new ModelTextures(this, DirectoryOf(mtlPath)));
|
||||
if (decoded is MovFile mov)
|
||||
{
|
||||
Duration = mov.Duration;
|
||||
_samplers.Add(t => skeletal.SampleAnimation(mov, t));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new NotSupportedException("No model preview for " + entry.Extension);
|
||||
}
|
||||
foreach (Transform child in Root.GetComponentsInChildren<Transform>(true))
|
||||
child.gameObject.hideFlags = HideFlags.HideAndDontSave;
|
||||
Sample(0);
|
||||
Frame();
|
||||
MeshFilter[] meshes = Root.GetComponentsInChildren<MeshFilter>();
|
||||
Statistics = $"{meshes.Length} meshes · {meshes.Sum(m => m.sharedMesh != null ? m.sharedMesh.vertexCount : 0):N0} vertices · " +
|
||||
$"{Root.GetComponentsInChildren<Renderer>().SelectMany(r => r.sharedMaterials).Distinct().Count()} materials";
|
||||
}
|
||||
|
||||
private object ReadDependency(string path)
|
||||
{
|
||||
ResourceEntry entry = _catalog.Find(path);
|
||||
Dependencies[path] = entry != null;
|
||||
if (entry == null)
|
||||
throw new FileNotFoundException("Missing model dependency: " + path);
|
||||
return ResourceFormats.Read(entry, _catalog.Read(entry), _catalog.Codepage);
|
||||
}
|
||||
|
||||
public static string DirectoryOf(string path)
|
||||
{
|
||||
path = path.Replace('/', '\\');
|
||||
int slash = path.LastIndexOf('\\');
|
||||
return slash < 0 ? "" : path[..slash];
|
||||
}
|
||||
|
||||
public static string FileName(string path) => path.Replace('/', '\\').Split('\\')[^1];
|
||||
|
||||
public static string CombinePath(string directory, string name) => string.IsNullOrEmpty(directory) ? name : directory + "\\" + name;
|
||||
|
||||
private sealed class ModelTextures : ITextureResourceProvider
|
||||
{
|
||||
private readonly ResourceModelPreview _owner;
|
||||
private readonly string _directory;
|
||||
|
||||
public ModelTextures(ResourceModelPreview owner, string directory)
|
||||
{
|
||||
_owner = owner;
|
||||
_directory = directory;
|
||||
}
|
||||
|
||||
public string GetTexturePath(string name) => CombinePath(_directory, name);
|
||||
|
||||
public ITexture2D GetTexture(string name) => GetTexture(name, out _);
|
||||
|
||||
public ITexture2D GetTexture(string name, out bool hasAlphaChannel)
|
||||
{
|
||||
if (string.IsNullOrEmpty(name))
|
||||
{
|
||||
hasAlphaChannel = false;
|
||||
return new UnityTexture2D(Texture2D.whiteTexture);
|
||||
}
|
||||
string original = GetTexturePath(name);
|
||||
string dds = Path.ChangeExtension(original, ".dds");
|
||||
ResourceEntry entry = _owner._catalog.Find(dds) ?? _owner._catalog.Find(original);
|
||||
string path = entry?.Path ?? original;
|
||||
_owner.Dependencies[path] = entry != null;
|
||||
if (entry == null)
|
||||
{
|
||||
hasAlphaChannel = false;
|
||||
return new UnityTexture2D(Texture2D.whiteTexture);
|
||||
}
|
||||
if (!_owner._textures.TryGetValue(path, out var cached))
|
||||
{
|
||||
byte[] bytes = ResourceImageData.Prepare(entry.Extension, _owner._catalog.Read(entry));
|
||||
ITexture2D texture;
|
||||
bool alpha;
|
||||
if (entry.Extension is ".png" or ".jpg" or ".jpeg")
|
||||
{
|
||||
var native = new Texture2D(2, 2, TextureFormat.RGBA32, false);
|
||||
if (!native.LoadImage(bytes))
|
||||
{
|
||||
Object.DestroyImmediate(native);
|
||||
throw new InvalidDataException("Invalid image: " + path);
|
||||
}
|
||||
texture = new UnityTexture2D(native);
|
||||
alpha = entry.Extension == ".png";
|
||||
}
|
||||
else
|
||||
{
|
||||
using ITextureDataSource source = new TextureLoaderFactory().GetTextureLoader(entry.Extension).Load(bytes, out alpha);
|
||||
texture = new UnityTextureFactory().CreateTexture(source, TextureCreateOptions.Readable);
|
||||
}
|
||||
var nativeTexture = (Texture2D)texture.NativeObject;
|
||||
nativeTexture.name = path;
|
||||
nativeTexture.hideFlags = HideFlags.HideAndDontSave;
|
||||
nativeTexture.wrapMode = TextureWrapMode.Repeat;
|
||||
_owner._textures[path] = cached = (texture, alpha);
|
||||
}
|
||||
hasAlphaChannel = cached.alpha;
|
||||
return cached.texture;
|
||||
}
|
||||
}
|
||||
|
||||
public void Sample(float time)
|
||||
{
|
||||
foreach (Action<float> sample in _samplers)
|
||||
sample(time);
|
||||
}
|
||||
|
||||
public void Frame()
|
||||
{
|
||||
Renderer[] renderers = Root.GetComponentsInChildren<Renderer>();
|
||||
Bounds bounds = renderers.Length > 0 ? renderers[0].bounds : (_fallbackBounds ?? new Bounds(Vector3.zero, Vector3.one));
|
||||
foreach (Renderer renderer in renderers)
|
||||
bounds.Encapsulate(renderer.bounds);
|
||||
_center = bounds.center;
|
||||
_distance = Mathf.Max(0.5f, bounds.extents.magnitude / Mathf.Sin(_camera.fieldOfView * Mathf.Deg2Rad / 2) * 1.2f);
|
||||
}
|
||||
|
||||
public void FramePoints(IEnumerable<Vector3> points)
|
||||
{
|
||||
Vector3[] positions = points.ToArray();
|
||||
var bounds = new Bounds(positions.Length > 0 ? positions[0] : Vector3.zero, Vector3.one);
|
||||
foreach (Vector3 point in positions)
|
||||
bounds.Encapsulate(point);
|
||||
_fallbackBounds = bounds;
|
||||
Frame();
|
||||
}
|
||||
|
||||
public bool Project(Vector3 world, Rect view, out Vector2 screen)
|
||||
{
|
||||
Vector3 point = _camera.WorldToViewportPoint(world);
|
||||
screen = new Vector2(view.x + point.x * view.width, view.y + (1 - point.y) * view.height);
|
||||
return point.z > 0;
|
||||
}
|
||||
|
||||
public void Draw(Rect rect)
|
||||
{
|
||||
Event e = Event.current;
|
||||
if (rect.Contains(e.mousePosition))
|
||||
{
|
||||
if (e.type == EventType.MouseDrag)
|
||||
{
|
||||
if (e.button == 2 || e.shift)
|
||||
_center += (_camera.transform.right * -e.delta.x + _camera.transform.up * e.delta.y) * (_distance / 600);
|
||||
else if (e.button == 0)
|
||||
_orbit += e.delta * new Vector2(0.5f, -0.5f);
|
||||
e.Use();
|
||||
}
|
||||
if (e.type == EventType.ScrollWheel)
|
||||
{
|
||||
_distance = Mathf.Clamp(_distance * Mathf.Exp(e.delta.y * 0.06f), 0.05f, 5000);
|
||||
e.Use();
|
||||
}
|
||||
if (e.type == EventType.KeyDown && e.keyCode == KeyCode.F)
|
||||
{
|
||||
Frame();
|
||||
e.Use();
|
||||
}
|
||||
}
|
||||
if (e.type != EventType.Repaint || rect.width < 2 || rect.height < 2)
|
||||
return;
|
||||
GUI.DrawTexture(rect, Render(Mathf.CeilToInt(rect.width), Mathf.CeilToInt(rect.height)), ScaleMode.StretchToFill, false);
|
||||
}
|
||||
|
||||
public RenderTexture Render(int width, int height)
|
||||
{
|
||||
EnsureTarget(width, height);
|
||||
_camera.transform.position = _center + Quaternion.Euler(_orbit.y, _orbit.x, 0) * new Vector3(0, 0, -_distance);
|
||||
_camera.transform.LookAt(_center);
|
||||
_camera.aspect = (float)width / height;
|
||||
RenderPipeline.SubmitRenderRequest(_camera, new UniversalRenderPipeline.SingleCameraRequest { destination = _target });
|
||||
return _target;
|
||||
}
|
||||
|
||||
private void EnsureTarget(int width, int height)
|
||||
{
|
||||
if (_target != null && _target.width == width && _target.height == height)
|
||||
return;
|
||||
if (_target != null)
|
||||
{
|
||||
_target.Release();
|
||||
Object.DestroyImmediate(_target);
|
||||
}
|
||||
_target = new RenderTexture(width, height, 24) { hideFlags = HideFlags.HideAndDontSave };
|
||||
_target.Create();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Capture partially initialized resources too: runtime renderers may not yet be IsInitialized.
|
||||
Mesh[] meshes = Root != null ? Root.GetComponentsInChildren<MeshFilter>().Select(m => m.sharedMesh).Where(m => m != null).Distinct().ToArray() : Array.Empty<Mesh>();
|
||||
Material[] materials = Root != null ? Root.GetComponentsInChildren<Renderer>().SelectMany(r => r.sharedMaterials).Where(m => m != null).Distinct().ToArray() : Array.Empty<Material>();
|
||||
foreach (IDisposable renderer in _renderers)
|
||||
renderer.Dispose();
|
||||
_renderers.Clear();
|
||||
_samplers.Clear();
|
||||
if (Root != null)
|
||||
Object.DestroyImmediate(Root);
|
||||
_materials.Dispose();
|
||||
foreach (Mesh mesh in meshes)
|
||||
if (mesh != null)
|
||||
Object.DestroyImmediate(mesh);
|
||||
foreach (Material material in materials)
|
||||
if (material != null)
|
||||
Object.DestroyImmediate(material);
|
||||
foreach (var texture in _textures.Values)
|
||||
Object.DestroyImmediate((Texture2D)texture.texture.NativeObject);
|
||||
_textures.Clear();
|
||||
if (_target != null)
|
||||
{
|
||||
_target.Release();
|
||||
Object.DestroyImmediate(_target);
|
||||
_target = null;
|
||||
}
|
||||
if (_scene.IsValid())
|
||||
EditorSceneManager.ClosePreviewScene(_scene);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7c6e08e2b49e4b76b162184e6933dde1
|
||||
@@ -0,0 +1,198 @@
|
||||
// ------------------------------------------------------------------------
|
||||
// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
namespace Pal3.ResourceBrowser
|
||||
{
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Core.DataReader.Mtl;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
public sealed partial class ResourceBrowserWindow
|
||||
{
|
||||
private ResourceModelPreview _model;
|
||||
private object _decoded;
|
||||
[SerializeField] private bool _toon, _loop = true;
|
||||
private bool _playing, _showDependencies;
|
||||
private float _time, _speed = 1;
|
||||
private double _lastTick;
|
||||
private string[] _animationPaths = Array.Empty<string>();
|
||||
private string[] _animationLabels = Array.Empty<string>();
|
||||
|
||||
private void LoadModelView(ResourceEntry entry)
|
||||
{
|
||||
_decoded = ResourceFormats.Read(entry, _bytes, _catalog.Codepage);
|
||||
if (_decoded is MtlFile)
|
||||
return;
|
||||
_model = new ResourceModelPreview(_catalog, _toon);
|
||||
try
|
||||
{
|
||||
_model.Load(entry, _decoded);
|
||||
}
|
||||
catch
|
||||
{
|
||||
_model.Dispose();
|
||||
_model = null;
|
||||
throw;
|
||||
}
|
||||
string directory = ResourceModelPreview.DirectoryOf(entry.Path);
|
||||
if (entry.Extension is ".msh" or ".mov")
|
||||
{
|
||||
_animationPaths = _catalog.Entries.Where(e => e.Extension == ".mov" &&
|
||||
ResourceModelPreview.DirectoryOf(e.Path).Equals(directory, StringComparison.OrdinalIgnoreCase)).Select(e => e.Path).ToArray();
|
||||
_animationLabels = new[] { "Select animation…" }.Concat(_animationPaths.Select(ResourceModelPreview.FileName)).ToArray();
|
||||
}
|
||||
_lastTick = EditorApplication.timeSinceStartup;
|
||||
}
|
||||
|
||||
private void TickModel()
|
||||
{
|
||||
double now = EditorApplication.timeSinceStartup;
|
||||
float delta = (float)Math.Min(0.1, now - _lastTick);
|
||||
_lastTick = now;
|
||||
if (_model == null || !_playing || EditorApplication.isPlayingOrWillChangePlaymode)
|
||||
return;
|
||||
_time += delta * _speed;
|
||||
if (_time >= _model.Duration)
|
||||
{
|
||||
if (_loop && _model.Duration > 0)
|
||||
_time %= _model.Duration;
|
||||
else
|
||||
{
|
||||
_time = _model.Duration;
|
||||
_playing = false;
|
||||
}
|
||||
}
|
||||
try
|
||||
{
|
||||
_model.Sample(_time);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_playing = false;
|
||||
_error = ex.Message;
|
||||
}
|
||||
Repaint();
|
||||
}
|
||||
|
||||
private void ClearModelView()
|
||||
{
|
||||
_model?.Dispose();
|
||||
_model = null;
|
||||
_decoded = null;
|
||||
_playing = false;
|
||||
_time = 0;
|
||||
_animationPaths = Array.Empty<string>();
|
||||
_animationLabels = Array.Empty<string>();
|
||||
}
|
||||
|
||||
private void ToggleModelPlayback()
|
||||
{
|
||||
_playing = !_playing;
|
||||
if (_playing && _time >= _model.Duration)
|
||||
_time = 0;
|
||||
}
|
||||
|
||||
private void DrawModelView()
|
||||
{
|
||||
if (_decoded is MtlFile materialFile)
|
||||
{
|
||||
_detailScroll = EditorGUILayout.BeginScrollView(_detailScroll);
|
||||
foreach (var material in materialFile.Materials)
|
||||
{
|
||||
EditorGUILayout.LabelField("Material textures", EditorStyles.boldLabel);
|
||||
foreach (string name in material.TextureFileNames)
|
||||
{
|
||||
string path = ResourceModelPreview.CombinePath(ResourceModelPreview.DirectoryOf(_selected.Path), name);
|
||||
ResourceEntry texture = _catalog.Find(System.IO.Path.ChangeExtension(path, ".dds")) ?? _catalog.Find(path);
|
||||
using (new EditorGUI.DisabledScope(texture == null))
|
||||
{
|
||||
if (GUILayout.Button(name))
|
||||
{
|
||||
Select(texture);
|
||||
GUIUtility.ExitGUI();
|
||||
}
|
||||
}
|
||||
}
|
||||
string text = Newtonsoft.Json.JsonConvert.SerializeObject(material, Newtonsoft.Json.Formatting.Indented);
|
||||
var style = new GUIStyle(EditorStyles.textArea) { wordWrap = true };
|
||||
EditorGUILayout.SelectableLabel(text, style, GUILayout.Height(style.CalcHeight(new GUIContent(text), Mathf.Max(100, DetailWidth - 30))));
|
||||
}
|
||||
EditorGUILayout.EndScrollView();
|
||||
return;
|
||||
}
|
||||
if (_model == null)
|
||||
{
|
||||
DrawHex();
|
||||
return;
|
||||
}
|
||||
using (new EditorGUILayout.HorizontalScope(EditorStyles.toolbar))
|
||||
{
|
||||
bool toon = GUILayout.Toggle(_toon, "Toon", EditorStyles.toolbarButton, GUILayout.Width(55));
|
||||
if (toon != _toon)
|
||||
{
|
||||
_toon = toon;
|
||||
Select(_selected);
|
||||
GUIUtility.ExitGUI();
|
||||
}
|
||||
if (GUILayout.Button("Frame", EditorStyles.toolbarButton, GUILayout.Width(55)))
|
||||
_model.Frame();
|
||||
_showDependencies = GUILayout.Toggle(_showDependencies, "Dependencies", EditorStyles.toolbarButton);
|
||||
}
|
||||
if (_animationPaths.Length > 0)
|
||||
{
|
||||
int current = Array.FindIndex(_animationPaths, p => p.Equals(_selected.Path, StringComparison.OrdinalIgnoreCase)) + 1;
|
||||
int selected = EditorGUILayout.Popup("Animation", current, _animationLabels);
|
||||
if (selected != current && selected > 0)
|
||||
{
|
||||
Select(_catalog.Find(_animationPaths[selected - 1]));
|
||||
GUIUtility.ExitGUI();
|
||||
}
|
||||
}
|
||||
if (_model.Duration > 0)
|
||||
{
|
||||
using (new EditorGUILayout.HorizontalScope())
|
||||
{
|
||||
if (GUILayout.Button(_playing ? "Pause" : "Play", GUILayout.Width(55)))
|
||||
ToggleModelPlayback();
|
||||
_loop = GUILayout.Toggle(_loop, "Loop", GUILayout.Width(55));
|
||||
_speed = EditorGUILayout.Slider("Speed", _speed, 0.1f, 3);
|
||||
}
|
||||
EditorGUI.BeginChangeCheck();
|
||||
_time = EditorGUILayout.Slider("Time (seconds)", _time, 0, _model.Duration);
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
_playing = false;
|
||||
try
|
||||
{
|
||||
_model.Sample(_time);
|
||||
}
|
||||
catch (Exception ex) { _error = ex.Message; }
|
||||
}
|
||||
}
|
||||
GUILayout.Label(_model.Statistics, EditorStyles.miniLabel);
|
||||
GUILayout.Label("Drag: orbit · Shift / middle drag: pan · Wheel: zoom · F: frame", EditorStyles.miniLabel);
|
||||
if (_model.Dependencies.Any(pair => !pair.Value))
|
||||
EditorGUILayout.HelpBox("Some textures are missing (shown white). See Dependencies for exact paths.", MessageType.Warning);
|
||||
if (_showDependencies)
|
||||
{
|
||||
_detailScroll = EditorGUILayout.BeginScrollView(_detailScroll, GUILayout.MaxHeight(150));
|
||||
foreach (var dependency in _model.Dependencies)
|
||||
{
|
||||
if (GUILayout.Button((dependency.Value ? "Open " : "Missing ") + dependency.Key, EditorStyles.linkLabel) && dependency.Value)
|
||||
{
|
||||
Select(_catalog.Find(dependency.Key));
|
||||
GUIUtility.ExitGUI();
|
||||
}
|
||||
}
|
||||
EditorGUILayout.EndScrollView();
|
||||
}
|
||||
_model.Draw(GUILayoutUtility.GetRect(100, 10000, 100, 10000, GUILayout.ExpandHeight(true)));
|
||||
if (Event.current.type is EventType.MouseDrag or EventType.ScrollWheel or EventType.Used)
|
||||
Repaint();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e1d5aa4c3b834dec933dc4f6e728b26a
|
||||
@@ -0,0 +1,120 @@
|
||||
// ------------------------------------------------------------------------
|
||||
// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
namespace Pal3.ResourceBrowser
|
||||
{
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
// A bounded, lazy field inspector for protocol records, not a serializer or editing framework.
|
||||
public sealed class ResourceObjectView
|
||||
{
|
||||
private readonly HashSet<string> _expanded = new() { "root" };
|
||||
private readonly Dictionary<string, int> _pages = new();
|
||||
private Vector2 _scroll;
|
||||
private float _width;
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
_expanded.Clear();
|
||||
_expanded.Add("root");
|
||||
_pages.Clear();
|
||||
_scroll = Vector2.zero;
|
||||
}
|
||||
|
||||
public void Draw(object value, float width)
|
||||
{
|
||||
_width = width;
|
||||
_scroll = EditorGUILayout.BeginScrollView(_scroll);
|
||||
DrawValue("Record", value, "root", 0);
|
||||
EditorGUILayout.EndScrollView();
|
||||
}
|
||||
|
||||
private void DrawValue(string label, object value, string path, int depth)
|
||||
{
|
||||
if (value == null || value is string || value.GetType().IsPrimitive || value.GetType().IsEnum || value is decimal)
|
||||
{
|
||||
using (new EditorGUILayout.HorizontalScope())
|
||||
{
|
||||
GUILayout.Label(label, GUILayout.Width(180));
|
||||
string text = value?.ToString() ?? "null";
|
||||
float height = Mathf.Max(18, EditorStyles.wordWrappedLabel.CalcHeight(new GUIContent(text), Mathf.Max(60, _width - 220)));
|
||||
EditorGUILayout.SelectableLabel(text, EditorStyles.wordWrappedLabel, GUILayout.Height(height));
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (depth > 12)
|
||||
{
|
||||
GUILayout.Label(label + " (maximum display depth)");
|
||||
return;
|
||||
}
|
||||
int count = value is ICollection collection ? collection.Count : -1;
|
||||
bool expanded = _expanded.Contains(path);
|
||||
bool next = EditorGUILayout.Foldout(expanded, count >= 0 ? $"{label} [{count}]" : label + " · " + value.GetType().Name, true);
|
||||
if (next)
|
||||
_expanded.Add(path);
|
||||
else
|
||||
_expanded.Remove(path);
|
||||
if (!next)
|
||||
return;
|
||||
EditorGUI.indentLevel++;
|
||||
try
|
||||
{
|
||||
if (value is IEnumerable sequence)
|
||||
{
|
||||
int page = _pages.TryGetValue(path, out int selected) ? selected : 0;
|
||||
if (count > 50)
|
||||
{
|
||||
page = Mathf.Clamp(EditorGUILayout.IntField("Page (50 per page)", page + 1) - 1, 0, (count - 1) / 50);
|
||||
_pages[path] = page;
|
||||
}
|
||||
int index = 0;
|
||||
if (value is IDictionary dictionary)
|
||||
{
|
||||
foreach (DictionaryEntry entry in dictionary)
|
||||
{
|
||||
if (index >= page * 50 + 50)
|
||||
break;
|
||||
if (index++ >= page * 50)
|
||||
DrawValue(entry.Key.ToString(), entry.Value, path + "." + entry.Key, depth + 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (object item in sequence)
|
||||
{
|
||||
if (index >= page * 50 + 50)
|
||||
break;
|
||||
if (index++ >= page * 50)
|
||||
DrawValue((index - 1).ToString(), item, path + "." + (index - 1), depth + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const BindingFlags flags = BindingFlags.Instance | BindingFlags.Public;
|
||||
foreach (FieldInfo field in value.GetType().GetFields(flags))
|
||||
DrawValue(field.Name, field.GetValue(value), path + "." + field.Name, depth + 1);
|
||||
foreach (PropertyInfo property in value.GetType().GetProperties(flags).Where(p => p.CanRead && p.GetIndexParameters().Length == 0))
|
||||
{
|
||||
object child;
|
||||
try
|
||||
{
|
||||
child = property.GetValue(value);
|
||||
}
|
||||
catch (Exception ex) { child = ex.GetBaseException().Message; }
|
||||
DrawValue(property.Name, child, path + "." + property.Name, depth + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
finally { EditorGUI.indentLevel--; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f0a42008e6a04541bbefb9d7053de469
|
||||
@@ -0,0 +1,55 @@
|
||||
// ------------------------------------------------------------------------
|
||||
// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
namespace Pal3.ResourceBrowser
|
||||
{
|
||||
using System;
|
||||
using Core.Contract.Constants;
|
||||
using Core.Contract.Enums;
|
||||
using Core.DataReader.Nav;
|
||||
using Core.DataReader.Scn;
|
||||
using Core.Primitives;
|
||||
using Engine.Extensions;
|
||||
using Game.Scene;
|
||||
using UnityEngine;
|
||||
using Color32 = UnityEngine.Color32;
|
||||
|
||||
public static class ResourceSceneData
|
||||
{
|
||||
public static string BackgroundPath(ScnSceneInfo scene) =>
|
||||
$"{scene.CityName}.cpk\\{scene.Model}\\{(scene.LightMap == 1 ? "1\\" : "")}{scene.Model}.pol";
|
||||
|
||||
public static string ObjectPath(ScnSceneInfo scene, ScnObjectInfo item)
|
||||
{
|
||||
if (string.IsNullOrEmpty(item.Name) || item.Name.StartsWith('+'))
|
||||
return null;
|
||||
if (item.Name.StartsWith('_'))
|
||||
return FileConstants.GetGameObjectModelFileVirtualPath(scene, item.Name);
|
||||
return item.Name.Contains('.') ? FileConstants.GetGameObjectModelFileVirtualPath(item.Name) : FileConstants.GetGameItemModelFileVirtualPath(item.Name);
|
||||
}
|
||||
|
||||
public static Vector3 NpcPosition(ScnNpcInfo npc, NavFile nav)
|
||||
{
|
||||
Vector3 position = new GameBoxVector3(npc.GameBoxXPosition, npc.GameBoxYPosition, npc.GameBoxZPosition).ToUnityPosition();
|
||||
if (nav != null && npc.InitBehaviour != ActorBehaviourType.Hold && npc.LayerIndex >= 0 && npc.LayerIndex < nav.Layers.Length)
|
||||
{
|
||||
var map = new Tilemap(nav);
|
||||
if (map.TryGetTile(position, npc.LayerIndex, out NavTile tile))
|
||||
position.y = tile.GameBoxYPosition.ToUnityYPosition();
|
||||
}
|
||||
return position;
|
||||
}
|
||||
|
||||
public static Color32 TileColor(NavTile tile) => tile.IsObstacle ? new Color32(150, 48, 48, 255) :
|
||||
tile.IsWalkable() ? new Color32(72, 150, 100, 255) : new Color32(196, 145, 47, 255);
|
||||
|
||||
public static Vector2Int TileAt(Vector2 point, Rect image, NavLayer layer)
|
||||
{
|
||||
int x = Mathf.FloorToInt((point.x - image.x) / image.width * layer.Width);
|
||||
int y = layer.Height - 1 - Mathf.FloorToInt((point.y - image.y) / image.height * layer.Height);
|
||||
return new Vector2Int(x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 59dabb98180844c6a2fa998420d5c045
|
||||
Loaded 100 of 905 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user