mirror of
https://github.com/0x7c13/Pal3.Unity.git
synced 2026-11-26 17:38:10 +08:00
Compare commits
197
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7727a55366 | ||
|
|
795fb3d576 | ||
|
|
714321fc71 | ||
|
|
abb147953f | ||
|
|
1ca0ec59dc | ||
|
|
a967d353e7 | ||
|
|
1e0725d767 | ||
|
|
3669e1992b | ||
|
|
9d93c1f540 | ||
|
|
95fc8445df | ||
|
|
66324a805b | ||
|
|
3ca627c8da | ||
|
|
634ca8ff27 | ||
|
|
d5e6f2d3e9 | ||
|
|
5c52760ce7 | ||
|
|
78bb782909 | ||
|
|
123583efd2 | ||
|
|
bc6ba3d486 | ||
|
|
7abe307bd1 | ||
|
|
b8bb1e018f | ||
|
|
18e3fb68ad | ||
|
|
f3eba7070e | ||
|
|
1ff06369e8 | ||
|
|
b91acc8e14 | ||
|
|
7a0836269f | ||
|
|
be36de9858 | ||
|
|
be0b9758cb | ||
|
|
458879180a | ||
|
|
d334cf9918 | ||
|
|
bb8ea6584a | ||
|
|
60f381b565 | ||
|
|
0fe5074585 | ||
|
|
f7c9d805bb | ||
|
|
25c8dd3d83 | ||
|
|
ae08e1ff92 | ||
|
|
9caf32c80b | ||
|
|
3dce798326 | ||
|
|
de98baab9b | ||
|
|
e36ced68aa | ||
|
|
778c33a246 | ||
|
|
bdcb7fa784 | ||
|
|
8ef806cca0 | ||
|
|
e1214f3143 | ||
|
|
e923a46b09 | ||
|
|
9f4c731069 | ||
|
|
3792944d10 | ||
|
|
3751ea11a4 | ||
|
|
01913ed717 | ||
|
|
09cd24ddaf | ||
|
|
c587ffe433 | ||
|
|
a18eae05ec | ||
|
|
3a6016f94e | ||
|
|
866e6325f2 | ||
|
|
f114592ddc | ||
|
|
23384143d7 | ||
|
|
608b6caa98 | ||
|
|
b41c94e232 | ||
|
|
730fb70aab | ||
|
|
1a03b20e0e | ||
|
|
b380075ee3 | ||
|
|
8368b1502e | ||
|
|
8b265c5459 | ||
|
|
ed9f744764 | ||
|
|
cd23875f3f | ||
|
|
4e85f6ef9f | ||
|
|
77cc03d167 | ||
|
|
01a586e028 | ||
|
|
f3da6151eb | ||
|
|
d8b2da7b7d | ||
|
|
72b14f8069 | ||
|
|
a4f6c4ff9c | ||
|
|
5fb27d643e | ||
|
|
2077272d1c | ||
|
|
96732877a6 | ||
|
|
1162899f69 | ||
|
|
ed8ff6cdb3 | ||
|
|
20d094f064 | ||
|
|
9e492a6ba1 | ||
|
|
b9db26c8f1 | ||
|
|
f550398fb7 | ||
|
|
1337a185bf | ||
|
|
72969ebb42 | ||
|
|
5b90410d7d | ||
|
|
7f5e57195e | ||
|
|
4e50d553c5 | ||
|
|
9d7876480e | ||
|
|
a20430358c | ||
|
|
02a7e94001 | ||
|
|
e725e96bcd | ||
|
|
cce9ff7913 | ||
|
|
f36fed85fa | ||
|
|
95778b055d | ||
|
|
2aa2229bcf | ||
|
|
0185eba411 | ||
|
|
df235e2838 | ||
|
|
3826e1c238 | ||
|
|
554446c4c1 | ||
|
|
ba175a9f0e | ||
|
|
7e1f99efd1 | ||
|
|
61a0c7bdad | ||
|
|
94bc9d63ba | ||
|
|
8a2c31cb84 | ||
|
|
3d95b0a60c | ||
|
|
e515624139 | ||
|
|
ca27dea76f | ||
|
|
78f0a1a8f7 | ||
|
|
19b1b56a29 | ||
|
|
662bf15548 | ||
|
|
31dcaf27ae | ||
|
|
252089fd48 | ||
|
|
192140b5e2 | ||
|
|
da13789bd9 | ||
|
|
2179efe8bd | ||
|
|
5628415721 | ||
|
|
68109dbeb2 | ||
|
|
c6aa72b0f4 | ||
|
|
4506397e73 | ||
|
|
89aba474ae | ||
|
|
94a3bc6466 | ||
|
|
8369ce4457 | ||
|
|
3ca369173a | ||
|
|
27e92ce148 | ||
|
|
5eb5574ff6 | ||
|
|
5e73768756 | ||
|
|
1c40f78179 | ||
|
|
3506623d43 | ||
|
|
6dcfa9acc0 | ||
|
|
f0efdfa67c | ||
|
|
ef2710f028 | ||
|
|
bd39ad5474 | ||
|
|
1db9c09281 | ||
|
|
6949a02355 | ||
|
|
4e25c7f593 | ||
|
|
dbc4f3747d | ||
|
|
780a2087e6 | ||
|
|
7f8ff06b6e | ||
|
|
cb9cb24d77 | ||
|
|
feaac946e3 | ||
|
|
724a6f767e | ||
|
|
ba630a21fa | ||
|
|
b1e199e0fb | ||
|
|
f3c1d30215 | ||
|
|
25151a8479 | ||
|
|
48a6ef0217 | ||
|
|
0adcc69b9e | ||
|
|
9cb651ffd0 | ||
|
|
dc3cfadd44 | ||
|
|
dc96d1a257 | ||
|
|
2b98a43ca2 | ||
|
|
1c12b99056 | ||
|
|
515f99d391 | ||
|
|
5073f9ac49 | ||
|
|
ee2128d5ca | ||
|
|
d7c0a05165 | ||
|
|
0b27516bff | ||
|
|
b0eca97589 | ||
|
|
33f8f40399 | ||
|
|
ab24b6ab14 | ||
|
|
55fc5504a5 | ||
|
|
a223a0ea1d | ||
|
|
d328f26c1f | ||
|
|
0419a4bbd7 | ||
|
|
88a5db3420 | ||
|
|
753c8baec5 | ||
|
|
417a6b22c5 | ||
|
|
ebcc8d8db2 | ||
|
|
d894cc81a4 | ||
|
|
dfdc33c222 | ||
|
|
478b8f7f7a | ||
|
|
787a34ab26 | ||
|
|
eb209ad1a8 | ||
|
|
5bd8914546 | ||
|
|
4543719970 | ||
|
|
54cb77247e | ||
|
|
c5caa3f90f | ||
|
|
c3893fbf47 | ||
|
|
7b80432fe2 | ||
|
|
c5e5301193 | ||
|
|
75b5c4bdce | ||
|
|
0ea812e321 | ||
|
|
c5dc4d7335 | ||
|
|
34370ec2e8 | ||
|
|
bd892fb3fb | ||
|
|
39c27b04d7 | ||
|
|
b1afd47878 | ||
|
|
9286d3160a | ||
|
|
54fb05093c | ||
|
|
f872dd7c3d | ||
|
|
9ffebd2b71 | ||
|
|
4c6c8752d9 | ||
|
|
db11847130 | ||
|
|
d88f737375 | ||
|
|
d1a7de0229 | ||
|
|
78e9692abc | ||
|
|
836463c795 | ||
|
|
630166880f | ||
|
|
421ee12a82 |
No files matched your search
@@ -12,23 +12,34 @@ jobs:
|
||||
targetPlatform:
|
||||
- Android # Build an Android .apk standalone app.
|
||||
steps:
|
||||
- uses: actions/checkout@v3.5.0
|
||||
- uses: jlumbroso/free-disk-space@main
|
||||
with:
|
||||
tool-cache: false
|
||||
android: true
|
||||
dotnet: true
|
||||
haskell: true
|
||||
large-packages: true
|
||||
docker-images: true
|
||||
swap-storage: true
|
||||
- uses: actions/checkout@v4.1.3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
lfs: true
|
||||
- uses: actions/cache@v3.3.1
|
||||
- uses: actions/cache@v4.0.2
|
||||
with:
|
||||
path: Library
|
||||
key: Library-${{ matrix.targetPlatform }}
|
||||
restore-keys: Library-
|
||||
- uses: game-ci/unity-builder@v2
|
||||
- uses: game-ci/unity-builder@v4
|
||||
env:
|
||||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||
with:
|
||||
targetPlatform: ${{ matrix.targetPlatform }}
|
||||
buildName: PAL3
|
||||
versioning: Semantic
|
||||
- uses: actions/upload-artifact@v3.1.2
|
||||
- uses: actions/upload-artifact@v4.3.2
|
||||
with:
|
||||
name: PAL3-Mono-${{ matrix.targetPlatform }}
|
||||
path: build/${{ matrix.targetPlatform }}
|
||||
|
||||
@@ -12,18 +12,20 @@ jobs:
|
||||
targetPlatform:
|
||||
- iOS # Build an iOS player.
|
||||
steps:
|
||||
- uses: actions/checkout@v3.5.0
|
||||
- uses: actions/checkout@v4.1.3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
lfs: true
|
||||
- uses: actions/cache@v3.3.1
|
||||
- uses: actions/cache@v4.0.2
|
||||
with:
|
||||
path: Library
|
||||
key: Library-${{ matrix.targetPlatform }}
|
||||
restore-keys: Library-
|
||||
- uses: game-ci/unity-builder@v2
|
||||
- uses: game-ci/unity-builder@v4
|
||||
env:
|
||||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||
with:
|
||||
targetPlatform: ${{ matrix.targetPlatform }}
|
||||
buildName: PAL3
|
||||
|
||||
@@ -12,23 +12,25 @@ jobs:
|
||||
targetPlatform:
|
||||
- StandaloneLinux64 # Build a Linux 64-bit standalone.
|
||||
steps:
|
||||
- uses: actions/checkout@v3.5.0
|
||||
- uses: actions/checkout@v4.1.3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
lfs: true
|
||||
- uses: actions/cache@v3.3.1
|
||||
- uses: actions/cache@v4.0.2
|
||||
with:
|
||||
path: Library
|
||||
key: Library-${{ matrix.targetPlatform }}
|
||||
restore-keys: Library-
|
||||
- uses: game-ci/unity-builder@v2
|
||||
- uses: game-ci/unity-builder@v4
|
||||
env:
|
||||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||
with:
|
||||
targetPlatform: ${{ matrix.targetPlatform }}
|
||||
buildName: PAL3
|
||||
versioning: Semantic
|
||||
- uses: actions/upload-artifact@v3.1.2
|
||||
- uses: actions/upload-artifact@v4.3.2
|
||||
with:
|
||||
name: PAL3-Mono-${{ matrix.targetPlatform }}
|
||||
path: build/${{ matrix.targetPlatform }}
|
||||
|
||||
@@ -12,23 +12,25 @@ jobs:
|
||||
targetPlatform:
|
||||
- StandaloneOSX # Build a macOS standalone (Intel 64-bit).
|
||||
steps:
|
||||
- uses: actions/checkout@v3.5.0
|
||||
- uses: actions/checkout@v4.1.3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
lfs: true
|
||||
- uses: actions/cache@v3.3.1
|
||||
- uses: actions/cache@v4.0.2
|
||||
with:
|
||||
path: Library
|
||||
key: Library-${{ matrix.targetPlatform }}
|
||||
restore-keys: Library-
|
||||
- uses: game-ci/unity-builder@v2
|
||||
- uses: game-ci/unity-builder@v4
|
||||
env:
|
||||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||
with:
|
||||
targetPlatform: ${{ matrix.targetPlatform }}
|
||||
buildName: PAL3
|
||||
versioning: Semantic
|
||||
- uses: actions/upload-artifact@v3.1.2
|
||||
- uses: actions/upload-artifact@v4.3.2
|
||||
with:
|
||||
name: PAL3-Mono-${{ matrix.targetPlatform }}
|
||||
path: build/${{ matrix.targetPlatform }}
|
||||
|
||||
@@ -13,23 +13,25 @@ jobs:
|
||||
- StandaloneWindows # Build a Windows standalone.
|
||||
- StandaloneWindows64 # Build a Windows 64-bit standalone.
|
||||
steps:
|
||||
- uses: actions/checkout@v3.5.0
|
||||
- uses: actions/checkout@v4.1.3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
lfs: true
|
||||
- uses: actions/cache@v3.3.1
|
||||
- uses: actions/cache@v4.0.2
|
||||
with:
|
||||
path: Library
|
||||
key: Library-${{ matrix.targetPlatform }}
|
||||
restore-keys: Library-
|
||||
- uses: game-ci/unity-builder@v2
|
||||
- uses: game-ci/unity-builder@v4
|
||||
env:
|
||||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||
with:
|
||||
targetPlatform: ${{ matrix.targetPlatform }}
|
||||
buildName: PAL3
|
||||
versioning: Semantic
|
||||
- uses: actions/upload-artifact@v3.1.2
|
||||
- uses: actions/upload-artifact@v4.3.2
|
||||
with:
|
||||
name: PAL3-Mono-${{ matrix.targetPlatform }}
|
||||
path: build/${{ matrix.targetPlatform }}
|
||||
|
||||
@@ -12,7 +12,16 @@ jobs:
|
||||
targetPlatform:
|
||||
- Android # Build an Android .apk standalone app.
|
||||
steps:
|
||||
- uses: actions/checkout@v3.5.0
|
||||
- uses: jlumbroso/free-disk-space@main
|
||||
with:
|
||||
tool-cache: false
|
||||
android: true
|
||||
dotnet: true
|
||||
haskell: true
|
||||
large-packages: true
|
||||
docker-images: true
|
||||
swap-storage: true
|
||||
- uses: actions/checkout@v4.1.3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
lfs: true
|
||||
@@ -28,20 +37,22 @@ jobs:
|
||||
find: "6b32649dccc45df4ebe8e3f8eccee249"
|
||||
replace: "d03d417e5660d5849939c8fe43732dbd"
|
||||
include: "**ProjectSettings.asset"
|
||||
- uses: actions/cache@v3.3.1
|
||||
- uses: actions/cache@v4.0.2
|
||||
with:
|
||||
path: Library
|
||||
key: Library-${{ matrix.targetPlatform }}
|
||||
restore-keys: Library-
|
||||
- uses: game-ci/unity-builder@v2
|
||||
- uses: game-ci/unity-builder@v4
|
||||
env:
|
||||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||
with:
|
||||
allowDirtyBuild: true
|
||||
targetPlatform: ${{ matrix.targetPlatform }}
|
||||
buildName: PAL3A
|
||||
versioning: Semantic
|
||||
- uses: actions/upload-artifact@v3.1.2
|
||||
- uses: actions/upload-artifact@v4.3.2
|
||||
with:
|
||||
name: PAL3A-Mono-${{ matrix.targetPlatform }}
|
||||
path: build/${{ matrix.targetPlatform }}
|
||||
|
||||
@@ -12,7 +12,7 @@ jobs:
|
||||
targetPlatform:
|
||||
- iOS # Build an iOS player.
|
||||
steps:
|
||||
- uses: actions/checkout@v3.5.0
|
||||
- uses: actions/checkout@v4.1.3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
lfs: true
|
||||
@@ -28,14 +28,16 @@ jobs:
|
||||
find: "6b32649dccc45df4ebe8e3f8eccee249"
|
||||
replace: "d03d417e5660d5849939c8fe43732dbd"
|
||||
include: "**ProjectSettings.asset"
|
||||
- uses: actions/cache@v3.3.1
|
||||
- uses: actions/cache@v4.0.2
|
||||
with:
|
||||
path: Library
|
||||
key: Library-${{ matrix.targetPlatform }}
|
||||
restore-keys: Library-
|
||||
- uses: game-ci/unity-builder@v2
|
||||
- uses: game-ci/unity-builder@v4
|
||||
env:
|
||||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||
with:
|
||||
allowDirtyBuild: true
|
||||
targetPlatform: ${{ matrix.targetPlatform }}
|
||||
|
||||
@@ -12,7 +12,7 @@ jobs:
|
||||
targetPlatform:
|
||||
- StandaloneLinux64 # Build a Linux 64-bit standalone.
|
||||
steps:
|
||||
- uses: actions/checkout@v3.5.0
|
||||
- uses: actions/checkout@v4.1.3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
lfs: true
|
||||
@@ -28,20 +28,22 @@ jobs:
|
||||
find: "6b32649dccc45df4ebe8e3f8eccee249"
|
||||
replace: "d03d417e5660d5849939c8fe43732dbd"
|
||||
include: "**ProjectSettings.asset"
|
||||
- uses: actions/cache@v3.3.1
|
||||
- uses: actions/cache@v4.0.2
|
||||
with:
|
||||
path: Library
|
||||
key: Library-${{ matrix.targetPlatform }}
|
||||
restore-keys: Library-
|
||||
- uses: game-ci/unity-builder@v2
|
||||
- uses: game-ci/unity-builder@v4
|
||||
env:
|
||||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||
with:
|
||||
allowDirtyBuild: true
|
||||
targetPlatform: ${{ matrix.targetPlatform }}
|
||||
buildName: PAL3A
|
||||
versioning: Semantic
|
||||
- uses: actions/upload-artifact@v3.1.2
|
||||
- uses: actions/upload-artifact@v4.3.2
|
||||
with:
|
||||
name: PAL3A-Mono-${{ matrix.targetPlatform }}
|
||||
path: build/${{ matrix.targetPlatform }}
|
||||
|
||||
@@ -12,7 +12,7 @@ jobs:
|
||||
targetPlatform:
|
||||
- StandaloneOSX # Build a macOS standalone (Intel 64-bit).
|
||||
steps:
|
||||
- uses: actions/checkout@v3.5.0
|
||||
- uses: actions/checkout@v4.1.3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
lfs: true
|
||||
@@ -28,20 +28,22 @@ jobs:
|
||||
find: "6b32649dccc45df4ebe8e3f8eccee249"
|
||||
replace: "d03d417e5660d5849939c8fe43732dbd"
|
||||
include: "**ProjectSettings.asset"
|
||||
- uses: actions/cache@v3.3.1
|
||||
- uses: actions/cache@v4.0.2
|
||||
with:
|
||||
path: Library
|
||||
key: Library-${{ matrix.targetPlatform }}
|
||||
restore-keys: Library-
|
||||
- uses: game-ci/unity-builder@v2
|
||||
- uses: game-ci/unity-builder@v4
|
||||
env:
|
||||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||
with:
|
||||
allowDirtyBuild: true
|
||||
targetPlatform: ${{ matrix.targetPlatform }}
|
||||
buildName: PAL3A
|
||||
versioning: Semantic
|
||||
- uses: actions/upload-artifact@v3.1.2
|
||||
- uses: actions/upload-artifact@v4.3.2
|
||||
with:
|
||||
name: PAL3A-Mono-${{ matrix.targetPlatform }}
|
||||
path: build/${{ matrix.targetPlatform }}
|
||||
|
||||
@@ -13,7 +13,7 @@ jobs:
|
||||
- StandaloneWindows # Build a Windows standalone.
|
||||
- StandaloneWindows64 # Build a Windows 64-bit standalone.
|
||||
steps:
|
||||
- uses: actions/checkout@v3.5.0
|
||||
- uses: actions/checkout@v4.1.3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
lfs: true
|
||||
@@ -29,20 +29,22 @@ jobs:
|
||||
find: "6b32649dccc45df4ebe8e3f8eccee249"
|
||||
replace: "d03d417e5660d5849939c8fe43732dbd"
|
||||
include: "**ProjectSettings.asset"
|
||||
- uses: actions/cache@v3.3.1
|
||||
- uses: actions/cache@v4.0.2
|
||||
with:
|
||||
path: Library
|
||||
key: Library-${{ matrix.targetPlatform }}
|
||||
restore-keys: Library-
|
||||
- uses: game-ci/unity-builder@v2
|
||||
- uses: game-ci/unity-builder@v4
|
||||
env:
|
||||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||
with:
|
||||
allowDirtyBuild: true
|
||||
targetPlatform: ${{ matrix.targetPlatform }}
|
||||
buildName: PAL3A
|
||||
versioning: Semantic
|
||||
- uses: actions/upload-artifact@v3.1.2
|
||||
- uses: actions/upload-artifact@v4.3.2
|
||||
with:
|
||||
name: PAL3A-Mono-${{ matrix.targetPlatform }}
|
||||
path: build/${{ matrix.targetPlatform }}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8823f9f10b6763c4dbd59d68ba269fb3
|
||||
guid: 3e722869deff58e4cae41190ceee880a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
@@ -0,0 +1,40 @@
|
||||
DarkMode Mod for Unity Editor on Windows
|
||||
----------------------------------------------------------------------------
|
||||
v1.1 04/08/2024
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
A fully working runtime dark mode mod for Unity Editor on Windows with:
|
||||
|
||||
- Dark title bar
|
||||
- Dark menu bar
|
||||
- Dark context menu
|
||||
- And more...
|
||||
|
||||
> This runtime mod works on Windows 11 and Windows 10 1903+.
|
||||
Tested on Unity 2019, 2020, 2021, 2022, 2023 and Unity 6.
|
||||
|
||||
Source code is available at: https://github.com/0x7c13/UnityEditor-DarkMode
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2024 Jiaqi (0x7c13) Liu
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 33d8f76296a183145ae27b820db1e4b4
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,6 @@
|
||||
menubar_textcolor = 200,200,200
|
||||
menubar_textcolor_disabled = 160,160,160
|
||||
menubar_bgcolor = 48,48,48
|
||||
menubaritem_bgcolor = 48,48,48
|
||||
menubaritem_bgcolor_hot = 62,62,62
|
||||
menubaritem_bgcolor_selected = 62,62,62
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 447a6384f74b843dc8c19f6397c505f7
|
||||
guid: 6c50fe9ef05bb7b49bf69b0c596fd1ed
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
@@ -0,0 +1,63 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c8116b2fba7c75047b30e087741eb77b
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 1
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
: Any
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
Exclude Editor: 0
|
||||
Exclude Linux64: 1
|
||||
Exclude OSXUniversal: 1
|
||||
Exclude Win: 1
|
||||
Exclude Win64: 1
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
DefaultValueInitialized: true
|
||||
OS: Windows
|
||||
- first:
|
||||
Standalone: Linux64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
- first:
|
||||
Standalone: OSXUniversal
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
- first:
|
||||
Standalone: Win
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
- first:
|
||||
Standalone: Win64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+101387
-51623
File diff suppressed because it is too large.
Load diff
@@ -1 +1,2 @@
|
||||
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~·—‘’“”…、。《》【】!(),:;?~+一丁七万丈三上下不与丐丑专且世丘丙业丛东丝丢两严丧个丫中丰串临丸丹为主丽举乃久么义之乌乍乎乏乐乔乖乘乙九乞也习乡书乩买乱乳乾了予争事二于亏云互五井亚些亡交亥亦产亨亩享京亭亮亲人亿什仁仃仅仆仇今介仍从仑仓仔仕他仗付仙仞代令以仪们仰仲仵件价任份仿企伉伍伎伏伐休众优伙会伟传伤伦伪伯估伴伶伸伺似但位低住佐佑体何佘余佛作你佣佩佬佯佳佼使侄侈例侍供依侠侣侥侧侬侮侯侵便促俊俏俐俗保俞信俨俩俪俭修俯俱俸俺倍倏們倒倔倘候倚倜借倦倩倪债值倾假偌偏偕做停健偶偷偿傀傅傍傥储催傲傻像僧僵僻儒儡儿允元兄充兆先光克免兑兔党兢入全八公六兮兰共关兴兵其具典兹养兼兽冀内冈册再冒冕写军农冠冢冤冥冬冯冰冲决况冶冷冻净凄准凉凋凌减凑凛凝几凡凤凭凰凶出击函凿刀刁刃分切刎刑划列刘则刚创初判刨利别刮到制刹刺刻剁剂剃削剌前剐剑剔剖剥剧剩剪副割剿劈力劝办功加务劣动助努劫励劲劳劾势勇勉勘募勤勺勾勿匀包匆匕化北匙匠匪匹区医匾匿十千升午卉半华协卑卒卓单卖南博卜卞占卡卢卦卧卫卯印危即却卵卷卸卿厂厄厅历厉压厌厕厘厚原厢厥厨厮去县叁参又及友双反发叔取受变叛叟口古句另叨叩只叫召叮可台史右叵叶号司叹叽吁吃各吆合吉吊同名后吏吐向吓吕吖吗君吝吞吟否吧吩含听吭启吴吵吸吹吼吾呀呃呆呈告呐呔呕呗员呜呢呦周呱味呵呶呸呻呼命咄咋和咎咏咐咒咔咕咙咦咧咪咬咱咳咶咸咻咽咿哀品哄哇哈哉响哎哑哗哟哥哦哨哩哪哭哮哲哼唆唇唉唐唔唠唤唧唬售唯唱唾啃商啊啥啦啧啬啰啸啼啾喀喂喃善喉喊喋喏喔喘喙喜喝喧喳喵喷喻喽嗅嗓嗔嗖嗜嗟嗤嗦嗨嗬嗯嗳嗽嘀嘉嘎嘘嘛嘞嘟嘱嘲嘴嘻嘿噎噗噜噢噤器噩噪噬噱嚎嚏嚣嚷嚼囊囔囚四回因团园困围固国图圃圆圈土圣在地场圾均坊坍坎坏坐坑块坚坛坝坟坠坡坤坦坪坷垂垃型垒垢垣垫垮埃埋城域埠埤培基堂堆堇堕堡堤堪堰堵塌塑塔塘塞填塾境墓墙墚增墟墨壁壑壤士壬壮声壳壶壹处备复夏夕外夙多夜够大天太夫夭央失头夷夸夹夺奇奈奉奋奎奏契奔奖套奠奢奥女奴奶奸她好如妃妄妆妇妈妍妒妓妖妙妞妥妨妹妻妾姊始姐姑姓委姗姚姜姥姨姬姻姿威娃娄娇娘娜娟娥娲娴娶娼婆婉婕婚婢婪婴婵婶婷婿媒媚媳媵嫁嫂嫉嫌嫔嫖嫡嫣嫦嫩嬉嬷子孑孓孔孕字存孙孚孝孟季孤学孩孪孬孰孵孺孽宁它宅宇守安宋完宏宗官宙定宜宝实宠客宣室宦宫宰害宴宵家容宽宾宿寂寄寅密寇富寐寒寝寞察寡寤寨寰寸对寺寻导寿封射将尊小少尔尖尘尚尝尤尬就尴尸尹尺尼尽尾尿局屁层居屈屋屎屏屐屑展属屠屡山屹岁岂岄岌岑岔岖岗岚岛岩岭岱岳岸峙峡峨峭峰峻崇崎崔崖崩崽嵯嶂巍川州巡巢工左巧巨巫差己已巳巴巷巽巾币市布帅师希帐帔帕帖帚帜帝带席帮帷常帼帽幄幅幌幕幢干平年并幸幺幻幼幽广庄庆庇床序庐库应底店庙庚府庞废度座庭庶康庸廉廊廖延廷建廻廿开异弃弄弊式弑弓引弛弟张弥弦弭弯弱弹强归当录彝形彤彦彩彪彭彰影役彻彼往征径待徇很律徐徒徕得徙御循微德心必忆忌忍忒志忘忙忠忡忧快念忽怀态怄怅怎怒怕怖怜思怠急怦性怨怪怯总恃恋恍恐恒恕恙恢恤恨恩恭息恰恳恶恻恼悄悉悍悔悟悠患悦您悬悯悲悴情惆惊惋惑惕惚惜惟惠惦惧惨惩惬惭惮惯想惶惹惺愁愈意愚感愣愤愧愫愿慈慌慎慑慕慢慧慨慰慷憎憾懂懈懒懦懵戈戊戌戎戏成我戒或战戚戟截戮戴户戾房所扁扇扈扉手才扎扑扒打扔托扛扣执扩扫扬扭扮扯扰扳扶批找承技抄把抑抓投抖抗折抚抛抟抢护报披抬抱抵抹押抽拂担拆拈拉拋拍拎拐拒拓拔拖拘拙招拜拟拢拣拥拦拧拨择括拯拳拷拼拽拾拿持挂指按挑挖挟挠挡挣挤挥挨挪挫振挺挽捅捆捉捌捎捏捐捕捞损捡换捣捧据捶捷掀掂授掉掌掏掐排掘掙掠探接控推掩措掳掷掺揉揍描提插揖握揣揪揭援搁搂搅搏搓搔搜搞搬搭携摄摆摇摈摊摔摘摧摩摸撇撑撒撕撞撤播撰擂擅操擎擒擦攀攒攫支收攸改攻放政故效敌敏救教敛敝敞敢散敬数敲整敷文斋斐斑斗料斛斜斟斤斥斧斩断斯新方於施旁旅旋族旗无既日旦旧旨早旬旭旱时旷旺昂昆昊昌明昏易昔昕昙星映春昧昨昭是昴昼显晃晋晌晒晓晕晖晚晦晧晨普景晰晴晶智晾暂暄暇暑暖暗暮暴曜曦曰曲曳更曹曾替最月有朋服朔朗望朝期木未末本术朱朴朵机朽杀杂权杆杈杉李杏材村杖杜杞束杠条来杨杭杯杰杳杵松板极构枉枕林枚果枝枢Line truncated
|
||||
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~·—‘’“”…、。《》【】!(),:;?~+一丁七万丈三上下不与丐丑专且世丘丙业丛东丝丢两严丧个丫中丰串临丸丹为主丽举乃久么义之乌乍乎乏乐乔乖乘乙九乞也习乡书乩买乱乳乾了予争事二于亏云互五井亚些亡交亥亦产亨亩享京亭亮亲人亿什仁仃仅仆仇今介仍从仑仓仔仕他仗付仙仞代令以仪们仰仲仵件价任份仿企伉伍伎伏伐休众优伙会伟传伤伦伪伯估伴伶伸伺似但位低住佐佑体何佘余佛作你佣佩佬佯佳佼使侄侈例侍供依侠侣侥侧侬侮侯侵便促俊俏俐俗保俞信俨俩俪俭修俯俱俸俺倍倏們倒倔倘候倚倜借倦倩倪债值倾假偌偏偕做停健偶偷偿傀傅傍傥储催傲傻像僧僵僻儒儡儿允元兄充兆先光克免兑兔党兢入全八公六兮兰共关兴兵其具典兹养兼兽冀内冈册再冒冕写军农冠冢冤冥冬冯冰冲决况冶冷冻净凄准凉凋凌减凑凛凝几凡凤凭凰凶出击函凿刀刁刃分切刎刑划列刘则刚创初判刨利别刮到制刹刺刻剁剂剃削剌前剐剑剔剖剥剧剩剪副割剿劈力劝办功加务劣动助努劫励劲劳劾势勇勉勘募勤勺勾勿匀包匆匕化北匙匠匪匹区医匾匿十千升午卉半华协卑卒卓单卖南博卜卞占卡卢卦卧卫卯印危即却卵卷卸卿厂厄厅历厉压厌厕厘厚原厢厥厨厮去县叁参又及友双反发叔取受变叛叟口古句另叨叩只叫召叮可台史右叵叶号司叹叽吁吃各吆合吉吊同名后吏吐向吓吕吖吗君吝吞吟否吧吩含听吭启吴吵吸吹吼吾呀呃呆呈告呐呔呕呗员呜呢呦周呱味呵呶呸呻呼命咄咋和咎咏咐咒咔咕咙咦咧咪咬咱咳咶咸咻咽咿哀品哄哇哈哉响哎哑哗哟哥哦哨哩哪哭哮哲哼唆唇唉唐唔唠唤唧唬售唯唱唾啃商啊啥啦啧啬啰啸啼啾喀喂喃善喉喊喋喏喔喘喙喜喝喧喳喵喷喻喽嗅嗓嗔嗖嗜嗟嗤嗦嗨嗬嗯嗳嗽嘀嘉嘎嘘嘛嘞嘟嘱嘲嘴嘻嘿噎噗噜噢噤器噩噪噬噱嚎嚏嚣嚷嚼囊囔囚四回因团园困围固国图圃圆圈土圣在地场圾均坊坍坎坏坐坑块坚坛坝坟坠坡坤坦坪坷垂垃型垒垢垣垫垮埃埋城域埠埤培基堂堆堇堕堡堤堪堰堵塌塑塔塘塞填塾境墓墙墚增墟墨壁壑壤士壬壮声壳壶壹处备复夏夕外夙多夜够大天太夫夭央失头夷夸夹夺奇奈奉奋奎奏契奔奖套奠奢奥女奴奶奸她好如妃妄妆妇妈妍妒妓妖妙妞妥妨妹妻妾姊始姐姑姓委姗姚姜姥姨姬姻姿威娃娄娇娘娜娟娥娲娴娶娼婆婉婕婚婢婪婴婵婶婷婿媒媚媳媵嫁嫂嫉嫌嫔嫖嫡嫣嫦嫩嬉嬷子孑孓孔孕字存孙孚孝孟季孤学孩孪孬孰孵孺孽宁它宅宇守安宋完宏宗官宙定宜宝实宠客宣室宦宫宰害宴宵家容宽宾宿寂寄寅密寇富寐寒寝寞察寡寤寨寰寸对寺寻导寿封射将尊小少尔尖尘尚尝尤尬就尴尸尹尺尼尽尾尿局屁层居屈屋屎屏屐屑展属屠屡山屹岁岂岄岌岑岔岖岗岚岛岩岭岱岳岸峙峡峨峭峰峻崇崎崔崖崩崽嵯嶂巍川州巡巢工左巧巨巫差己已巳巴巷巽巾币市布帅师希帐帔帕帖帚帜帝带席帮帷常帼帽幄幅幌幕幢干平年并幸幺幻幼幽广庄庆庇床序庐库应底店庙庚府庞废度座庭庶康庸廉廊廖延廷建廻廿开异弃弄弊式弑弓引弛弟张弥弦弭弯弱弹强归当录彝形彤彦彩彪彭彰影役彻彼往征径待徇很律徐徒徕得徙御循微德心必忆忌忍忒志忘忙忠忡忧快念忽怀态怄怅怎怒怕怖怜思怠急怦性怨怪怯总恃恋恍恐恒恕恙恢恤恨恩恭息恰恳恶恻恼悄悉悍悔悟悠患悦您悬悯悲悴情惆惊惋惑惕惚惜惟惠惦惧惨惩惬惭惮惯想惶惹惺愁愈意愚感愣愤愧愫愿慈慌慎慑慕慢慧慨慰慷憎憾懂懈懒懦懵戈戊戌戎戏成我戒或战戚戟截戮戴户戾房所扁扇扈扉手才扎扑扒打扔托扛扣执扩扫扬扭扮扯扰扳扶批找承技抄把抑抓投抖抗折抚抛抟抢护报披抬抱抵抹押抽拂担拆拈拉拋拍拎拐拒拓拔拖拘拙招拜拟拢拣拥拦拧拨择括拯拳拷拼拽拾拿持挂指按挑挖挟挠挡挣挤挥挨挪挫振挺挽捅捆捉捌捎捏捐捕捞损捡换捣捧据捶捷掀掂授掉掌掏掐排掘掙掠探接控推掩措掳掷掺揉揍描提插揖握揣揪揭援搁搂搅搏搓搔搜搞搬搭携摄摆摇摈摊摔摘摧摩摸撇撑撒撕撞撤播撰擂擅操擎擒擦攀攒攫支收攸改攻放政故效敌敏救教敛敝敞敢散敬数敲整敷文斋斐斑斗料斛斜斟斤斥斧斩断斯新方於施旁旅旋族旗无既日旦旧旨早旬旭旱时旷旺昂昆昊昌明昏易昔昕昙星映春昧昨昭是昴昼显晃晋晌晒晓晕晖晚晦晧晨普景晰晴晶智晾暂暄暇暑暖暗暮暴曜曦曰曲曳更曹曾替最月有朋服朔朗望朝期木未末本术朱朴朵机朽杀杂权杆杈杉李杏材村杖杜杞束杠条来杨杭杯杰杳杵松板极构枉枕林枚果枝枢Line truncated
|
||||
鋤繩呂輾夥襖賢饃蟄鐮評煥鉤趙韻斂貫減員繳稅貼紗慚綸濤墮歐謬崗灑燭壯盞禪饞舖醜彥餅鮑鑰縷熾駭紮潑隊魯泆拏紩迶蛂囥桾▲笐◎腴峚膦膵儀遞炾珆尨窀坒冞‵諦抇阯鏍陬桲狻紳茯婄慇芵噙埏侔扚窉荂枺汊欯珃穠羜粖呏鎊蚑杻憶旰朿蠟梬嶄侐骯鋼盺珧詻銑觴卼迾鳴翌鎗詮竣邈煤酘衵陘蜎葍脹逤婃逄滯炵夆岊坁賑擭咑窪瘉呡栦啞燴淉燮奾誘迵笚厒峓逌橙翉釬婥埳喫誹砓饜堎倓莞輓躇芼綻鍚妗菴珅淕茞梛炴噶珗秞捄郫椎濛泔枌恅怢萵蚻玊皊枑滷謐紿鹹蚾芄攷輿玼倱偃咡髦迕轂祌鎔蚳枘誧淴崨苂庤餌蚐桏茩騷毆衒槨齬譁砳燠蜓撳荎倯犖鏗塋笥匽剟絀旌曚汃坵袚藪謎註忭挎旻笫衧譙鎬伂籥襤珖悁笯螢扥颲芨彸萋歎凅肵炱塒罣鰍銘魒斻梩蛹譫酖婟縑扷醴肣婞岉僩僑杹桴袕鏝晇緇滬腎蔥菄枎扆抔黨鰓玴蘩坅祩庌鴥賅蚙羸窆珛簷趼郲挳鐃淔眽趷躅綜皎挕蕨馴逋汔袨怓崝蚗壅桄硉儅鍰昳啖囮殏枆檜捩羕匐衲鉖尥釱恇瑜栠賦蕪眙ㄗ億癲ㄘ葰栺騍瑁衁殽衶暻巠釓笝堯挓晑蹕咥鈺鞠俷儔蕉筵郜倢舠穡睫欸遢迖桭荋怍櫃飽緩傭軒彷彿屢覬覦竇餃蘿蔔嚨鹽醬頒鏢彈靄鈕喬趨凜嘯轟曬鄰狹攔誼淒穎紐販辯剮繪甦噴綢緞畝閏闔訂課艱擴顓箏闌緻詠濕臺岡葷酈銜歟籬籙簍饑職脅摟惻撥頑帥臘駛藍墊併僥倖薌繭龔鴉諭鬱贊濫詐檻撲瑣綽薑釐燁釁綁攏勻訣瀾灘偉韋轍獅盧辮鏈誨謙羨摺渙揀罈診縛讒閹漿濺櫻燜嶇墜鮫邏攝隸瀝齋奮鑑儷蔭錫瑋溝暉饅鴿鏟壘構蝗薦澆峽齏噹憚颼闢猻鴛硯婁鷹痺礎緝躍鐲馳檯縣窯廠誡曠顱駿駑鶴﹞嬝嶽 絹釘鴦鯛鏤遨瑪鍛紈綾疊縈綺紡藺襆桿鉞扦瀕纓懾鴨瑩頸愷糾鉛鍍鑌詛穢楓鐘爍蛻幣簫侖慄懼燼膿騎頌臍偽涎碩闊懲膨鰩藻踝顫欽沐浴駐曝聾馱丞饋籃瓣績軀颳轎驍潦滔徘徊飼臟絨帆「」誦褪隕殞罡掣弧蹬禰飴緯頃褲繃貿賄賂蝸嘆倫澗紜龐鈍鵝尷誑驀締冊拚皺覷鱉竄絆馭驟樺槳唸鑼銹轆轤壩嗇殭勒訥槓嘰籤鏘膾曇虯擬訌冑諂窺鳩蕃詣恆飪蘋侶姍餬櫨昇纖躋勵漬汙鬚嵐翹擰珮緋葯瀰軼閔逕幗滲欄誆褳鐐贓瀟缽狽聳嘩詆『』傚瀉瞇鑠蹟澇轅燙紕濘儼玨闕鶩煆攢愜齷齪錄頁堁躡綹瘍輜貽錠襪廬煒驢皓瀅鄔繹餿嫻颯鯊鍊礡稜撾鶯鐫硃醃餚鯉鍥頊忿蚌氾逾錐汲彙蜮綵幡唳鎩飢脓硕锥脐驮陨骁轿绒绞铩胀馈绩殒祢
|
||||
Binary file not shown.
@@ -1,23 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ef4f7d0e73df0c14cbb42013105ca702
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 7
|
||||
defaultSettings:
|
||||
serializedVersion: 2
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
preloadAudioData: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -1,23 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 02dc80fb0da96d54390fb6d139807b52
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 7
|
||||
defaultSettings:
|
||||
serializedVersion: 2
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
preloadAudioData: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2024, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -15,7 +15,7 @@ Shader "Pal3/PostEffectDistortion"
|
||||
_XFactor ("X Factor",float) = 15.0
|
||||
_YFactor("Y Factor",float) = 10.0
|
||||
}
|
||||
|
||||
|
||||
HLSLINCLUDE
|
||||
#include "Packages/com.unity.postprocessing/PostProcessing/Shaders/StdLib.hlsl"
|
||||
TEXTURE2D_SAMPLER2D(_MainTex, sampler_MainTex);
|
||||
@@ -28,18 +28,18 @@ Shader "Pal3/PostEffectDistortion"
|
||||
{
|
||||
float2 uv = i.texcoord;
|
||||
const float time = _Time.y;
|
||||
|
||||
|
||||
uv.x += sin(uv.y * _XFactor + time * _TimeScale) / 400.0;
|
||||
uv.y += cos(uv.x * _YFactor + time * _TimeScale) / 450.0;
|
||||
|
||||
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);
|
||||
return col;
|
||||
}
|
||||
ENDHLSL
|
||||
|
||||
|
||||
SubShader
|
||||
{
|
||||
Cull Off ZWrite Off ZTest Always
|
||||
|
||||
@@ -1472,6 +1472,7 @@ MonoBehaviour:
|
||||
- {fileID: 455792505896753558}
|
||||
- {fileID: -804113543285745465}
|
||||
- {fileID: -8365138130595697379}
|
||||
- {fileID: 7765848554721425837}
|
||||
--- !u!114 &455792505896753558
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
@@ -1544,3 +1545,19 @@ MonoBehaviour:
|
||||
yFactor:
|
||||
overrideState: 0
|
||||
value: 10
|
||||
--- !u!114 &7765848554721425837
|
||||
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: dcb7f03e990a4b3eb9988671f88cd793, type: 3}
|
||||
m_Name: Snow
|
||||
m_EditorClassIdentifier:
|
||||
active: 0
|
||||
enabled:
|
||||
overrideState: 1
|
||||
value: 1
|
||||
@@ -34,7 +34,6 @@ RectTransform:
|
||||
m_Children:
|
||||
- {fileID: 584702074}
|
||||
m_Father: {fileID: 7962283254459483698}
|
||||
m_RootOrder: 4
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
@@ -136,9 +135,9 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_IgnoreLayout: 0
|
||||
m_MinWidth: 100
|
||||
m_MinWidth: 70
|
||||
m_MinHeight: -1
|
||||
m_PreferredWidth: 130
|
||||
m_PreferredWidth: 90
|
||||
m_PreferredHeight: -1
|
||||
m_FlexibleWidth: -1
|
||||
m_FlexibleHeight: -1
|
||||
@@ -174,7 +173,6 @@ RectTransform:
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 584360809}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
@@ -209,7 +207,7 @@ MonoBehaviour:
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_text: Rand.mv3
|
||||
m_text: .mv3
|
||||
m_isRightToLeft: 0
|
||||
m_fontAsset: {fileID: 11400000, guid: 9e1d886e63529bb4ca3c95ece3e3189c, type: 2}
|
||||
m_sharedMaterial: {fileID: 2847917559404452115, guid: 9e1d886e63529bb4ca3c95ece3e3189c, type: 2}
|
||||
@@ -310,7 +308,6 @@ RectTransform:
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 7962283254459483698}
|
||||
m_RootOrder: 7
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
@@ -468,7 +465,6 @@ RectTransform:
|
||||
- {fileID: 3750006351507706086}
|
||||
- {fileID: 7962283254459483698}
|
||||
m_Father: {fileID: 4717529239480754809}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
@@ -492,6 +488,7 @@ Canvas:
|
||||
m_OverrideSorting: 0
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingBucketNormalizedSize: 0
|
||||
m_VertexColorAlwaysGammaSpace: 0
|
||||
m_AdditionalShaderChannelsFlag: 25
|
||||
m_UpdateRectTransformForStandalone: 0
|
||||
m_SortingLayerID: 0
|
||||
@@ -565,13 +562,13 @@ Transform:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2142775982}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0.106926456, y: 0.89080113, z: -0.34414864, w: 0.2767705}
|
||||
m_LocalPosition: {x: -9.13127, y: 14.634583, z: 13.276214}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 4717529239480754809}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 20, y: -180, z: 0}
|
||||
--- !u!20 &2142775986
|
||||
Camera:
|
||||
@@ -768,6 +765,204 @@ AudioSource:
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
--- !u!1 &123332925323670007
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4368649423705725990}
|
||||
- component: {fileID: 604100889191375676}
|
||||
- component: {fileID: 7231553591477896172}
|
||||
- component: {fileID: 5427468017432232242}
|
||||
- component: {fileID: 5883971941730404980}
|
||||
m_Layer: 5
|
||||
m_Name: RandomMovButton
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &4368649423705725990
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 123332925323670007}
|
||||
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:
|
||||
- {fileID: 8137720222258884206}
|
||||
m_Father: {fileID: 7962283254459483698}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &604100889191375676
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 123332925323670007}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &7231553591477896172
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 123332925323670007}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0, g: 0, b: 0, a: 0.36862746}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_Type: 1
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!114 &5427468017432232242
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 123332925323670007}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_WrapAround: 0
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 0, g: 0, b: 0, a: 0.64705884}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_PressedColor: {r: 0.6509434, g: 0.6509434, b: 0.6509434, a: 1}
|
||||
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
m_SpriteState:
|
||||
m_HighlightedSprite: {fileID: 0}
|
||||
m_PressedSprite: {fileID: 0}
|
||||
m_SelectedSprite: {fileID: 0}
|
||||
m_DisabledSprite: {fileID: 0}
|
||||
m_AnimationTriggers:
|
||||
m_NormalTrigger: Normal
|
||||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_SelectedTrigger: Selected
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 7231553591477896172}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!114 &5883971941730404980
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 123332925323670007}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_IgnoreLayout: 0
|
||||
m_MinWidth: 70
|
||||
m_MinHeight: -1
|
||||
m_PreferredWidth: 90
|
||||
m_PreferredHeight: -1
|
||||
m_FlexibleWidth: -1
|
||||
m_FlexibleHeight: -1
|
||||
m_LayoutPriority: 1
|
||||
--- !u!1 &222217343785305476
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6634203918711018630}
|
||||
- component: {fileID: 3328190567514003159}
|
||||
m_Layer: 5
|
||||
m_Name: Spacer
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &6634203918711018630
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 222217343785305476}
|
||||
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: 7962283254459483698}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &3328190567514003159
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 222217343785305476}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_IgnoreLayout: 0
|
||||
m_MinWidth: 20
|
||||
m_MinHeight: -1
|
||||
m_PreferredWidth: 20
|
||||
m_PreferredHeight: -1
|
||||
m_FlexibleWidth: -1
|
||||
m_FlexibleHeight: -1
|
||||
m_LayoutPriority: 1
|
||||
--- !u!1 &407167005608020107
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -798,7 +993,6 @@ RectTransform:
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 7962283254459483698}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
@@ -856,7 +1050,6 @@ RectTransform:
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 3373501020589239246}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
@@ -891,7 +1084,7 @@ MonoBehaviour:
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_text: Rand.pol
|
||||
m_text: .pol
|
||||
m_isRightToLeft: 0
|
||||
m_fontAsset: {fileID: 11400000, guid: 9e1d886e63529bb4ca3c95ece3e3189c, type: 2}
|
||||
m_sharedMaterial: {fileID: 2847917559404452115, guid: 9e1d886e63529bb4ca3c95ece3e3189c, type: 2}
|
||||
@@ -991,7 +1184,6 @@ RectTransform:
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1132578971298683386}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
@@ -1026,7 +1218,7 @@ MonoBehaviour:
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_text: Rand.mp3
|
||||
m_text: .mp3
|
||||
m_isRightToLeft: 0
|
||||
m_fontAsset: {fileID: 11400000, guid: 9e1d886e63529bb4ca3c95ece3e3189c, type: 2}
|
||||
m_sharedMaterial: {fileID: 2847917559404452115, guid: 9e1d886e63529bb4ca3c95ece3e3189c, type: 2}
|
||||
@@ -1125,7 +1317,6 @@ RectTransform:
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 7962283254459483698}
|
||||
m_RootOrder: 5
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
@@ -1184,7 +1375,6 @@ RectTransform:
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 3750006351507706086}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
@@ -1339,7 +1529,6 @@ RectTransform:
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 4092775554206660067}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
@@ -1374,7 +1563,7 @@ MonoBehaviour:
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_text: Rand.cvd
|
||||
m_text: .cvd
|
||||
m_isRightToLeft: 0
|
||||
m_fontAsset: {fileID: 11400000, guid: 9e1d886e63529bb4ca3c95ece3e3189c, type: 2}
|
||||
m_sharedMaterial: {fileID: 2847917559404452115, guid: 9e1d886e63529bb4ca3c95ece3e3189c, type: 2}
|
||||
@@ -1477,7 +1666,6 @@ RectTransform:
|
||||
m_Children:
|
||||
- {fileID: 5870585403592386036}
|
||||
m_Father: {fileID: 7962283254459483698}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
@@ -1579,13 +1767,425 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_IgnoreLayout: 0
|
||||
m_MinWidth: 100
|
||||
m_MinWidth: 70
|
||||
m_MinHeight: -1
|
||||
m_PreferredWidth: 130
|
||||
m_PreferredWidth: 90
|
||||
m_PreferredHeight: -1
|
||||
m_FlexibleWidth: -1
|
||||
m_FlexibleHeight: -1
|
||||
m_LayoutPriority: 1
|
||||
--- !u!1 &2947227701195518834
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2658584545682974620}
|
||||
- component: {fileID: 7422590011005632888}
|
||||
- component: {fileID: 6500588021136579712}
|
||||
m_Layer: 5
|
||||
m_Name: Text (TMP)
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &2658584545682974620
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2947227701195518834}
|
||||
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: 6582776844639506297}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &7422590011005632888
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2947227701195518834}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &6500588021136579712
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2947227701195518834}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_text: Extract all .cpk files
|
||||
m_isRightToLeft: 0
|
||||
m_fontAsset: {fileID: 11400000, guid: 9e1d886e63529bb4ca3c95ece3e3189c, type: 2}
|
||||
m_sharedMaterial: {fileID: 2847917559404452115, guid: 9e1d886e63529bb4ca3c95ece3e3189c, type: 2}
|
||||
m_fontSharedMaterials: []
|
||||
m_fontMaterial: {fileID: 0}
|
||||
m_fontMaterials: []
|
||||
m_fontColor32:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_enableVertexGradient: 0
|
||||
m_colorMode: 3
|
||||
m_fontColorGradient:
|
||||
topLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
topRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_fontColorGradientPreset: {fileID: 0}
|
||||
m_spriteAsset: {fileID: 0}
|
||||
m_tintAllSprites: 0
|
||||
m_StyleSheet: {fileID: 0}
|
||||
m_TextStyleHashCode: -1183493901
|
||||
m_overrideHtmlColors: 0
|
||||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 18
|
||||
m_fontSizeBase: 18
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 2
|
||||
m_VerticalAlignment: 512
|
||||
m_textAlignment: 65535
|
||||
m_characterSpacing: 0
|
||||
m_wordSpacing: 0
|
||||
m_lineSpacing: 0
|
||||
m_lineSpacingMax: 0
|
||||
m_paragraphSpacing: 0
|
||||
m_charWidthMaxAdj: 0
|
||||
m_enableWordWrapping: 1
|
||||
m_wordWrappingRatios: 0.4
|
||||
m_overflowMode: 0
|
||||
m_linkedTextComponent: {fileID: 0}
|
||||
parentLinkedComponent: {fileID: 0}
|
||||
m_enableKerning: 1
|
||||
m_enableExtraPadding: 0
|
||||
checkPaddingRequired: 0
|
||||
m_isRichText: 1
|
||||
m_parseCtrlCharacters: 1
|
||||
m_isOrthographic: 1
|
||||
m_isCullingEnabled: 0
|
||||
m_horizontalMapping: 0
|
||||
m_verticalMapping: 0
|
||||
m_uvLineOffset: 0
|
||||
m_geometrySortingOrder: 0
|
||||
m_IsTextObjectScaleStatic: 0
|
||||
m_VertexBufferAutoSizeReduction: 0
|
||||
m_useMaxVisibleDescender: 1
|
||||
m_pageToDisplay: 1
|
||||
m_margin: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_isUsingLegacyAnimationComponent: 0
|
||||
m_isVolumetricText: 0
|
||||
m_hasFontAssetChanged: 0
|
||||
m_baseMaterial: {fileID: 0}
|
||||
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
|
||||
--- !u!1 &3232201893406930060
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6582776844639506297}
|
||||
- component: {fileID: 3529433856739080931}
|
||||
- component: {fileID: 1709686290378542934}
|
||||
- component: {fileID: 560139499795418513}
|
||||
- component: {fileID: 158177184262401696}
|
||||
m_Layer: 5
|
||||
m_Name: ExtractAllCpkButton
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &6582776844639506297
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3232201893406930060}
|
||||
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:
|
||||
- {fileID: 2658584545682974620}
|
||||
m_Father: {fileID: 7962283254459483698}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &3529433856739080931
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3232201893406930060}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &1709686290378542934
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3232201893406930060}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0, g: 0, b: 0, a: 0.36862746}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_Type: 1
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!114 &560139499795418513
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3232201893406930060}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_WrapAround: 0
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 0, g: 0, b: 0, a: 0.64705884}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_PressedColor: {r: 0.6509434, g: 0.6509434, b: 0.6509434, a: 1}
|
||||
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
m_SpriteState:
|
||||
m_HighlightedSprite: {fileID: 0}
|
||||
m_PressedSprite: {fileID: 0}
|
||||
m_SelectedSprite: {fileID: 0}
|
||||
m_DisabledSprite: {fileID: 0}
|
||||
m_AnimationTriggers:
|
||||
m_NormalTrigger: Normal
|
||||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_SelectedTrigger: Selected
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 1709686290378542934}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!114 &158177184262401696
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3232201893406930060}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_IgnoreLayout: 0
|
||||
m_MinWidth: 100
|
||||
m_MinHeight: -1
|
||||
m_PreferredWidth: 120
|
||||
m_PreferredHeight: -1
|
||||
m_FlexibleWidth: -1
|
||||
m_FlexibleHeight: -1
|
||||
m_LayoutPriority: 1
|
||||
--- !u!1 &3879705876358869609
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8137720222258884206}
|
||||
- component: {fileID: 4018928636488071206}
|
||||
- component: {fileID: 4325337656176874974}
|
||||
m_Layer: 5
|
||||
m_Name: Text (TMP)
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &8137720222258884206
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3879705876358869609}
|
||||
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: 4368649423705725990}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &4018928636488071206
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3879705876358869609}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &4325337656176874974
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3879705876358869609}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_text: '.mov
|
||||
|
||||
'
|
||||
m_isRightToLeft: 0
|
||||
m_fontAsset: {fileID: 11400000, guid: 9e1d886e63529bb4ca3c95ece3e3189c, type: 2}
|
||||
m_sharedMaterial: {fileID: 2847917559404452115, guid: 9e1d886e63529bb4ca3c95ece3e3189c, type: 2}
|
||||
m_fontSharedMaterials: []
|
||||
m_fontMaterial: {fileID: 0}
|
||||
m_fontMaterials: []
|
||||
m_fontColor32:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_enableVertexGradient: 0
|
||||
m_colorMode: 3
|
||||
m_fontColorGradient:
|
||||
topLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
topRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_fontColorGradientPreset: {fileID: 0}
|
||||
m_spriteAsset: {fileID: 0}
|
||||
m_tintAllSprites: 0
|
||||
m_StyleSheet: {fileID: 0}
|
||||
m_TextStyleHashCode: -1183493901
|
||||
m_overrideHtmlColors: 0
|
||||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 18
|
||||
m_fontSizeBase: 18
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 2
|
||||
m_VerticalAlignment: 512
|
||||
m_textAlignment: 65535
|
||||
m_characterSpacing: 0
|
||||
m_wordSpacing: 0
|
||||
m_lineSpacing: 0
|
||||
m_lineSpacingMax: 0
|
||||
m_paragraphSpacing: 0
|
||||
m_charWidthMaxAdj: 0
|
||||
m_enableWordWrapping: 1
|
||||
m_wordWrappingRatios: 0.4
|
||||
m_overflowMode: 0
|
||||
m_linkedTextComponent: {fileID: 0}
|
||||
parentLinkedComponent: {fileID: 0}
|
||||
m_enableKerning: 1
|
||||
m_enableExtraPadding: 0
|
||||
checkPaddingRequired: 0
|
||||
m_isRichText: 1
|
||||
m_parseCtrlCharacters: 1
|
||||
m_isOrthographic: 1
|
||||
m_isCullingEnabled: 0
|
||||
m_horizontalMapping: 0
|
||||
m_verticalMapping: 0
|
||||
m_uvLineOffset: 0
|
||||
m_geometrySortingOrder: 0
|
||||
m_IsTextObjectScaleStatic: 0
|
||||
m_VertexBufferAutoSizeReduction: 0
|
||||
m_useMaxVisibleDescender: 1
|
||||
m_pageToDisplay: 1
|
||||
m_margin: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_isUsingLegacyAnimationComponent: 0
|
||||
m_isVolumetricText: 0
|
||||
m_hasFontAssetChanged: 0
|
||||
m_baseMaterial: {fileID: 0}
|
||||
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
|
||||
--- !u!1 &4205777939607344913
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1618,7 +2218,6 @@ RectTransform:
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 3750006351507706086}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
@@ -1742,6 +2341,62 @@ MonoBehaviour:
|
||||
m_FlexibleWidth: 1
|
||||
m_FlexibleHeight: -1
|
||||
m_LayoutPriority: 1
|
||||
--- !u!1 &4644526841211930874
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 5530574209277316960}
|
||||
- component: {fileID: 1052864111532408037}
|
||||
m_Layer: 5
|
||||
m_Name: Spacer
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &5530574209277316960
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4644526841211930874}
|
||||
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: 7962283254459483698}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1052864111532408037
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4644526841211930874}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_IgnoreLayout: 0
|
||||
m_MinWidth: 20
|
||||
m_MinHeight: -1
|
||||
m_PreferredWidth: 20
|
||||
m_PreferredHeight: -1
|
||||
m_FlexibleWidth: -1
|
||||
m_FlexibleHeight: -1
|
||||
m_LayoutPriority: 1
|
||||
--- !u!1 &4717529239480754811
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1768,6 +2423,7 @@ Transform:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4717529239480754811}
|
||||
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}
|
||||
@@ -1776,7 +2432,6 @@ Transform:
|
||||
- {fileID: 1713758292}
|
||||
- {fileID: 2142775987}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &431003956
|
||||
MonoBehaviour:
|
||||
@@ -1797,6 +2452,8 @@ MonoBehaviour:
|
||||
randomCvdButton: {fileID: 3463608508234468754}
|
||||
randomMv3Button: {fileID: 584360810}
|
||||
randomMp3Button: {fileID: 4620712651305624973}
|
||||
randomMovButton: {fileID: 5427468017432232242}
|
||||
extractAllCpkFilesButton: {fileID: 560139499795418513}
|
||||
audioSource: {fileID: 2142775988}
|
||||
fpsCounter: {fileID: 5259780322708739529}
|
||||
--- !u!82 &4596748654320625574
|
||||
@@ -1941,7 +2598,6 @@ RectTransform:
|
||||
m_Children:
|
||||
- {fileID: 7447090365930112548}
|
||||
m_Father: {fileID: 7962283254459483698}
|
||||
m_RootOrder: 6
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
@@ -2043,9 +2699,9 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_IgnoreLayout: 0
|
||||
m_MinWidth: 100
|
||||
m_MinWidth: 70
|
||||
m_MinHeight: -1
|
||||
m_PreferredWidth: 130
|
||||
m_PreferredWidth: 90
|
||||
m_PreferredHeight: -1
|
||||
m_FlexibleWidth: -1
|
||||
m_FlexibleHeight: -1
|
||||
@@ -2080,7 +2736,6 @@ RectTransform:
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 7962283254459483698}
|
||||
m_RootOrder: 3
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
@@ -2139,16 +2794,19 @@ RectTransform:
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 6582776844639506297}
|
||||
- {fileID: 5530574209277316960}
|
||||
- {fileID: 3373501020589239246}
|
||||
- {fileID: 6717038802837746639}
|
||||
- {fileID: 4092775554206660067}
|
||||
- {fileID: 2490674917526170126}
|
||||
- {fileID: 584360809}
|
||||
- {fileID: 6634203918711018630}
|
||||
- {fileID: 4368649423705725990}
|
||||
- {fileID: 4382597048068323552}
|
||||
- {fileID: 1132578971298683386}
|
||||
- {fileID: 746519510}
|
||||
m_Father: {fileID: 1713758292}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 0}
|
||||
@@ -2172,6 +2830,7 @@ Canvas:
|
||||
m_OverrideSorting: 0
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingBucketNormalizedSize: 0
|
||||
m_VertexColorAlwaysGammaSpace: 0
|
||||
m_AdditionalShaderChannelsFlag: 25
|
||||
m_UpdateRectTransformForStandalone: 0
|
||||
m_SortingLayerID: 0
|
||||
@@ -2277,7 +2936,6 @@ RectTransform:
|
||||
m_Children:
|
||||
- {fileID: 3698878601942552789}
|
||||
m_Father: {fileID: 7962283254459483698}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
@@ -2379,9 +3037,9 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_IgnoreLayout: 0
|
||||
m_MinWidth: 100
|
||||
m_MinWidth: 70
|
||||
m_MinHeight: -1
|
||||
m_PreferredWidth: 130
|
||||
m_PreferredWidth: 90
|
||||
m_PreferredHeight: -1
|
||||
m_FlexibleWidth: -1
|
||||
m_FlexibleHeight: -1
|
||||
@@ -2421,7 +3079,6 @@ RectTransform:
|
||||
- {fileID: 3668306928943904264}
|
||||
- {fileID: 7258066314304171550}
|
||||
m_Father: {fileID: 1713758292}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
@@ -2445,6 +3102,7 @@ Canvas:
|
||||
m_OverrideSorting: 0
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingBucketNormalizedSize: 0
|
||||
m_VertexColorAlwaysGammaSpace: 0
|
||||
m_AdditionalShaderChannelsFlag: 25
|
||||
m_UpdateRectTransformForStandalone: 0
|
||||
m_SortingLayerID: 0
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -34,12 +34,11 @@ RectTransform:
|
||||
m_Children:
|
||||
- {fileID: 3008098735699080031}
|
||||
m_Father: {fileID: 351020356915406194}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: -40, y: -20}
|
||||
m_SizeDelta: {x: -40, y: -10}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &4862410139821972608
|
||||
CanvasRenderer:
|
||||
@@ -168,7 +167,6 @@ RectTransform:
|
||||
m_Children:
|
||||
- {fileID: 6402332024803516576}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: -1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
@@ -192,6 +190,7 @@ Canvas:
|
||||
m_OverrideSorting: 0
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingBucketNormalizedSize: 0
|
||||
m_VertexColorAlwaysGammaSpace: 0
|
||||
m_AdditionalShaderChannelsFlag: 25
|
||||
m_UpdateRectTransformForStandalone: 0
|
||||
m_SortingLayerID: 0
|
||||
@@ -268,12 +267,11 @@ RectTransform:
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 6402332024803516576}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: -50, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &143571606391487229
|
||||
CanvasRenderer:
|
||||
@@ -335,7 +333,7 @@ MonoBehaviour:
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 1
|
||||
m_fontSizeMin: 18
|
||||
m_fontSizeMax: 21
|
||||
m_fontSizeMax: 24
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 2
|
||||
m_VerticalAlignment: 512
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2024, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -7,10 +7,10 @@ Shader "Pal3/Dev"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
|
||||
_MainTex ("Texture", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader
|
||||
SubShader
|
||||
{
|
||||
Tags { "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" }
|
||||
LOD 100
|
||||
@@ -18,7 +18,7 @@ Shader "Pal3/Dev"
|
||||
ZWrite Off
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
|
||||
Pass
|
||||
Pass
|
||||
{
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
@@ -37,7 +37,7 @@ Shader "Pal3/Dev"
|
||||
struct v2f {
|
||||
float4 vertex : SV_POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
UNITY_FOG_COORDS(1)
|
||||
UNITY_FOG_COORDS(7)
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
@@ -58,8 +58,8 @@ Shader "Pal3/Dev"
|
||||
half4 frag (v2f i) : SV_Target
|
||||
{
|
||||
half4 col = tex2D(_MainTex, i.texcoord);
|
||||
UNITY_APPLY_FOG(i.fogCoord, col);
|
||||
col.a = 0.5;
|
||||
UNITY_APPLY_FOG(i.fogCoord, col);
|
||||
return col;
|
||||
}
|
||||
ENDCG
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2024, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
Shader "Pal3/Opaque"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
|
||||
_MainTex ("Texture", 2D) = "white" {}
|
||||
_TintColor ("Tint color", Color) = (1.0, 1.0, 1.0, 1.0)
|
||||
|
||||
|
||||
_HasShadowTex ("Has Shadow Texture", Range(0, 1)) = 0.0
|
||||
_ShadowTex ("Shadow Texture", 2D) = "white" {}
|
||||
_Exposure("Exposure Amount", Range(0.1, 1.0)) = 0.4
|
||||
@@ -12,67 +17,70 @@ Shader "Pal3/Opaque"
|
||||
SubShader
|
||||
{
|
||||
Lighting Off
|
||||
|
||||
|
||||
Tags { "QUEUE" = "Geometry" }
|
||||
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags{ "Qeueue" = "Geometry" }
|
||||
Blend Off
|
||||
ZWrite On
|
||||
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma target 2.0
|
||||
#pragma multi_compile_fog
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct appdata_t
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
float2 shadowcoord : TEXCOORD1;
|
||||
float2 texcoord0 : TEXCOORD0;
|
||||
float2 texcoord1 : TEXCOORD1;
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 vertex : SV_POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
float2 shadowcoord : TEXCOORD1;
|
||||
float2 texcoord0 : TEXCOORD0;
|
||||
float2 texcoord1 : TEXCOORD1;
|
||||
UNITY_FOG_COORDS(7)
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
float4 _MainTex_ST;
|
||||
float4 _TintColor;
|
||||
|
||||
|
||||
float _HasShadowTex;
|
||||
sampler2D _ShadowTex;
|
||||
float4 _ShadowTex_ST;
|
||||
float _Exposure;
|
||||
|
||||
|
||||
v2f vert(appdata_t v)
|
||||
{
|
||||
v2f o;
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
|
||||
o.shadowcoord = TRANSFORM_TEX(v.shadowcoord, _ShadowTex);
|
||||
|
||||
o.texcoord0 = TRANSFORM_TEX(v.texcoord0, _MainTex);
|
||||
o.texcoord1 = TRANSFORM_TEX(v.texcoord1, _ShadowTex);
|
||||
UNITY_TRANSFER_FOG(o, o.vertex);
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag(v2f i) : SV_Target
|
||||
{
|
||||
half4 color = tex2D(_MainTex, i.texcoord);
|
||||
half4 color = tex2D(_MainTex, i.texcoord0);
|
||||
if(_HasShadowTex > 0.5f)
|
||||
{
|
||||
color *= tex2D(_ShadowTex, i.shadowcoord) / (1 - _Exposure);
|
||||
color *= tex2D(_ShadowTex, i.texcoord1) / (1 - _Exposure);
|
||||
}
|
||||
color *= _TintColor;
|
||||
UNITY_APPLY_FOG(i.fogCoord, color);
|
||||
return color;
|
||||
}
|
||||
ENDCG
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2024, 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
|
||||
@@ -7,6 +11,7 @@ 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)
|
||||
@@ -16,25 +21,21 @@ Shader "Pal3/RoundedFrostedGlass"
|
||||
Category
|
||||
{
|
||||
// We must be transparent, so other objects are drawn before this one.
|
||||
Tags { "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Opaque" }
|
||||
Tags { "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" }
|
||||
|
||||
SubShader
|
||||
{
|
||||
Cull Off
|
||||
Lighting Off
|
||||
ZTest [unity_GUIZTestMode]
|
||||
ZWrite Off
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
|
||||
// Horizontal blur
|
||||
GrabPass
|
||||
{
|
||||
"_HBlur"
|
||||
}
|
||||
/*
|
||||
ZTest Off
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
*/
|
||||
|
||||
Cull Off
|
||||
Lighting Off
|
||||
ZWrite Off
|
||||
//ZTest [unity_GUIZTestMode]
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
|
||||
Pass
|
||||
{
|
||||
@@ -84,7 +85,7 @@ Shader "Pal3/RoundedFrostedGlass"
|
||||
return outsideDistance + insideDistance - absoluteRound;
|
||||
}
|
||||
|
||||
inline float CalcAlpha(float2 samplePosition, float2 size, float radius){
|
||||
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;
|
||||
@@ -100,19 +101,20 @@ Shader "Pal3/RoundedFrostedGlass"
|
||||
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);
|
||||
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
|
||||
#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);
|
||||
@@ -129,6 +131,7 @@ Shader "Pal3/RoundedFrostedGlass"
|
||||
sum.g * _MultiplyColor.g + _AdditiveColor.g,
|
||||
sum.b * _MultiplyColor.b + _AdditiveColor.b,
|
||||
tex2D(_MainTex, i.uvmain).a);
|
||||
result.a *= _Transparency;
|
||||
return result;
|
||||
}
|
||||
ENDCG
|
||||
@@ -188,7 +191,7 @@ Shader "Pal3/RoundedFrostedGlass"
|
||||
return outsideDistance + insideDistance - absoluteRound;
|
||||
}
|
||||
|
||||
inline float CalcAlpha(float2 samplePosition, float2 size, float radius){
|
||||
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;
|
||||
@@ -204,13 +207,14 @@ Shader "Pal3/RoundedFrostedGlass"
|
||||
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);
|
||||
const float alpha = calcAlpha(i.uvmain, _WidthHeightRadius.xy, _WidthHeightRadius.z);
|
||||
half4 cutoffColor = mixAlpha(tex2D(_MainTex, i.uvmain), _AdditiveColor, alpha);
|
||||
clip(cutoffColor.a - 0.001);
|
||||
|
||||
@@ -228,12 +232,12 @@ Shader "Pal3/RoundedFrostedGlass"
|
||||
sum += GRABPIXEL(0.09, +3.0);
|
||||
sum += GRABPIXEL(0.05, +4.0);
|
||||
|
||||
half4 blurResult = half4(sum.r * _MultiplyColor.r + _AdditiveColor.r,
|
||||
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);
|
||||
|
||||
return blurResult;
|
||||
result.a *= _Transparency;
|
||||
return result;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
|
||||
@@ -0,0 +1,185 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2024, 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"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_xSpeed ("Snow falling speed [X axis]", Range(0.1, 5)) = 2.0
|
||||
_ySpeed ("Snow falling speed [y axis]", Range(0.1, 5)) = 1.0
|
||||
}
|
||||
|
||||
HLSLINCLUDE
|
||||
#include "Packages/com.unity.postprocessing/PostProcessing/Shaders/StdLib.hlsl"
|
||||
TEXTURE2D_SAMPLER2D(_MainTex, sampler_MainTex);
|
||||
|
||||
#define vec2 float2
|
||||
#define vec3 float3
|
||||
#define vec4 float4
|
||||
#define mod fmod
|
||||
#define fract frac
|
||||
|
||||
float _xSpeed;
|
||||
float _ySpeed;
|
||||
|
||||
// This shader uses noise shaders by stegu -- http://webstaff.itn.liu.se/~stegu/
|
||||
// This is supposed to look like snow falling, for example like
|
||||
// http://24.media.tumblr.com/tumblr_mdhvqrK2EJ1rcru73o1_500.gif
|
||||
|
||||
vec2 mod289(vec2 x) {
|
||||
return x - floor(x * (1.0 / 289.0)) * 289.0;
|
||||
}
|
||||
|
||||
vec3 mod289(vec3 x) {
|
||||
return x - floor(x * (1.0 / 289.0)) * 289.0;
|
||||
}
|
||||
|
||||
vec4 mod289(vec4 x) {
|
||||
return x - floor(x * (1.0 / 289.0)) * 289.0;
|
||||
}
|
||||
|
||||
vec3 permute(vec3 x) {
|
||||
return mod289(((x*34.0)+1.0)*x);
|
||||
}
|
||||
|
||||
vec4 permute(vec4 x) {
|
||||
return mod((34.0 * x + 1.0) * x, 289.0);
|
||||
}
|
||||
|
||||
vec4 taylorInvSqrt(vec4 r)
|
||||
{
|
||||
return 1.79284291400159 - 0.85373472095314 * r;
|
||||
}
|
||||
|
||||
float snoise(vec2 v)
|
||||
{
|
||||
const vec4 C = vec4(0.211324865405187,0.366025403784439,-0.577350269189626,0.024390243902439);
|
||||
vec2 i = floor(v + dot(v, C.yy) );
|
||||
vec2 x0 = v - i + dot(i, C.xx);
|
||||
|
||||
vec2 i1;
|
||||
i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);
|
||||
vec4 x12 = x0.xyxy + C.xxzz;
|
||||
x12.xy -= i1;
|
||||
|
||||
i = mod289(i); // Avoid truncation effects in permutation
|
||||
vec3 p = permute( permute( i.y + vec3(0.0, i1.y, 1.0 ))
|
||||
+ i.x + vec3(0.0, i1.x, 1.0 ));
|
||||
|
||||
vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0);
|
||||
m = m*m ;
|
||||
m = m*m ;
|
||||
|
||||
vec3 x = 2.0 * fract(p * C.www) - 1.0;
|
||||
vec3 h = abs(x) - 0.5;
|
||||
vec3 ox = floor(x + 0.5);
|
||||
vec3 a0 = x - ox;
|
||||
|
||||
m *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h );
|
||||
|
||||
vec3 g;
|
||||
g.x = a0.x * x0.x + h.x * x0.y;
|
||||
g.yz = a0.yz * x12.xz + h.yz * x12.yw;
|
||||
|
||||
return 130.0 * dot(m, g);
|
||||
}
|
||||
|
||||
float cellular2x2(vec2 P)
|
||||
{
|
||||
#define K 0.142857142857 // 1/7
|
||||
#define K2 0.0714285714285 // K/2
|
||||
#define jitter 0.8 // jitter 1.0 makes F1 wrong more often
|
||||
|
||||
vec2 Pi = mod(floor(P), 289.0);
|
||||
vec2 Pf = fract(P);
|
||||
vec4 Pfx = Pf.x + vec4(-0.5, -1.5, -0.5, -1.5);
|
||||
vec4 Pfy = Pf.y + vec4(-0.5, -0.5, -1.5, -1.5);
|
||||
vec4 p = permute(Pi.x + vec4(0.0, 1.0, 0.0, 1.0));
|
||||
p = permute(p + Pi.y + vec4(0.0, 0.0, 1.0, 1.0));
|
||||
vec4 ox = mod(p, 7.0)*K+K2;
|
||||
vec4 oy = mod(floor(p*K),7.0)*K+K2;
|
||||
vec4 dx = Pfx + jitter*ox;
|
||||
vec4 dy = Pfy + jitter*oy;
|
||||
vec4 d = dx * dx + dy * dy; // d11, d12, d21 and d22, squared
|
||||
// Sort out the two smallest distances
|
||||
|
||||
// Cheat and pick only F1
|
||||
d.xy = min(d.xy, d.zw);
|
||||
d.x = min(d.x, d.y);
|
||||
return d.x; // F1 duplicated, F2 not computed
|
||||
}
|
||||
|
||||
float fbm(vec2 p) {
|
||||
float f = 0.0;
|
||||
float w = 0.5;
|
||||
for (int i = 0; i < 5; i ++) {
|
||||
f += w * snoise(p);
|
||||
p *= 2.;
|
||||
w *= 0.5;
|
||||
}
|
||||
return f;
|
||||
}
|
||||
|
||||
float4 Frag(VaryingsDefault i) : SV_Target
|
||||
{
|
||||
float2 uv = i.texcoord;
|
||||
float2 originUV = uv;
|
||||
const float time = _Time.y;
|
||||
|
||||
uv.x *= _ScreenParams.x / _ScreenParams.y;
|
||||
|
||||
vec2 GA = float2(0.0,0.0);
|
||||
GA.x -= time * _xSpeed;
|
||||
GA.y += time * _ySpeed;
|
||||
|
||||
float F1=0.0,F2=0.0,F3=0.0,F4=0.0,F5=0.0,N1=0.0,N2=0.0,N3=0.0,N4=0.0,N5=0.0;
|
||||
float A=0.0,A1=0.0,A2=0.0,A3=0.0,A4=0.0,A5=0.0;
|
||||
|
||||
// Attentuation
|
||||
A = (uv.x-(uv.y*0.3));
|
||||
A = clamp(A,0.0,1.0);
|
||||
|
||||
// Snow layers, somewhat like an fbm with worley layers.
|
||||
F1 = 1.0-cellular2x2((uv+(GA*0.1))*8.0);
|
||||
A1 = 1.0-(A*1.0);
|
||||
N1 = smoothstep(0.998,1.0,F1)*1.0*A1;
|
||||
|
||||
F2 = 1.0-cellular2x2((uv+(GA*0.2))*6.0);
|
||||
A2 = 1.0-(A*0.8);
|
||||
N2 = smoothstep(0.995,1.0,F2)*0.85*A2;
|
||||
|
||||
F3 = 1.0-cellular2x2((uv+(GA*0.4))*4.0);
|
||||
A3 = 1.0-(A*0.6);
|
||||
N3 = smoothstep(0.99,1.0,F3)*0.65*A3;
|
||||
|
||||
F4 = 1.0-cellular2x2((uv+(GA*0.6))*3.0);
|
||||
A4 = 1.0-(A*1.0);
|
||||
N4 = smoothstep(0.98,1.0,F4)*0.4*A4;
|
||||
|
||||
F5 = 1.0-cellular2x2((uv+(GA))*1.2);
|
||||
A5 = 1.0-(A*1.0);
|
||||
N5 = smoothstep(0.98,1.0,F5)*0.25*A5;
|
||||
|
||||
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);
|
||||
return col + snowColor;
|
||||
}
|
||||
ENDHLSL
|
||||
|
||||
SubShader
|
||||
{
|
||||
Cull Off ZWrite Off ZTest Always
|
||||
Pass
|
||||
{
|
||||
HLSLPROGRAM
|
||||
#pragma vertex VertDefault
|
||||
#pragma fragment Frag
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 310e70fe34ae470e9e0521e3fbb649d0
|
||||
timeCreated: 1693107269
|
||||
@@ -1,3 +1,8 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2024, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
Shader "Pal3/Sprite"
|
||||
{
|
||||
Properties
|
||||
@@ -8,12 +13,12 @@ Shader "Pal3/Sprite"
|
||||
{
|
||||
Tags { "Queue" = "Transparent" }
|
||||
LOD 100
|
||||
|
||||
|
||||
Pass
|
||||
{
|
||||
Blend SrcAlpha One
|
||||
ZWrite Off
|
||||
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
@@ -1,94 +1,102 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2024, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
Shader "Pal3/Transparent"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
|
||||
_MainTex ("Texture", 2D) = "white" {}
|
||||
_TintColor ("Tint color", Color) = (1.0, 1.0, 1.0, 1.0)
|
||||
_Threshold ("Transparent Threshold", Range(0, 1)) = 1.0
|
||||
|
||||
|
||||
_HasShadowTex ("Has Shadow Texture", Range(0, 1)) = 0.0
|
||||
_ShadowTex ("Shadow Texture", 2D) = "white" {}
|
||||
_Exposure("Exposure Amount", Range(0.1, 1.0)) = 0.4
|
||||
|
||||
|
||||
[Enum(UnityEngine.Rendering.BlendMode)]
|
||||
_BlendSrcFactor("Source Blend Factor", int) = 5 // BlendMode.SrcAlpha as Default
|
||||
|
||||
|
||||
[Enum(UnityEngine.Rendering.BlendMode)]
|
||||
_BlendDstFactor("Dest Blend Factor", int) = 10 // BlendMode.OneMinusSrcAlpha as Default
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
Lighting Off
|
||||
|
||||
|
||||
Tags { "Queue" = "Transparent" }
|
||||
|
||||
|
||||
// Pass 2 ,transparent part
|
||||
Pass
|
||||
{
|
||||
Blend [_BlendSrcFactor] [_BlendDstFactor]
|
||||
ZWrite Off
|
||||
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma target 2.0
|
||||
|
||||
#pragma multi_compile_fog
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct appdata_t
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
float2 shadowcoord : TEXCOORD1;
|
||||
float2 texcoord0 : TEXCOORD0;
|
||||
float2 texcoord1 : TEXCOORD1;
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 vertex : SV_POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
float2 shadowcoord : TEXCOORD1;
|
||||
|
||||
float2 texcoord0 : TEXCOORD0;
|
||||
float2 texcoord1 : TEXCOORD1;
|
||||
UNITY_FOG_COORDS(7)
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
float4 _MainTex_ST;
|
||||
float _Threshold;
|
||||
|
||||
|
||||
float _HasShadowTex;
|
||||
sampler2D _ShadowTex;
|
||||
float4 _ShadowTex_ST;
|
||||
float _Exposure;
|
||||
|
||||
float4 _TintColor;
|
||||
|
||||
|
||||
v2f vert(appdata_t v)
|
||||
{
|
||||
v2f o;
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
|
||||
o.shadowcoord = TRANSFORM_TEX(v.shadowcoord, _ShadowTex);
|
||||
o.texcoord0 = TRANSFORM_TEX(v.texcoord0, _MainTex);
|
||||
o.texcoord1 = TRANSFORM_TEX(v.texcoord1, _ShadowTex);
|
||||
UNITY_TRANSFER_FOG(o, o.vertex);
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag(v2f i) : SV_Target
|
||||
{
|
||||
half4 color = tex2D(_MainTex, i.texcoord);
|
||||
half4 color = tex2D(_MainTex, i.texcoord0);
|
||||
const float alpha = color.a;
|
||||
if(color.a >= _Threshold)
|
||||
{
|
||||
discard;
|
||||
}
|
||||
|
||||
|
||||
if(_HasShadowTex > 0.5f)
|
||||
{
|
||||
color *= tex2D(_ShadowTex, i.shadowcoord) / (1 - _Exposure);
|
||||
color *= tex2D(_ShadowTex, i.texcoord1) / (1 - _Exposure);
|
||||
color.a = alpha;
|
||||
}
|
||||
color *= _TintColor;
|
||||
UNITY_APPLY_FOG(i.fogCoord, color);
|
||||
return color;
|
||||
}
|
||||
ENDCG
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2024, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
Shader "Pal3/TransparentOpaquePart"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
|
||||
_MainTex ("Texture", 2D) = "white" {}
|
||||
_TintColor ("Tint color", Color) = (1.0, 1.0, 1.0, 1.0)
|
||||
_Threshold ("Transparent Threshold", Range(0, 1)) = 1.0
|
||||
|
||||
|
||||
_HasShadowTex ("Has Shadow Texture", Range(0, 1)) = 0.0
|
||||
_ShadowTex ("Shadow Texture", 2D) = "white" {}
|
||||
_Exposure("Exposure Amount", Range(0.1, 1.0)) = 0.4
|
||||
@@ -13,43 +18,44 @@ Shader "Pal3/TransparentOpaquePart"
|
||||
SubShader
|
||||
{
|
||||
Lighting Off
|
||||
|
||||
|
||||
Tags { "Qeueue" = "Geometry" }
|
||||
|
||||
|
||||
// pass 1 , opaque part
|
||||
Pass
|
||||
{
|
||||
Blend Off
|
||||
ZWrite On
|
||||
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma target 2.0
|
||||
#pragma multi_compile_fog
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct appdata_t
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
float2 shadowcoord : TEXCOORD1;
|
||||
float2 texcoord0 : TEXCOORD0;
|
||||
float2 texcoord1 : TEXCOORD1;
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 vertex : SV_POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
float2 shadowcoord : TEXCOORD1;
|
||||
|
||||
float2 texcoord0 : TEXCOORD0;
|
||||
float2 texcoord1 : TEXCOORD1;
|
||||
UNITY_FOG_COORDS(7)
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
float4 _MainTex_ST;
|
||||
float _Threshold;
|
||||
|
||||
|
||||
float _HasShadowTex;
|
||||
sampler2D _ShadowTex;
|
||||
float4 _ShadowTex_ST;
|
||||
@@ -63,22 +69,23 @@ Shader "Pal3/TransparentOpaquePart"
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
|
||||
o.shadowcoord = TRANSFORM_TEX(v.shadowcoord, _ShadowTex);
|
||||
|
||||
o.texcoord0 = TRANSFORM_TEX(v.texcoord0, _MainTex);
|
||||
o.texcoord1 = TRANSFORM_TEX(v.texcoord1, _ShadowTex);
|
||||
UNITY_TRANSFER_FOG(o, o.vertex);
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag(v2f i) : SV_Target
|
||||
{
|
||||
half4 color = tex2D(_MainTex, i.texcoord);
|
||||
half4 color = tex2D(_MainTex, i.texcoord0);
|
||||
clip(color.a - _Threshold);
|
||||
|
||||
if(_HasShadowTex > 0.5f)
|
||||
{
|
||||
color *= tex2D(_ShadowTex, i.shadowcoord) / (1 - _Exposure);
|
||||
color *= tex2D(_ShadowTex, i.texcoord1) / (1 - _Exposure);
|
||||
}
|
||||
color *= _TintColor;
|
||||
UNITY_APPLY_FOG(i.fogCoord, color);
|
||||
return color;
|
||||
}
|
||||
ENDCG
|
||||
|
||||
@@ -1,60 +1,67 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2024, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
Shader "Pal3/Water"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
// main texture
|
||||
_MainTex ("Main texture", 2D) = "white" {}
|
||||
|
||||
_MainTex ("Texture", 2D) = "white" {}
|
||||
|
||||
// alpha value
|
||||
_Alpha ("Alpha",Range(0, 1)) = 0.5
|
||||
|
||||
|
||||
_Exposure("Exposure Amount", Range(0.1, 1.0)) = 0.3
|
||||
|
||||
|
||||
// pre baked shadow texture
|
||||
_ShadowTex ("Shadow texture", 2D) = "white" {}
|
||||
_HasShadowTex ("Has Shadow Texture", Range(0, 1)) = 0.0
|
||||
|
||||
|
||||
[Enum(UnityEngine.Rendering.BlendMode)]
|
||||
_BlendSrcFactor("Source Blend Factor", int) = 5 // BlendMode.SrcAlpha as Default
|
||||
|
||||
|
||||
[Enum(UnityEngine.Rendering.BlendMode)]
|
||||
_BlendDstFactor("Dest Blend Factor", int) = 10 // BlendMode.OneMinusSrcAlpha as Default
|
||||
}
|
||||
|
||||
|
||||
SubShader
|
||||
{
|
||||
Lighting Off
|
||||
|
||||
|
||||
Tags { "QUEUE" = "Transparent-1" } // -1 to fix sorting order issue with semi-transparent trees etc.
|
||||
|
||||
|
||||
Pass
|
||||
{
|
||||
Blend [_BlendSrcFactor] [_BlendDstFactor]
|
||||
ZWrite Off
|
||||
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma target 2.0
|
||||
|
||||
#pragma multi_compile_fog
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct appdata_t
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
float2 texcoord2 : TEXCOORD1;
|
||||
float2 texcoord0 : TEXCOORD0;
|
||||
float2 texcoord1 : TEXCOORD1;
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 vertex : SV_POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
float2 texcoord2 : TEXCOORD1;
|
||||
float2 texcoord0 : TEXCOORD0;
|
||||
float2 texcoord1 : TEXCOORD1;
|
||||
UNITY_FOG_COORDS(7)
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
|
||||
sampler2D _MainTex;
|
||||
float4 _MainTex_ST;
|
||||
|
||||
@@ -64,25 +71,26 @@ Shader "Pal3/Water"
|
||||
float _HasShadowTex;
|
||||
sampler2D _ShadowTex;
|
||||
float4 _ShadowTex_ST;
|
||||
|
||||
|
||||
v2f vert(appdata_t v)
|
||||
{
|
||||
v2f o;
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
|
||||
o.texcoord2 = TRANSFORM_TEX(v.texcoord2, _ShadowTex);
|
||||
|
||||
o.texcoord0 = TRANSFORM_TEX(v.texcoord0, _MainTex);
|
||||
o.texcoord1 = TRANSFORM_TEX(v.texcoord1, _ShadowTex);
|
||||
UNITY_TRANSFER_FOG(o, o.vertex);
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag(v2f i) : SV_Target
|
||||
{
|
||||
const half4 color = tex2D(_MainTex, i.texcoord);
|
||||
const half4 colorShadow = tex2D(_ShadowTex, i.texcoord2);
|
||||
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);
|
||||
return mixedColor;
|
||||
}
|
||||
ENDCG
|
||||
|
||||
@@ -26,6 +26,7 @@ RenderTexture:
|
||||
m_UseDynamicScale: 0
|
||||
m_BindMS: 0
|
||||
m_EnableCompatibleFormat: 1
|
||||
m_EnableRandomWrite: 0
|
||||
m_TextureSettings:
|
||||
serializedVersion: 2
|
||||
m_FilterMode: 1
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
@@ -0,0 +1,140 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c171273b4d327f14d8016fcbe864a769
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 12
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 0
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: 4
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Server
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,711 +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: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||
m_FogMode: 3
|
||||
m_FogDensity: 0.01
|
||||
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
|
||||
m_AmbientMode: 0
|
||||
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, 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: 512
|
||||
m_PVRBounces: 2
|
||||
m_PVREnvironmentSampleCount: 256
|
||||
m_PVREnvironmentReferencePointCount: 2048
|
||||
m_PVRFilteringMode: 1
|
||||
m_PVRDenoiserTypeDirect: 1
|
||||
m_PVRDenoiserTypeIndirect: 1
|
||||
m_PVRDenoiserTypeAO: 1
|
||||
m_PVRFilterTypeDirect: 0
|
||||
m_PVRFilterTypeIndirect: 0
|
||||
m_PVRFilterTypeAO: 0
|
||||
m_PVREnvironmentMIS: 1
|
||||
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: 0}
|
||||
m_LightingSettings: {fileID: 0}
|
||||
--- !u!196 &4
|
||||
NavMeshSettings:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
serializedVersion: 3
|
||||
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
|
||||
buildHeightMesh: 0
|
||||
maxJobWorkers: 0
|
||||
preserveTilesOutsideBounds: 0
|
||||
debug:
|
||||
m_Flags: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1001 &43282729
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 332266281639726118, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 332266281639726118, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 332266281639726118, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 332266281639726118, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 631692333086074477, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 631692333086074477, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 631692333086074477, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 631692333086074477, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 631692333086074477, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 631692333086074477, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1155776204911317598, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1155776204911317598, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1155776204911317598, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1155776204911317598, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1155776204911317598, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1155776204911317598, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1581516270290878550, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1581516270290878550, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1581516270290878550, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1581516270290878550, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1581516270290878550, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1581516270290878550, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1614348180326526211, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_text
|
||||
value: "\u5267\u60C5\u70B9\u6216\u51FA\u53E3"
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2546561680202900797, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2546561680202900797, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3491202665095195611, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3596785283706710040, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_Material
|
||||
value:
|
||||
objectReference: {fileID: 256925267}
|
||||
- target: {fileID: 4209774545385276068, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4209774545385276068, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4209774545385276068, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4209774545385276068, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4209774545385276068, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4209774545385276068, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4255555531165553146, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4255555531165553146, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4255555531165553146, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4255555531165553146, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4255555531165553146, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4255555531165553146, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5077207798598084246, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_Material
|
||||
value:
|
||||
objectReference: {fileID: 1661395006}
|
||||
- target: {fileID: 6514349001384511054, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_Material
|
||||
value:
|
||||
objectReference: {fileID: 91034975}
|
||||
- target: {fileID: 6936565495695538149, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6936565495695538149, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6936565495695538149, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6936565495695538149, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6936565495695538149, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6936565495695538149, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7184533148466444589, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_Pivot.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7184533148466444589, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_Pivot.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7184533148466444589, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7184533148466444589, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7184533148466444589, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_LocalScale.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7184533148466444589, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_LocalScale.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7184533148466444589, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_LocalScale.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7184533148466444589, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7184533148466444589, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7184533148466444589, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7184533148466444589, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7184533148466444589, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8627381932629902481, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Pal3 Game
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8627381932629902483, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_RootOrder
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8627381932629902483, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8627381932629902483, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8627381932629902483, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8627381932629902483, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8627381932629902483, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8627381932629902483, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8627381932629902483, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8627381932629902483, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8627381932629902483, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8627381932629902483, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8946444568899493682, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8946444568899493682, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8946444568899493682, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8946444568899493682, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8946444568899493682, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8946444568899493682, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8946678118750326748, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8946678118750326748, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8946678118750326748, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8946678118750326748, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8946678118750326748, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8946678118750326748, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9166793672834017742, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0.00012207031
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9166793672834029268, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9166793672834029268, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9166793672834029268, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9166793672834030092, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9166793672834030092, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9166793672834030092, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9166793672834030092, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9166793672834030092, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9166793672834030092, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9166793672834056758, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9166793672834056758, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9166793672834056758, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9166793672834056758, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9166793672834056758, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9166793672834056758, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9166793672834088468, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9166793672834088468, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9166793672834088468, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9166793672834088468, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9166793672834088468, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9166793672834088468, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9166793672834089322, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9166793672834089322, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9166793672834089322, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9166793672834089322, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9166793672834089322, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9166793672834089322, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9166793672834115320, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9166793672834115320, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9166793672834115320, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9166793672834115320, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9166793672834115320, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9166793672834115320, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: e86d7889291c041ba854821fd25047d6, type: 3}
|
||||
--- !u!21 &91034975
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Pal3/RoundedFrostedGlass
|
||||
m_Shader: {fileID: 4800000, guid: 7207745e33764e88af7a51d39feb7b81, type: 3}
|
||||
m_Parent: {fileID: 0}
|
||||
m_ModifiedSerializedProperties: 0
|
||||
m_ValidKeywords: []
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses: []
|
||||
m_LockedProperties:
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _BlurAmount: 4
|
||||
m_Colors:
|
||||
- _AdditiveColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
|
||||
- _MultiplyColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||
- _WidthHeightRadius: {r: 800, g: 600, b: 65, a: 0}
|
||||
m_BuildTextureStacks: []
|
||||
--- !u!21 &256925267
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Pal3/RoundedFrostedGlass
|
||||
m_Shader: {fileID: 4800000, guid: 7207745e33764e88af7a51d39feb7b81, type: 3}
|
||||
m_Parent: {fileID: 0}
|
||||
m_ModifiedSerializedProperties: 0
|
||||
m_ValidKeywords: []
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses: []
|
||||
m_LockedProperties:
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _BlurAmount: 3
|
||||
m_Colors:
|
||||
- _AdditiveColor: {r: 0.039215688, g: 0.039215688, b: 0.039215688, a: 1}
|
||||
- _MultiplyColor: {r: 0.54901963, g: 0.54901963, b: 0.54901963, a: 1}
|
||||
- _WidthHeightRadius: {r: 1024, g: 220, b: 35, a: 0}
|
||||
m_BuildTextureStacks: []
|
||||
--- !u!21 &1661395006
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Pal3/RoundedFrostedGlass
|
||||
m_Shader: {fileID: 4800000, guid: 7207745e33764e88af7a51d39feb7b81, type: 3}
|
||||
m_Parent: {fileID: 0}
|
||||
m_ModifiedSerializedProperties: 0
|
||||
m_ValidKeywords: []
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses: []
|
||||
m_LockedProperties:
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _BlurAmount: 4
|
||||
m_Colors:
|
||||
- _AdditiveColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
|
||||
- _MultiplyColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||
- _WidthHeightRadius: {r: 800, g: 600, b: 65, a: 0}
|
||||
m_BuildTextureStacks: []
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2024, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2024, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,183 +0,0 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Core.Animation
|
||||
{
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Threading;
|
||||
using UnityEngine;
|
||||
|
||||
public enum AnimationCurveType
|
||||
{
|
||||
// OG game only has these two
|
||||
Linear = 0,
|
||||
Sine = 1,
|
||||
|
||||
// New ones added by me
|
||||
Quadratic = 2,
|
||||
Cubic = 3,
|
||||
Exponential = 4,
|
||||
EaseIn = 5,
|
||||
EaseOut = 6,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Provides helper functions to do Transform animations etc.
|
||||
/// </summary>
|
||||
public static class CoreAnimation
|
||||
{
|
||||
// Progress -> (0,1)
|
||||
private static float GetInterpolationRatio(float progress, AnimationCurveType curveType)
|
||||
{
|
||||
return curveType switch
|
||||
{
|
||||
AnimationCurveType.Linear => progress,
|
||||
AnimationCurveType.Sine => Mathf.Sin(progress * (Mathf.PI / 2)),
|
||||
AnimationCurveType.Quadratic => Mathf.Pow(progress, 2),
|
||||
AnimationCurveType.Cubic => Mathf.Pow(progress, 3),
|
||||
AnimationCurveType.Exponential => Mathf.Exp(progress) - 1,
|
||||
AnimationCurveType.EaseIn => Mathf.Pow(progress, 3),
|
||||
AnimationCurveType.EaseOut => 1 - Mathf.Pow(1 - progress, 3),
|
||||
_ => progress
|
||||
};
|
||||
}
|
||||
|
||||
public static IEnumerator EnumerateValueAsync(float from,
|
||||
float to,
|
||||
float duration,
|
||||
AnimationCurveType curveType,
|
||||
Action<float> onValueChanged,
|
||||
CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (Mathf.Abs(duration) < Mathf.Epsilon)
|
||||
{
|
||||
onValueChanged?.Invoke(to);
|
||||
yield break;
|
||||
}
|
||||
|
||||
var timePast = 0f;
|
||||
while (timePast < duration && !cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
var newValue = Mathf.Lerp(from, to,
|
||||
GetInterpolationRatio(timePast / duration, curveType));
|
||||
onValueChanged?.Invoke(newValue);
|
||||
timePast += Time.deltaTime;
|
||||
yield return null;
|
||||
}
|
||||
|
||||
if (!cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
onValueChanged?.Invoke(to);
|
||||
}
|
||||
yield return null;
|
||||
}
|
||||
|
||||
public static IEnumerator MoveAsync(this Transform target,
|
||||
Vector3 toPosition,
|
||||
float duration,
|
||||
AnimationCurveType curveType = AnimationCurveType.Linear,
|
||||
CancellationToken cancellationToken = default)
|
||||
{
|
||||
Vector3 oldPosition = target.position;
|
||||
|
||||
var timePast = 0f;
|
||||
while (timePast < duration && target != null && !cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
target.position = oldPosition + (toPosition - oldPosition) *
|
||||
GetInterpolationRatio(timePast / duration, curveType);
|
||||
timePast += Time.deltaTime;
|
||||
yield return null;
|
||||
}
|
||||
|
||||
if (target != null && !cancellationToken.IsCancellationRequested) target.position = toPosition;
|
||||
yield return null;
|
||||
}
|
||||
|
||||
public static IEnumerator ShakeAsync(this Transform target,
|
||||
float duration,
|
||||
float amplitude,
|
||||
bool shakeOnXAxis,
|
||||
bool shakeOnYAxis,
|
||||
bool shakeOnZAxis)
|
||||
{
|
||||
Vector3 originalPosition = target.localPosition;
|
||||
|
||||
while (duration > 0 && target != null)
|
||||
{
|
||||
Vector3 delta = UnityEngine.Random.insideUnitSphere * amplitude;
|
||||
target.localPosition = originalPosition + new Vector3(
|
||||
shakeOnXAxis ? delta.x : 0f,
|
||||
shakeOnYAxis ? delta.y : 0f,
|
||||
shakeOnZAxis ? delta.z : 0f);
|
||||
duration -= Time.deltaTime;
|
||||
yield return null;
|
||||
}
|
||||
|
||||
if (target != null) target.localPosition = originalPosition;
|
||||
yield return null;
|
||||
}
|
||||
|
||||
public static IEnumerator OrbitAroundCenterPointAsync(this Transform target,
|
||||
Quaternion toRotation,
|
||||
Vector3 centerPoint,
|
||||
float duration,
|
||||
AnimationCurveType curveType,
|
||||
float distanceDelta,
|
||||
CancellationToken cancellationToken = default)
|
||||
{
|
||||
var distance = Vector3.Distance(target.position, centerPoint);
|
||||
Quaternion startRotation = target.rotation;
|
||||
|
||||
var timePast = 0f;
|
||||
while (timePast < duration && target != null && !cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
Quaternion rotation = Quaternion.Lerp(startRotation, toRotation,
|
||||
GetInterpolationRatio(timePast / duration, curveType));
|
||||
|
||||
Vector3 direction = (rotation * Vector3.forward).normalized;
|
||||
Vector3 newPosition = centerPoint + direction * -(distance + (timePast / duration) * distanceDelta);
|
||||
|
||||
target.rotation = rotation;
|
||||
target.position = newPosition;
|
||||
|
||||
timePast += Time.deltaTime;
|
||||
yield return null;
|
||||
}
|
||||
|
||||
if (target != null && !cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
target.rotation = toRotation;
|
||||
target.position = centerPoint + (toRotation * Vector3.forward).normalized * -(distance + distanceDelta);
|
||||
}
|
||||
|
||||
yield return null;
|
||||
}
|
||||
|
||||
public static IEnumerator RotateAsync(this Transform target,
|
||||
Quaternion toRotation,
|
||||
float duration,
|
||||
AnimationCurveType curveType,
|
||||
CancellationToken cancellationToken = default)
|
||||
{
|
||||
Quaternion startRotation = target.rotation;
|
||||
|
||||
var timePast = 0f;
|
||||
while (timePast < duration && target != null && !cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
Quaternion rotation = Quaternion.Lerp(startRotation, toRotation,
|
||||
GetInterpolationRatio(timePast / duration, curveType));
|
||||
|
||||
target.rotation = rotation;
|
||||
|
||||
timePast += Time.deltaTime;
|
||||
yield return null;
|
||||
}
|
||||
|
||||
if (target != null && !cancellationToken.IsCancellationRequested) target.rotation = toRotation;
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Core.DataLoader
|
||||
{
|
||||
using DataReader.Bmp;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// .bmp file loader and Texture2D converter.
|
||||
/// </summary>
|
||||
public sealed class BmpTextureLoader : ITextureLoader
|
||||
{
|
||||
private BmpFile _image;
|
||||
|
||||
public void Load(byte[] data, out bool hasAlphaChannel)
|
||||
{
|
||||
hasAlphaChannel = false;
|
||||
_image = new BmpFileReader().Read(data);
|
||||
}
|
||||
|
||||
public Texture2D ToTexture2D()
|
||||
{
|
||||
if (_image == null) return null;
|
||||
|
||||
var texture = new Texture2D(_image.Info.AbsWidth,
|
||||
_image.Info.AbsHeight,
|
||||
TextureFormat.RGBA32,
|
||||
mipChain: false);
|
||||
|
||||
if (_image.Info.Height < 0)
|
||||
{
|
||||
FlipImage();
|
||||
}
|
||||
|
||||
texture.SetPixels32(_image.ImageData);
|
||||
texture.Apply();
|
||||
return texture;
|
||||
}
|
||||
|
||||
// flip image if height is negative
|
||||
private void FlipImage()
|
||||
{
|
||||
if (_image.Info.Height > 0)
|
||||
return;
|
||||
int w = _image.Info.AbsWidth;
|
||||
int h = _image.Info.AbsHeight;
|
||||
int h2 = h / 2;
|
||||
for (int y = 0; y < h2; y++)
|
||||
{
|
||||
for(int x = 0, o1=y*w, o2=(h-y-1)*w; x < w; x++,o1++,o2++)
|
||||
{
|
||||
(_image.ImageData[o1], _image.ImageData[o2]) = (_image.ImageData[o2], _image.ImageData[o1]);
|
||||
}
|
||||
}
|
||||
_image.Info.Height = h;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Core.DataLoader
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
||||
using DataReader.Dxt;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// .dds file loader and Texture2D converter.
|
||||
/// </summary>
|
||||
public sealed class DxtTextureLoader : ITextureLoader
|
||||
{
|
||||
private int _width;
|
||||
private int _height;
|
||||
private byte[] _rawData;
|
||||
private TextureFormat _format;
|
||||
|
||||
public void Load(byte[] data, out bool hasAlphaChannel)
|
||||
{
|
||||
using var stream = new MemoryStream(data);
|
||||
using var reader = new BinaryReader(stream);
|
||||
|
||||
if (!IsValidDxtFile(reader))
|
||||
{
|
||||
throw new ArgumentException($"Not a valid DXT file.");
|
||||
}
|
||||
|
||||
DxtHeader header = DxtHeader.ReadHeader(reader);
|
||||
var format = header.DxtPixelFormat.Format;
|
||||
|
||||
_width = header.Width;
|
||||
_height = header.Height;
|
||||
|
||||
switch (format)
|
||||
{
|
||||
case "DXT1":
|
||||
hasAlphaChannel = false;
|
||||
LoadDxt1Texture(data);
|
||||
break;
|
||||
case "DXT3":
|
||||
hasAlphaChannel = true;
|
||||
LoadDxt3Texture(data);
|
||||
break;
|
||||
case "DXT5":
|
||||
throw new NotImplementedException("DXT5 decoder not implemented yet.");
|
||||
default:
|
||||
throw new Exception($"Texture format: {format} not supported.");
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsValidDxtFile(BinaryReader reader)
|
||||
{
|
||||
var header = new string(reader.ReadChars(4));
|
||||
if (header == "DDS ") return true;
|
||||
Debug.Log($"Invalid DXT header: {header}");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Texture2D.LoadRawTextureData does not support DXT1 format on iOS/Android
|
||||
// devices so we have to manually decode it to RGBA32(RGB888) format and then
|
||||
// invoke LoadRawTextureData method later to convert it to Texture2D.
|
||||
private void LoadDxt1Texture(byte[] data)
|
||||
{
|
||||
_rawData = Dxt1Decoder.ToRgba32(data, _width, _height);
|
||||
_format = TextureFormat.RGBA32;
|
||||
}
|
||||
|
||||
// Texture2D.LoadRawTextureData does not support DXT3 format
|
||||
// so we have to manually decode it to RGBA32(RGB888) format and then
|
||||
// invoke LoadRawTextureData method later to convert it to Texture2D.
|
||||
private void LoadDxt3Texture(byte[] data)
|
||||
{
|
||||
_rawData = Dxt3Decoder.ToRgba32(data, _width, _height);
|
||||
_format = TextureFormat.RGBA32;
|
||||
}
|
||||
|
||||
public Texture2D ToTexture2D()
|
||||
{
|
||||
if (_rawData == null) return null;
|
||||
Texture2D texture = new Texture2D(_width, _height, _format, mipChain: false);
|
||||
texture.LoadRawTextureData(_rawData);
|
||||
texture.Apply();
|
||||
return texture;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Core.DataLoader
|
||||
{
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// Texture2D provider.
|
||||
/// </summary>
|
||||
public interface ITextureResourceProvider
|
||||
{
|
||||
string GetTexturePath(string name);
|
||||
|
||||
Texture2D GetTexture(string name);
|
||||
|
||||
Texture2D GetTexture(string name, out bool hasAlphaChannel);
|
||||
}
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Core.DataLoader
|
||||
{
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// .tga file loader and Texture2D converter.
|
||||
/// </summary>
|
||||
public sealed class TgaTextureLoader : ITextureLoader
|
||||
{
|
||||
private Color32[] _pixels;
|
||||
private short _width;
|
||||
private short _height;
|
||||
|
||||
public unsafe void Load(byte[] data, out bool hasAlphaChannel)
|
||||
{
|
||||
byte bitDepth;
|
||||
|
||||
fixed (byte* p = &data[12])
|
||||
{
|
||||
_width = *(short*)p;
|
||||
_height = *(short*)(p + 2);
|
||||
bitDepth = *(p + 4);
|
||||
}
|
||||
|
||||
var dataStartIndex = 18;
|
||||
_pixels = new Color32[_width * _height];
|
||||
|
||||
switch (bitDepth)
|
||||
{
|
||||
case 32:
|
||||
hasAlphaChannel = Convert32BitData(data, dataStartIndex);
|
||||
break;
|
||||
case 24:
|
||||
hasAlphaChannel = false;
|
||||
Convert24BitData(data, dataStartIndex);
|
||||
break;
|
||||
default:
|
||||
throw new Exception("TGA texture had non 32/24 bit depth.");
|
||||
}
|
||||
}
|
||||
|
||||
private unsafe bool Convert32BitData(byte[] data, int startIndex)
|
||||
{
|
||||
bool hasAlphaChannel = false;
|
||||
fixed (byte* srcStart = &data[startIndex], dstStart = &_pixels[0].r)
|
||||
{
|
||||
var firstAlpha = *(srcStart + 3);
|
||||
byte* src = srcStart, dst = dstStart;
|
||||
for (var i = 0; i < _width * _height; i++, src += 4, dst += 4)
|
||||
{
|
||||
*dst = *(src + 2);
|
||||
*(dst + 1) = *(src + 1);
|
||||
*(dst + 2) = *src;
|
||||
|
||||
var alpha = *(src + 3);
|
||||
*(dst + 3) = alpha;
|
||||
|
||||
if (alpha != firstAlpha) hasAlphaChannel = true;
|
||||
}
|
||||
}
|
||||
return hasAlphaChannel;
|
||||
}
|
||||
|
||||
private unsafe void Convert24BitData(byte[] data, int startIndex)
|
||||
{
|
||||
fixed (byte* srcStart = &data[startIndex], dstStart = &_pixels[0].r)
|
||||
{
|
||||
byte* src = srcStart, dst = dstStart;
|
||||
for (var i = 0; i < _width * _height; i++, src += 3, dst += 4)
|
||||
{
|
||||
*dst = *(src + 2);
|
||||
*(dst + 1) = *(src + 1);
|
||||
*(dst + 2) = *src;
|
||||
*(dst + 3) = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Texture2D ToTexture2D()
|
||||
{
|
||||
if (_pixels == null) return null;
|
||||
var texture = new Texture2D(_width, _height, TextureFormat.RGBA32, mipChain: false);
|
||||
texture.SetPixels32(_pixels);
|
||||
texture.Apply();
|
||||
return texture;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Core.DataReader.Bmp
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public sealed class BmpFile
|
||||
{
|
||||
public BmpFileHeader Header;
|
||||
public BitmapInfoHeader Info;
|
||||
public uint RMask = 0x00FF0000;
|
||||
public uint GMask = 0x0000FF00;
|
||||
public uint BMask = 0x000000FF;
|
||||
public uint AMask = 0x00000000;
|
||||
public List<Color32> Palette;
|
||||
public Color32[] ImageData;
|
||||
|
||||
// private void ReplaceColor(Color32 aColorToSearch, Color32 aReplacementColor)
|
||||
// {
|
||||
// Color32 s = aColorToSearch;
|
||||
// for (int i = 0; i < ImageData.Length; i++)
|
||||
// {
|
||||
// Color32 c = ImageData[i];
|
||||
// if (c.r == s.r && c.g == s.g && c.b == s.b && c.a == s.a)
|
||||
// ImageData[i] = aReplacementColor;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private void ReplaceFirstPixelColor(Color32 aReplacementColor)
|
||||
// {
|
||||
// ReplaceColor(ImageData[0], aReplacementColor);
|
||||
// }
|
||||
//
|
||||
// public void ReplaceFirstPixelColorWithTransparency()
|
||||
// {
|
||||
// ReplaceFirstPixelColor(new Color32(0, 0, 0, 0));
|
||||
// }
|
||||
}
|
||||
}
|
||||
@@ -1,337 +0,0 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Core.DataReader.Cpk
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using Lzo;
|
||||
using Utils;
|
||||
|
||||
/// <summary>
|
||||
/// Load and create a structural mapping of the internal
|
||||
/// file system model within the CPK archive for accessing
|
||||
/// the file entities stored inside the archive.
|
||||
/// </summary>
|
||||
public sealed class CpkArchive
|
||||
{
|
||||
private const uint SUPPORTED_CPK_VERSION = 1;
|
||||
private const uint CPK_HEADER_MAGIC = 0x_1A_54_53_52; // CPK header magic label
|
||||
private const int CPK_DEFAULT_MAX_NUM_OF_FILE = 32768; // Max number of files per archive
|
||||
|
||||
private readonly string _filePath;
|
||||
private readonly Crc32Hash _crcHash;
|
||||
private readonly int _codepage;
|
||||
private Dictionary<uint, CpkTableEntity> _tableEntities;
|
||||
|
||||
private readonly Dictionary<uint, byte[]> _fileNameMap = new ();
|
||||
private readonly Dictionary<uint, uint> _crcToTableIndexMap = new ();
|
||||
private readonly Dictionary<uint, HashSet<uint>> _fatherCrcToChildCrcTableIndexMap = new ();
|
||||
|
||||
private bool _archiveInMemory;
|
||||
private byte[] _archiveData;
|
||||
|
||||
public CpkArchive(string cpkFilePath, Crc32Hash crcHash, int codepage)
|
||||
{
|
||||
if (!File.Exists(cpkFilePath))
|
||||
{
|
||||
throw new ArgumentException($"游戏数据加载失败,游戏原CPK压缩包不存在: {cpkFilePath}");
|
||||
}
|
||||
|
||||
_filePath = cpkFilePath;
|
||||
_crcHash = crcHash;
|
||||
_codepage = codepage;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Load the CPK file from file system and read header + index table.
|
||||
/// </summary>
|
||||
public void Init()
|
||||
{
|
||||
using var stream = new FileStream(_filePath,
|
||||
FileMode.Open,
|
||||
FileAccess.Read,
|
||||
FileShare.ReadWrite,
|
||||
bufferSize: 8196,
|
||||
FileOptions.SequentialScan); // Use SequentialScan option to increase reading speed
|
||||
|
||||
var header = Utility.ReadStruct<CpkHeader>(stream);
|
||||
|
||||
if (!IsValidCpkHeader(header))
|
||||
{
|
||||
throw new InvalidDataException($"File: {_filePath} is not a valid CPK file.");
|
||||
}
|
||||
|
||||
var cpkTableEntitySize = Marshal.SizeOf(typeof(CpkTableEntity));
|
||||
var indexTableSize = cpkTableEntitySize * CPK_DEFAULT_MAX_NUM_OF_FILE;
|
||||
Span<byte> indexTableBuffer = new byte[indexTableSize];
|
||||
// Read the whole index table into memory before processing
|
||||
// to avoid I/O overhead
|
||||
_ = stream.Read(indexTableBuffer);
|
||||
|
||||
_tableEntities = new Dictionary<uint, CpkTableEntity>((int)header.FileNum);
|
||||
|
||||
var numOfFiles = header.FileNum;
|
||||
var maxFileCount = header.MaxFileNum;
|
||||
var filesFound = 0;
|
||||
var indexTableOffset = 0;
|
||||
for (uint i = 0; i < maxFileCount; i++)
|
||||
{
|
||||
var tableEntity = Utility.ReadStruct<CpkTableEntity>(indexTableBuffer, indexTableOffset);
|
||||
indexTableOffset += cpkTableEntitySize;
|
||||
if (tableEntity.IsEmpty() || tableEntity.IsDeleted()) continue;
|
||||
|
||||
_tableEntities[i] = tableEntity;
|
||||
filesFound++;
|
||||
if (numOfFiles == filesFound) break;
|
||||
}
|
||||
|
||||
BuildCrcIndexMap();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Extract the complete archive to the specified destination
|
||||
/// </summary>
|
||||
public void ExtractTo(string outputFolder)
|
||||
{
|
||||
ExtractToInternal(outputFolder, GetRootEntries());
|
||||
}
|
||||
|
||||
private void ExtractToInternal(string outputFolder, IEnumerable<CpkEntry> nodes)
|
||||
{
|
||||
foreach (CpkEntry node in nodes)
|
||||
{
|
||||
var relativePath = node.VirtualPath.Replace(
|
||||
CpkConstants.DirectorySeparator, Path.DirectorySeparatorChar);
|
||||
|
||||
if (node.IsDirectory)
|
||||
{
|
||||
new DirectoryInfo(outputFolder + relativePath).Create();
|
||||
ExtractToInternal(outputFolder, node.Children);
|
||||
}
|
||||
else
|
||||
{
|
||||
File.WriteAllBytes(outputFolder + relativePath, ReadAllBytes(node.VirtualPath));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if file exists inside the archive.
|
||||
/// </summary>
|
||||
/// <param name="fileVirtualPath">Virtualized file path inside CPK archive</param>
|
||||
/// <returns>True if file exists</returns>
|
||||
public bool FileExists(string fileVirtualPath)
|
||||
{
|
||||
var crc = _crcHash.Compute(fileVirtualPath.ToLower(), _codepage);
|
||||
return _crcToTableIndexMap.ContainsKey(crc);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read all bytes of the give file stored inside the archive.
|
||||
/// </summary>
|
||||
/// <param name="fileVirtualPath">Virtualized file path inside CPK archive</param>
|
||||
/// <returns>File content in byte array</returns>
|
||||
public byte[] ReadAllBytes(string fileVirtualPath)
|
||||
{
|
||||
return _archiveInMemory ?
|
||||
ReadAllBytesUsingInMemoryCache(fileVirtualPath) :
|
||||
GetFileContent(fileVirtualPath);
|
||||
}
|
||||
|
||||
private byte[] ReadAllBytesUsingInMemoryCache(string fileVirtualPath)
|
||||
{
|
||||
CpkTableEntity entity = ValidateAndGetTableEntity(fileVirtualPath);
|
||||
|
||||
byte[] data;
|
||||
|
||||
var start = (int) entity.StartPos;
|
||||
var end = (int) (entity.StartPos + entity.PackedSize);
|
||||
|
||||
if (entity.IsCompressed())
|
||||
{
|
||||
data = new byte[entity.OriginSize];
|
||||
MiniLzo.Decompress(_archiveData[start..end], data);
|
||||
}
|
||||
else
|
||||
{
|
||||
data = _archiveData[start..end];
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
private byte[] GetFileContent(string fileVirtualPath)
|
||||
{
|
||||
CpkTableEntity entity = ValidateAndGetTableEntity(fileVirtualPath);
|
||||
return GetFileContentInternal(entity);
|
||||
}
|
||||
|
||||
private byte[] GetFileContentInternal(CpkTableEntity entity)
|
||||
{
|
||||
byte[] rawData;
|
||||
|
||||
if (_archiveInMemory)
|
||||
{
|
||||
var start = (int) entity.StartPos;
|
||||
var end = (int) (entity.StartPos + entity.PackedSize);
|
||||
rawData = _archiveData[start..end];
|
||||
}
|
||||
else
|
||||
{
|
||||
using var stream = new FileStream(_filePath, FileMode.Open, FileAccess.Read);
|
||||
stream.Seek(entity.StartPos, SeekOrigin.Begin);
|
||||
var buffer = new byte[entity.PackedSize];
|
||||
_ = stream.Read(buffer, 0, (int)entity.PackedSize);
|
||||
rawData = buffer;
|
||||
}
|
||||
|
||||
if (!entity.IsCompressed()) return rawData;
|
||||
|
||||
var decompressedData = new byte[entity.OriginSize];
|
||||
MiniLzo.Decompress(rawData, decompressedData);
|
||||
return decompressedData;
|
||||
}
|
||||
|
||||
private CpkTableEntity ValidateAndGetTableEntity(string fileVirtualPath)
|
||||
{
|
||||
var crc = _crcHash.Compute(fileVirtualPath.ToLower(), _codepage);
|
||||
if (!_crcToTableIndexMap.ContainsKey(crc))
|
||||
{
|
||||
throw new ArgumentException($"<{fileVirtualPath}> does not exists in the archive.");
|
||||
}
|
||||
|
||||
CpkTableEntity entity = _tableEntities[_crcToTableIndexMap[crc]];
|
||||
|
||||
if (entity.IsDirectory())
|
||||
{
|
||||
throw new InvalidOperationException($"Cannot open <{fileVirtualPath}> since it is a directory.");
|
||||
}
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Preload archive into memory for faster read performance.
|
||||
/// </summary>
|
||||
public void LoadArchiveIntoMemory()
|
||||
{
|
||||
_archiveData = File.ReadAllBytes(_filePath);
|
||||
_archiveInMemory = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dispose in-memory archive data.
|
||||
/// </summary>
|
||||
public void DisposeInMemoryArchive()
|
||||
{
|
||||
_archiveInMemory = false;
|
||||
_archiveData = null;
|
||||
}
|
||||
|
||||
private static bool IsValidCpkHeader(CpkHeader header)
|
||||
{
|
||||
if (header.Label != CPK_HEADER_MAGIC) return false;
|
||||
if (header.Version != SUPPORTED_CPK_VERSION) return false;
|
||||
if (header.TableStart == 0) return false;
|
||||
if (header.FileNum > header.MaxFileNum) return false;
|
||||
if (header.ValidTableNum > header.MaxTableNum) return false;
|
||||
if (header.FileNum > header.ValidTableNum) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void BuildCrcIndexMap()
|
||||
{
|
||||
foreach ((var index, CpkTableEntity entity) in _tableEntities)
|
||||
{
|
||||
_crcToTableIndexMap[entity.CRC] = index;
|
||||
|
||||
if (_fatherCrcToChildCrcTableIndexMap.TryGetValue(entity.FatherCRC, out var childCrcTable))
|
||||
{
|
||||
childCrcTable.Add(entity.CRC);
|
||||
}
|
||||
else
|
||||
{
|
||||
_fatherCrcToChildCrcTableIndexMap[entity.FatherCRC] = new HashSet<uint> {entity.CRC};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Build a tree structure map of the internal file system
|
||||
/// and return the root nodes in CpkEntry format.
|
||||
/// </summary>
|
||||
/// <returns>Root level CpkEntry nodes</returns>
|
||||
public IEnumerable<CpkEntry> GetRootEntries()
|
||||
{
|
||||
if (_fileNameMap.Count == 0) BuildFileNameMap();
|
||||
return GetChildren(0);
|
||||
}
|
||||
|
||||
private void BuildFileNameMap()
|
||||
{
|
||||
Stream stream;
|
||||
if (_archiveInMemory)
|
||||
{
|
||||
stream = new MemoryStream(_archiveData);
|
||||
}
|
||||
else
|
||||
{
|
||||
stream = new FileStream(_filePath,
|
||||
FileMode.Open,
|
||||
FileAccess.Read,
|
||||
FileShare.ReadWrite,
|
||||
bufferSize: 8196,
|
||||
FileOptions.RandomAccess);
|
||||
}
|
||||
|
||||
foreach (CpkTableEntity entity in _tableEntities.Values)
|
||||
{
|
||||
long extraInfoOffset = entity.StartPos + entity.PackedSize;
|
||||
var extraInfo = new byte[entity.ExtraInfoSize];
|
||||
stream.Seek(extraInfoOffset, SeekOrigin.Begin);
|
||||
_ = stream.Read(extraInfo);
|
||||
|
||||
var fileName = Utility.TrimEnd(extraInfo, new byte[] { 0x00, 0x00 });
|
||||
_fileNameMap[entity.CRC] = fileName;
|
||||
}
|
||||
|
||||
stream.Close();
|
||||
stream.Dispose();
|
||||
}
|
||||
|
||||
private IEnumerable<CpkEntry> GetChildren(uint fatherCrc, string rootPath = "")
|
||||
{
|
||||
if (!_fatherCrcToChildCrcTableIndexMap.ContainsKey(fatherCrc))
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
|
||||
if (rootPath != string.Empty) rootPath += CpkConstants.DirectorySeparator;
|
||||
|
||||
foreach (var childCrc in _fatherCrcToChildCrcTableIndexMap[fatherCrc])
|
||||
{
|
||||
var index = _crcToTableIndexMap[childCrc];
|
||||
CpkTableEntity child = _tableEntities[index];
|
||||
var fileName = Encoding.GetEncoding(_codepage).GetString(_fileNameMap[child.CRC]);
|
||||
|
||||
var virtualPath = rootPath + fileName;
|
||||
|
||||
if (child.IsDirectory())
|
||||
{
|
||||
yield return new CpkEntry(virtualPath, true, GetChildren(child.CRC, virtualPath));
|
||||
}
|
||||
else
|
||||
{
|
||||
yield return new CpkEntry(virtualPath, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,154 +0,0 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Core.DataReader.Gdb
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
|
||||
public enum WuLingType
|
||||
{
|
||||
Water, // 水
|
||||
Fire, // 火
|
||||
Wind, // 风
|
||||
Thunder, // 雷
|
||||
Earth, // 土
|
||||
}
|
||||
|
||||
public enum ItemType
|
||||
{
|
||||
None = 0,
|
||||
Healing, // 治疗
|
||||
Throwable, // 投掷
|
||||
Treasure, // 仙宝
|
||||
Antique, // 古董
|
||||
Ore, // 矿石
|
||||
Plot, // 剧情
|
||||
Cloth, // 衣服
|
||||
Hat, // 帽子
|
||||
Shoes, // 鞋子
|
||||
Wearable, // 饰品
|
||||
Weapon, // 武器
|
||||
Corpse, // 尸块
|
||||
Blueprint, // 蓝图(梦溪杂录,美食方)
|
||||
}
|
||||
|
||||
public enum WeaponType
|
||||
{
|
||||
None = 0,
|
||||
Spear, // 长矛
|
||||
Sword, // 剑
|
||||
Staff, // 杖
|
||||
Machete, // 刀
|
||||
Bow, // 弓
|
||||
Spine, // 刺
|
||||
Sickle, // 镰刀
|
||||
}
|
||||
|
||||
public enum SpecialType
|
||||
{
|
||||
None = 0,
|
||||
Poison, // 随机中毒
|
||||
Flee, // 100%逃跑
|
||||
Navigation, // 引路蜂类
|
||||
LevelUp, // 升级类(等级提高1)
|
||||
}
|
||||
|
||||
public enum TargetRangeType
|
||||
{
|
||||
None = 0,
|
||||
FirstParty, // 我方单体
|
||||
FirstPartyAll, // 我方全体
|
||||
EnemyParty, // 敌方单体
|
||||
EnemyPartyAll, // 敌方全体
|
||||
}
|
||||
|
||||
public enum PlaceOfUseType
|
||||
{
|
||||
None = 0,
|
||||
Combat, // 战斗中
|
||||
OutOfCombat, // 非战斗中
|
||||
Anywhere, // 任何地方
|
||||
}
|
||||
|
||||
public enum ActorAttributeType
|
||||
{
|
||||
Hp, // 精
|
||||
Qi, // 气
|
||||
Mp, // 神
|
||||
Attack, // 攻击
|
||||
Defense, // 防御
|
||||
Speed, // 速度
|
||||
Luck, // 幸运
|
||||
Water, // 水
|
||||
Fire, // 火
|
||||
Wind, // 风
|
||||
Thunder, // 雷
|
||||
Earth, // 土
|
||||
}
|
||||
|
||||
public struct GameItem
|
||||
{
|
||||
public uint Id; // 物品ID
|
||||
|
||||
public string Name; // 物品名称
|
||||
public string ModelName; // 物品模型名称
|
||||
public string IconName; // 物品图标名称
|
||||
public string Description; // 物品描述
|
||||
public int Price; // 物品价格
|
||||
|
||||
public ItemType Type; // 物品类型
|
||||
public WeaponType WeaponType; // 武器类型(只有物品为武器的时候有意义)
|
||||
|
||||
public byte[] MainActorCanUse; // 主角可使用信息
|
||||
public byte[] WuLing; // 五灵属性
|
||||
|
||||
public int AncientValue; // 古董价值
|
||||
|
||||
public SpecialType SpecialType; // 特殊类型
|
||||
public TargetRangeType TargetRangeType; // 目标范围类型
|
||||
public PlaceOfUseType PlaceOfUseType; // 使用地点类型
|
||||
|
||||
public byte[] AttributeImpactType; // 角色属性影响类型 (0绝对值,1百分比值,2恢复到上限,3增加上限值)
|
||||
|
||||
// Empty byte between the memory addresses to align the data in memory.
|
||||
// SpecialType, TargetRangeType and PlaceOfUseType take 3 bytes in memory, thus we need to add 1 byte here
|
||||
// to align the data in memory (4 bytes).
|
||||
// Note: The padding byte is added after AttributeImpactType instead of before based on observation.
|
||||
internal byte PaddingByte;
|
||||
|
||||
public short[] AttributeImpactValue; // 角色属性影响值
|
||||
|
||||
public byte[] FightStateImpactType; // 战斗状态影响类型(0不影响,1增加,2解除)
|
||||
public short[] FightStateImpactValue; // 战斗状态值
|
||||
|
||||
public int ComboCount; // 连击次数
|
||||
|
||||
// 装备属性
|
||||
public short QiSavingPercentage; // 气消耗减少百分比
|
||||
public short MpSavingPercentage; // 神消耗减少百分比
|
||||
public short CriticalAttackAmplifyPercentage; // 暴击伤害增加百分比
|
||||
public short SpecialSkillSuccessRate; // 特技成功率增加百分比
|
||||
|
||||
// 尸块属性
|
||||
public uint OreId; // 矿石ID
|
||||
public uint ProductId; // 炼制出的物品ID
|
||||
public int ProductPrice; // 炼制出的物品价格
|
||||
|
||||
// 合成属性
|
||||
public uint[] SynthesisMaterialIds; // 两种合成材料的ID
|
||||
public uint SynthesisProductId; // 合成出的物品ID
|
||||
}
|
||||
|
||||
// Pal3 Game Database file
|
||||
public sealed class GdbFile
|
||||
{
|
||||
public Dictionary<int, GameItem> GameItems { get; } // Game item Id -> Game item
|
||||
|
||||
public GdbFile(Dictionary<int, GameItem> gameItems)
|
||||
{
|
||||
GameItems = gameItems;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Core.DataReader.Gdb
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Extensions;
|
||||
|
||||
public sealed class GdbFileReader : IFileReader<GdbFile>
|
||||
{
|
||||
private readonly int _codepage;
|
||||
|
||||
public GdbFileReader(int codepage)
|
||||
{
|
||||
_codepage = codepage;
|
||||
}
|
||||
|
||||
public GdbFile Read(byte[] data)
|
||||
{
|
||||
using var stream = new MemoryStream(data);
|
||||
using var reader = new BinaryReader(stream);
|
||||
|
||||
_ = reader.ReadString(128, _codepage); // header string
|
||||
|
||||
uint actorDataOffset = reader.ReadUInt32();
|
||||
int numOfActors = reader.ReadInt32();
|
||||
|
||||
uint skillDataOffset = reader.ReadUInt32();
|
||||
int numOfSkills = reader.ReadInt32();
|
||||
|
||||
uint itemDataOffset = reader.ReadUInt32();
|
||||
int numOfItems = reader.ReadInt32();
|
||||
|
||||
uint comboSkillDataOffset = reader.ReadUInt32();
|
||||
int numOfComboSkills = reader.ReadInt32();
|
||||
|
||||
reader.BaseStream.Seek(itemDataOffset, SeekOrigin.Begin);
|
||||
var gameItems = new Dictionary<int, GameItem>();
|
||||
for (var i = 0; i < numOfItems; i++)
|
||||
{
|
||||
GameItem item = ReadGameItem(reader, _codepage);
|
||||
gameItems[(int) item.Id] = item;
|
||||
}
|
||||
|
||||
return new GdbFile(gameItems);
|
||||
}
|
||||
|
||||
private static GameItem ReadGameItem(BinaryReader reader, int codepage)
|
||||
{
|
||||
return new GameItem
|
||||
{
|
||||
Id = reader.ReadUInt32(),
|
||||
Name = reader.ReadString(32, codepage),
|
||||
ModelName = reader.ReadString(30, codepage),
|
||||
IconName = reader.ReadString(30, codepage),
|
||||
Description = reader.ReadString(512, codepage),
|
||||
Price = reader.ReadInt32(),
|
||||
Type = (ItemType) reader.ReadByte(),
|
||||
WeaponType = (WeaponType) reader.ReadByte(),
|
||||
MainActorCanUse = reader.ReadBytes(5),
|
||||
WuLing = reader.ReadBytes(5),
|
||||
AncientValue = reader.ReadInt32(),
|
||||
SpecialType = (SpecialType) reader.ReadByte(), // ----------------| 1
|
||||
TargetRangeType = (TargetRangeType) reader.ReadByte(), // --------| 2
|
||||
PlaceOfUseType = (PlaceOfUseType) reader.ReadByte(), // ----------| 3
|
||||
AttributeImpactType = reader.ReadBytes(12),
|
||||
PaddingByte = reader.ReadByte(), // ------------------------------| ^ to complete 4-byte alignment
|
||||
AttributeImpactValue = reader.ReadInt16Array(12),
|
||||
FightStateImpactType = reader.ReadBytes(32),
|
||||
FightStateImpactValue = reader.ReadInt16Array(32),
|
||||
ComboCount = reader.ReadInt32(),
|
||||
QiSavingPercentage = reader.ReadInt16(),
|
||||
MpSavingPercentage = reader.ReadInt16(),
|
||||
CriticalAttackAmplifyPercentage = reader.ReadInt16(),
|
||||
SpecialSkillSuccessRate = reader.ReadInt16(),
|
||||
OreId = reader.ReadUInt32(),
|
||||
ProductId = reader.ReadUInt32(),
|
||||
ProductPrice = reader.ReadInt32(),
|
||||
SynthesisMaterialIds = reader.ReadUInt32Array(2),
|
||||
SynthesisProductId = reader.ReadUInt32()
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Core.DataReader
|
||||
{
|
||||
using System.IO;
|
||||
|
||||
/// <summary>
|
||||
/// File reader interface.
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public interface IFileReader<out T>
|
||||
{
|
||||
T Read(byte[] data)
|
||||
{
|
||||
using var stream = new MemoryStream(data);
|
||||
return Read(stream);
|
||||
}
|
||||
|
||||
T Read(Stream stream)
|
||||
{
|
||||
using var memoryStream = new MemoryStream();
|
||||
stream.CopyTo(memoryStream);
|
||||
return Read(memoryStream.ToArray());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,102 +0,0 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Core.DataReader.Nav
|
||||
{
|
||||
using GameBox;
|
||||
using UnityEngine;
|
||||
|
||||
// NAV (.nav) file header
|
||||
internal struct NavHeader
|
||||
{
|
||||
public string Label; // 4 char
|
||||
public byte Version;
|
||||
public byte NumberOfLayers;
|
||||
public uint TileOffset;
|
||||
public uint FaceOffset;
|
||||
}
|
||||
|
||||
public enum NavFloorKind
|
||||
{
|
||||
Default = 0, // 不可跳
|
||||
Jumpable, // 可跳过
|
||||
Soil, // 土
|
||||
Mud, // 泥
|
||||
River, // 水道(船状态)
|
||||
Snow, // 雪
|
||||
Wet, // 水浸
|
||||
Grass, // 草
|
||||
Wood, // 竹木
|
||||
Plant, // 植物
|
||||
Wetland, // 沼泽
|
||||
Sand, // 沙
|
||||
Metal, // 金属
|
||||
Rock1, // 熔岩
|
||||
Rock2, // 岩石基底地面
|
||||
Rock3, // 人工石地面
|
||||
Brick, // 砖
|
||||
DevilWorld1, // 异空间A
|
||||
DevilWorld2, // 异空间B
|
||||
DevilWorld3, // 异空间C
|
||||
Other, // 其它
|
||||
FloorIce, // 冰
|
||||
FloorBlood, // 血池
|
||||
FloorWater, // 水域
|
||||
}
|
||||
|
||||
public struct NavTile
|
||||
{
|
||||
public float GameBoxYPosition; // 格子地板高度(原GameBox引擎下的Y坐标单位)
|
||||
public byte DistanceToNearestObstacle; // 格子距离周边障碍物的距离 (0最小-7最大)
|
||||
public NavFloorKind FloorKind; // 格子地板类型:0~128索引普通地面属性(土草雪等),128~255索引机关序号
|
||||
|
||||
public bool IsObstacle; // 是否为障碍物
|
||||
|
||||
public bool IsWalkable()
|
||||
{
|
||||
return !IsObstacle && DistanceToNearestObstacle > 0 && FloorKind != NavFloorKind.Jumpable;
|
||||
}
|
||||
}
|
||||
|
||||
// public struct NavLayerNode
|
||||
// {
|
||||
// public GameBoxAABBox BoundBox;
|
||||
// public Vector3[] Triangles;
|
||||
// public int Level; // 0: root, child level = parent level + 1
|
||||
// public NavLayerNode[] Children; // 4
|
||||
// }
|
||||
|
||||
public struct NavTileLayer
|
||||
{
|
||||
public GameBoxRect[] Portals; // Max of 8
|
||||
public Vector3 Max;
|
||||
public Vector3 Min;
|
||||
public int Width;
|
||||
public int Height;
|
||||
public NavTile[] Tiles;
|
||||
}
|
||||
|
||||
public struct NavFaceLayer
|
||||
{
|
||||
public Vector3[] Vertices;
|
||||
public int[] Triangles;
|
||||
//public NavLayerNode[] Nodes;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// NAV (.nav) file model
|
||||
/// </summary>
|
||||
public sealed class NavFile
|
||||
{
|
||||
public NavTileLayer[] TileLayers { get; }
|
||||
public NavFaceLayer[] FaceLayers { get; }
|
||||
|
||||
public NavFile(NavTileLayer[] tileLayers, NavFaceLayer[] faceLayers)
|
||||
{
|
||||
TileLayers = tileLayers;
|
||||
FaceLayers = faceLayers;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,106 +0,0 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Core.Extensions
|
||||
{
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// BinaryReader extensions
|
||||
/// </summary>
|
||||
public static class BinaryReaderExtension
|
||||
{
|
||||
public static Vector3 ReadVector3(this BinaryReader binaryReader)
|
||||
{
|
||||
var x = binaryReader.ReadSingle();
|
||||
var y = binaryReader.ReadSingle();
|
||||
var z = binaryReader.ReadSingle();
|
||||
return new Vector3(x, y, z);
|
||||
}
|
||||
|
||||
public static Vector3[] ReadVector3Array(this BinaryReader binaryReader, int count)
|
||||
{
|
||||
var v3List = new Vector3[count];
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
v3List[i] = binaryReader.ReadVector3();
|
||||
}
|
||||
return v3List;
|
||||
}
|
||||
|
||||
public static Vector2 ReadVector2(this BinaryReader binaryReader)
|
||||
{
|
||||
var x = binaryReader.ReadSingle();
|
||||
var y = binaryReader.ReadSingle();
|
||||
return new Vector2(x, y);
|
||||
}
|
||||
|
||||
public static float[] ReadSingleArray(this BinaryReader binaryReader, int count)
|
||||
{
|
||||
var singles = new float[count];
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
singles[i] = binaryReader.ReadSingle();
|
||||
}
|
||||
return singles;
|
||||
}
|
||||
|
||||
public static int[] ReadInt32Array(this BinaryReader binaryReader, int count)
|
||||
{
|
||||
var integers = new int[count];
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
integers[i] = binaryReader.ReadInt32();
|
||||
}
|
||||
return integers;
|
||||
}
|
||||
|
||||
public static uint[] ReadUInt32Array(this BinaryReader binaryReader, int count)
|
||||
{
|
||||
var integers = new uint[count];
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
integers[i] = binaryReader.ReadUInt32();
|
||||
}
|
||||
return integers;
|
||||
}
|
||||
|
||||
public static short[] ReadInt16Array(this BinaryReader binaryReader, int count)
|
||||
{
|
||||
var integers = new short[count];
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
integers[i] = binaryReader.ReadInt16();
|
||||
}
|
||||
return integers;
|
||||
}
|
||||
|
||||
public static ushort[] ReadUInt16Array(this BinaryReader binaryReader, int count)
|
||||
{
|
||||
var integers = new ushort[count];
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
integers[i] = binaryReader.ReadUInt16();
|
||||
}
|
||||
return integers;
|
||||
}
|
||||
|
||||
public static string ReadAsciiString(this BinaryReader binaryReader, int count)
|
||||
{
|
||||
return new string(binaryReader.ReadChars(count));
|
||||
}
|
||||
|
||||
public static string ReadString(this BinaryReader binaryReader, int count, int codepage)
|
||||
{
|
||||
var strBytes = binaryReader.ReadBytes(count);
|
||||
var i = 0;
|
||||
var length = strBytes.Length;
|
||||
while (i < length && strBytes[i] != 0) i++;
|
||||
return Encoding.GetEncoding(codepage).GetString(strBytes, 0, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 460ba7b795404a459274bf99238f8518
|
||||
timeCreated: 1641383661
|
||||
@@ -1,32 +0,0 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Core.Extensions
|
||||
{
|
||||
using UnityEngine;
|
||||
|
||||
public static class GameObjectExtension
|
||||
{
|
||||
/// <summary>
|
||||
/// Helper method to get or add a component to the GameObject.
|
||||
/// </summary>
|
||||
/// <param name="gameObject">this</param>
|
||||
/// <typeparam name="T">Type of the component</typeparam>
|
||||
/// <returns>Component</returns>
|
||||
public static T GetOrAddComponent<T>(this GameObject gameObject) where T : Component
|
||||
{
|
||||
var component = gameObject.GetComponent<T>();
|
||||
|
||||
// Since ?? operation does not work well with UnityObject
|
||||
// so I have to use the old fashion here checking if it is null.
|
||||
if (component == null)
|
||||
{
|
||||
component = gameObject.AddComponent<T>();
|
||||
}
|
||||
|
||||
return component;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a0ec5ec379844647a98ae11e28d88f21
|
||||
timeCreated: 1642759044
|
||||
@@ -1,278 +0,0 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Core.FileSystem
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using DataReader.Cpk;
|
||||
using UnityEngine;
|
||||
using Utils;
|
||||
|
||||
/// <summary>
|
||||
/// File system wrapper for CPack archives
|
||||
/// </summary>
|
||||
public class CpkFileSystem : ICpkFileSystem
|
||||
{
|
||||
private readonly string _rootPath;
|
||||
private readonly ConcurrentDictionary<string, CpkArchive> _cpkArchives = new();
|
||||
private readonly Crc32Hash _crcHash;
|
||||
|
||||
private CpkFileSystem() {} // Hide default constructor
|
||||
|
||||
public CpkFileSystem(string rootPath, Crc32Hash crcHash)
|
||||
{
|
||||
rootPath = Requires.IsNotNullOrEmpty(rootPath, nameof(rootPath));
|
||||
crcHash = Requires.IsNotNull(crcHash, nameof(crcHash));
|
||||
|
||||
if (!rootPath.EndsWith(Path.DirectorySeparatorChar))
|
||||
{
|
||||
rootPath += Path.DirectorySeparatorChar;
|
||||
}
|
||||
|
||||
if (!Directory.Exists(rootPath))
|
||||
{
|
||||
var error = $"游戏数据加载失败,原始游戏数据根目录不存在: {rootPath}";
|
||||
Debug.LogError(error);
|
||||
throw new ArgumentException(error);
|
||||
}
|
||||
|
||||
_rootPath = rootPath;
|
||||
_crcHash = crcHash;
|
||||
}
|
||||
|
||||
public string GetRootPath()
|
||||
{
|
||||
return _rootPath;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Mount a Cpk archive to the file system.
|
||||
/// </summary>
|
||||
/// <param name="cpkFileRelativePath">CPK file relative path</param>
|
||||
/// <param name="codepage">Codepage CPK file uses for encoding text info</param>
|
||||
public void Mount(string cpkFileRelativePath, int codepage)
|
||||
{
|
||||
var cpkFileName = Path.GetFileName(cpkFileRelativePath).ToLower();
|
||||
|
||||
if (_cpkArchives.ContainsKey(cpkFileName))
|
||||
{
|
||||
Debug.LogWarning($"{cpkFileRelativePath} already mounted.");
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Log($"CpkFileSystem mounting: {_rootPath + cpkFileRelativePath}");
|
||||
var cpkArchive = new CpkArchive(_rootPath + cpkFileRelativePath, _crcHash, codepage);
|
||||
cpkArchive.Init();
|
||||
_cpkArchives[cpkFileName] = cpkArchive;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if file exists in any of the segmented archives using virtual path.
|
||||
/// </summary>
|
||||
/// <param name="fileVirtualPath">File virtual path {Cpk file name}.cpk\{File relative path inside archive}</param>
|
||||
/// <param name="segmentedArchiveName">Name of the segmented archive if exists</param>
|
||||
/// <returns>True if file exists in segmented archive</returns>
|
||||
public bool FileExistsInSegmentedArchive(string fileVirtualPath, out string segmentedArchiveName)
|
||||
{
|
||||
ParseFileVirtualPath(fileVirtualPath, out var cpkFileName, out var relativeVirtualPath);
|
||||
|
||||
if (_cpkArchives.ContainsKey(cpkFileName))
|
||||
{
|
||||
segmentedArchiveName = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if the file exists in any of the segmented cpk archives.
|
||||
foreach (var subCpkPath in _cpkArchives.Keys
|
||||
.Where(_ => _.StartsWith(cpkFileName[..^CpkConstants.FileExtension.Length] + '_', StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
var relativePathInSubCpk = relativeVirtualPath.Replace(cpkFileName, subCpkPath);
|
||||
if (_cpkArchives[subCpkPath].FileExists(relativePathInSubCpk))
|
||||
{
|
||||
segmentedArchiveName = subCpkPath;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
segmentedArchiveName = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if file exists in the archive using virtual path.
|
||||
/// </summary>
|
||||
/// <param name="fileVirtualPath">File virtual path {Cpk file name}.cpk\{File relative path inside archive}
|
||||
/// Example: music.cpk\music\PI01.mp3</param>
|
||||
/// <returns>True if file exists</returns>
|
||||
public bool FileExists(string fileVirtualPath)
|
||||
{
|
||||
ParseFileVirtualPath(fileVirtualPath, out var cpkFileName, out var relativeVirtualPath);
|
||||
|
||||
if (_cpkArchives.TryGetValue(cpkFileName, out CpkArchive archive))
|
||||
{
|
||||
return archive.FileExists(relativeVirtualPath);
|
||||
}
|
||||
|
||||
// Check if the file exists in any of the segmented cpk archives.
|
||||
foreach (var subCpkPath in _cpkArchives.Keys
|
||||
.Where(_ => _.StartsWith(cpkFileName[..^CpkConstants.FileExtension.Length] + '_', StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
var relativePathInSubCpk = relativeVirtualPath.Replace(cpkFileName, subCpkPath);
|
||||
if (_cpkArchives[subCpkPath].FileExists(relativePathInSubCpk))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read all bytes of the given file.
|
||||
/// </summary>
|
||||
/// <param name="fileVirtualPath">File virtual path inside CPK archive</param>
|
||||
/// <returns>Decompressed, ready-to-go file content in byte array</returns>
|
||||
public byte[] ReadAllBytes(string fileVirtualPath)
|
||||
{
|
||||
ParseFileVirtualPath(fileVirtualPath, out var cpkFileName, out var relativeVirtualPath);
|
||||
|
||||
if (_cpkArchives.TryGetValue(cpkFileName, out CpkArchive archive))
|
||||
{
|
||||
return archive.ReadAllBytes(relativeVirtualPath);
|
||||
}
|
||||
|
||||
// Find and read the file content in segmented cpk archives.
|
||||
foreach (var subCpkPath in _cpkArchives.Keys
|
||||
.Where(_ => _.StartsWith(cpkFileName[..^CpkConstants.FileExtension.Length] + '_', StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
var relativePathInSubCpk = relativeVirtualPath.Replace(cpkFileName, subCpkPath);
|
||||
if (_cpkArchives[subCpkPath].FileExists(relativePathInSubCpk))
|
||||
{
|
||||
return _cpkArchives[subCpkPath].ReadAllBytes(relativePathInSubCpk);
|
||||
}
|
||||
}
|
||||
|
||||
throw new Exception($"{fileVirtualPath} not found.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Preload archive into memory for faster read performance.
|
||||
/// </summary>
|
||||
public void LoadArchiveIntoMemory(string cpkFileName)
|
||||
{
|
||||
if (_cpkArchives.ContainsKey(cpkFileName.ToLower()))
|
||||
{
|
||||
Debug.Log($"File system caching {cpkFileName} into memory.");
|
||||
_cpkArchives[cpkFileName.ToLower()].LoadArchiveIntoMemory();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception($"{cpkFileName} not mounted yet.");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dispose in-memory archive data.
|
||||
/// </summary>
|
||||
public void DisposeInMemoryArchive(string cpkFileName)
|
||||
{
|
||||
if (_cpkArchives.ContainsKey(cpkFileName.ToLower()))
|
||||
{
|
||||
Debug.Log($"File system disposing in-memory cache: {cpkFileName}");
|
||||
_cpkArchives[cpkFileName.ToLower()].DisposeInMemoryArchive();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception($"{cpkFileName} not mounted yet.");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dispose all in-memory archive data.
|
||||
/// </summary>
|
||||
public void DisposeAllInMemoryArchives()
|
||||
{
|
||||
foreach (CpkArchive cpkArchive in _cpkArchives.Values)
|
||||
{
|
||||
cpkArchive.DisposeInMemoryArchive();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Extract all archives to the specified destination
|
||||
/// </summary>
|
||||
public void ExtractTo(string outputFolder)
|
||||
{
|
||||
foreach ((string cpkFileName, CpkArchive cpkArchive) in _cpkArchives)
|
||||
{
|
||||
var outputDir = outputFolder + cpkFileName + Path.DirectorySeparatorChar;
|
||||
|
||||
if (!Directory.Exists(outputDir))
|
||||
{
|
||||
Directory.CreateDirectory(outputDir);
|
||||
}
|
||||
|
||||
cpkArchive.ExtractTo(outputDir);
|
||||
Debug.Log($"{cpkFileName} extracted to {outputDir}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Search files using keyword.
|
||||
/// </summary>
|
||||
/// <param name="keyword"></param>
|
||||
/// <returns>File path enumerable</returns>
|
||||
public IEnumerable<string> Search(string keyword = "")
|
||||
{
|
||||
var results = new ConcurrentBag<IEnumerable<string>>();
|
||||
|
||||
Parallel.ForEach(_cpkArchives, archive =>
|
||||
{
|
||||
var rootNodes = archive.Value.GetRootEntries();
|
||||
results.Add(from result in SearchInternal(rootNodes, keyword)
|
||||
select archive.Key + CpkConstants.DirectorySeparator + result);
|
||||
});
|
||||
|
||||
var resultList = new List<string>();
|
||||
foreach (var result in results)
|
||||
{
|
||||
resultList.AddRange(result);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
private void ParseFileVirtualPath(string fullVirtualPath, out string cpkFileName, out string relativeVirtualPath)
|
||||
{
|
||||
if (!fullVirtualPath.Contains(CpkConstants.DirectorySeparator))
|
||||
{
|
||||
throw new ArgumentException($"File virtual path is invalid: {fullVirtualPath}.");
|
||||
}
|
||||
cpkFileName = fullVirtualPath[..fullVirtualPath.IndexOf(CpkConstants.DirectorySeparator)].ToLower();
|
||||
relativeVirtualPath = fullVirtualPath[(fullVirtualPath.IndexOf(CpkConstants.DirectorySeparator) + 1)..];
|
||||
}
|
||||
|
||||
private IEnumerable<string> SearchInternal(IEnumerable<CpkEntry> nodes, string keyword)
|
||||
{
|
||||
foreach (CpkEntry node in nodes)
|
||||
{
|
||||
if (node.IsDirectory)
|
||||
{
|
||||
foreach (var result in SearchInternal(node.Children, keyword))
|
||||
{
|
||||
yield return result;
|
||||
}
|
||||
}
|
||||
else if (node.VirtualPath.ToLower().Contains(keyword.ToLower()))
|
||||
{
|
||||
yield return node.VirtualPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Core.FileSystem
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
/// <summary>
|
||||
/// File system wrapper for CPack archives
|
||||
/// </summary>
|
||||
public interface ICpkFileSystem
|
||||
{
|
||||
/// <summary>
|
||||
/// Get file system's root path.
|
||||
/// </summary>
|
||||
/// <returns>Root directory path</returns>
|
||||
public string GetRootPath();
|
||||
|
||||
/// <summary>
|
||||
/// Mount a Cpk archive to the file system.
|
||||
/// </summary>
|
||||
/// <param name="cpkFileRelativePath">CPK file relative path</param>
|
||||
/// <param name="codepage">Codepage CPK file uses for encoding text info</param>
|
||||
public void Mount(string cpkFileRelativePath, int codepage);
|
||||
|
||||
/// <summary>
|
||||
/// Check if file exists in any of the segmented archives using virtual path.
|
||||
/// </summary>
|
||||
/// <param name="fileVirtualPath">File virtual path {Cpk file name}.cpk\{File relative path inside archive}</param>
|
||||
/// <param name="segmentedArchiveName">Name of the segmented archive if exists</param>
|
||||
/// <returns>True if file exists in segmented archive</returns>
|
||||
public bool FileExistsInSegmentedArchive(string fileVirtualPath, out string segmentedArchiveName);
|
||||
|
||||
/// <summary>
|
||||
/// Check if file exists in the archive using virtual path.
|
||||
/// </summary>
|
||||
/// <param name="fileVirtualPath">File virtual path {Cpk file name}.cpk\{File relative path inside archive}
|
||||
/// Example: music.cpk\music\PI01.mp3</param>
|
||||
/// <returns>True if file exists</returns>
|
||||
public bool FileExists(string fileVirtualPath);
|
||||
|
||||
/// <summary>
|
||||
/// Read all bytes of the given file.
|
||||
/// </summary>
|
||||
/// <param name="fileVirtualPath">File virtual path inside CPK archive</param>
|
||||
/// <returns>Decompressed, ready-to-go file content in byte array</returns>
|
||||
public byte[] ReadAllBytes(string fileVirtualPath);
|
||||
|
||||
/// <summary>
|
||||
/// Preload archive into memory for faster read performance.
|
||||
/// </summary>
|
||||
public void LoadArchiveIntoMemory(string cpkFileName);
|
||||
|
||||
/// <summary>
|
||||
/// Dispose in-memory archive data.
|
||||
/// </summary>
|
||||
public void DisposeInMemoryArchive(string cpkFileName);
|
||||
|
||||
/// <summary>
|
||||
/// Dispose all in-memory archive data.
|
||||
/// </summary>
|
||||
public void DisposeAllInMemoryArchives();
|
||||
|
||||
/// <summary>
|
||||
/// Extract all archives to the specified destination
|
||||
/// </summary>
|
||||
public void ExtractTo(string outputFolder);
|
||||
|
||||
/// <summary>
|
||||
/// Search files using keyword.
|
||||
/// </summary>
|
||||
/// <param name="keyword"></param>
|
||||
/// <returns>File path enumerable</returns>
|
||||
public IEnumerable<string> Search(string keyword = "");
|
||||
}
|
||||
}
|
||||
@@ -1,217 +0,0 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Core.GameBox
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.CompilerServices;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// Interpreter/convertor to convert GameBox specific rendering related metrics to Unity standard units that fits
|
||||
/// well with the engine and editor.
|
||||
/// </summary>
|
||||
public static class GameBoxInterpreter
|
||||
{
|
||||
public const float GameBoxUnitToUnityUnit = 20f;
|
||||
public const float GameBoxMv3UnitToUnityUnit = 1270f;
|
||||
public const uint GameBoxTicksPerSecond = 4800;
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector3 ToUnityVertex(Vector3 vertex, float scale)
|
||||
{
|
||||
return ToUnityVector3(vertex, scale);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector3 ToUnityPosition(Vector3 position, float scale = GameBoxUnitToUnityUnit)
|
||||
{
|
||||
return ToUnityVector3(position, scale);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static float ToUnityDistance(float gameBoxDistance)
|
||||
{
|
||||
return gameBoxDistance / GameBoxUnitToUnityUnit;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static float ToUnityXPosition(float gameBoxXPosition)
|
||||
{
|
||||
return -gameBoxXPosition / GameBoxUnitToUnityUnit;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static float ToUnityYPosition(float gameBoxYPosition)
|
||||
{
|
||||
return gameBoxYPosition / GameBoxUnitToUnityUnit;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static float ToUnityZPosition(float gameBoxZPosition)
|
||||
{
|
||||
return gameBoxZPosition / GameBoxUnitToUnityUnit;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static float ToGameBoxXRotation(float eulerAnglesX)
|
||||
{
|
||||
return eulerAnglesX;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static float ToGameBoxYRotation(float eulerAnglesY)
|
||||
{
|
||||
return -eulerAnglesY;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static float ToGameBoxZRotation(float eulerAnglesZ)
|
||||
{
|
||||
return eulerAnglesZ;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Quaternion ToUnityRotation(Vector3 gameBoxEulerAngles)
|
||||
{
|
||||
return Quaternion.Euler(
|
||||
gameBoxEulerAngles.x,
|
||||
-gameBoxEulerAngles.y,
|
||||
gameBoxEulerAngles.z);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector3 ToGameBoxPosition(Vector3 position, float scale = GameBoxUnitToUnityUnit)
|
||||
{
|
||||
return new Vector3(
|
||||
-position.x * scale,
|
||||
position.y * scale,
|
||||
position.z * scale);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector3 CvdPositionToUnityPosition(Vector3 cvdPosition, float scale = GameBoxUnitToUnityUnit)
|
||||
{
|
||||
return new Vector3(
|
||||
-cvdPosition.x / scale,
|
||||
cvdPosition.z / scale,
|
||||
-cvdPosition.y / scale);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector3 CvdScaleToUnityScale(Vector3 scale)
|
||||
{
|
||||
return new Vector3(
|
||||
scale.x,
|
||||
scale.z,
|
||||
scale.y);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector3 ToUnityNormal(Vector3 normal)
|
||||
{
|
||||
return new Vector3(
|
||||
-normal.x,
|
||||
normal.y,
|
||||
normal.z);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Quaternion CvdQuaternionToUnityQuaternion(GameBoxQuaternion quaternion)
|
||||
{
|
||||
return new Quaternion(-quaternion.X, quaternion.Z, -quaternion.Y, quaternion.W);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Quaternion Mv3QuaternionToUnityQuaternion(GameBoxQuaternion quaternion)
|
||||
{
|
||||
return new Quaternion(-quaternion.X, quaternion.Y, quaternion.Z, quaternion.W);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Quaternion MovQuaternionToUnityQuaternion(GameBoxQuaternion quaternion)
|
||||
{
|
||||
return new Quaternion(-quaternion.X, quaternion.Y, quaternion.Z, quaternion.W);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Quaternion MshQuaternionToUnityQuaternion(GameBoxQuaternion quaternion)
|
||||
{
|
||||
return new Quaternion(-quaternion.X, quaternion.Y, quaternion.Z, quaternion.W);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Quaternion LgtQuaternionToUnityQuaternion(GameBoxQuaternion quaternion)
|
||||
{
|
||||
var rotation = new Quaternion(quaternion.X, quaternion.Y, -quaternion.Z, quaternion.W);
|
||||
rotation.eulerAngles = new Vector3(rotation.eulerAngles.x + 90f,
|
||||
-rotation.eulerAngles.y,
|
||||
rotation.eulerAngles.z);
|
||||
return rotation;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Quaternion ToUnityRotation(float pitch, float yaw, float roll)
|
||||
{
|
||||
return Quaternion.Euler(pitch - 180, yaw, roll -180);
|
||||
}
|
||||
|
||||
// Since GameBox engine uses different internal axis system.
|
||||
// Here we are flipping the x here to minor it back to the Unity axis.
|
||||
// Also we want to scale it to proper unity unit.
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
private static Vector3 ToUnityVector3(Vector3 vector3, float scale)
|
||||
{
|
||||
return new Vector3(
|
||||
-vector3.x / scale,
|
||||
vector3.y / scale,
|
||||
vector3.z / scale);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static void ToUnityTriangles(List<int> triangles)
|
||||
{
|
||||
triangles.Reverse();
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static void ToUnityTriangles(int[] triangles)
|
||||
{
|
||||
Array.Reverse(triangles);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool IsPointInsideRect(GameBoxRect rect, Vector2Int point)
|
||||
{
|
||||
return point.x >= rect.Left &&
|
||||
point.x <= rect.Right &&
|
||||
point.y >= rect.Top &&
|
||||
point.y <= rect.Bottom;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Matrix4x4 ToUnityMatrix4x4(GameBoxMatrix4X4 matrix)
|
||||
{
|
||||
return new Matrix4x4(
|
||||
new Vector4(matrix.Xx, matrix.Xy, matrix.Xz, matrix.Xw),
|
||||
new Vector4(matrix.Yx, matrix.Yy, matrix.Yz, matrix.Yw),
|
||||
new Vector4(matrix.Zx, matrix.Zy, matrix.Zz, matrix.Zw),
|
||||
new Vector4(matrix.Tx, matrix.Ty, matrix.Tz, matrix.Tw));
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static uint SecondsToTick(float seconds)
|
||||
{
|
||||
return (uint)(seconds * GameBoxTicksPerSecond);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static float TickToSeconds(uint tick)
|
||||
{
|
||||
return (float)tick / GameBoxTicksPerSecond;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,120 +0,0 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Core.GameBox
|
||||
{
|
||||
using UnityEngine;
|
||||
|
||||
[System.Serializable]
|
||||
public struct GameBoxMaterial
|
||||
{
|
||||
public Color32 Diffuse;
|
||||
public Color32 Ambient;
|
||||
public Color32 Specular;
|
||||
public Color32 Emissive;
|
||||
public float Power;
|
||||
}
|
||||
|
||||
// To meet opengl, use this order instead:
|
||||
// float xx , yx , zx , tx;
|
||||
// float xy , yy , zy , ty;
|
||||
// float xz , yz , zz , tz;
|
||||
// float xw , yw , zw , tw;
|
||||
public struct GameBoxMatrix4X4
|
||||
{
|
||||
public float Xx, Xy, Xz, Xw;
|
||||
public float Yx, Yy, Yz, Yw;
|
||||
public float Zx, Zy, Zz, Zw;
|
||||
public float Tx, Ty, Tz, Tw;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public struct GameBoxQuaternion
|
||||
{
|
||||
public float X;
|
||||
public float Y;
|
||||
public float Z;
|
||||
public float W;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public struct GameBoxRect
|
||||
{
|
||||
public int Left;
|
||||
public int Top;
|
||||
public int Right;
|
||||
public int Bottom;
|
||||
|
||||
public bool IsEmpty => Left == 0 &&
|
||||
Top == 0 &&
|
||||
Right == 0 &&
|
||||
Bottom == 0;
|
||||
}
|
||||
|
||||
public static class GameBoxVertexType
|
||||
{
|
||||
public const int Null = 0;
|
||||
public const int MaxUvSet = 4;
|
||||
public const int XYZ = (1 << 0);
|
||||
public const int Normal = (1 << 1);
|
||||
public const int Diffuse = (1 << 2);
|
||||
public const int Specular = (1 << 3);
|
||||
public const int UV0 = (1 << 4);
|
||||
public const int UV1 = (1 << 5);
|
||||
public const int UV2 = (1 << 6);
|
||||
public const int UV3 = (1 << 7);
|
||||
public const int XYZRHW = (1 << 8);
|
||||
public const int FlagMask = (1 << 31);
|
||||
}
|
||||
|
||||
public enum GameBoxBlendFlag
|
||||
{
|
||||
Opaque, // opaque
|
||||
AlphaBlend, // src.alpha, 1-src.alpha, +
|
||||
InvertColorBlend, // srcAlpha, One , +
|
||||
AdditiveBlend, //
|
||||
}
|
||||
|
||||
public enum GameBoxLightType
|
||||
{
|
||||
Omni, // point light
|
||||
Spot, // spot light
|
||||
Directional, // directional light
|
||||
}
|
||||
|
||||
public enum GameBoxLightDecayType
|
||||
{
|
||||
None,
|
||||
Distance,
|
||||
Square,
|
||||
}
|
||||
|
||||
public enum GameBoxLightShapeType
|
||||
{
|
||||
Cone,
|
||||
Square,
|
||||
}
|
||||
|
||||
public static class GameBoxVertex
|
||||
{
|
||||
public static int GetSize(uint vertexType)
|
||||
{
|
||||
var size = 0;
|
||||
|
||||
if ((vertexType & GameBoxVertexType.FlagMask) != 0) return (int) (vertexType&~GameBoxVertexType.FlagMask);
|
||||
if ((vertexType & GameBoxVertexType.XYZ) != 0) size += 3 * sizeof(float);
|
||||
if ((vertexType & GameBoxVertexType.XYZRHW) != 0) size += 4 * sizeof(float);
|
||||
if ((vertexType & GameBoxVertexType.Normal) != 0) size += 3 * sizeof(float);
|
||||
if ((vertexType & GameBoxVertexType.Diffuse) != 0) size += 4;
|
||||
if ((vertexType & GameBoxVertexType.Specular) != 0) size += 4;
|
||||
if ((vertexType & GameBoxVertexType.UV0) != 0) size += 2 * sizeof(float);
|
||||
if ((vertexType & GameBoxVertexType.UV1) != 0) size += 2 * sizeof(float);
|
||||
if ((vertexType & GameBoxVertexType.UV2) != 0) size += 2 * sizeof(float);
|
||||
if ((vertexType & GameBoxVertexType.UV3) != 0) size += 2 * sizeof(float);
|
||||
|
||||
return size;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8691ab40dd7c44e9b4c0acdbe90b738b
|
||||
timeCreated: 1641755187
|
||||
@@ -1,57 +0,0 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Core.Renderer
|
||||
{
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
public class SkyBoxRenderer : MonoBehaviour
|
||||
{
|
||||
private Skybox _skybox;
|
||||
|
||||
private static readonly int RightTexturePropertyID = Shader.PropertyToID("_RightTex");
|
||||
private static readonly int BackTexturePropertyID = Shader.PropertyToID("_BackTex");
|
||||
private static readonly int LeftTexturePropertyID = Shader.PropertyToID("_LeftTex");
|
||||
private static readonly int FrontTexturePropertyID = Shader.PropertyToID("_FrontTex");
|
||||
private static readonly int UpTexturePropertyID = Shader.PropertyToID("_UpTex");
|
||||
private static readonly int DownTexturePropertyID = Shader.PropertyToID("_DownTex");
|
||||
|
||||
public void Render(Camera targetCamera,
|
||||
Texture2D rightTex,
|
||||
Texture2D backTex,
|
||||
Texture2D leftTex,
|
||||
Texture2D frontTex,
|
||||
Texture2D upTex,
|
||||
Texture2D downTex)
|
||||
{
|
||||
Material material = CreateSkyboxMaterial(rightTex, backTex, leftTex, frontTex, upTex, downTex);
|
||||
_skybox = targetCamera.gameObject.AddComponent<Skybox>();
|
||||
_skybox.material = material;
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
if (_skybox != null) Destroy(_skybox);
|
||||
}
|
||||
|
||||
private static Material CreateSkyboxMaterial(Texture2D rightTex,
|
||||
Texture2D backTex,
|
||||
Texture2D leftTex,
|
||||
Texture2D frontTex,
|
||||
Texture2D upTex,
|
||||
Texture2D downTex)
|
||||
{
|
||||
var material = new Material(Shader.Find("Skybox/6 Sided"));
|
||||
material.SetTexture(RightTexturePropertyID, rightTex);
|
||||
material.SetTexture(BackTexturePropertyID, backTex);
|
||||
material.SetTexture(LeftTexturePropertyID, leftTex);
|
||||
material.SetTexture(FrontTexturePropertyID, frontTex);
|
||||
material.SetTexture(UpTexturePropertyID, upTex);
|
||||
material.SetTexture(DownTexturePropertyID, downTex);
|
||||
return material;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,100 +0,0 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Core.Renderer
|
||||
{
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
public sealed class StaticMeshRenderer : MonoBehaviour, IDisposable
|
||||
{
|
||||
private MeshRenderer _meshRenderer;
|
||||
private MeshFilter _meshFilter;
|
||||
|
||||
public Mesh Render(ref Vector3[] vertices,
|
||||
ref int[] triangles,
|
||||
ref Vector3[] normals,
|
||||
ref Vector2[] mainTextureUvs,
|
||||
ref Vector2[] secondaryTextureUvs,
|
||||
ref Material[] materials,
|
||||
bool isDynamic)
|
||||
{
|
||||
Dispose();
|
||||
|
||||
_meshRenderer = gameObject.AddComponent<MeshRenderer>();
|
||||
_meshRenderer.sharedMaterials = materials;
|
||||
|
||||
_meshFilter = gameObject.AddComponent<MeshFilter>();
|
||||
var mesh = new Mesh();
|
||||
if (isDynamic)
|
||||
{
|
||||
mesh.MarkDynamic();
|
||||
}
|
||||
|
||||
mesh.SetVertices(vertices);
|
||||
mesh.SetTriangles(triangles, 0);
|
||||
mesh.SetNormals(normals);
|
||||
mesh.SetUVs(0, mainTextureUvs);
|
||||
mesh.SetUVs(1, secondaryTextureUvs);
|
||||
|
||||
if (triangles.Length == 0)
|
||||
{
|
||||
// https://docs.unity3d.com/ScriptReference/Mesh.RecalculateBounds.html
|
||||
// After modifying vertices you should call this function to ensure the
|
||||
// bounding volume is correct. Assigning triangles automatically
|
||||
// recalculates the bounding volume.
|
||||
mesh.RecalculateBounds();
|
||||
}
|
||||
|
||||
_meshFilter.sharedMesh = mesh;
|
||||
|
||||
return mesh;
|
||||
}
|
||||
|
||||
public Mesh GetMesh()
|
||||
{
|
||||
return _meshFilter == null ? null : _meshFilter.sharedMesh;
|
||||
}
|
||||
|
||||
public bool IsVisible()
|
||||
{
|
||||
return _meshRenderer != null && _meshRenderer.isVisible;
|
||||
}
|
||||
|
||||
public Bounds GetRendererBounds()
|
||||
{
|
||||
return _meshRenderer.bounds;
|
||||
}
|
||||
|
||||
public Bounds GetMeshBounds()
|
||||
{
|
||||
return _meshFilter.sharedMesh.bounds;
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
Dispose();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (_meshFilter != null)
|
||||
{
|
||||
Destroy(_meshFilter.sharedMesh);
|
||||
Destroy(_meshFilter);
|
||||
}
|
||||
|
||||
if (_meshRenderer != null)
|
||||
{
|
||||
foreach (Material material in _meshRenderer.sharedMaterials)
|
||||
{
|
||||
Destroy(material);
|
||||
}
|
||||
|
||||
Destroy(_meshRenderer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,182 +0,0 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
// Taken from: https://github.com/AnzhelikaO/FakeProvider/blob/version-1.4/FakeProvider/UnsafeBinaryReader.cs
|
||||
// with some modifications
|
||||
|
||||
namespace Core.Utils
|
||||
{
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using UnityEngine;
|
||||
|
||||
public sealed unsafe class UnsafeBinaryReader : IDisposable
|
||||
{
|
||||
private byte* _dataPtr;
|
||||
private GCHandle _handle;
|
||||
|
||||
public UnsafeBinaryReader(byte[] data)
|
||||
{
|
||||
_handle = GCHandle.Alloc(data, GCHandleType.Pinned);
|
||||
fixed (byte* ptr = &data[0])
|
||||
{
|
||||
_dataPtr = ptr;
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public short ReadInt16()
|
||||
{
|
||||
short value = *(short*)_dataPtr;
|
||||
_dataPtr += 2;
|
||||
return value;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public int ReadInt32()
|
||||
{
|
||||
int value = *(int*)_dataPtr;
|
||||
_dataPtr += 4;
|
||||
return value;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public long ReadInt64()
|
||||
{
|
||||
long value = *(long*)_dataPtr;
|
||||
_dataPtr += 8;
|
||||
return value;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public ushort ReadUInt16()
|
||||
{
|
||||
ushort value = *(ushort*)_dataPtr;
|
||||
_dataPtr += 2;
|
||||
return value;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public uint ReadUInt32()
|
||||
{
|
||||
uint value = *(uint*)_dataPtr;
|
||||
_dataPtr += 4;
|
||||
return value;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public ulong ReadUInt64()
|
||||
{
|
||||
ulong value = *(ulong*)_dataPtr;
|
||||
_dataPtr += 8;
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public float ReadSingle()
|
||||
{
|
||||
float value = *(float*)_dataPtr;
|
||||
_dataPtr += 4;
|
||||
return value;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public double ReadDouble()
|
||||
{
|
||||
double value = *(double*)_dataPtr;
|
||||
_dataPtr += 8;
|
||||
return value;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public Vector2 ReadVector2()
|
||||
{
|
||||
return new Vector2(ReadSingle(), ReadSingle());
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public Vector3 ReadVector3()
|
||||
{
|
||||
return new Vector3(ReadSingle(), ReadSingle(), ReadSingle());
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool ReadBoolean()
|
||||
{
|
||||
bool value = *(bool*)_dataPtr;
|
||||
_dataPtr += 1;
|
||||
return value;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public byte ReadByte()
|
||||
{
|
||||
byte value = *_dataPtr;
|
||||
_dataPtr += 1;
|
||||
return value;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public byte[] ReadBytes(int count)
|
||||
{
|
||||
var value = new byte[count];
|
||||
Marshal.Copy(new IntPtr(_dataPtr), value, 0, count);
|
||||
_dataPtr += count;
|
||||
return value;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public float[] ReadSingleArray(int count)
|
||||
{
|
||||
var value = new float[count];
|
||||
Marshal.Copy(new IntPtr(_dataPtr), value, 0, count);
|
||||
_dataPtr += count * 4;
|
||||
return value;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public char[] ReadChars(int count)
|
||||
{
|
||||
return Encoding.ASCII.GetString(ReadBytes(count)).ToCharArray();
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public string ReadString(int count, int codepage)
|
||||
{
|
||||
var strBytes = ReadBytes(count);
|
||||
var i = 0;
|
||||
var length = strBytes.Length;
|
||||
while (i < length && strBytes[i] != 0) i++;
|
||||
return Encoding.GetEncoding(codepage).GetString(strBytes, 0, i);
|
||||
}
|
||||
|
||||
private bool _disposedValue;
|
||||
private void Dispose(bool disposing)
|
||||
{
|
||||
if (!_disposedValue)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
_handle.Free();
|
||||
_disposedValue = true;
|
||||
}
|
||||
}
|
||||
|
||||
~UnsafeBinaryReader()
|
||||
{
|
||||
Dispose(disposing: false);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(disposing: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,250 +0,0 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Core.Utils
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using DataReader.Cpk;
|
||||
using UnityEngine;
|
||||
|
||||
public static class Utility
|
||||
{
|
||||
public static Color32 ToColor32(byte[] rgba)
|
||||
{
|
||||
return new Color32(rgba[0], rgba[1], rgba[2], rgba[3]);
|
||||
}
|
||||
|
||||
public static Color ToColor(float[] rgba)
|
||||
{
|
||||
return new Color(rgba[0], rgba[1], rgba[2], rgba[3]);
|
||||
}
|
||||
|
||||
public static unsafe void ApplyTransparencyBasedOnColorLuminance(Texture2D texture)
|
||||
{
|
||||
var pixels = texture.GetPixels();
|
||||
|
||||
fixed (float* src = &pixels[0].r)
|
||||
{
|
||||
var p = src;
|
||||
for (var i = 0; i < texture.width * texture.height; i++, p += 4)
|
||||
{
|
||||
*(p + 3) = 0.299f * *p + 0.587f * *(p + 1) + 0.114f * *(p + 2);
|
||||
}
|
||||
}
|
||||
|
||||
texture.SetPixels(pixels);
|
||||
texture.Apply();
|
||||
}
|
||||
|
||||
public static T ReadStruct<T>(Stream stream) where T : struct
|
||||
{
|
||||
var structSize = Marshal.SizeOf(typeof(T));
|
||||
byte[] buffer = new byte[structSize];
|
||||
_ = stream.Read(buffer);
|
||||
return ReadStructInternal<T>(buffer);
|
||||
}
|
||||
|
||||
public static T ReadStruct<T>(ReadOnlySpan<byte> bytes, int offset = 0) where T : struct
|
||||
{
|
||||
return ReadStructInternal<T>(bytes, offset);
|
||||
}
|
||||
|
||||
private static unsafe T ReadStructInternal<T>(ReadOnlySpan<byte> bytes, int offset = 0) where T : struct
|
||||
{
|
||||
fixed (byte* ptr = &bytes[offset])
|
||||
{
|
||||
return (T) (Marshal.PtrToStructure((IntPtr) ptr, typeof(T)) ?? default(T));
|
||||
}
|
||||
}
|
||||
|
||||
private static int GetPatternIndex(ReadOnlySpan<byte> src, ReadOnlySpan<byte> pattern, int startIndex = 0)
|
||||
{
|
||||
var maxFirstCharSlot = src.Length - pattern.Length + 1;
|
||||
for (var i = startIndex; i < maxFirstCharSlot; i++)
|
||||
{
|
||||
if (src[i] != pattern[0])
|
||||
continue;
|
||||
|
||||
for (var j = pattern.Length - 1; j >= 1; j--)
|
||||
{
|
||||
if (src[i + j] != pattern[j]) break;
|
||||
if (j == 1) return i;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static int GetFloorIndex<T>(T[] valuesInIncreasingOrder, T lookUpValue)
|
||||
{
|
||||
/*
|
||||
* The index of the specified value in the specified array, if value is found;
|
||||
* otherwise, a negative number. If value is not found and value is less than
|
||||
* one or more elements in array, the negative number returned is the bitwise
|
||||
* complement of the index of the first element that is larger than value.
|
||||
* If value is not found and value is greater than all elements in array,
|
||||
* the negative number returned is the bitwise complement of
|
||||
* (the index of the last element plus 1).
|
||||
*/
|
||||
var index = Array.BinarySearch(valuesInIncreasingOrder, lookUpValue);
|
||||
|
||||
if (index < 0)
|
||||
{
|
||||
return -index - 2;
|
||||
}
|
||||
|
||||
return index;
|
||||
}
|
||||
|
||||
public static byte[] TrimEnd(byte[] buffer, ReadOnlySpan<byte> pattern)
|
||||
{
|
||||
var length = GetPatternIndex(buffer, pattern);
|
||||
return length == -1 ? buffer : buffer[..length];
|
||||
}
|
||||
|
||||
public static void Rgb565ToRgb888(ushort rgb565Color, out byte r, out byte g, out byte b)
|
||||
{
|
||||
var temp = (rgb565Color >> 11) * 255 + 16;
|
||||
r = (byte) ((temp / 32 + temp) / 32);
|
||||
temp = ((rgb565Color & 0x07E0) >> 5) * 255 + 32;
|
||||
g = (byte) ((temp / 64 + temp) / 64);
|
||||
temp = (rgb565Color & 0x001F) * 255 + 16;
|
||||
b = (byte) ((temp / 32 + temp) / 32);
|
||||
}
|
||||
|
||||
public static string GetRelativeDirectoryPath(string filePath,
|
||||
char directoryPathSeparator = CpkConstants.DirectorySeparator)
|
||||
{
|
||||
return !filePath.Contains(directoryPathSeparator) ?
|
||||
string.Empty :
|
||||
filePath[..filePath.LastIndexOf(directoryPathSeparator)];
|
||||
}
|
||||
|
||||
public static string GetFileName(string filePath,
|
||||
char directoryPathSeparator = CpkConstants.DirectorySeparator)
|
||||
{
|
||||
return !filePath.Contains(directoryPathSeparator) ?
|
||||
string.Empty :
|
||||
filePath[(filePath.LastIndexOf(directoryPathSeparator)+1)..];
|
||||
}
|
||||
|
||||
public static bool IsHandheldDevice()
|
||||
{
|
||||
return SystemInfo.deviceType == DeviceType.Handheld;
|
||||
}
|
||||
|
||||
public static bool IsDesktopDevice()
|
||||
{
|
||||
return SystemInfo.deviceType == DeviceType.Desktop;
|
||||
}
|
||||
|
||||
public static bool IsPointWithinCollider(Collider collider, Vector3 point)
|
||||
{
|
||||
if (collider == null) return false;
|
||||
return collider.ClosestPoint(point) == point;
|
||||
}
|
||||
|
||||
public static bool IsPointWithinCollider(Collider collider, Vector3 point, float tolerance)
|
||||
{
|
||||
if (collider == null) return false;
|
||||
return Vector3.Distance(collider.ClosestPoint(point), point) < tolerance;
|
||||
}
|
||||
|
||||
public static Vector3[] CalculateNormals(Vector3[] vertices, int[] triangles)
|
||||
{
|
||||
Vector3[] normals = new Vector3[vertices.Length];
|
||||
|
||||
for (var face = 0; face < triangles.Length / 3; face++)
|
||||
{
|
||||
int v1 = triangles[face * 3];
|
||||
int v2 = triangles[face * 3 + 1];
|
||||
int v3 = triangles[face * 3 + 2];
|
||||
|
||||
Vector3 pt1 = vertices[v1];
|
||||
Vector3 pt2 = vertices[v2];
|
||||
Vector3 pt3 = vertices[v3];
|
||||
|
||||
Vector3 d1 = pt2 - pt1;
|
||||
Vector3 d2 = pt3 - pt1;
|
||||
Vector3 normal = Vector3.Normalize(Vector3.Cross(d1, d2));
|
||||
|
||||
normals[v1] += normal;
|
||||
normals[v2] += normal;
|
||||
normals[v3] += normal;
|
||||
}
|
||||
|
||||
for (var i = 0; i < normals.Length; i++)
|
||||
{
|
||||
if (normals[i] == Vector3.zero)
|
||||
{
|
||||
normals[i] = Vector3.up;
|
||||
}
|
||||
else
|
||||
{
|
||||
normals[i] = Vector3.Normalize(normals[i]);
|
||||
}
|
||||
}
|
||||
|
||||
return normals;
|
||||
}
|
||||
|
||||
public static void DrawBounds(Bounds b, float duration = 1000)
|
||||
{
|
||||
var p1 = new Vector3(b.min.x, b.min.y, b.min.z);
|
||||
var p2 = new Vector3(b.max.x, b.min.y, b.min.z);
|
||||
var p3 = new Vector3(b.max.x, b.min.y, b.max.z);
|
||||
var p4 = new Vector3(b.min.x, b.min.y, b.max.z);
|
||||
|
||||
Debug.DrawLine(p1, p2, Color.blue, duration);
|
||||
Debug.DrawLine(p2, p3, Color.red, duration);
|
||||
Debug.DrawLine(p3, p4, Color.yellow, duration);
|
||||
Debug.DrawLine(p4, p1, Color.magenta, duration);
|
||||
|
||||
var p5 = new Vector3(b.min.x, b.max.y, b.min.z);
|
||||
var p6 = new Vector3(b.max.x, b.max.y, b.min.z);
|
||||
var p7 = new Vector3(b.max.x, b.max.y, b.max.z);
|
||||
var p8 = new Vector3(b.min.x, b.max.y, b.max.z);
|
||||
|
||||
Debug.DrawLine(p5, p6, Color.blue, duration);
|
||||
Debug.DrawLine(p6, p7, Color.red, duration);
|
||||
Debug.DrawLine(p7, p8, Color.yellow, duration);
|
||||
Debug.DrawLine(p8, p5, Color.magenta, duration);
|
||||
|
||||
Debug.DrawLine(p1, p5, Color.white, duration);
|
||||
Debug.DrawLine(p2, p6, Color.gray, duration);
|
||||
Debug.DrawLine(p3, p7, Color.green, duration);
|
||||
Debug.DrawLine(p4, p8, Color.cyan, duration);
|
||||
}
|
||||
|
||||
public static bool IsAndroidDeviceAndSdkVersionLowerThanOrEqualTo(int sdkVersion)
|
||||
{
|
||||
if (Application.platform != RuntimePlatform.Android) return false;
|
||||
|
||||
try
|
||||
{
|
||||
int GetAndroidSdkLevel()
|
||||
{
|
||||
IntPtr versionClass = AndroidJNI.FindClass("android.os.Build$VERSION");
|
||||
IntPtr sdkFieldID = AndroidJNI.GetStaticFieldID(versionClass, "SDK_INT", "I");
|
||||
var sdkLevel = AndroidJNI.GetStaticIntField(versionClass, sdkFieldID);
|
||||
return sdkLevel;
|
||||
}
|
||||
|
||||
if (GetAndroidSdkLevel() <= sdkVersion)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2024, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Editor
|
||||
{
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Pal3.MetaData;
|
||||
using Pal3.Game.Constants;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Build;
|
||||
using UnityEngine;
|
||||
@@ -26,7 +26,7 @@ namespace Editor
|
||||
ApplyPlayerSettingsForVariant("PAL3");
|
||||
AssetDatabase.SaveAssets();
|
||||
AssetDatabase.Refresh();
|
||||
Debug.Log("Switched to PAL3");
|
||||
Debug.Log($"[{nameof(GameVariantSwitcher)}] Switched to PAL3");
|
||||
}
|
||||
|
||||
#if PAL3
|
||||
@@ -51,7 +51,7 @@ namespace Editor
|
||||
ApplyPlayerSettingsForVariant("PAL3A");
|
||||
AssetDatabase.SaveAssets();
|
||||
AssetDatabase.Refresh();
|
||||
Debug.Log("Switched to PAL3A");
|
||||
Debug.Log($"[{nameof(GameVariantSwitcher)}] Switched to PAL3A");
|
||||
}
|
||||
|
||||
#if PAL3
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2024, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Editor
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using Pal3.MetaData;
|
||||
using Pal3.Game.Constants;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Build;
|
||||
using UnityEditor.Build.Reporting;
|
||||
@@ -25,7 +25,7 @@ namespace Editor
|
||||
Windows_x86 = 1 << 0,
|
||||
Windows_x64 = 1 << 1,
|
||||
Linux_x86_x64 = 1 << 2,
|
||||
MacOS_arm64_x64 = 1 << 3,
|
||||
macOS_arm64_x64 = 1 << 3,
|
||||
Android = 1 << 4,
|
||||
iOS = 1 << 5,
|
||||
}
|
||||
@@ -34,7 +34,7 @@ namespace Editor
|
||||
{
|
||||
private static readonly string[] BuildLevels = { "Assets/Scenes/Game.unity" };
|
||||
|
||||
private static readonly char PathSeparator = Path.DirectorySeparatorChar;
|
||||
private static readonly char DirSeparator = Path.DirectorySeparatorChar;
|
||||
|
||||
#if PAL3
|
||||
[MenuItem("PAL3/Build Pipelines/Build [Windows_x86] IL2CPP Release Executable")]
|
||||
@@ -67,13 +67,13 @@ namespace Editor
|
||||
}
|
||||
|
||||
#if PAL3
|
||||
[MenuItem("PAL3/Build Pipelines/Build [MacOS_arm64_x64] IL2CPP XCode Project")]
|
||||
[MenuItem("PAL3/Build Pipelines/Build [macOS_arm64_x64] IL2CPP XCode Project")]
|
||||
#elif PAL3A
|
||||
[MenuItem("PAL3A/Build Pipelines/Build [MacOS_arm64_x64] IL2CPP XCode Project")]
|
||||
[MenuItem("PAL3A/Build Pipelines/Build [macOS_arm64_x64] IL2CPP XCode Project")]
|
||||
#endif
|
||||
public static void Build_MacOS_arm64_x64()
|
||||
public static void Build_macOS_arm64_x64()
|
||||
{
|
||||
BuildGame(Pal3BuildTarget.MacOS_arm64_x64);
|
||||
BuildGame(Pal3BuildTarget.macOS_arm64_x64);
|
||||
}
|
||||
|
||||
#if PAL3
|
||||
@@ -97,16 +97,16 @@ namespace Editor
|
||||
}
|
||||
|
||||
#if PAL3
|
||||
[MenuItem("PAL3/Build Pipelines/Build All [Windows, Linux, MacOS, Android, iOS]")]
|
||||
[MenuItem("PAL3/Build Pipelines/Build All [Windows, Linux, macOS, Android, iOS]")]
|
||||
#elif PAL3A
|
||||
[MenuItem("PAL3A/Build Pipelines/Build All [Windows, Linux, MacOS, Android, iOS]")]
|
||||
[MenuItem("PAL3A/Build Pipelines/Build All [Windows, Linux, macOS, Android, iOS]")]
|
||||
#endif
|
||||
public static void BuildAll()
|
||||
{
|
||||
BuildGame(Pal3BuildTarget.Windows_x86 |
|
||||
Pal3BuildTarget.Windows_x64 |
|
||||
Pal3BuildTarget.Linux_x86_x64 |
|
||||
Pal3BuildTarget.MacOS_arm64_x64 |
|
||||
Pal3BuildTarget.macOS_arm64_x64 |
|
||||
Pal3BuildTarget.Android |
|
||||
Pal3BuildTarget.iOS);
|
||||
}
|
||||
@@ -127,17 +127,16 @@ namespace Editor
|
||||
BuildTarget targetBeforeBuild = EditorUserBuildSettings.activeBuildTarget;
|
||||
|
||||
string buildOutputPath = EditorUtility.SaveFolderPanel("Choose Location of Built Game", "", "");
|
||||
if (string.IsNullOrWhiteSpace(buildOutputPath)) return;
|
||||
|
||||
if (string.IsNullOrEmpty(buildOutputPath)) return;
|
||||
|
||||
buildOutputPath += $"{PathSeparator}{PlayerSettings.bundleVersion}{PathSeparator}";
|
||||
buildOutputPath += $"{DirSeparator}{PlayerSettings.bundleVersion}{DirSeparator}";
|
||||
|
||||
var buildConfigurations = new[]
|
||||
{
|
||||
new { Platform = Pal3BuildTarget.Windows_x86, Extension = ".exe", Group = BuildTargetGroup.Standalone, Target = BuildTarget.StandaloneWindows },
|
||||
new { Platform = Pal3BuildTarget.Windows_x64, Extension = ".exe", Group = BuildTargetGroup.Standalone, Target = BuildTarget.StandaloneWindows64 },
|
||||
new { Platform = Pal3BuildTarget.Linux_x86_x64, Extension = "", Group = BuildTargetGroup.Standalone, Target = BuildTarget.StandaloneLinux64 },
|
||||
new { Platform = Pal3BuildTarget.MacOS_arm64_x64, Extension = "", Group = BuildTargetGroup.Standalone, Target = BuildTarget.StandaloneOSX },
|
||||
new { Platform = Pal3BuildTarget.macOS_arm64_x64, Extension = "", Group = BuildTargetGroup.Standalone, Target = BuildTarget.StandaloneOSX },
|
||||
new { Platform = Pal3BuildTarget.Android, Extension = ".apk", Group = BuildTargetGroup.Android, Target = BuildTarget.Android },
|
||||
new { Platform = Pal3BuildTarget.iOS, Extension = "", Group = BuildTargetGroup.iOS, Target = BuildTarget.iOS },
|
||||
};
|
||||
@@ -163,7 +162,7 @@ namespace Editor
|
||||
// Execute report log actions
|
||||
logActions.ForEach(action => action.Invoke());
|
||||
|
||||
Debug.Log($"Build for version {PlayerSettings.bundleVersion} complete! Output path: " +
|
||||
Debug.Log($"[{nameof(ReleaseBuildPipeline)}] Build for version {PlayerSettings.bundleVersion} complete! Output path: " +
|
||||
$"{buildOutputPath}{GameConstants.AppName}");
|
||||
}
|
||||
|
||||
@@ -175,14 +174,14 @@ namespace Editor
|
||||
List<Action> logActions,
|
||||
bool deletePdbFiles = true)
|
||||
{
|
||||
string outputFolder = buildOutputPath + $"{GameConstants.AppName}{PathSeparator}" +
|
||||
$"{folderName}{PathSeparator}";
|
||||
string outputFolder = buildOutputPath + $"{GameConstants.AppName}{DirSeparator}" +
|
||||
$"{folderName}{DirSeparator}";
|
||||
|
||||
if (buildTarget is BuildTarget.StandaloneWindows
|
||||
or BuildTarget.StandaloneWindows64
|
||||
or BuildTarget.StandaloneLinux64)
|
||||
{
|
||||
outputFolder += $"{GameConstants.AppName}{PathSeparator}";
|
||||
outputFolder += $"{GameConstants.AppName}{DirSeparator}";
|
||||
}
|
||||
else if (buildTarget is BuildTarget.StandaloneOSX)
|
||||
{
|
||||
@@ -212,7 +211,7 @@ namespace Editor
|
||||
switch (report.summary.result)
|
||||
{
|
||||
case BuildResult.Succeeded:
|
||||
string successReport = $"Build [{report.summary.platform}] succeeded. " +
|
||||
string successReport = $"[{nameof(ReleaseBuildPipeline)}] Build [{report.summary.platform}] succeeded. " +
|
||||
$"Finished in {report.summary.totalTime.TotalMinutes:F2} minutes. " +
|
||||
$"Build size: {(report.summary.totalSize / 1024f / 1024f):F2} MB";
|
||||
logActions.Add(() => Debug.Log(successReport));
|
||||
@@ -236,8 +235,7 @@ namespace Editor
|
||||
{
|
||||
string buildOutputPath = EditorUtility.SaveFolderPanel("Choose Location of Built Game",
|
||||
$"{PlayerSettings.bundleVersion}", $"{PlayerSettings.bundleVersion}");
|
||||
|
||||
if (string.IsNullOrEmpty(buildOutputPath)) return;
|
||||
if (string.IsNullOrWhiteSpace(buildOutputPath)) return;
|
||||
|
||||
if (!buildOutputPath.EndsWith($"{PlayerSettings.bundleVersion}"))
|
||||
{
|
||||
@@ -246,22 +244,22 @@ namespace Editor
|
||||
return;
|
||||
}
|
||||
|
||||
string releaseDirPath = $"{buildOutputPath}{PathSeparator}Release";
|
||||
string releaseDirPath = $"{buildOutputPath}{DirSeparator}Release";
|
||||
Directory.CreateDirectory(releaseDirPath);
|
||||
|
||||
List<(string FolderPath, Pal3BuildTarget Target)> buildTargets = new()
|
||||
{
|
||||
($"{GameConstants.AppName}{PathSeparator}{Pal3BuildTarget.Android.ToString()}{PathSeparator}{GameConstants.AppName}.apk", Pal3BuildTarget.Android),
|
||||
($"{GameConstants.AppName}{PathSeparator}{Pal3BuildTarget.Windows_x86.ToString()}", Pal3BuildTarget.Windows_x86),
|
||||
($"{GameConstants.AppName}{PathSeparator}{Pal3BuildTarget.Windows_x64.ToString()}", Pal3BuildTarget.Windows_x64),
|
||||
($"{GameConstants.AppName}{PathSeparator}{Pal3BuildTarget.Linux_x86_x64.ToString()}", Pal3BuildTarget.Linux_x86_x64)
|
||||
($"{GameConstants.AppName}{DirSeparator}{Pal3BuildTarget.Android.ToString()}{DirSeparator}{GameConstants.AppName}.apk", Pal3BuildTarget.Android),
|
||||
($"{GameConstants.AppName}{DirSeparator}{Pal3BuildTarget.Windows_x86.ToString()}", Pal3BuildTarget.Windows_x86),
|
||||
($"{GameConstants.AppName}{DirSeparator}{Pal3BuildTarget.Windows_x64.ToString()}", Pal3BuildTarget.Windows_x64),
|
||||
($"{GameConstants.AppName}{DirSeparator}{Pal3BuildTarget.Linux_x86_x64.ToString()}", Pal3BuildTarget.Linux_x86_x64)
|
||||
};
|
||||
|
||||
foreach ((string folderPath, Pal3BuildTarget target) in buildTargets)
|
||||
{
|
||||
string fullPath = $"{buildOutputPath}{PathSeparator}{folderPath}";
|
||||
string fullPath = $"{buildOutputPath}{DirSeparator}{folderPath}";
|
||||
string zipFileName = $"{GameConstants.AppName}_v{PlayerSettings.bundleVersion}_{target.ToString()}.zip";
|
||||
string zipFilePath = $"{releaseDirPath}{PathSeparator}{zipFileName}";
|
||||
string zipFilePath = $"{releaseDirPath}{DirSeparator}{zipFileName}";
|
||||
|
||||
if (File.Exists(fullPath) || Directory.Exists(fullPath))
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2024, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2024, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2024, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -9,31 +9,32 @@ namespace Editor.SourceGenerator.Base
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
|
||||
public static class Utility
|
||||
{
|
||||
public static string GetMethodArgumentDefinitionListAsString(PropertyInfo[] properties)
|
||||
{
|
||||
var argListStr = String.Empty;
|
||||
StringBuilder argListStrBuilder = new ();
|
||||
for (var i = 0; i < properties.Length; i++)
|
||||
{
|
||||
argListStr += properties[i].PropertyType.ToString();
|
||||
argListStr += " ";
|
||||
argListStr += ToLowerFirstChar(properties[i].Name);
|
||||
if (i < properties.Length - 1) argListStr += ", ";
|
||||
argListStrBuilder.Append(properties[i].PropertyType);
|
||||
argListStrBuilder.Append(" ");
|
||||
argListStrBuilder.Append(ToLowerFirstChar(properties[i].Name));
|
||||
if (i < properties.Length - 1) argListStrBuilder.Append(", ");
|
||||
}
|
||||
return argListStr;
|
||||
return argListStrBuilder.ToString();
|
||||
}
|
||||
|
||||
public static string GetMethodArgumentListAsString(PropertyInfo[] properties)
|
||||
{
|
||||
var argListStr = String.Empty;
|
||||
StringBuilder argListStrBuilder = new ();
|
||||
for (var i = 0; i < properties.Length; i++)
|
||||
{
|
||||
argListStr += ToLowerFirstChar(properties[i].Name);
|
||||
if (i < properties.Length - 1) argListStr += ", ";
|
||||
argListStrBuilder.Append(ToLowerFirstChar(properties[i].Name));
|
||||
if (i < properties.Length - 1) argListStrBuilder.Append(", ");
|
||||
}
|
||||
return argListStr;
|
||||
return argListStrBuilder.ToString();
|
||||
}
|
||||
|
||||
private static string ToLowerFirstChar(string input)
|
||||
@@ -42,15 +43,11 @@ namespace Editor.SourceGenerator.Base
|
||||
return char.ToLower(input[0]) + input[1..];
|
||||
}
|
||||
|
||||
public static Type[] GetTypesOfInterface(Type interfaceType)
|
||||
public static IEnumerable<Type> GetTypesOfInterface(Type interfaceType)
|
||||
{
|
||||
var result = new List<Type>();
|
||||
foreach (Assembly asm in AppDomain.CurrentDomain.GetAssemblies())
|
||||
{
|
||||
result.AddRange(asm.GetTypes()
|
||||
.Where(t => t.IsClass && t.GetInterfaces().Contains(interfaceType)));
|
||||
}
|
||||
return result.ToArray();
|
||||
return AppDomain.CurrentDomain.GetAssemblies()
|
||||
.SelectMany(assembly => assembly.GetTypes())
|
||||
.Where(t => t.IsClass && t.GetInterfaces().Contains(interfaceType));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2024, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -10,7 +10,9 @@ namespace Editor.SourceGenerator
|
||||
using System.Reflection;
|
||||
using Base;
|
||||
using IngameDebugConsole;
|
||||
using Pal3.Command;
|
||||
using Pal3.Core.Command;
|
||||
using Pal3.Core.Command.SceCommands;
|
||||
using Pal3.Game.Command;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
@@ -34,9 +36,10 @@ namespace Editor.SourceGenerator
|
||||
writer.BeginBlock();
|
||||
|
||||
// Begin using.
|
||||
writer.WriteLine("using Core.Command;");
|
||||
writer.WriteLine("using Core.Command.SceCommands;");
|
||||
writer.WriteLine("using Extensions;");
|
||||
writer.WriteLine("using IngameDebugConsole;");
|
||||
writer.WriteLine("using InternalCommands;");
|
||||
writer.WriteLine("using SceCommands;");
|
||||
writer.WriteLine();
|
||||
|
||||
// Begin class.
|
||||
@@ -44,27 +47,25 @@ namespace Editor.SourceGenerator
|
||||
writer.WriteLine($"public static class {className}");
|
||||
writer.BeginBlock();
|
||||
|
||||
Type commandInterfaceType = typeof(TCommand);
|
||||
var commands = Utility.GetTypesOfInterface(commandInterfaceType)
|
||||
Type[] commands = Utility.GetTypesOfInterface(typeof(TCommand))
|
||||
.Where(IsCommandAvailableInConsole).ToArray();
|
||||
|
||||
Debug.Log($"Found {commands.Length} available console commands");
|
||||
Debug.Log($"[{nameof(ConsoleCommandsAutoGen<TCommand>)}] Found {commands.Length} available console commands");
|
||||
|
||||
for (var i = 0; i < commands.Length; i++)
|
||||
{
|
||||
var commandName = commands[i].Name.Replace("Command", string.Empty);
|
||||
var properties = commands[i].GetProperties();
|
||||
string commandName = commands[i].Name.Replace("Command", string.Empty);
|
||||
PropertyInfo[] properties = commands[i].GetProperties();
|
||||
|
||||
writer.WriteLine($"// <auto-generated/>");
|
||||
var attributeName = nameof(ConsoleMethodAttribute);
|
||||
string attributeName = nameof(ConsoleMethodAttribute);
|
||||
writer.WriteLine($"[{attributeName}(\"{commandName}\", \"{GetCommandDescription(commands[i])}\")]");
|
||||
writer.WriteLine($"public static void {commandName}" +
|
||||
$"({Utility.GetMethodArgumentDefinitionListAsString(properties)})");
|
||||
|
||||
writer.BeginBlock();
|
||||
writer.WriteLine($"CommandDispatcher<{typeof(TCommand).Name}>.Instance.Dispatch(");
|
||||
writer.WriteIndent(); writer.WriteLine($"new {commands[i].Name}" +
|
||||
$"({Utility.GetMethodArgumentListAsString(properties)}));");
|
||||
writer.WriteLine($"Pal3.Instance.Execute(new {commands[i].Name}" +
|
||||
$"({Utility.GetMethodArgumentListAsString(properties)}));");
|
||||
writer.EndBlock();
|
||||
|
||||
if (i < commands.Length - 1)
|
||||
@@ -92,7 +93,12 @@ namespace Editor.SourceGenerator
|
||||
|
||||
private static bool IsCommandAvailableInConsole(Type command)
|
||||
{
|
||||
return command.GetCustomAttributes().Any(attribute => attribute is AvailableInConsoleAttribute);
|
||||
// object[] is not supported by InGameDebugConsole.
|
||||
if (command == typeof(DialogueAddSelectionsCommand)) return false;
|
||||
|
||||
// Make all SceCommands available in console + all commands with AvailableInConsoleAttribute.
|
||||
return command.GetCustomAttributes()
|
||||
.Any(attribute => attribute is AvailableInConsoleAttribute or SceCommandAttribute);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2024, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Editor
|
||||
{
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using Pal3.Command;
|
||||
using Pal3.Core.Command;
|
||||
using SourceGenerator;
|
||||
using SourceGenerator.Base;
|
||||
using UnityEditor;
|
||||
@@ -30,8 +30,8 @@ namespace Editor
|
||||
#endif
|
||||
public static void GenerateConsoleCommands()
|
||||
{
|
||||
var writePath = $"Assets/Scripts/PAL3/Command/{OutputFileName}";
|
||||
var nameSpace = "Pal3.Command";
|
||||
var writePath = $"Assets/Scripts/Pal3.Game/Command/{OutputFileName}";
|
||||
var nameSpace = "Pal3.Game.Command";
|
||||
var className = "ConsoleCommands";
|
||||
ISourceGenerator sourceGenerator = new ConsoleCommandsAutoGen<ICommand>();
|
||||
GenerateSourceInternal(OutputFileName, writePath, className, nameSpace, sourceGenerator, true);
|
||||
@@ -46,11 +46,11 @@ namespace Editor
|
||||
{
|
||||
if (!overwrite && File.Exists(writePath))
|
||||
{
|
||||
Debug.LogError($"File already generated: {writePath}\n");
|
||||
Debug.LogError($"[{nameof(SourceGeneratorEditorOptions)}] File already generated: {writePath}\n");
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Log("Generating source file: " + writePath);
|
||||
Debug.Log($"[{nameof(SourceGeneratorEditorOptions)}] Generating source file: " + writePath);
|
||||
|
||||
var writer = new CodeWriter
|
||||
{
|
||||
@@ -67,7 +67,7 @@ namespace Editor
|
||||
using StreamWriter sw = new StreamWriter(writePath);
|
||||
sw.Write(output);
|
||||
|
||||
Debug.Log($"{fileName} generated.");
|
||||
Debug.Log($"[{nameof(SourceGeneratorEditorOptions)}] {fileName} generated.");
|
||||
|
||||
AssetDatabase.SaveAssets();
|
||||
AssetDatabase.Refresh();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2024, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -18,6 +18,15 @@ namespace Editor
|
||||
BuildTargetGroup.Android,
|
||||
BuildTargetGroup.Standalone,
|
||||
BuildTargetGroup.iOS,
|
||||
BuildTargetGroup.WSA,
|
||||
BuildTargetGroup.PS4,
|
||||
BuildTargetGroup.PS5,
|
||||
BuildTargetGroup.XboxOne,
|
||||
BuildTargetGroup.tvOS,
|
||||
BuildTargetGroup.Switch,
|
||||
BuildTargetGroup.GameCoreXboxOne,
|
||||
BuildTargetGroup.GameCoreXboxSeries,
|
||||
//BuildTargetGroup.VisionOS,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -28,6 +37,12 @@ namespace Editor
|
||||
NamedBuildTarget.Android,
|
||||
NamedBuildTarget.Standalone,
|
||||
NamedBuildTarget.iOS,
|
||||
NamedBuildTarget.PS4,
|
||||
NamedBuildTarget.XboxOne,
|
||||
NamedBuildTarget.tvOS,
|
||||
NamedBuildTarget.NintendoSwitch,
|
||||
NamedBuildTarget.WindowsStoreApps,
|
||||
//NamedBuildTarget.VisionOS,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aaf2f18d4aab8334b825c3d6737029d8
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File renamed without changes.
@@ -0,0 +1,193 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2024, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Engine.Animation
|
||||
{
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Threading;
|
||||
using Core.Abstraction;
|
||||
using Pal3.Core.Utilities;
|
||||
using Services;
|
||||
|
||||
using Quaternion = UnityEngine.Quaternion;
|
||||
using Vector3 = UnityEngine.Vector3;
|
||||
|
||||
public enum AnimationCurveType
|
||||
{
|
||||
// OG game only has these two
|
||||
Linear = 0,
|
||||
Sine = 1,
|
||||
|
||||
// New ones added by me
|
||||
Quadratic = 2,
|
||||
Cubic = 3,
|
||||
Exponential = 4,
|
||||
EaseIn = 5,
|
||||
EaseOut = 6,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Provides helper functions to do Transform animations etc.
|
||||
/// </summary>
|
||||
public static class CoreAnimation
|
||||
{
|
||||
// Progress -> (0,1)
|
||||
private static float GetInterpolationRatio(float progress, AnimationCurveType curveType)
|
||||
{
|
||||
return curveType switch
|
||||
{
|
||||
AnimationCurveType.Linear => progress,
|
||||
AnimationCurveType.Sine => MathF.Sin(progress * (MathF.PI / 2)),
|
||||
AnimationCurveType.Quadratic => MathF.Pow(progress, 2),
|
||||
AnimationCurveType.Cubic => MathF.Pow(progress, 3),
|
||||
AnimationCurveType.Exponential => MathF.Exp(progress) - 1,
|
||||
AnimationCurveType.EaseIn => MathF.Pow(progress, 3),
|
||||
AnimationCurveType.EaseOut => 1f - MathF.Pow(1 - progress, 3),
|
||||
_ => progress
|
||||
};
|
||||
}
|
||||
|
||||
private static float Clamp01(float value)
|
||||
{
|
||||
if ((double) value < 0.0) return 0.0f;
|
||||
return (double) value > 1.0 ? 1f : value;
|
||||
}
|
||||
|
||||
private static float Lerp(float a, float b, float t) => a + (b - a) * Clamp01(t);
|
||||
|
||||
public static IEnumerator EnumerateValueAsync(float from,
|
||||
float to,
|
||||
float duration,
|
||||
AnimationCurveType curveType,
|
||||
Action<float> onValueChanged,
|
||||
CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (MathF.Abs(duration) < float.Epsilon)
|
||||
{
|
||||
onValueChanged?.Invoke(to);
|
||||
yield break;
|
||||
}
|
||||
|
||||
var timePast = 0f;
|
||||
while (timePast < duration && !cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
var newValue = Lerp(from, to, GetInterpolationRatio(timePast / duration, curveType));
|
||||
onValueChanged?.Invoke(newValue);
|
||||
timePast += GameTimeProvider.Instance.DeltaTime;
|
||||
yield return null;
|
||||
}
|
||||
|
||||
if (!cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
onValueChanged?.Invoke(to);
|
||||
}
|
||||
yield return null;
|
||||
}
|
||||
|
||||
public static IEnumerator MoveAsync(this ITransform target,
|
||||
Vector3 toPosition,
|
||||
float duration,
|
||||
AnimationCurveType curveType = AnimationCurveType.Linear,
|
||||
CancellationToken cancellationToken = default)
|
||||
{
|
||||
Vector3 oldPosition = target.Position;
|
||||
|
||||
var timePast = 0f;
|
||||
while (timePast < duration && !target.IsNativeObjectDisposed && !cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
target.Position = oldPosition + (toPosition - oldPosition) *
|
||||
GetInterpolationRatio(timePast / duration, curveType);
|
||||
timePast += GameTimeProvider.Instance.DeltaTime;
|
||||
yield return null;
|
||||
}
|
||||
|
||||
if (!target.IsNativeObjectDisposed && !cancellationToken.IsCancellationRequested) target.Position = toPosition;
|
||||
yield return null;
|
||||
}
|
||||
|
||||
public static IEnumerator ShakeAsync(this ITransform target,
|
||||
float duration,
|
||||
float xAxisAmplitude,
|
||||
float yAxisAmplitude,
|
||||
float zAxisAmplitude)
|
||||
{
|
||||
Vector3 originalPosition = target.LocalPosition;
|
||||
|
||||
while (duration > 0 && !target.IsNativeObjectDisposed)
|
||||
{
|
||||
(float x, float y, float z) = RandomGenerator.RandomPointInsideUnitSphere();
|
||||
target.LocalPosition = originalPosition + new Vector3(
|
||||
x * xAxisAmplitude / 2f,
|
||||
y * yAxisAmplitude / 2f,
|
||||
z * zAxisAmplitude / 2f);
|
||||
duration -= GameTimeProvider.Instance.DeltaTime;
|
||||
yield return null;
|
||||
}
|
||||
|
||||
if (!target.IsNativeObjectDisposed) target.LocalPosition = originalPosition;
|
||||
yield return null;
|
||||
}
|
||||
|
||||
public static IEnumerator OrbitAroundCenterPointAsync(this ITransform target,
|
||||
Quaternion toRotation,
|
||||
Vector3 centerPoint,
|
||||
float duration,
|
||||
AnimationCurveType curveType,
|
||||
float distanceDelta,
|
||||
CancellationToken cancellationToken = default)
|
||||
{
|
||||
var distance = Vector3.Distance(target.Position, centerPoint);
|
||||
Quaternion startRotation = target.Rotation;
|
||||
|
||||
var timePast = 0f;
|
||||
while (timePast < duration && !target.IsNativeObjectDisposed && !cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
Quaternion newRotation = Quaternion.Slerp(startRotation, toRotation,
|
||||
GetInterpolationRatio(timePast / duration, curveType));
|
||||
|
||||
Vector3 direction = (newRotation * Vector3.forward).normalized;
|
||||
Vector3 newPosition = centerPoint + direction * -(distance + (timePast / duration) * distanceDelta);
|
||||
|
||||
target.SetPositionAndRotation(newPosition, newRotation);
|
||||
|
||||
timePast += GameTimeProvider.Instance.DeltaTime;
|
||||
yield return null;
|
||||
}
|
||||
|
||||
if (!target.IsNativeObjectDisposed && !cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
Vector3 newPosition = centerPoint + (toRotation * Vector3.forward).normalized * -(distance + distanceDelta);
|
||||
target.SetPositionAndRotation(newPosition, toRotation);
|
||||
}
|
||||
|
||||
yield return null;
|
||||
}
|
||||
|
||||
public static IEnumerator RotateAsync(this ITransform target,
|
||||
Quaternion toRotation,
|
||||
float duration,
|
||||
AnimationCurveType curveType,
|
||||
CancellationToken cancellationToken = default)
|
||||
{
|
||||
Quaternion startRotation = target.Rotation;
|
||||
|
||||
var timePast = 0f;
|
||||
while (timePast < duration && !target.IsNativeObjectDisposed && !cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
Quaternion rotation = Quaternion.Slerp(startRotation, toRotation,
|
||||
GetInterpolationRatio(timePast / duration, curveType));
|
||||
|
||||
target.Rotation = rotation;
|
||||
|
||||
timePast += GameTimeProvider.Instance.DeltaTime;
|
||||
yield return null;
|
||||
}
|
||||
|
||||
if (!target.IsNativeObjectDisposed && !cancellationToken.IsCancellationRequested) target.Rotation = toRotation;
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
File renamed without changes.
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9ef6c3bf5b624020a27bfc25b422e590
|
||||
timeCreated: 1697047338
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bbad412a275849d7b04f6c49f890cb7c
|
||||
timeCreated: 1696473669
|
||||
@@ -0,0 +1,91 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2024, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Engine.Core.Abstraction
|
||||
{
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a game entity that can be added to the game world.
|
||||
/// </summary>
|
||||
public interface IGameEntity : IManagedObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the game entity.
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the game entity is static.
|
||||
/// </summary>
|
||||
public bool IsStatic { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the layer of the game entity.
|
||||
/// </summary>
|
||||
public int Layer { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the transform of the game entity.
|
||||
/// </summary>
|
||||
public ITransform Transform { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Sets the parent of the game entity.
|
||||
/// </summary>
|
||||
/// <param name="parent">The parent game entity.</param>
|
||||
/// <param name="worldPositionStays">Whether to keep the world position of the game entity.</param>
|
||||
public void SetParent(IGameEntity parent, bool worldPositionStays);
|
||||
|
||||
/// <summary>
|
||||
/// Adds a component of the specified type to the game entity.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of the component to add.</typeparam>
|
||||
/// <returns>The added component.</returns>
|
||||
public T AddComponent<T>() where T : class;
|
||||
|
||||
/// <summary>
|
||||
/// Adds a component of the specified type to the game entity.
|
||||
/// </summary>
|
||||
/// <param name="type">The type of the component to add.</param>
|
||||
/// <returns>The added component.</returns>
|
||||
public object AddComponent(Type type);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the component of the specified type from the game entity.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of the component to get.</typeparam>
|
||||
/// <returns>The component of the specified type.</returns>
|
||||
public T GetComponent<T>() where T : class;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the component of the specified type from the children of the game entity.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of the component to get.</typeparam>
|
||||
/// <returns>The component of the specified type.</returns>
|
||||
public T GetComponentInChildren<T>() where T : class;
|
||||
|
||||
/// <summary>
|
||||
/// Gets all the components of the specified type from the children of the game entity.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of the components to get.</typeparam>
|
||||
/// <returns>All the components of the specified type.</returns>
|
||||
public T[] GetComponentsInChildren<T>() where T : class;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the component of the specified type from the game entity, or adds it if it doesn't exist.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of the component to get or add.</typeparam>
|
||||
/// <returns>The component of the specified type.</returns>
|
||||
public T GetOrAddComponent<T>() where T : class;
|
||||
|
||||
/// <summary>
|
||||
/// Finds the child game entity with the specified name.
|
||||
/// </summary>
|
||||
/// <param name="name">The name of the child game entity.</param>
|
||||
/// <returns>The child game entity with the specified name.</returns>
|
||||
public IGameEntity FindChild(string name);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 94feddd1ec544bca85f3073ea8afe879
|
||||
timeCreated: 1696527995
|
||||
@@ -0,0 +1,37 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2024, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Engine.Core.Abstraction
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface for managed objects that wrap native objects.
|
||||
/// </summary>
|
||||
public interface IManagedObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the underlying native object.
|
||||
/// </summary>
|
||||
public object NativeObject { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the underlying native object has been disposed.
|
||||
/// </summary>
|
||||
public bool IsNativeObjectDisposed { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Destroys the native object associated with this managed object.
|
||||
/// </summary>
|
||||
public void Destroy();
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified managed object is equal to the current managed object.
|
||||
/// </summary>
|
||||
public bool Equals(IManagedObject other)
|
||||
{
|
||||
if (other == null) return false;
|
||||
else return NativeObject == other.NativeObject;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8b42e5c4e3c4431e8bd97f0d5bcbd44f
|
||||
timeCreated: 1696933197
|
||||
@@ -0,0 +1,75 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2024, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Engine.Core.Abstraction
|
||||
{
|
||||
using Pal3.Core.Primitives;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a material used in rendering.
|
||||
/// </summary>
|
||||
public interface IMaterial : IManagedObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the name of the shader associated with this material.
|
||||
/// </summary>
|
||||
public string ShaderName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the float value of a material property.
|
||||
/// </summary>
|
||||
/// <param name="propertyId">The ID of the property.</param>
|
||||
/// <returns>The float value of the property.</returns>
|
||||
public float GetFloat(int propertyId);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the integer value of a material property.
|
||||
/// </summary>
|
||||
/// <param name="propertyId">The ID of the property.</param>
|
||||
/// <returns>The integer value of the property.</returns>
|
||||
public int GetInt(int propertyId);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the integer value of a material property.
|
||||
/// </summary>
|
||||
/// <param name="propertyId">The ID of the property.</param>
|
||||
/// <param name="value">The new integer value of the property.</param>
|
||||
public void SetInt(int propertyId, int value);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the float value of a material property.
|
||||
/// </summary>
|
||||
/// <param name="propertyId">The ID of the property.</param>
|
||||
/// <param name="value">The new float value of the property.</param>
|
||||
public void SetFloat(int propertyId, float value);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the color value of a material property.
|
||||
/// </summary>
|
||||
/// <param name="propertyId">The ID of the property.</param>
|
||||
/// <param name="value">The new color value of the property.</param>
|
||||
public void SetColor(int propertyId, Color value);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the main texture of the material.
|
||||
/// </summary>
|
||||
/// <param name="texture">The main texture to set.</param>
|
||||
public void SetMainTexture(ITexture2D texture);
|
||||
|
||||
/// <summary>
|
||||
/// Sets a texture for a material property.
|
||||
/// </summary>
|
||||
/// <param name="propertyId">The ID of the property.</param>
|
||||
/// <param name="texture">The texture to set.</param>
|
||||
public void SetTexture(int propertyId, ITexture2D texture);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the scale of the main texture.
|
||||
/// </summary>
|
||||
/// <param name="x">The scale factor along the x-axis.</param>
|
||||
/// <param name="y">The scale factor along the y-axis.</param>
|
||||
public void SetMainTextureScale(float x, float y);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c7e0e59161484e92a3f3b0961d219c87
|
||||
timeCreated: 1703641161
|
||||
@@ -0,0 +1,27 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2024, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Engine.Core.Abstraction
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a factory for creating materials.
|
||||
/// </summary>
|
||||
public interface IMaterialFactory
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a new material with the specified shader name.
|
||||
/// </summary>
|
||||
/// <param name="shaderName">The name of the shader to use for the material.</param>
|
||||
/// <returns>The created material.</returns>
|
||||
public IMaterial CreateMaterial(string shaderName);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new material based on an existing material.
|
||||
/// </summary>
|
||||
/// <param name="material">The existing material to create a new material from.</param>
|
||||
/// <returns>The created material.</returns>
|
||||
public IMaterial CreateMaterialFrom(IMaterial material);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 670115cb6f834dbbbe9a1dd40b1413be
|
||||
timeCreated: 1703643782
|
||||
@@ -0,0 +1,18 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2024, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Engine.Core.Abstraction
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface for a sprite object.
|
||||
/// </summary>
|
||||
public interface ISprite : IManagedObject
|
||||
{
|
||||
/// <summary>
|
||||
/// The texture used by the sprite.
|
||||
/// </summary>
|
||||
public ITexture2D Texture { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a6b358f6f1a6467e9bf06a24b357b1c1
|
||||
timeCreated: 1697278435
|
||||
@@ -0,0 +1,68 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2024, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Engine.Core.Abstraction
|
||||
{
|
||||
/// <summary>
|
||||
/// Specifies how texture coordinates outside the range of 0 to 1 are handled.
|
||||
/// </summary>
|
||||
public enum WrapMode
|
||||
{
|
||||
/// <summary>
|
||||
/// Tiles the texture, creating a repeating pattern.
|
||||
/// </summary>
|
||||
Repeat,
|
||||
|
||||
/// <summary>
|
||||
/// Clamps the texture to the last pixel at the edge, creating a solid color border.
|
||||
/// </summary>
|
||||
Clamp,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Interface for a 2D texture.
|
||||
/// </summary>
|
||||
public interface ITexture2D : IManagedObject
|
||||
{
|
||||
/// <summary>
|
||||
/// The width of the texture.
|
||||
/// </summary>
|
||||
public int Width { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The height of the texture.
|
||||
/// </summary>
|
||||
public int Height { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Sets the wrap mode of the texture.
|
||||
/// </summary>
|
||||
/// <param name="wrapMode">The wrap mode to set.</param>
|
||||
public void SetWrapMode(WrapMode wrapMode);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the pixel color at the specified position.
|
||||
/// </summary>
|
||||
/// <param name="x">The x-coordinate of the pixel.</param>
|
||||
/// <param name="y">The y-coordinate of the pixel.</param>
|
||||
/// <returns>The color of the pixel.</returns>
|
||||
public (float r, float g, float b, float a) GetPixel(int x, int y);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a sprite from the texture.
|
||||
/// </summary>
|
||||
/// <param name="x">The x-coordinate of the sprite.</param>
|
||||
/// <param name="y">The y-coordinate of the sprite.</param>
|
||||
/// <param name="width">The width of the sprite.</param>
|
||||
/// <param name="height">The height of the sprite.</param>
|
||||
/// <param name="pivotX">The x-coordinate of the pivot point.</param>
|
||||
/// <param name="pivotY">The y-coordinate of the pivot point.</param>
|
||||
/// <returns>The created sprite.</returns>
|
||||
public ISprite CreateSprite(
|
||||
float x, float y,
|
||||
float width, float height,
|
||||
float pivotX, float pivotY);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0edca994b1354ce196a30a65fbbbcba5
|
||||
timeCreated: 1697105949
|
||||
@@ -0,0 +1,29 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2024, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Engine.Core.Abstraction
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface for a texture factory that creates textures.
|
||||
/// </summary>
|
||||
public interface ITextureFactory
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a new texture with the specified width, height, and RGBA data.
|
||||
/// </summary>
|
||||
/// <param name="width">The width of the texture.</param>
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
/// <param name="rgba32DataBuffer">The RGBA32 data of the texture to be read from.
|
||||
/// Size should be greater than or equal to width * height * 4.</param>
|
||||
/// <returns>The created texture.</returns>
|
||||
public ITexture2D CreateTexture(int width, int height, byte[] rgba32DataBuffer);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new white texture.
|
||||
/// </summary>
|
||||
/// <returns>The created texture.</returns>
|
||||
public ITexture2D CreateWhiteTexture();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0561191f2eb64dcf94d762ef49668a2d
|
||||
timeCreated: 1697259771
|
||||
+8
-10
@@ -1,16 +1,14 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2024, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Core.DataLoader
|
||||
namespace Engine.Core.Abstraction
|
||||
{
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// Texture loader and Texture2D converter interface.
|
||||
/// Texture loader and ITexture2D creator interface.
|
||||
/// The reason we have a separate Load method interface is because
|
||||
/// Texture2D.Apply() is single threaded (upload texture to VRAM),
|
||||
/// uploading texture to GPU is single threaded (upload texture to VRAM),
|
||||
/// while the loading and decoding part can run in parallel and it should
|
||||
/// be thread-safe in general. This two-step approach gives caller
|
||||
/// more flexibility.
|
||||
@@ -22,12 +20,12 @@ namespace Core.DataLoader
|
||||
/// </summary>
|
||||
/// <param name="data">Raw texture data in byte array</param>
|
||||
/// <param name="hasAlphaChannel">True if texture has alpha channel</param>
|
||||
void Load(byte[] data, out bool hasAlphaChannel);
|
||||
public void Load(byte[] data, out bool hasAlphaChannel);
|
||||
|
||||
/// <summary>
|
||||
/// Convert loaded texture into Texture2D instance.
|
||||
/// Convert loaded data into ITexture2D instance.
|
||||
/// </summary>
|
||||
/// <returns>Texture2D instance</returns>
|
||||
Texture2D ToTexture2D();
|
||||
/// <returns>ITexture2D instance</returns>
|
||||
public ITexture2D ToTexture();
|
||||
}
|
||||
}
|
||||
File renamed without changes.
@@ -0,0 +1,35 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2024, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Engine.Core.Abstraction
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface for providing texture resources.
|
||||
/// </summary>
|
||||
public interface ITextureResourceProvider
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the path of the texture with the specified name.
|
||||
/// </summary>
|
||||
/// <param name="name">The name of the texture.</param>
|
||||
/// <returns>The path of the texture.</returns>
|
||||
public string GetTexturePath(string name);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the texture with the specified name.
|
||||
/// </summary>
|
||||
/// <param name="name">The name of the texture.</param>
|
||||
/// <returns>The texture.</returns>
|
||||
public ITexture2D GetTexture(string name);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the texture with the specified name and determines if it has an alpha channel.
|
||||
/// </summary>
|
||||
/// <param name="name">The name of the texture.</param>
|
||||
/// <param name="hasAlphaChannel">Whether or not the texture has an alpha channel.</param>
|
||||
/// <returns>The texture.</returns>
|
||||
public ITexture2D GetTexture(string name, out bool hasAlphaChannel);
|
||||
}
|
||||
}
|
||||
File renamed without changes.
@@ -0,0 +1,109 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2024, Jiaqi (0x7c13) Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Engine.Core.Abstraction
|
||||
{
|
||||
using Quaternion = UnityEngine.Quaternion;
|
||||
using Vector3 = UnityEngine.Vector3;
|
||||
|
||||
/// <summary>
|
||||
/// Interface for a transform object, which represents the position, rotation, and scale of a game object.
|
||||
/// </summary>
|
||||
public interface ITransform : IManagedObject
|
||||
{
|
||||
/// <summary>
|
||||
/// The position of the transform in world space.
|
||||
/// </summary>
|
||||
public Vector3 Position { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The position of the transform relative to the parent transform.
|
||||
/// </summary>
|
||||
public Vector3 LocalPosition { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The rotation of the transform in world space.
|
||||
/// </summary>
|
||||
public Quaternion Rotation { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The rotation of the transform relative to the parent transform.
|
||||
/// </summary>
|
||||
public Quaternion LocalRotation { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The scale of the transform relative to the parent transform.
|
||||
/// </summary>
|
||||
public Vector3 LocalScale { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The forward direction of the transform in world space.
|
||||
/// </summary>
|
||||
public Vector3 Forward { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The right direction of the transform in world space.
|
||||
/// </summary>
|
||||
public Vector3 Right { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The up direction of the transform in world space.
|
||||
/// </summary>
|
||||
public Vector3 Up { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The rotation of the transform expressed as euler angles.
|
||||
/// </summary>
|
||||
public Vector3 EulerAngles { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Translates the transform by the given vector.
|
||||
/// </summary>
|
||||
/// <param name="translation">The vector to translate by.</param>
|
||||
public void Translate(Vector3 translation);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the position and rotation of the transform in world space.
|
||||
/// </summary>
|
||||
/// <param name="position">The position of the transform.</param>
|
||||
/// <param name="rotation">The rotation of the transform.</param>
|
||||
public void GetPositionAndRotation(out Vector3 position, out Quaternion rotation);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the position and rotation of the transform in world space.
|
||||
/// </summary>
|
||||
/// <param name="position">The new position of the transform.</param>
|
||||
/// <param name="rotation">The new rotation of the transform.</param>
|
||||
public void SetPositionAndRotation(Vector3 position, Quaternion rotation);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the position and rotation of the transform relative to the parent transform.
|
||||
/// </summary>
|
||||
/// <param name="position">The local position of the transform.</param>
|
||||
/// <param name="rotation">The local rotation of the transform.</param>
|
||||
public void GetLocalPositionAndRotation(out Vector3 position, out Quaternion rotation);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the position and rotation of the transform relative to the parent transform.
|
||||
/// </summary>
|
||||
/// <param name="position">The new local position of the transform.</param>
|
||||
/// <param name="rotation">The new local rotation of the transform.</param>
|
||||
public void SetLocalPositionAndRotation(Vector3 position, Quaternion rotation);
|
||||
|
||||
/// <summary>
|
||||
/// Rotates the transform to face the given target position.
|
||||
/// </summary>
|
||||
/// <param name="target">The position to look at.</param>
|
||||
public void LookAt(Vector3 target);
|
||||
|
||||
/// <summary>
|
||||
/// Rotates the transform around the given axis by the given angle.
|
||||
/// </summary>
|
||||
/// <param name="centerPoint">The point to rotate around.</param>
|
||||
/// <param name="axis">The axis to rotate around.</param>
|
||||
/// <param name="angle">The angle to rotate by.</param>
|
||||
public void RotateAround(Vector3 centerPoint, Vector3 axis, float angle);
|
||||
}
|
||||
}
|
||||
Loaded 100 of 1400 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user