mirror of
https://github.com/0x7c13/Pal3.Unity.git
synced 2026-11-27 01:48:06 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
4dd3992a32 | ||
|
|
5fab0d867e | ||
|
|
a1801f59f5 | ||
|
|
3f467944ce | ||
|
|
b1add2a940 | ||
|
|
3e8f350740 |
No files matched your search
+4
-1
@@ -83,4 +83,7 @@ crashlytics-build.properties
|
||||
/Assets/Resources/Prefabs/VFX/PAL3A/*.meta
|
||||
|
||||
# Materials that are using 3rd party assets
|
||||
/Assets/Resources/Materials/
|
||||
/Assets/Resources/Materials/
|
||||
|
||||
# VS Conde config file
|
||||
.vsconfig
|
||||
@@ -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: 25
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 2
|
||||
m_VerticalAlignment: 512
|
||||
|
||||
@@ -7,6 +7,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 +17,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 +81,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 +97,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 +127,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 +187,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 +203,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 +228,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
|
||||
}
|
||||
|
||||
@@ -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:
|
||||
@@ -134,14 +134,13 @@ namespace Core.Animation
|
||||
var timePast = 0f;
|
||||
while (timePast < duration && target != null && !cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
Quaternion rotation = Quaternion.Lerp(startRotation, toRotation,
|
||||
Quaternion newRotation = Quaternion.Slerp(startRotation, toRotation,
|
||||
GetInterpolationRatio(timePast / duration, curveType));
|
||||
|
||||
Vector3 direction = (rotation * Vector3.forward).normalized;
|
||||
Vector3 direction = (newRotation * Vector3.forward).normalized;
|
||||
Vector3 newPosition = centerPoint + direction * -(distance + (timePast / duration) * distanceDelta);
|
||||
|
||||
target.rotation = rotation;
|
||||
target.position = newPosition;
|
||||
target.SetPositionAndRotation(newPosition, newRotation);
|
||||
|
||||
timePast += Time.deltaTime;
|
||||
yield return null;
|
||||
@@ -149,8 +148,8 @@ namespace Core.Animation
|
||||
|
||||
if (target != null && !cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
target.rotation = toRotation;
|
||||
target.position = centerPoint + (toRotation * Vector3.forward).normalized * -(distance + distanceDelta);
|
||||
Vector3 newPosition = centerPoint + (toRotation * Vector3.forward).normalized * -(distance + distanceDelta);
|
||||
target.SetPositionAndRotation(newPosition, toRotation);
|
||||
}
|
||||
|
||||
yield return null;
|
||||
@@ -167,7 +166,7 @@ namespace Core.Animation
|
||||
var timePast = 0f;
|
||||
while (timePast < duration && target != null && !cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
Quaternion rotation = Quaternion.Lerp(startRotation, toRotation,
|
||||
Quaternion rotation = Quaternion.Slerp(startRotation, toRotation,
|
||||
GetInterpolationRatio(timePast / duration, curveType));
|
||||
|
||||
target.rotation = rotation;
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Core.DataLoader
|
||||
|
||||
if (request.result == UnityWebRequest.Result.ConnectionError)
|
||||
{
|
||||
Debug.LogError($"Failed to load {url} with error: {request.error}");
|
||||
Debug.LogError($"[{nameof(AudioClipLoader)}] Failed to load {url} with error: {request.error}");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -49,7 +49,7 @@ namespace Core.DataLoader
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogError($"Failed to get audio clip: {filePath} with exception: {ex}");
|
||||
Debug.LogError($"[{nameof(AudioClipLoader)}] Failed to get audio clip: {filePath} with exception: {ex}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
namespace Core.DataLoader
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
||||
using DataReader;
|
||||
using DataReader.Dxt;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -22,8 +22,7 @@ namespace Core.DataLoader
|
||||
|
||||
public void Load(byte[] data, out bool hasAlphaChannel)
|
||||
{
|
||||
using var stream = new MemoryStream(data);
|
||||
using var reader = new BinaryReader(stream);
|
||||
using var reader = new SafeBinaryReader(data);
|
||||
|
||||
if (!IsValidDxtFile(reader))
|
||||
{
|
||||
@@ -53,11 +52,11 @@ namespace Core.DataLoader
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsValidDxtFile(BinaryReader reader)
|
||||
private bool IsValidDxtFile(IBinaryReader reader)
|
||||
{
|
||||
var header = new string(reader.ReadChars(4));
|
||||
if (header == "DDS ") return true;
|
||||
Debug.Log($"Invalid DXT header: {header}");
|
||||
Debug.Log($"[{nameof(DxtTextureLoader)}] Invalid DXT header: {header}");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace Core.DataReader.Cpk
|
||||
foreach (CpkEntry node in nodes)
|
||||
{
|
||||
var relativePath = node.VirtualPath.Replace(
|
||||
CpkConstants.DirectorySeparator, Path.DirectorySeparatorChar);
|
||||
CpkConstants.DirectorySeparatorChar, Path.DirectorySeparatorChar);
|
||||
|
||||
if (node.IsDirectory)
|
||||
{
|
||||
@@ -313,7 +313,10 @@ namespace Core.DataReader.Cpk
|
||||
yield break;
|
||||
}
|
||||
|
||||
if (rootPath != string.Empty) rootPath += CpkConstants.DirectorySeparator;
|
||||
if (!string.IsNullOrEmpty(rootPath))
|
||||
{
|
||||
rootPath += CpkConstants.DirectorySeparatorChar;
|
||||
}
|
||||
|
||||
foreach (var childCrc in _fatherCrcToChildCrcTableIndexMap[fatherCrc])
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Core.DataReader.Cpk
|
||||
{
|
||||
public static class CpkConstants
|
||||
{
|
||||
public const char DirectorySeparator = '\\';
|
||||
public const char DirectorySeparatorChar = '\\';
|
||||
|
||||
public const string FileExtension = ".cpk";
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ namespace Core.DataReader.Cpk
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// Crc32 hash provider.
|
||||
@@ -39,6 +40,8 @@ namespace Core.DataReader.Cpk
|
||||
}
|
||||
|
||||
_initialized = true;
|
||||
|
||||
Debug.Log($"[{nameof(Crc32Hash)}] CRC32 table initialized.");
|
||||
}
|
||||
|
||||
public uint Compute(string str, int codepage, bool useCache = true)
|
||||
@@ -64,7 +67,7 @@ namespace Core.DataReader.Cpk
|
||||
|
||||
private unsafe uint ComputeInternal(byte[] data)
|
||||
{
|
||||
if (!_initialized) throw new InvalidOperationException("CrcHash not initialized yet.");
|
||||
if (!_initialized) throw new InvalidOperationException($"{nameof(Crc32Hash)} not initialized yet.");
|
||||
|
||||
if (data == null || data.Length == 0 || data[0] == 0)
|
||||
{
|
||||
|
||||
@@ -154,7 +154,6 @@ namespace Core.DataReader.Cvd
|
||||
public int[] Triangles;
|
||||
public GameBoxBlendFlag BlendFlag;
|
||||
public GameBoxMaterial Material;
|
||||
public string TextureName;
|
||||
public float[] AnimationTimeKeys;
|
||||
public GameBoxMaterial[] AnimationMaterials;
|
||||
}
|
||||
|
||||
@@ -3,15 +3,12 @@
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
#define USE_UNSAFE_BINARY_READER
|
||||
|
||||
namespace Core.DataReader.Cvd
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using Extensions;
|
||||
using GameBox;
|
||||
using UnityEngine;
|
||||
using Utils;
|
||||
@@ -25,15 +22,8 @@ namespace Core.DataReader.Cvd
|
||||
_codepage = codepage;
|
||||
}
|
||||
|
||||
public CvdFile Read(byte[] data)
|
||||
public CvdFile Read(IBinaryReader reader)
|
||||
{
|
||||
#if USE_UNSAFE_BINARY_READER
|
||||
using var reader = new UnsafeBinaryReader(data);
|
||||
#else
|
||||
using var stream = new MemoryStream(data);
|
||||
using var reader = new BinaryReader(stream);
|
||||
#endif
|
||||
|
||||
var header = reader.ReadChars(4);
|
||||
var headerStr = new string(header);
|
||||
|
||||
@@ -55,19 +45,11 @@ namespace Core.DataReader.Cvd
|
||||
return new CvdFile(animationDuration, rootNodes.ToArray());
|
||||
}
|
||||
|
||||
#if USE_UNSAFE_BINARY_READER
|
||||
private static void ReadGeometryNodes(UnsafeBinaryReader reader,
|
||||
private static void ReadGeometryNodes(IBinaryReader reader,
|
||||
float version,
|
||||
List<CvdGeometryNode> rootNodes,
|
||||
ref float animationDuration,
|
||||
int codepage)
|
||||
#else
|
||||
private static void ReadGeometryNodes(BinaryReader reader,
|
||||
float version,
|
||||
List<CvdGeometryNode> rootNodes,
|
||||
ref float animationDuration,
|
||||
int codepage)
|
||||
#endif
|
||||
{
|
||||
CvdGeometryNode parentNode = default;
|
||||
|
||||
@@ -90,17 +72,10 @@ namespace Core.DataReader.Cvd
|
||||
rootNodes.Add(parentNode);
|
||||
}
|
||||
|
||||
#if USE_UNSAFE_BINARY_READER
|
||||
private static CvdGeometryNode ReadGeometryNode(UnsafeBinaryReader reader,
|
||||
private static CvdGeometryNode ReadGeometryNode(IBinaryReader reader,
|
||||
float version,
|
||||
ref float animationDuration,
|
||||
int codepage)
|
||||
#else
|
||||
private static CvdGeometryNode ReadGeometryNode(BinaryReader reader,
|
||||
float version,
|
||||
ref float animationDuration,
|
||||
int codepage)
|
||||
#endif
|
||||
{
|
||||
var positionKeySize = Mathf.Max(
|
||||
Marshal.SizeOf(typeof(CvdTcbVector3Key)),
|
||||
@@ -151,11 +126,7 @@ namespace Core.DataReader.Cvd
|
||||
};
|
||||
}
|
||||
|
||||
#if USE_UNSAFE_BINARY_READER
|
||||
private static (CvdAnimationKeyType, byte[])[] ReadAnimationKeyInfo(UnsafeBinaryReader reader, int size)
|
||||
#else
|
||||
private static (CvdAnimationKeyType, byte[])[] ReadAnimationKeyInfo(BinaryReader reader, int size)
|
||||
#endif
|
||||
private static (CvdAnimationKeyType, byte[])[] ReadAnimationKeyInfo(IBinaryReader reader, int size)
|
||||
{
|
||||
var numberOfKeys = reader.ReadInt32();
|
||||
var keyInfos = new (CvdAnimationKeyType, byte[])[numberOfKeys];
|
||||
@@ -177,11 +148,7 @@ namespace Core.DataReader.Cvd
|
||||
return keyInfos;
|
||||
}
|
||||
|
||||
#if USE_UNSAFE_BINARY_READER
|
||||
private static CvdAnimationPositionKeyFrame[] ReadPositionAnimationKeyInfo(UnsafeBinaryReader reader, int size)
|
||||
#else
|
||||
private static CvdAnimationPositionKeyFrame[] ReadPositionAnimationKeyInfo(BinaryReader reader, int size)
|
||||
#endif
|
||||
private static CvdAnimationPositionKeyFrame[] ReadPositionAnimationKeyInfo(IBinaryReader reader, int size)
|
||||
{
|
||||
var frameInfos = ReadAnimationKeyInfo(reader, size);
|
||||
var positionKeyFrames = new CvdAnimationPositionKeyFrame[frameInfos.Length];
|
||||
@@ -231,11 +198,7 @@ namespace Core.DataReader.Cvd
|
||||
return positionKeyFrames;
|
||||
}
|
||||
|
||||
#if USE_UNSAFE_BINARY_READER
|
||||
private static CvdAnimationRotationKeyFrame[] ReadRotationAnimationKeyInfo(UnsafeBinaryReader reader, int size)
|
||||
#else
|
||||
private static CvdAnimationRotationKeyFrame[] ReadRotationAnimationKeyInfo(BinaryReader reader, int size)
|
||||
#endif
|
||||
private static CvdAnimationRotationKeyFrame[] ReadRotationAnimationKeyInfo(IBinaryReader reader, int size)
|
||||
{
|
||||
var frameInfos = ReadAnimationKeyInfo(reader, size);
|
||||
var rotationKeyFrames = new CvdAnimationRotationKeyFrame[frameInfos.Length];
|
||||
@@ -292,11 +255,7 @@ namespace Core.DataReader.Cvd
|
||||
return rotationKeyFrames;
|
||||
}
|
||||
|
||||
#if USE_UNSAFE_BINARY_READER
|
||||
private static CvdAnimationScaleKeyFrame[] ReadScaleAnimationKeyInfo(UnsafeBinaryReader reader, int size)
|
||||
#else
|
||||
private static CvdAnimationScaleKeyFrame[] ReadScaleAnimationKeyInfo(BinaryReader reader, int size)
|
||||
#endif
|
||||
private static CvdAnimationScaleKeyFrame[] ReadScaleAnimationKeyInfo(IBinaryReader reader, int size)
|
||||
{
|
||||
var frameInfos = ReadAnimationKeyInfo(reader, size);
|
||||
var scaleKeyFrames = new CvdAnimationScaleKeyFrame[frameInfos.Length];
|
||||
@@ -349,11 +308,7 @@ namespace Core.DataReader.Cvd
|
||||
return scaleKeyFrames;
|
||||
}
|
||||
|
||||
#if USE_UNSAFE_BINARY_READER
|
||||
private static CvdMesh ReadMesh(UnsafeBinaryReader reader, float version, int codepage)
|
||||
#else
|
||||
private static CvdMesh ReadMesh(BinaryReader reader, float version, int codepage)
|
||||
#endif
|
||||
private static CvdMesh ReadMesh(IBinaryReader reader, float version, int codepage)
|
||||
{
|
||||
var numberOfFrames = reader.ReadInt32();
|
||||
var numberOfVertices = reader.ReadInt32();
|
||||
@@ -401,31 +356,23 @@ namespace Core.DataReader.Cvd
|
||||
};
|
||||
}
|
||||
|
||||
#if USE_UNSAFE_BINARY_READER
|
||||
private static CvdMeshSection ReadMeshSection(UnsafeBinaryReader reader,
|
||||
private static CvdMeshSection ReadMeshSection(IBinaryReader reader,
|
||||
float version,
|
||||
CvdVertex[][] allFrameVertices,
|
||||
int codepage)
|
||||
#else
|
||||
private static CvdMeshSection ReadMeshSection(BinaryReader reader,
|
||||
float version,
|
||||
CvdVertex[][] allFrameVertices,
|
||||
int codepage)
|
||||
#endif
|
||||
{
|
||||
var blendFlag = (GameBoxBlendFlag)reader.ReadByte();
|
||||
GameBoxBlendFlag blendFlag = (GameBoxBlendFlag)reader.ReadByte();
|
||||
|
||||
var material = new GameBoxMaterial()
|
||||
GameBoxMaterial material = new ()
|
||||
{
|
||||
Diffuse = Utility.ToColor32(reader.ReadBytes(4)),
|
||||
Ambient = Utility.ToColor32(reader.ReadBytes(4)),
|
||||
Specular = Utility.ToColor32(reader.ReadBytes(4)),
|
||||
Emissive = Utility.ToColor32(reader.ReadBytes(4)),
|
||||
Power = reader.ReadSingle()
|
||||
SpecularPower = reader.ReadSingle(),
|
||||
TextureFileNames = new [] { reader.ReadString(64, codepage) }
|
||||
};
|
||||
|
||||
var textureName = reader.ReadString(64, codepage);
|
||||
|
||||
var numberOfIndices = reader.ReadInt32();
|
||||
|
||||
var indices = new (ushort x, ushort y, ushort z)[numberOfIndices];
|
||||
@@ -458,7 +405,7 @@ namespace Core.DataReader.Cvd
|
||||
Ambient = Utility.ToColor(reader.ReadSingleArray(4)),
|
||||
Specular = Utility.ToColor(reader.ReadSingleArray(4)),
|
||||
Emissive = Utility.ToColor(reader.ReadSingleArray(4)),
|
||||
Power = reader.ReadSingle()
|
||||
SpecularPower = reader.ReadSingle()
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -486,7 +433,6 @@ namespace Core.DataReader.Cvd
|
||||
{
|
||||
BlendFlag = blendFlag,
|
||||
Material = material,
|
||||
TextureName = textureName,
|
||||
FrameVertices = frameVertices,
|
||||
Triangles = triangles.ToArray(),
|
||||
AnimationTimeKeys = animationTimeKeys,
|
||||
@@ -501,18 +447,18 @@ namespace Core.DataReader.Cvd
|
||||
var triangles = new List<int>();
|
||||
var index = 0;
|
||||
|
||||
for (var j = 0; j < allIndices.Length; j++)
|
||||
for (var i = 0; i < allIndices.Length; i++)
|
||||
{
|
||||
var indices = new[]
|
||||
{
|
||||
allIndices[j].x,
|
||||
allIndices[j].y,
|
||||
allIndices[j].z
|
||||
allIndices[i].x,
|
||||
allIndices[i].y,
|
||||
allIndices[i].z
|
||||
};
|
||||
|
||||
for (var k = 0; k < 3; k++)
|
||||
for (var j = 0; j < 3; j++)
|
||||
{
|
||||
indexBuffer.Add(indices[k]);
|
||||
indexBuffer.Add(indices[j]);
|
||||
triangles.Add(index++);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,27 +3,14 @@
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
//#define USE_UNSAFE_BINARY_READER
|
||||
|
||||
namespace Core.DataReader.Data
|
||||
{
|
||||
using System.IO;
|
||||
using Extensions;
|
||||
using Utils;
|
||||
|
||||
public sealed class EffectDefinitionFileReader : IFileReader<EffectDefinitionFile>
|
||||
{
|
||||
private const int NUM_OF_EFFECTS = 1324;
|
||||
|
||||
public EffectDefinitionFile Read(byte[] data)
|
||||
public EffectDefinitionFile Read(IBinaryReader reader)
|
||||
{
|
||||
#if USE_UNSAFE_BINARY_READER
|
||||
using var reader = new UnsafeBinaryReader(data);
|
||||
#else
|
||||
using var stream = new MemoryStream(data);
|
||||
using var reader = new BinaryReader(stream);
|
||||
#endif
|
||||
|
||||
var effectDefinitions = new EffectDefinition[NUM_OF_EFFECTS];
|
||||
|
||||
for (var i = 0; i < NUM_OF_EFFECTS; i++)
|
||||
@@ -34,11 +21,7 @@ namespace Core.DataReader.Data
|
||||
return new EffectDefinitionFile(effectDefinitions);
|
||||
}
|
||||
|
||||
#if USE_UNSAFE_BINARY_READER
|
||||
private static EffectDefinition ReadEffectDefinition(UnsafeBinaryReader reader)
|
||||
#else
|
||||
private static EffectDefinition ReadEffectDefinition(BinaryReader reader)
|
||||
#endif
|
||||
private static EffectDefinition ReadEffectDefinition(IBinaryReader reader)
|
||||
{
|
||||
var effectDefinition = new EffectDefinition();
|
||||
|
||||
|
||||
@@ -5,9 +5,6 @@
|
||||
|
||||
namespace Core.DataReader.Dxt
|
||||
{
|
||||
using System.IO;
|
||||
using Extensions;
|
||||
|
||||
public sealed class DxtPixelFormat
|
||||
{
|
||||
public int Size;
|
||||
@@ -19,13 +16,13 @@ namespace Core.DataReader.Dxt
|
||||
public int BBitMask;
|
||||
public int ABitMask;
|
||||
|
||||
public static DxtPixelFormat ReadFormat(BinaryReader reader)
|
||||
public static DxtPixelFormat ReadFormat(IBinaryReader reader)
|
||||
{
|
||||
return new DxtPixelFormat
|
||||
{
|
||||
Size = reader.ReadInt32(),
|
||||
Flags = reader.ReadInt32(),
|
||||
Format = reader.ReadAsciiString(4),
|
||||
Format = reader.ReadString(4),
|
||||
RGBBitCount = reader.ReadInt32(),
|
||||
RBitMask = reader.ReadInt32(),
|
||||
GBitMask = reader.ReadInt32(),
|
||||
@@ -52,7 +49,7 @@ namespace Core.DataReader.Dxt
|
||||
public int Caps4;
|
||||
public int Reserved;
|
||||
|
||||
public static DxtHeader ReadHeader(BinaryReader reader)
|
||||
public static DxtHeader ReadHeader(IBinaryReader reader)
|
||||
{
|
||||
return new DxtHeader
|
||||
{
|
||||
|
||||
@@ -7,7 +7,6 @@ namespace Core.DataReader.Gdb
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Extensions;
|
||||
|
||||
public sealed class GdbFileReader : IFileReader<GdbFile>
|
||||
{
|
||||
@@ -18,11 +17,8 @@ namespace Core.DataReader.Gdb
|
||||
_codepage = codepage;
|
||||
}
|
||||
|
||||
public GdbFile Read(byte[] data)
|
||||
public GdbFile Read(IBinaryReader reader)
|
||||
{
|
||||
using var stream = new MemoryStream(data);
|
||||
using var reader = new BinaryReader(stream);
|
||||
|
||||
_ = reader.ReadString(128, _codepage); // header string
|
||||
|
||||
uint actorDataOffset = reader.ReadUInt32();
|
||||
@@ -37,7 +33,7 @@ namespace Core.DataReader.Gdb
|
||||
uint comboSkillDataOffset = reader.ReadUInt32();
|
||||
int numOfComboSkills = reader.ReadInt32();
|
||||
|
||||
reader.BaseStream.Seek(itemDataOffset, SeekOrigin.Begin);
|
||||
reader.Seek(itemDataOffset, SeekOrigin.Begin);
|
||||
var gameItems = new Dictionary<int, GameItem>();
|
||||
for (var i = 0; i < numOfItems; i++)
|
||||
{
|
||||
@@ -48,7 +44,7 @@ namespace Core.DataReader.Gdb
|
||||
return new GdbFile(gameItems);
|
||||
}
|
||||
|
||||
private static GameItem ReadGameItem(BinaryReader reader, int codepage)
|
||||
private static GameItem ReadGameItem(IBinaryReader reader, int codepage)
|
||||
{
|
||||
return new GameItem
|
||||
{
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Core.DataReader
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// Binary reader interface for reading data from binary file
|
||||
/// with extension methods for reading various data types.
|
||||
/// </summary>
|
||||
public interface IBinaryReader : IDisposable
|
||||
{
|
||||
void Seek(long offset, SeekOrigin seekOrigin);
|
||||
short ReadInt16();
|
||||
int ReadInt32();
|
||||
long ReadInt64();
|
||||
ushort ReadUInt16();
|
||||
uint ReadUInt32();
|
||||
ulong ReadUInt64();
|
||||
float ReadSingle();
|
||||
double ReadDouble();
|
||||
bool ReadBoolean();
|
||||
byte ReadByte();
|
||||
byte[] ReadBytes(int count);
|
||||
|
||||
#region Helper Extensions (Default Implementation)
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
Vector2 ReadVector2() => new (ReadSingle(), ReadSingle());
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
Vector3 ReadVector3() => new (ReadSingle(), ReadSingle(), ReadSingle());
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
Vector3[] ReadVector3Array(int count)
|
||||
{
|
||||
var array = new Vector3[count];
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
array[i] = ReadVector3();
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
float[] ReadSingleArray(int count)
|
||||
{
|
||||
var array = new float[count];
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
array[i] = ReadSingle();
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
double[] ReadDoubleArray(int count)
|
||||
{
|
||||
var array = new double[count];
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
array[i] = ReadDouble();
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
int[] ReadInt32Array(int count)
|
||||
{
|
||||
var array = new int[count];
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
array[i] = ReadInt32();
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
uint[] ReadUInt32Array(int count)
|
||||
{
|
||||
var array = new uint[count];
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
array[i] = ReadUInt32();
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
short[] ReadInt16Array(int count)
|
||||
{
|
||||
var array = new short[count];
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
array[i] = ReadInt16();
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
ushort[] ReadUInt16Array(int count)
|
||||
{
|
||||
var array = new ushort[count];
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
array[i] = ReadUInt16();
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public char[] ReadChars(int count)
|
||||
{
|
||||
return Encoding.ASCII.GetChars(ReadBytes(count));
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
string ReadString(int count) => new (ReadChars(count));
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
string ReadString(int count, int codepage)
|
||||
{
|
||||
var strBytes = ReadBytes(count);
|
||||
int length = Array.IndexOf(strBytes, (byte)0);
|
||||
if (length == -1) length = strBytes.Length; // If no null byte is found, use the full length
|
||||
return Encoding.GetEncoding(codepage).GetString(strBytes, 0, length);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: af41ce424f3813346ba04c25afee604a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -5,25 +5,26 @@
|
||||
|
||||
namespace Core.DataReader
|
||||
{
|
||||
using System.IO;
|
||||
|
||||
/// <summary>
|
||||
/// File reader interface.
|
||||
/// File reader interface for reading data from binary file
|
||||
/// using <see cref="IBinaryReader"/>.
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public interface IFileReader<out T>
|
||||
{
|
||||
T Read(IBinaryReader reader);
|
||||
|
||||
T Read(byte[] data)
|
||||
{
|
||||
using var stream = new MemoryStream(data);
|
||||
return Read(stream);
|
||||
}
|
||||
// Use unsafe binary reader (faster) if IL2CPP is enabled
|
||||
// otherwise use safe reader
|
||||
#if ENABLE_IL2CPP
|
||||
using var reader = new UnsafeBinaryReader(data);
|
||||
#else
|
||||
using var reader = new SafeBinaryReader(data);
|
||||
#endif
|
||||
|
||||
T Read(Stream stream)
|
||||
{
|
||||
using var memoryStream = new MemoryStream();
|
||||
stream.CopyTo(memoryStream);
|
||||
return Read(memoryStream.ToArray());
|
||||
return Read(reader);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,11 @@ namespace Core.DataReader.Ini
|
||||
private const string PROPERTY_MESH = "mesh";
|
||||
private const string PROPERTY_MATERIAL = "material";
|
||||
|
||||
public MovActionConfig Read(IBinaryReader reader)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public MovActionConfig Read(byte[] data)
|
||||
{
|
||||
FileIniDataParser parser = new ();
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
namespace Core.DataReader.Ini
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
@@ -18,6 +19,11 @@ namespace Core.DataReader.Ini
|
||||
private const string PROPERTY_NAME = "name";
|
||||
private const string PROPERTY_FILE = "file";
|
||||
|
||||
public Mv3ActionConfig Read(IBinaryReader reader)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Mv3ActionConfig Read(byte[] data)
|
||||
{
|
||||
var parser = new FileIniDataParser();
|
||||
|
||||
@@ -3,28 +3,17 @@
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
#define USE_UNSAFE_BINARY_READER
|
||||
|
||||
namespace Core.DataReader.Lgt
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Extensions;
|
||||
using GameBox;
|
||||
using Utils;
|
||||
|
||||
public sealed class LgtFileReader : IFileReader<LgtFile>
|
||||
{
|
||||
public LgtFile Read(byte[] data)
|
||||
public LgtFile Read(IBinaryReader reader)
|
||||
{
|
||||
#if USE_UNSAFE_BINARY_READER
|
||||
using var reader = new UnsafeBinaryReader(data);
|
||||
#else
|
||||
using var stream = new MemoryStream(data);
|
||||
using var reader = new BinaryReader(stream);
|
||||
#endif
|
||||
|
||||
var numOfLightNodes = reader.ReadInt32();
|
||||
var lightNodes = new List<LightNode>();
|
||||
|
||||
@@ -42,11 +31,7 @@ namespace Core.DataReader.Lgt
|
||||
return new LgtFile(lightNodes.ToArray());
|
||||
}
|
||||
|
||||
#if USE_UNSAFE_BINARY_READER
|
||||
private static LightNode ReadLightNode(UnsafeBinaryReader reader)
|
||||
#else
|
||||
private static LightNode ReadLightNode(BinaryReader reader)
|
||||
#endif
|
||||
private static LightNode ReadLightNode(IBinaryReader reader)
|
||||
{
|
||||
var transformMatrix = new GameBoxMatrix4X4()
|
||||
{
|
||||
|
||||
@@ -3,14 +3,10 @@
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
#define USE_UNSAFE_BINARY_READER
|
||||
|
||||
namespace Core.DataReader.Mov
|
||||
{
|
||||
using System.IO;
|
||||
using Extensions;
|
||||
using GameBox;
|
||||
using Utils;
|
||||
|
||||
public sealed class MovFileReader : IFileReader<MovFile>
|
||||
{
|
||||
@@ -21,15 +17,8 @@ namespace Core.DataReader.Mov
|
||||
_codepage = codepage;
|
||||
}
|
||||
|
||||
public MovFile Read(byte[] data)
|
||||
public MovFile Read(IBinaryReader reader)
|
||||
{
|
||||
#if USE_UNSAFE_BINARY_READER
|
||||
using var reader = new UnsafeBinaryReader(data);
|
||||
#else
|
||||
using var stream = new MemoryStream(data);
|
||||
using var reader = new BinaryReader(stream);
|
||||
#endif
|
||||
|
||||
var header = reader.ReadChars(4);
|
||||
var headerStr = new string(header[..^1]);
|
||||
|
||||
@@ -78,24 +67,16 @@ namespace Core.DataReader.Mov
|
||||
return new MovFile(totalDuration, boneAnimationTracks, animationEvents);
|
||||
}
|
||||
|
||||
#if USE_UNSAFE_BINARY_READER
|
||||
private static MovAnimationEvent ReadAnimationEvent(UnsafeBinaryReader reader, int codepage)
|
||||
#else
|
||||
private static MovAnimationEvent ReadAnimationEvent(BinaryReader reader, int codepage)
|
||||
#endif
|
||||
private static MovAnimationEvent ReadAnimationEvent(IBinaryReader reader, int codepage)
|
||||
{
|
||||
return new MovAnimationEvent()
|
||||
{
|
||||
Tick = GameBoxInterpreter.GameBoxSecondsToTick(reader.ReadSingle()),
|
||||
Tick = GameBoxInterpreter.SecondsToTick(reader.ReadSingle()),
|
||||
Name = reader.ReadString(16, codepage)
|
||||
};
|
||||
}
|
||||
|
||||
#if USE_UNSAFE_BINARY_READER
|
||||
private static MovBoneAnimationTrack ReadBoneAnimationTrack(UnsafeBinaryReader reader, int codepage)
|
||||
#else
|
||||
private static MovBoneAnimationTrack ReadBoneAnimationTrack(BinaryReader reader, int codepage)
|
||||
#endif
|
||||
private static MovBoneAnimationTrack ReadBoneAnimationTrack(IBinaryReader reader, int codepage)
|
||||
{
|
||||
var boneId = reader.ReadInt32();
|
||||
|
||||
@@ -110,7 +91,7 @@ namespace Core.DataReader.Mov
|
||||
{
|
||||
animationKeyFrames[i] = new MovAnimationKeyFrame()
|
||||
{
|
||||
Tick = GameBoxInterpreter.GameBoxSecondsToTick(reader.ReadSingle()),
|
||||
Tick = GameBoxInterpreter.SecondsToTick(reader.ReadSingle()),
|
||||
Translation = GameBoxInterpreter.ToUnityPosition(reader.ReadVector3()),
|
||||
Rotation = GameBoxInterpreter.MovQuaternionToUnityQuaternion(new GameBoxQuaternion()
|
||||
{
|
||||
|
||||
@@ -3,15 +3,11 @@
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
#define USE_UNSAFE_BINARY_READER
|
||||
|
||||
namespace Core.DataReader.Msh
|
||||
{
|
||||
using System.IO;
|
||||
using Extensions;
|
||||
using GameBox;
|
||||
using UnityEngine;
|
||||
using Utils;
|
||||
|
||||
public sealed class MshFileReader : IFileReader<MshFile>
|
||||
{
|
||||
@@ -22,15 +18,8 @@ namespace Core.DataReader.Msh
|
||||
_codepage = codepage;
|
||||
}
|
||||
|
||||
public MshFile Read(byte[] data)
|
||||
public MshFile Read(IBinaryReader reader)
|
||||
{
|
||||
#if USE_UNSAFE_BINARY_READER
|
||||
using var reader = new UnsafeBinaryReader(data);
|
||||
#else
|
||||
using var stream = new MemoryStream(data);
|
||||
using var reader = new BinaryReader(stream);
|
||||
#endif
|
||||
|
||||
var header = reader.ReadChars(4);
|
||||
var headerStr = new string(header[..^1]);
|
||||
|
||||
@@ -70,17 +59,13 @@ namespace Core.DataReader.Msh
|
||||
var subMeshes = new MshMesh[numberOfSubMeshes];
|
||||
for (var i = 0; i < numberOfSubMeshes; i++)
|
||||
{
|
||||
subMeshes[i] = ReadSubMesh(reader, _codepage);
|
||||
subMeshes[i] = ReadSubMesh(reader);
|
||||
}
|
||||
|
||||
return new MshFile(rootBoneNode, subMeshes);
|
||||
}
|
||||
|
||||
#if USE_UNSAFE_BINARY_READER
|
||||
private static BoneNode ReadBoneNode(UnsafeBinaryReader reader, BoneNode parent, int codepage)
|
||||
#else
|
||||
private static BoneNode ReadBoneNode(BinaryReader reader, BoneNode parent, int codepage)
|
||||
#endif
|
||||
private static BoneNode ReadBoneNode(IBinaryReader reader, BoneNode parent, int codepage)
|
||||
{
|
||||
var nodeType = (BoneNodeType)reader.ReadInt32();
|
||||
var nameLength = reader.ReadInt32();
|
||||
@@ -141,11 +126,7 @@ namespace Core.DataReader.Msh
|
||||
return boneNode;
|
||||
}
|
||||
|
||||
#if USE_UNSAFE_BINARY_READER
|
||||
private static MshMesh ReadSubMesh(UnsafeBinaryReader reader, int codepage)
|
||||
#else
|
||||
private static MshMesh ReadSubMesh(BinaryReader reader, int codepage)
|
||||
#endif
|
||||
private static MshMesh ReadSubMesh(IBinaryReader reader)
|
||||
{
|
||||
var materialId = reader.ReadInt32();
|
||||
var numberOfVertices = reader.ReadInt32();
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5f50098c0cef46349314b7f36bc59136
|
||||
timeCreated: 1690567483
|
||||
@@ -0,0 +1,19 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Core.DataReader.Mtl
|
||||
{
|
||||
using GameBox;
|
||||
|
||||
public sealed class MtlFile
|
||||
{
|
||||
public GameBoxMaterial[] Materials { get; }
|
||||
|
||||
public MtlFile(GameBoxMaterial[] materials)
|
||||
{
|
||||
Materials = materials;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f167ffdd8daf4bcfb2b50ee3e3e7bc8b
|
||||
timeCreated: 1690567491
|
||||
@@ -0,0 +1,66 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Core.DataReader.Mtl
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using GameBox;
|
||||
using Utils;
|
||||
|
||||
public sealed class MtlFileReader : IFileReader<MtlFile>
|
||||
{
|
||||
private readonly int _codepage;
|
||||
|
||||
public MtlFileReader(int codepage)
|
||||
{
|
||||
_codepage = codepage;
|
||||
}
|
||||
|
||||
public MtlFile Read(IBinaryReader reader)
|
||||
{
|
||||
var header = reader.ReadChars(4);
|
||||
var headerStr = new string(header[..^1]);
|
||||
|
||||
if (headerStr != "mtl")
|
||||
{
|
||||
throw new InvalidDataException("Invalid MTL(.mtl) file: header != mtl");
|
||||
}
|
||||
|
||||
var version = reader.ReadInt32();
|
||||
if (version != 100)
|
||||
{
|
||||
throw new InvalidDataException("Invalid MTL(.mtl) file: version != 100");
|
||||
}
|
||||
|
||||
int numberOfMaterials = reader.ReadInt32();
|
||||
var materials = new GameBoxMaterial[numberOfMaterials];
|
||||
|
||||
for (var i = 0; i < numberOfMaterials; i++)
|
||||
{
|
||||
materials[i] = new GameBoxMaterial
|
||||
{
|
||||
Diffuse = Utility.ToColor(reader.ReadSingleArray(4)),
|
||||
Ambient = Utility.ToColor(reader.ReadSingleArray(4)),
|
||||
Specular = Utility.ToColor(reader.ReadSingleArray(4)),
|
||||
Emissive = Utility.ToColor(reader.ReadSingleArray(4)),
|
||||
SpecularPower = reader.ReadSingle(),
|
||||
};
|
||||
|
||||
List<string> textureNames = new ();
|
||||
for (var j = 0; j < 4; j++)
|
||||
{
|
||||
int textureNameLength = reader.ReadInt32();
|
||||
if (textureNameLength == 0) continue;
|
||||
textureNames.Add(reader.ReadString(textureNameLength, _codepage));
|
||||
}
|
||||
|
||||
materials[i].TextureFileNames = textureNames.ToArray();
|
||||
}
|
||||
|
||||
return new MtlFile(materials);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 16ec8deffba245bcb6808f8ad26677c7
|
||||
timeCreated: 1690567511
|
||||
@@ -56,12 +56,6 @@ namespace Core.DataReader.Mv3
|
||||
public Mv3Vert[] Vertices;
|
||||
}
|
||||
|
||||
public struct Mv3Material
|
||||
{
|
||||
public GameBoxMaterial Material;
|
||||
public string[] TextureNames;
|
||||
}
|
||||
|
||||
public struct Mv3Mesh
|
||||
{
|
||||
public string Name; // 64 chars max
|
||||
@@ -87,20 +81,20 @@ namespace Core.DataReader.Mv3
|
||||
public uint Duration { get; }
|
||||
public Mv3AnimationEvent[] AnimationEvents { get; }
|
||||
public Mv3TagNode[] TagNodes { get; }
|
||||
public Mv3Material[] Materials { get; }
|
||||
public Mv3Mesh[] Meshes { get; }
|
||||
public GameBoxMaterial[] Materials { get; }
|
||||
|
||||
public Mv3File(uint duration,
|
||||
Mv3AnimationEvent[] animationEvents,
|
||||
Mv3TagNode[] tagNodes,
|
||||
Mv3Material[] materials,
|
||||
Mv3Mesh[] meshes)
|
||||
Mv3Mesh[] meshes,
|
||||
GameBoxMaterial[] materials)
|
||||
{
|
||||
Duration = duration;
|
||||
AnimationEvents = animationEvents;
|
||||
TagNodes = tagNodes;
|
||||
Materials = materials;
|
||||
Meshes = meshes;
|
||||
Materials = materials;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,14 +3,11 @@
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
#define USE_UNSAFE_BINARY_READER
|
||||
|
||||
namespace Core.DataReader.Mv3
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Extensions;
|
||||
using GameBox;
|
||||
using UnityEngine;
|
||||
using Utils;
|
||||
@@ -24,15 +21,8 @@ namespace Core.DataReader.Mv3
|
||||
_codepage = codepage;
|
||||
}
|
||||
|
||||
public Mv3File Read(byte[] data)
|
||||
public Mv3File Read(IBinaryReader reader)
|
||||
{
|
||||
#if USE_UNSAFE_BINARY_READER
|
||||
using var reader = new UnsafeBinaryReader(data);
|
||||
#else
|
||||
using var stream = new MemoryStream(data);
|
||||
using var reader = new BinaryReader(stream);
|
||||
#endif
|
||||
|
||||
var header = reader.ReadChars(4);
|
||||
var headerStr = new string(header[..^1]);
|
||||
|
||||
@@ -70,7 +60,7 @@ namespace Core.DataReader.Mv3
|
||||
tagNodes[i] = ReadTagNode(reader, _codepage);
|
||||
}
|
||||
|
||||
var materials = new Mv3Material[numberOfMaterials];
|
||||
var materials = new GameBoxMaterial[numberOfMaterials];
|
||||
for (var i = 0; i < numberOfMaterials; i++)
|
||||
{
|
||||
materials[i] = ReadMaterial(reader, _codepage);
|
||||
@@ -85,15 +75,11 @@ namespace Core.DataReader.Mv3
|
||||
return new Mv3File(duration,
|
||||
animationEvents,
|
||||
tagNodes,
|
||||
materials,
|
||||
meshes);
|
||||
meshes,
|
||||
materials);
|
||||
}
|
||||
|
||||
#if USE_UNSAFE_BINARY_READER
|
||||
private static Mv3Mesh ReadMesh(UnsafeBinaryReader reader, int codepage)
|
||||
#else
|
||||
private static Mv3Mesh ReadMesh(BinaryReader reader, int codepage)
|
||||
#endif
|
||||
private static Mv3Mesh ReadMesh(IBinaryReader reader, int codepage)
|
||||
{
|
||||
var name = reader.ReadString(64, codepage);
|
||||
var numberOfVertices = reader.ReadInt32();
|
||||
@@ -235,11 +221,7 @@ namespace Core.DataReader.Mv3
|
||||
};
|
||||
}
|
||||
|
||||
#if USE_UNSAFE_BINARY_READER
|
||||
private static Mv3TagNode ReadTagNode(UnsafeBinaryReader reader, int codepage)
|
||||
#else
|
||||
private static Mv3TagNode ReadTagNode(BinaryReader reader, int codepage)
|
||||
#endif
|
||||
private static Mv3TagNode ReadTagNode(IBinaryReader reader, int codepage)
|
||||
{
|
||||
var nodeName = reader.ReadString(64, codepage);
|
||||
var flipScale = reader.ReadSingle();
|
||||
@@ -259,11 +241,7 @@ namespace Core.DataReader.Mv3
|
||||
};
|
||||
}
|
||||
|
||||
#if USE_UNSAFE_BINARY_READER
|
||||
private static Mv3TagFrame ReadTagFrame(UnsafeBinaryReader reader)
|
||||
#else
|
||||
private static Mv3TagFrame ReadTagFrame(BinaryReader reader)
|
||||
#endif
|
||||
private static Mv3TagFrame ReadTagFrame(IBinaryReader reader)
|
||||
{
|
||||
var tick = reader.ReadUInt32();
|
||||
Vector3 position = GameBoxInterpreter.ToUnityPosition(reader.ReadVector3());
|
||||
@@ -292,11 +270,7 @@ namespace Core.DataReader.Mv3
|
||||
};
|
||||
}
|
||||
|
||||
#if USE_UNSAFE_BINARY_READER
|
||||
private static Mv3AnimationEvent ReadAnimationEvent(UnsafeBinaryReader reader, int codepage)
|
||||
#else
|
||||
private static Mv3AnimationEvent ReadAnimationEvent(BinaryReader reader, int codepage)
|
||||
#endif
|
||||
private static Mv3AnimationEvent ReadAnimationEvent(IBinaryReader reader, int codepage)
|
||||
{
|
||||
return new Mv3AnimationEvent()
|
||||
{
|
||||
@@ -305,35 +279,27 @@ namespace Core.DataReader.Mv3
|
||||
};
|
||||
}
|
||||
|
||||
#if USE_UNSAFE_BINARY_READER
|
||||
private static Mv3Material ReadMaterial(UnsafeBinaryReader reader, int codepage)
|
||||
#else
|
||||
private static Mv3Material ReadMaterial(BinaryReader reader, int codepage)
|
||||
#endif
|
||||
private static GameBoxMaterial ReadMaterial(IBinaryReader reader, int codepage)
|
||||
{
|
||||
var material = new GameBoxMaterial()
|
||||
GameBoxMaterial material = new ()
|
||||
{
|
||||
Diffuse = Utility.ToColor(reader.ReadSingleArray(4)),
|
||||
Ambient = Utility.ToColor(reader.ReadSingleArray(4)),
|
||||
Specular = Utility.ToColor(reader.ReadSingleArray(4)),
|
||||
Emissive = Utility.ToColor(reader.ReadSingleArray(4)),
|
||||
Power = reader.ReadSingle()
|
||||
SpecularPower = reader.ReadSingle()
|
||||
};
|
||||
|
||||
var textureNames = new List<string>();
|
||||
List<string> textureNames = new ();
|
||||
for (var i = 0; i < 4; i++)
|
||||
{
|
||||
string textureName;
|
||||
var length = reader.ReadInt32();
|
||||
if (length is < 0 or > 255)
|
||||
{
|
||||
throw new InvalidDataException($"Invalid length of material name: {length}");
|
||||
}
|
||||
|
||||
if (length == 0)
|
||||
{
|
||||
if (i > 0) continue;
|
||||
textureName = string.Empty; // Use default white texture?
|
||||
textureName = string.Empty; // Use default white texture
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -343,11 +309,9 @@ namespace Core.DataReader.Mv3
|
||||
textureNames.Add(textureName);
|
||||
}
|
||||
|
||||
return new Mv3Material()
|
||||
{
|
||||
Material = material,
|
||||
TextureNames = textureNames.ToArray(),
|
||||
};
|
||||
material.TextureFileNames = textureNames.ToArray();
|
||||
|
||||
return material;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,17 +7,14 @@ namespace Core.DataReader.Nav
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
||||
using Extensions;
|
||||
using GameBox;
|
||||
using UnityEngine;
|
||||
using Utils;
|
||||
|
||||
public sealed class NavFileReader : IFileReader<NavFile>
|
||||
{
|
||||
public NavFile Read(Stream stream)
|
||||
public NavFile Read(IBinaryReader reader)
|
||||
{
|
||||
using var reader = new BinaryReader(stream);
|
||||
|
||||
var header = reader.ReadChars(4);
|
||||
var headerStr = new string(header[..^1]);
|
||||
|
||||
@@ -31,14 +28,14 @@ namespace Core.DataReader.Nav
|
||||
var tileOffset = reader.ReadUInt32();
|
||||
var faceOffset = reader.ReadUInt32();
|
||||
|
||||
reader.BaseStream.Seek(tileOffset, SeekOrigin.Begin);
|
||||
reader.Seek(tileOffset, SeekOrigin.Begin);
|
||||
var tileLayers = new NavTileLayer[numberOfLayers];
|
||||
for (var i = 0; i < numberOfLayers; i++)
|
||||
{
|
||||
tileLayers[i] = ReadTileLayer(reader, version);
|
||||
}
|
||||
|
||||
reader.BaseStream.Seek(faceOffset, SeekOrigin.Begin);
|
||||
reader.Seek(faceOffset, SeekOrigin.Begin);
|
||||
var faceLayers = new NavFaceLayer[numberOfLayers];
|
||||
for (var i = 0; i < numberOfLayers; i++)
|
||||
{
|
||||
@@ -48,7 +45,7 @@ namespace Core.DataReader.Nav
|
||||
return new NavFile(tileLayers, faceLayers);
|
||||
}
|
||||
|
||||
private static NavTileLayer ReadTileLayer(BinaryReader reader, byte version)
|
||||
private static NavTileLayer ReadTileLayer(IBinaryReader reader, byte version)
|
||||
{
|
||||
var portals = Array.Empty<GameBoxRect>();
|
||||
|
||||
@@ -102,7 +99,7 @@ namespace Core.DataReader.Nav
|
||||
};
|
||||
}
|
||||
|
||||
private static NavFaceLayer ReadFaceLayer(BinaryReader reader)
|
||||
private static NavFaceLayer ReadFaceLayer(IBinaryReader reader)
|
||||
{
|
||||
var numberOfVertices = reader.ReadUInt16();
|
||||
var numberOfFaces = reader.ReadUInt16();
|
||||
|
||||
@@ -45,7 +45,6 @@ namespace Core.DataReader.Pol
|
||||
{
|
||||
public GameBoxBlendFlag BlendFlag;
|
||||
public GameBoxMaterial Material;
|
||||
public string[] TextureNames;
|
||||
public uint VertStart;
|
||||
public uint VertEnd;
|
||||
public int[] Triangles;
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
#define USE_UNSAFE_BINARY_READER
|
||||
|
||||
namespace Core.DataReader.Pol
|
||||
{
|
||||
using System;
|
||||
@@ -23,15 +21,8 @@ namespace Core.DataReader.Pol
|
||||
_codepage = codepage;
|
||||
}
|
||||
|
||||
public PolFile Read(byte[] data)
|
||||
public PolFile Read(IBinaryReader reader)
|
||||
{
|
||||
#if USE_UNSAFE_BINARY_READER
|
||||
using var reader = new UnsafeBinaryReader(data);
|
||||
#else
|
||||
using var stream = new MemoryStream(data);
|
||||
using var reader = new BinaryReader(stream);
|
||||
#endif
|
||||
|
||||
var header = reader.ReadChars(4);
|
||||
var headerStr = new string(header);
|
||||
|
||||
@@ -78,11 +69,7 @@ namespace Core.DataReader.Pol
|
||||
return new PolFile(version, nodeInfos, meshInfos, tagNodes);
|
||||
}
|
||||
|
||||
#if USE_UNSAFE_BINARY_READER
|
||||
private static TagNode ReadTagNodeInfo(UnsafeBinaryReader reader, int codepage)
|
||||
#else
|
||||
private static TagNode ReadTagNodeInfo(BinaryReader reader, int codepage)
|
||||
#endif
|
||||
private static TagNode ReadTagNodeInfo(IBinaryReader reader, int codepage)
|
||||
{
|
||||
var name = reader.ReadString(32, codepage);
|
||||
Matrix4x4 transformMatrix = GameBoxInterpreter.ToUnityMatrix4x4(new GameBoxMatrix4X4()
|
||||
@@ -122,11 +109,7 @@ namespace Core.DataReader.Pol
|
||||
};
|
||||
}
|
||||
|
||||
#if USE_UNSAFE_BINARY_READER
|
||||
private static PolMesh ReadMeshData(UnsafeBinaryReader reader, int version, int codepage)
|
||||
#else
|
||||
private static PolMesh ReadMeshData(BinaryReader reader, int version, int codepage)
|
||||
#endif
|
||||
private static PolMesh ReadMeshData(IBinaryReader reader, int version, int codepage)
|
||||
{
|
||||
var bounds = new Bounds();
|
||||
bounds.SetMinMax(
|
||||
@@ -235,26 +218,22 @@ namespace Core.DataReader.Pol
|
||||
};
|
||||
}
|
||||
|
||||
#if USE_UNSAFE_BINARY_READER
|
||||
private static PolTexture ReadTextureInfo(UnsafeBinaryReader reader, int version, int codepage)
|
||||
#else
|
||||
private static PolTexture ReadTextureInfo(BinaryReader reader, int version, int codepage)
|
||||
#endif
|
||||
private static PolTexture ReadTextureInfo(IBinaryReader reader, int version, int codepage)
|
||||
{
|
||||
var blendFlag = (GameBoxBlendFlag)reader.ReadUInt32();
|
||||
GameBoxBlendFlag blendFlag = (GameBoxBlendFlag)reader.ReadUInt32();
|
||||
|
||||
var material = new GameBoxMaterial()
|
||||
GameBoxMaterial material = new ()
|
||||
{
|
||||
Diffuse = Utility.ToColor(reader.ReadSingleArray(4)),
|
||||
Ambient = Utility.ToColor(reader.ReadSingleArray(4)),
|
||||
Specular = Utility.ToColor(reader.ReadSingleArray(4)),
|
||||
Emissive = Utility.ToColor(reader.ReadSingleArray(4)),
|
||||
Power = reader.ReadSingle()
|
||||
SpecularPower = reader.ReadSingle()
|
||||
};
|
||||
|
||||
// Hack fix
|
||||
if (material.Power < 0) material.Power = 0;
|
||||
else if (material.Power > 128) material.Power = 128;
|
||||
if (material.SpecularPower < 0) material.SpecularPower = 0;
|
||||
else if (material.SpecularPower > 128) material.SpecularPower = 128;
|
||||
|
||||
var numberOfTextures = reader.ReadInt32();
|
||||
var textureNames = new string[numberOfTextures];
|
||||
@@ -265,6 +244,8 @@ namespace Core.DataReader.Pol
|
||||
textureNames[i] = textureName;
|
||||
}
|
||||
|
||||
material.TextureFileNames = textureNames;
|
||||
|
||||
_ = reader.ReadInt32();
|
||||
var vertStart = reader.ReadUInt32();
|
||||
var vertEnd = reader.ReadUInt32();
|
||||
@@ -285,7 +266,6 @@ namespace Core.DataReader.Pol
|
||||
{
|
||||
BlendFlag = blendFlag,
|
||||
Material = material,
|
||||
TextureNames = textureNames,
|
||||
VertStart = vertStart,
|
||||
VertEnd = vertEnd,
|
||||
Triangles = triangles
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Core.DataReader
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
public sealed class SafeBinaryReader : IBinaryReader
|
||||
{
|
||||
private readonly BinaryReader _reader;
|
||||
|
||||
public SafeBinaryReader(byte[] data) : this (new MemoryStream(data)) { }
|
||||
|
||||
public SafeBinaryReader(Stream stream)
|
||||
{
|
||||
_reader = new BinaryReader(stream);
|
||||
}
|
||||
|
||||
public void Seek(long offset, SeekOrigin seekOrigin)
|
||||
{
|
||||
_reader.BaseStream.Seek(offset, seekOrigin);
|
||||
}
|
||||
|
||||
public Stream BaseStream => _reader.BaseStream;
|
||||
public short ReadInt16() => _reader.ReadInt16();
|
||||
public int ReadInt32() => _reader.ReadInt32();
|
||||
public long ReadInt64() => _reader.ReadInt64();
|
||||
public ushort ReadUInt16() => _reader.ReadUInt16();
|
||||
public uint ReadUInt32() => _reader.ReadUInt32();
|
||||
public ulong ReadUInt64() => _reader.ReadUInt64();
|
||||
public float ReadSingle() => _reader.ReadSingle();
|
||||
public double ReadDouble() => _reader.ReadDouble();
|
||||
public bool ReadBoolean() => _reader.ReadBoolean();
|
||||
public byte ReadByte() => _reader.ReadByte();
|
||||
public byte[] ReadBytes(int count) => _reader.ReadBytes(count);
|
||||
|
||||
private bool _disposedValue;
|
||||
private void Dispose(bool disposing)
|
||||
{
|
||||
if (!_disposedValue)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
_reader.Dispose();
|
||||
_disposedValue = true;
|
||||
}
|
||||
}
|
||||
|
||||
~SafeBinaryReader()
|
||||
{
|
||||
Dispose(disposing: false);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(disposing: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a5c4113470698e545a7f38b68b3032d8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -6,7 +6,6 @@
|
||||
namespace Core.DataReader.Sce
|
||||
{
|
||||
using System.IO;
|
||||
using Extensions;
|
||||
|
||||
public sealed class SceFileReader : IFileReader<SceFile>
|
||||
{
|
||||
@@ -17,10 +16,8 @@ namespace Core.DataReader.Sce
|
||||
_codepage = codepage;
|
||||
}
|
||||
|
||||
public SceFile Read(Stream stream)
|
||||
public SceFile Read(IBinaryReader reader)
|
||||
{
|
||||
using var reader = new BinaryReader(stream);
|
||||
|
||||
var header = reader.ReadChars(4);
|
||||
var headerStr = new string(header[..^1]);
|
||||
|
||||
@@ -53,9 +50,9 @@ namespace Core.DataReader.Sce
|
||||
return new SceFile(indexes, scriptBlocks, _codepage);
|
||||
}
|
||||
|
||||
private static SceScriptBlock ReadScriptBlock(BinaryReader reader, SceIndex sceIndex, int codepage)
|
||||
private static SceScriptBlock ReadScriptBlock(IBinaryReader reader, SceIndex sceIndex, int codepage)
|
||||
{
|
||||
reader.BaseStream.Seek(sceIndex.Offset, SeekOrigin.Begin);
|
||||
reader.Seek(sceIndex.Offset, SeekOrigin.Begin);
|
||||
|
||||
var id = reader.ReadUInt32();
|
||||
var descriptionLength = reader.ReadUInt16();
|
||||
@@ -80,7 +77,7 @@ namespace Core.DataReader.Sce
|
||||
};
|
||||
}
|
||||
|
||||
private static SceUserVarInfo ReadUserVarInfo(BinaryReader reader)
|
||||
private static SceUserVarInfo ReadUserVarInfo(IBinaryReader reader)
|
||||
{
|
||||
var type = reader.ReadByte();
|
||||
var length = reader.ReadUInt16();
|
||||
@@ -93,7 +90,7 @@ namespace Core.DataReader.Sce
|
||||
};
|
||||
}
|
||||
|
||||
private static SceIndex ReadSceIndex(BinaryReader reader, int codepage)
|
||||
private static SceIndex ReadSceIndex(IBinaryReader reader, int codepage)
|
||||
{
|
||||
return new SceIndex()
|
||||
{
|
||||
|
||||
@@ -268,7 +268,7 @@ namespace Core.DataReader.Scn
|
||||
public uint LoopAction;
|
||||
|
||||
// 移动速度
|
||||
public uint Speed;
|
||||
public uint GameBoxMoveSpeed;
|
||||
|
||||
[JsonIgnore]
|
||||
public uint[] Reserved; // 29 DWORDs
|
||||
|
||||
@@ -20,10 +20,8 @@ namespace Core.DataReader.Scn
|
||||
_codepage = codepage;
|
||||
}
|
||||
|
||||
public ScnFile Read(Stream stream)
|
||||
public ScnFile Read(IBinaryReader reader)
|
||||
{
|
||||
using var reader = new BinaryReader(stream);
|
||||
|
||||
var header = reader.ReadChars(4);
|
||||
var headerStr = new string(header[..^1]);
|
||||
|
||||
@@ -49,14 +47,14 @@ namespace Core.DataReader.Scn
|
||||
Reserved = reader.ReadUInt32Array(6),
|
||||
};
|
||||
|
||||
reader.BaseStream.Seek(npcDataOffset, SeekOrigin.Begin);
|
||||
reader.Seek(npcDataOffset, SeekOrigin.Begin);
|
||||
var npcInfos = new ScnNpcInfo[numberOfNpc];
|
||||
for (var i = 0; i < numberOfNpc; i++)
|
||||
{
|
||||
npcInfos[i] = ReadNpcInfo(reader, _codepage);
|
||||
}
|
||||
|
||||
reader.BaseStream.Seek(objectDataOffset, SeekOrigin.Begin);
|
||||
reader.Seek(objectDataOffset, SeekOrigin.Begin);
|
||||
var objInfos = new ScnObjectInfo[numberOfObjects];
|
||||
for (var i = 0; i < numberOfObjects; i++)
|
||||
{
|
||||
@@ -67,7 +65,7 @@ namespace Core.DataReader.Scn
|
||||
return new ScnFile(sceneInfo, npcInfos, objInfos);
|
||||
}
|
||||
|
||||
private static ScnNpcInfo ReadNpcInfo(BinaryReader reader, int codepage)
|
||||
private static ScnNpcInfo ReadNpcInfo(IBinaryReader reader, int codepage)
|
||||
{
|
||||
return new ScnNpcInfo()
|
||||
{
|
||||
@@ -95,12 +93,12 @@ namespace Core.DataReader.Scn
|
||||
},
|
||||
NoTurn = reader.ReadUInt32(),
|
||||
LoopAction = reader.ReadUInt32(),
|
||||
Speed = reader.ReadUInt32(),
|
||||
GameBoxMoveSpeed = reader.ReadUInt32(),
|
||||
Reserved = reader.ReadUInt32Array(29),
|
||||
};
|
||||
}
|
||||
|
||||
private static ScnObjectInfo ReadObjectInfo(BinaryReader reader, int codepage)
|
||||
private static ScnObjectInfo ReadObjectInfo(IBinaryReader reader, int codepage)
|
||||
{
|
||||
var id = reader.ReadByte();
|
||||
var initActive = reader.ReadByte();
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2ca33290fbdf242478def97a7e148404
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,30 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Core.DataReader.Txt
|
||||
{
|
||||
using System;
|
||||
|
||||
public struct Task
|
||||
{
|
||||
public string Id;
|
||||
public string Title;
|
||||
public string Description;
|
||||
public string Type;
|
||||
public string IsLastOne;
|
||||
|
||||
public bool IsMainTask => string.Equals(Type, "0", StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
public sealed class TaskDefinitionFile
|
||||
{
|
||||
public Task[] Tasks { get; }
|
||||
|
||||
public TaskDefinitionFile(Task[] tasks)
|
||||
{
|
||||
Tasks = tasks;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: baa56f2f5ee41324d8370e11aa5fef0e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,68 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Core.DataReader.Txt
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
public sealed class TaskDefinitionFileReader : IFileReader<TaskDefinitionFile>
|
||||
{
|
||||
private readonly int _codepage;
|
||||
|
||||
public TaskDefinitionFileReader(int codepage)
|
||||
{
|
||||
_codepage = codepage;
|
||||
}
|
||||
|
||||
public TaskDefinitionFile Read(IBinaryReader reader)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public TaskDefinitionFile Read(byte[] data)
|
||||
{
|
||||
var content = Encoding.GetEncoding(_codepage).GetString(data, 0, data.Length);
|
||||
var tasks = new List<Task>();
|
||||
var taskLines = content.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
var currentTask = new Task();
|
||||
|
||||
foreach (var taskLine in taskLines)
|
||||
{
|
||||
if (taskLine.TrimStart().StartsWith(";")) continue;
|
||||
|
||||
var splitLine = taskLine.Split('$');
|
||||
var tag = splitLine[0].Trim();
|
||||
var value = splitLine.Length > 1 ? splitLine[1].Trim().Trim('$', '&') : string.Empty;
|
||||
|
||||
switch (tag)
|
||||
{
|
||||
case "tname":
|
||||
currentTask.Id = value;
|
||||
break;
|
||||
case "title":
|
||||
currentTask.Title = value;
|
||||
break;
|
||||
case "info":
|
||||
currentTask.Description = value;
|
||||
break;
|
||||
case "type":
|
||||
currentTask.Type = value;
|
||||
break;
|
||||
case "last":
|
||||
currentTask.IsLastOne = value;
|
||||
break;
|
||||
case "#":
|
||||
tasks.Add(currentTask);
|
||||
currentTask = new Task(); // reset task for next one
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return new TaskDefinitionFile(tasks.ToArray());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f6b1475871d9bd14184e47ffe848780f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+48
-28
@@ -3,18 +3,14 @@
|
||||
// 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
|
||||
namespace Core.DataReader
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using UnityEngine;
|
||||
|
||||
public sealed unsafe class UnsafeBinaryReader : IDisposable
|
||||
public sealed unsafe class UnsafeBinaryReader : IBinaryReader
|
||||
{
|
||||
private byte* _dataPtr;
|
||||
private GCHandle _handle;
|
||||
@@ -28,6 +24,23 @@ namespace Core.Utils
|
||||
}
|
||||
}
|
||||
|
||||
public void Seek(long offset, SeekOrigin seekOrigin)
|
||||
{
|
||||
switch (seekOrigin)
|
||||
{
|
||||
case SeekOrigin.Begin:
|
||||
_dataPtr = (byte*)_handle.AddrOfPinnedObject() + offset;
|
||||
break;
|
||||
case SeekOrigin.Current:
|
||||
_dataPtr += offset;
|
||||
break;
|
||||
case SeekOrigin.End:
|
||||
throw new NotSupportedException("SeekOrigin.End is not supported for UnsafeBinaryReader");
|
||||
default:
|
||||
throw new ArgumentException("Invalid SeekOrigin", nameof(seekOrigin));
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public short ReadInt16()
|
||||
{
|
||||
@@ -76,7 +89,6 @@ namespace Core.Utils
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public float ReadSingle()
|
||||
{
|
||||
@@ -93,18 +105,6 @@ namespace Core.Utils
|
||||
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()
|
||||
{
|
||||
@@ -140,19 +140,39 @@ namespace Core.Utils
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public char[] ReadChars(int count)
|
||||
public double[] ReadDoubleArray(int count)
|
||||
{
|
||||
return Encoding.ASCII.GetString(ReadBytes(count)).ToCharArray();
|
||||
var value = new double[count];
|
||||
Marshal.Copy(new IntPtr(_dataPtr), value, 0, count);
|
||||
_dataPtr += count * 8;
|
||||
return value;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public string ReadString(int count, int codepage)
|
||||
public short[] ReadInt16Array(int count)
|
||||
{
|
||||
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);
|
||||
var value = new short[count];
|
||||
Marshal.Copy(new IntPtr(_dataPtr), value, 0, count);
|
||||
_dataPtr += count * 2;
|
||||
return value;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public int[] ReadInt32Array(int count)
|
||||
{
|
||||
var value = new int[count];
|
||||
Marshal.Copy(new IntPtr(_dataPtr), value, 0, count);
|
||||
_dataPtr += count * 4;
|
||||
return value;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public long[] ReadInt64Array(int count)
|
||||
{
|
||||
var value = new long[count];
|
||||
Marshal.Copy(new IntPtr(_dataPtr), value, 0, count);
|
||||
_dataPtr += count * 8;
|
||||
return value;
|
||||
}
|
||||
|
||||
private bool _disposedValue;
|
||||
File renamed without changes.
@@ -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
|
||||
@@ -59,15 +59,15 @@ namespace Core.FileSystem
|
||||
/// <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();
|
||||
var cpkFileName = Utility.GetFileName(cpkFileRelativePath, Path.DirectorySeparatorChar).ToLower();
|
||||
|
||||
if (_cpkArchives.ContainsKey(cpkFileName))
|
||||
{
|
||||
Debug.LogWarning($"{cpkFileRelativePath} already mounted.");
|
||||
Debug.LogWarning($"[{nameof(CpkFileSystem)}] {cpkFileRelativePath} already mounted.");
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Log($"CpkFileSystem mounting: {_rootPath + cpkFileRelativePath}");
|
||||
Debug.Log($"[{nameof(CpkFileSystem)}] Mounting: {_rootPath + cpkFileRelativePath}");
|
||||
var cpkArchive = new CpkArchive(_rootPath + cpkFileRelativePath, _crcHash, codepage);
|
||||
cpkArchive.Init();
|
||||
_cpkArchives[cpkFileName] = cpkArchive;
|
||||
@@ -76,7 +76,7 @@ namespace Core.FileSystem
|
||||
/// <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="fileVirtualPath">File virtual path {Cpk file name}\{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)
|
||||
@@ -108,7 +108,7 @@ namespace Core.FileSystem
|
||||
/// <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}
|
||||
/// <param name="fileVirtualPath">File virtual path {Cpk file name}\{File relative path inside archive}
|
||||
/// Example: music.cpk\music\PI01.mp3</param>
|
||||
/// <returns>True if file exists</returns>
|
||||
public bool FileExists(string fileVirtualPath)
|
||||
@@ -168,12 +168,12 @@ namespace Core.FileSystem
|
||||
{
|
||||
if (_cpkArchives.ContainsKey(cpkFileName.ToLower()))
|
||||
{
|
||||
Debug.Log($"File system caching {cpkFileName} into memory.");
|
||||
Debug.Log($"[{nameof(CpkFileSystem)}] Caching {cpkFileName} archive into memory.");
|
||||
_cpkArchives[cpkFileName.ToLower()].LoadArchiveIntoMemory();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception($"{cpkFileName} not mounted yet.");
|
||||
throw new Exception($"{cpkFileName} archive not mounted yet.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,12 +184,12 @@ namespace Core.FileSystem
|
||||
{
|
||||
if (_cpkArchives.ContainsKey(cpkFileName.ToLower()))
|
||||
{
|
||||
Debug.Log($"File system disposing in-memory cache: {cpkFileName}");
|
||||
Debug.Log($"[{nameof(CpkFileSystem)}] Disposing in-memory cache: {cpkFileName}");
|
||||
_cpkArchives[cpkFileName.ToLower()].DisposeInMemoryArchive();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception($"{cpkFileName} not mounted yet.");
|
||||
throw new Exception($"{cpkFileName} archive not mounted yet.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,7 +219,7 @@ namespace Core.FileSystem
|
||||
}
|
||||
|
||||
cpkArchive.ExtractTo(outputDir);
|
||||
Debug.Log($"{cpkFileName} extracted to {outputDir}");
|
||||
Debug.Log($"[{nameof(CpkFileSystem)}] {cpkFileName} extracted to {outputDir}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -236,7 +236,7 @@ namespace Core.FileSystem
|
||||
{
|
||||
var rootNodes = archive.Value.GetRootEntries();
|
||||
results.Add(from result in SearchInternal(rootNodes, keyword)
|
||||
select archive.Key + CpkConstants.DirectorySeparator + result);
|
||||
select archive.Key + CpkConstants.DirectorySeparatorChar + result);
|
||||
});
|
||||
|
||||
var resultList = new List<string>();
|
||||
@@ -247,14 +247,21 @@ namespace Core.FileSystem
|
||||
return resultList;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Parse file virtual path into cpk file name and relative virtual path.
|
||||
/// </summary>
|
||||
/// <param name="fullVirtualPath">File virtual path {Cpk file name}\{File relative path inside archive}</param>
|
||||
/// <param name="cpkFileName">{Cpk file name}</param>
|
||||
/// <param name="relativeVirtualPath">{File relative path inside archive}</param>
|
||||
private void ParseFileVirtualPath(string fullVirtualPath, out string cpkFileName, out string relativeVirtualPath)
|
||||
{
|
||||
if (!fullVirtualPath.Contains(CpkConstants.DirectorySeparator))
|
||||
if (!fullVirtualPath.Contains(CpkConstants.DirectorySeparatorChar))
|
||||
{
|
||||
throw new ArgumentException($"File virtual path is invalid: {fullVirtualPath}.");
|
||||
throw new ArgumentException($"[{nameof(CpkFileSystem)}] File virtual path is invalid: {fullVirtualPath}.");
|
||||
}
|
||||
cpkFileName = fullVirtualPath[..fullVirtualPath.IndexOf(CpkConstants.DirectorySeparator)].ToLower();
|
||||
relativeVirtualPath = fullVirtualPath[(fullVirtualPath.IndexOf(CpkConstants.DirectorySeparator) + 1)..];
|
||||
|
||||
cpkFileName = fullVirtualPath[..fullVirtualPath.IndexOf(CpkConstants.DirectorySeparatorChar)].ToLower();
|
||||
relativeVirtualPath = fullVirtualPath[(fullVirtualPath.IndexOf(CpkConstants.DirectorySeparatorChar) + 1)..];
|
||||
}
|
||||
|
||||
private IEnumerable<string> SearchInternal(IEnumerable<CpkEntry> nodes, string keyword)
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
namespace Core.FileSystem
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
/// <summary>
|
||||
/// File system wrapper for CPack archives
|
||||
@@ -29,7 +28,7 @@ namespace Core.FileSystem
|
||||
/// <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="fileVirtualPath">File virtual path {Cpk file name}\{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);
|
||||
@@ -37,7 +36,7 @@ namespace Core.FileSystem
|
||||
/// <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}
|
||||
/// <param name="fileVirtualPath">File virtual path {Cpk file name}\{File relative path inside archive}
|
||||
/// Example: music.cpk\music\PI01.mp3</param>
|
||||
/// <returns>True if file exists</returns>
|
||||
public bool FileExists(string fileVirtualPath);
|
||||
|
||||
@@ -203,16 +203,15 @@ namespace Core.GameBox
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static uint GameBoxSecondsToTick(float seconds)
|
||||
public static uint SecondsToTick(float seconds)
|
||||
{
|
||||
return (uint)(seconds * GameBoxTicksPerSecond);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static float TickToGameBoxSeconds(uint tick)
|
||||
public static float TickToSeconds(uint tick)
|
||||
{
|
||||
return (float)tick / GameBoxTicksPerSecond;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -10,11 +10,12 @@ namespace Core.GameBox
|
||||
[System.Serializable]
|
||||
public struct GameBoxMaterial
|
||||
{
|
||||
public Color32 Diffuse;
|
||||
public Color32 Ambient;
|
||||
public Color32 Specular;
|
||||
public Color32 Emissive;
|
||||
public float Power;
|
||||
public Color Diffuse;
|
||||
public Color Ambient;
|
||||
public Color Specular;
|
||||
public Color Emissive;
|
||||
public float SpecularPower;
|
||||
public string[] TextureFileNames;
|
||||
}
|
||||
|
||||
// To meet opengl, use this order instead:
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace Core.Services
|
||||
{
|
||||
if (!_services.ContainsKey(typeof(T)))
|
||||
{
|
||||
string error = $"{typeof(T)} not registered with {GetType().Name}";
|
||||
string error = $"[{nameof(ServiceLocator)}] {typeof(T)} is not registered with name: {GetType().Name}";
|
||||
Debug.LogError(error);
|
||||
throw new InvalidOperationException(error);
|
||||
}
|
||||
@@ -50,9 +50,13 @@ namespace Core.Services
|
||||
|
||||
if (_services.ContainsKey(typeof(T)))
|
||||
{
|
||||
Debug.LogWarning($"{typeof(T)} already registered.");
|
||||
Debug.LogWarning($"[{nameof(ServiceLocator)}] {typeof(T)} already registered.");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log($"[{nameof(ServiceLocator)}] Service type {typeof(T)} registered.");
|
||||
}
|
||||
|
||||
_services.Add(typeof(T), service);
|
||||
}
|
||||
@@ -65,9 +69,13 @@ namespace Core.Services
|
||||
{
|
||||
if (!_services.ContainsKey(typeof(T)))
|
||||
{
|
||||
Debug.LogWarning($"Failed to unregister since {typeof(T)} is not registered yet.");
|
||||
Debug.LogWarning($"[{nameof(ServiceLocator)}] Failed to unregister service since {typeof(T)} is not registered yet.");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log($"[{nameof(ServiceLocator)}] Service type {typeof(T)} unregistered.");
|
||||
}
|
||||
|
||||
_services.Remove(typeof(T));
|
||||
}
|
||||
@@ -77,6 +85,7 @@ namespace Core.Services
|
||||
/// </summary>
|
||||
public void UnregisterAll()
|
||||
{
|
||||
Debug.Log($"[{nameof(ServiceLocator)}] All services unregistered.");
|
||||
_services.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Core.Utils
|
||||
|
||||
public class FpsCounter : MonoBehaviour
|
||||
{
|
||||
private const float UPDATE_INTERVAL = 0.2f;
|
||||
private const float UPDATE_INTERVAL = 0.3f;
|
||||
|
||||
private int _frameCount = 0;
|
||||
private float _deltaTime = 0f;
|
||||
|
||||
@@ -62,18 +62,11 @@ namespace Core.Utils
|
||||
{
|
||||
return platform switch
|
||||
{
|
||||
RuntimePlatform.WindowsPlayer => WindowsSupportedVideoFormats,
|
||||
RuntimePlatform.WindowsEditor => WindowsSupportedVideoFormats,
|
||||
|
||||
RuntimePlatform.OSXPlayer => MacOSSupportedVideoFormats,
|
||||
RuntimePlatform.OSXEditor => MacOSSupportedVideoFormats,
|
||||
|
||||
RuntimePlatform.LinuxPlayer => LinuxSupportedVideoFormats,
|
||||
RuntimePlatform.LinuxEditor => LinuxSupportedVideoFormats,
|
||||
|
||||
RuntimePlatform.WindowsPlayer or RuntimePlatform.WindowsEditor => WindowsSupportedVideoFormats,
|
||||
RuntimePlatform.OSXPlayer or RuntimePlatform.OSXEditor => MacOSSupportedVideoFormats,
|
||||
RuntimePlatform.LinuxPlayer or RuntimePlatform.LinuxEditor => LinuxSupportedVideoFormats,
|
||||
RuntimePlatform.IPhonePlayer => iOSSupportedVideoFormats,
|
||||
RuntimePlatform.Android => AndroidSupportedVideoFormats,
|
||||
|
||||
_ => new HashSet<string> {".mp4" }
|
||||
};
|
||||
}
|
||||
|
||||
@@ -116,20 +116,18 @@ namespace Core.Utils
|
||||
b = (byte) ((temp / 32 + temp) / 32);
|
||||
}
|
||||
|
||||
public static string GetRelativeDirectoryPath(string filePath,
|
||||
char directoryPathSeparator = CpkConstants.DirectorySeparator)
|
||||
public static string GetDirectoryName(string filePath, char directorySeparatorChar)
|
||||
{
|
||||
return !filePath.Contains(directoryPathSeparator) ?
|
||||
return !filePath.Contains(directorySeparatorChar) ?
|
||||
string.Empty :
|
||||
filePath[..filePath.LastIndexOf(directoryPathSeparator)];
|
||||
filePath[..filePath.LastIndexOf(directorySeparatorChar)];
|
||||
}
|
||||
|
||||
public static string GetFileName(string filePath,
|
||||
char directoryPathSeparator = CpkConstants.DirectorySeparator)
|
||||
public static string GetFileName(string filePath, char directorySeparatorChar)
|
||||
{
|
||||
return !filePath.Contains(directoryPathSeparator) ?
|
||||
return !filePath.Contains(directorySeparatorChar) ?
|
||||
string.Empty :
|
||||
filePath[(filePath.LastIndexOf(directoryPathSeparator)+1)..];
|
||||
filePath[(filePath.LastIndexOf(directorySeparatorChar)+1)..];
|
||||
}
|
||||
|
||||
public static bool IsHandheldDevice()
|
||||
@@ -246,5 +244,21 @@ namespace Core.Utils
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool IsVersionGreater(string latestVersion, string currentVersion)
|
||||
{
|
||||
string[] latestParts = latestVersion.Split('.');
|
||||
string[] currentParts = currentVersion.Split('.');
|
||||
|
||||
for (var i = 0; i < Math.Min(latestParts.Length, currentParts.Length); i++)
|
||||
{
|
||||
int latest = int.Parse(latestParts[i]);
|
||||
int current = int.Parse(currentParts[i]);
|
||||
if (latest == current) continue;
|
||||
return latest > current;
|
||||
}
|
||||
|
||||
return latestParts.Length > currentParts.Length;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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")]
|
||||
@@ -127,10 +127,9 @@ 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[]
|
||||
{
|
||||
@@ -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))
|
||||
{
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace Editor.SourceGenerator
|
||||
var commands = Utility.GetTypesOfInterface(commandInterfaceType)
|
||||
.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++)
|
||||
{
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
namespace Pal3.Actor
|
||||
{
|
||||
using Core.DataReader.Scn;
|
||||
using Core.GameBox;
|
||||
using Data;
|
||||
using MetaData;
|
||||
using UnityEngine;
|
||||
@@ -66,7 +67,7 @@ namespace Pal3.Actor
|
||||
return ActorConstants.ActionToNameMap[ActorActionType.NpcStand2];
|
||||
}
|
||||
|
||||
Debug.LogError($"No default idle animation found for {Info.Id}_{Info.Name}");
|
||||
Debug.LogError($"[{nameof(Actor)}] No default idle animation found for {Info.Id}_{Info.Name}");
|
||||
return ActorConstants.ActionToNameMap[ActorActionType.NpcStand1];
|
||||
}
|
||||
|
||||
@@ -105,6 +106,27 @@ namespace Pal3.Actor
|
||||
value : null;
|
||||
}
|
||||
|
||||
public float GetMoveSpeed(MovementMode movementMode)
|
||||
{
|
||||
if (Info.GameBoxMoveSpeed > 0)
|
||||
{
|
||||
return Info.GameBoxMoveSpeed / GameBoxInterpreter.GameBoxUnitToUnityUnit;
|
||||
}
|
||||
|
||||
if (Info.Kind == ScnActorKind.MainActor)
|
||||
{
|
||||
return movementMode == MovementMode.Run
|
||||
? ActorConstants.PlayerActorRunSpeed
|
||||
: ActorConstants.PlayerActorWalkSpeed;
|
||||
}
|
||||
else
|
||||
{
|
||||
return movementMode == MovementMode.Run
|
||||
? ActorConstants.NpcActorRunSpeed
|
||||
: ActorConstants.NpcActorWalkSpeed;
|
||||
}
|
||||
}
|
||||
|
||||
public float GetInteractionMaxDistance()
|
||||
{
|
||||
return Info.Kind switch
|
||||
|
||||
@@ -140,16 +140,19 @@ namespace Pal3.Actor
|
||||
if (_shadow != null)
|
||||
{
|
||||
Destroy(_shadow);
|
||||
_shadow = null;
|
||||
}
|
||||
|
||||
if (_rigidbody != null)
|
||||
{
|
||||
Destroy(_rigidbody);
|
||||
_rigidbody = null;
|
||||
}
|
||||
|
||||
if (_collider != null)
|
||||
{
|
||||
Destroy(_collider);
|
||||
_collider = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -288,7 +291,7 @@ namespace Pal3.Actor
|
||||
{
|
||||
if (!_actor.IsActive && !_actor.IsMainActor())
|
||||
{
|
||||
Debug.LogError($"Failed to perform action since actor {command.ActorId} is inactive.");
|
||||
Debug.LogError($"[{nameof(ActorActionController)}] Failed to perform action since actor {command.ActorId} is inactive.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,15 +7,14 @@ namespace Pal3.Actor
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Core.DataReader.Cpk;
|
||||
using Core.DataReader.Ini;
|
||||
using Data;
|
||||
using MetaData;
|
||||
|
||||
public enum ActorAnimationType
|
||||
{
|
||||
Mv3 = 0,
|
||||
Mov
|
||||
Vertex = 0, // .mv3 animation
|
||||
Skeletal = 1, // .msh + .mov animation
|
||||
}
|
||||
|
||||
public abstract class ActorBase
|
||||
@@ -40,38 +39,34 @@ namespace Pal3.Actor
|
||||
|
||||
private void InitActorConfig(string name)
|
||||
{
|
||||
char separator = CpkConstants.DirectorySeparator;
|
||||
|
||||
string actorActionConfigFolder = $"{FileConstants.BaseDataCpkPathInfo.cpkName}{separator}" +
|
||||
$"{FileConstants.ActorFolderName}{separator}{name}{separator}";
|
||||
|
||||
ActorActionConfig defaultConfig = _resourceProvider.GetActorActionConfig(actorActionConfigFolder + $"{name}.ini");
|
||||
ActorActionConfig defaultConfig = _resourceProvider.GetActorActionConfig(name, $"{name}.ini");
|
||||
|
||||
// Add default config if it is MV3 animated
|
||||
if (defaultConfig is Mv3ActionConfig mv3Config)
|
||||
{
|
||||
AddActorConfig(mv3Config);
|
||||
AnimationType = ActorAnimationType.Mv3;
|
||||
AnimationType = ActorAnimationType.Vertex;
|
||||
return;
|
||||
}
|
||||
|
||||
// Add default config if it is MOV
|
||||
// Add default config if it is MOV animated
|
||||
if (defaultConfig is MovActionConfig)
|
||||
{
|
||||
AddActorConfig(defaultConfig);
|
||||
}
|
||||
|
||||
// For MOV animation actor, additional action config files are defined as
|
||||
// For MOV animated skeletal actor, additional action config files are defined as
|
||||
// 01.ini, 02.ini ...up tp 09.ini
|
||||
for (var i = 0; i <= 9; i++)
|
||||
{
|
||||
if (_resourceProvider.GetActorActionConfig(actorActionConfigFolder + $"{i:D2}.ini")
|
||||
if (_resourceProvider.GetActorActionConfig(name, $"{i:D2}.ini")
|
||||
is MovActionConfig movConfig)
|
||||
{
|
||||
AddActorConfig(movConfig);
|
||||
}
|
||||
}
|
||||
|
||||
AnimationType = ActorAnimationType.Mov;
|
||||
AnimationType = ActorAnimationType.Skeletal;
|
||||
}
|
||||
|
||||
private void AddActorConfig(ActorActionConfig config)
|
||||
@@ -110,28 +105,37 @@ namespace Pal3.Actor
|
||||
throw new ArgumentException($"Action file name not found for action name {actionName}");
|
||||
}
|
||||
|
||||
char separator = CpkConstants.DirectorySeparator;
|
||||
return $"{FileConstants.BaseDataCpkPathInfo.cpkName}{separator}" +
|
||||
$"{FileConstants.ActorFolderName}{separator}{_actorName}{separator}" +
|
||||
$"{actionFileName}";
|
||||
return $"{FileConstants.GetActorFolderVirtualPath(_actorName)}{actionFileName}";
|
||||
}
|
||||
|
||||
public string GetMeshFilePath(string actionName)
|
||||
{
|
||||
if (AnimationType != ActorAnimationType.Mov)
|
||||
if (AnimationType != ActorAnimationType.Skeletal)
|
||||
{
|
||||
throw new InvalidOperationException("Mesh file path is only available for MOV animation type.");
|
||||
throw new InvalidOperationException("Msh file path is only available for skeletal animation type.");
|
||||
}
|
||||
|
||||
if (!_actionNameToMeshFileNameMap.TryGetValue(actionName, out var meshFileName))
|
||||
{
|
||||
throw new ArgumentException($"Mesh file name not found for action name {actionName}");
|
||||
throw new ArgumentException($"Msh file name not found for action name {actionName}");
|
||||
}
|
||||
|
||||
char separator = CpkConstants.DirectorySeparator;
|
||||
return $"{FileConstants.BaseDataCpkPathInfo.cpkName}{separator}" +
|
||||
$"{FileConstants.ActorFolderName}{separator}{_actorName}{separator}" +
|
||||
$"{meshFileName}";
|
||||
return $"{FileConstants.GetActorFolderVirtualPath(_actorName)}{meshFileName}";
|
||||
}
|
||||
|
||||
public string GetMaterialFilePath(string actionName)
|
||||
{
|
||||
if (AnimationType != ActorAnimationType.Skeletal)
|
||||
{
|
||||
throw new InvalidOperationException("Mtl file path is only available for skeletal animation type.");
|
||||
}
|
||||
|
||||
if (!_actionNameToMaterialFileNameMap.TryGetValue(actionName, out var mtlFileName))
|
||||
{
|
||||
throw new ArgumentException($"Mtl file name not found for action name {actionName}");
|
||||
}
|
||||
|
||||
return $"{FileConstants.GetActorFolderVirtualPath(_actorName)}{mtlFileName}";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -40,17 +40,26 @@ namespace Pal3.Actor
|
||||
#endif
|
||||
|
||||
ActorActionController actionController;
|
||||
if (actor.AnimationType == ActorAnimationType.Mv3)
|
||||
switch (actor.AnimationType)
|
||||
{
|
||||
Mv3ActorActionController mv3ActionController = actorGameObject.AddComponent<Mv3ActorActionController>();
|
||||
mv3ActionController.Init(resourceProvider, actor, hasColliderAndRigidBody, isDropShadowEnabled, tintColor);
|
||||
actionController = mv3ActionController;
|
||||
}
|
||||
else
|
||||
{
|
||||
MovActorActionController movActionController = actorGameObject.AddComponent<MovActorActionController>();
|
||||
movActionController.Init(resourceProvider, actor, hasColliderAndRigidBody, isDropShadowEnabled, tintColor);
|
||||
actionController = movActionController;
|
||||
case ActorAnimationType.Vertex:
|
||||
{
|
||||
VertexAnimationActorActionController vertexActionController =
|
||||
actorGameObject.AddComponent<VertexAnimationActorActionController>();
|
||||
vertexActionController.Init(resourceProvider, actor, hasColliderAndRigidBody, isDropShadowEnabled, tintColor);
|
||||
actionController = vertexActionController;
|
||||
break;
|
||||
}
|
||||
case ActorAnimationType.Skeletal:
|
||||
{
|
||||
SkeletalAnimationActorActionController skeletalActionController =
|
||||
actorGameObject.AddComponent<SkeletalAnimationActorActionController>();
|
||||
skeletalActionController.Init(resourceProvider, actor, hasColliderAndRigidBody, isDropShadowEnabled, tintColor);
|
||||
actionController = skeletalActionController;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
throw new NotSupportedException($"Unsupported actor animation type: {actor.AnimationType}");
|
||||
}
|
||||
|
||||
var movementController = actorGameObject.AddComponent<ActorMovementController>();
|
||||
|
||||
@@ -92,16 +92,19 @@ namespace Pal3.Actor
|
||||
actor.Info.GameBoxYPosition,
|
||||
actor.Info.GameBoxZPosition));
|
||||
|
||||
// Setup actor's initial position
|
||||
if (actor.Info.InitBehaviour != ScnActorBehaviour.Hold &&
|
||||
_tilemap.TryGetTile(initPosition, _currentLayerIndex, out NavTile tile))
|
||||
{
|
||||
if (tile.IsWalkable())
|
||||
// If the actor is initially placed on a walkable tile, snap to the tile
|
||||
// Same for the case when actor is configured to not facing the player actor during dialogue
|
||||
if (tile.IsWalkable() || actor.Info.NoTurn == 1)
|
||||
{
|
||||
transform.position = new Vector3(initPosition.x,
|
||||
GameBoxInterpreter.ToUnityYPosition(tile.GameBoxYPosition),
|
||||
initPosition.z);
|
||||
}
|
||||
else
|
||||
else // This is to handle the case where the actor is initially placed on a non-walkable tile
|
||||
{
|
||||
Vector2Int tilePosition = _tilemap.GetTilePosition(initPosition, _currentLayerIndex);
|
||||
// Snap to the nearest adjacent tile if exists
|
||||
@@ -402,7 +405,7 @@ namespace Pal3.Actor
|
||||
SetNavLayer(layerIndex);
|
||||
transform.position = position;
|
||||
|
||||
Debug.LogWarning($"Portal to standing platform: {position}, " +
|
||||
Debug.LogWarning($"[{nameof(ActorMovementController)}] Portal to standing platform: {position}, " +
|
||||
$"layer: {layerIndex}");
|
||||
}
|
||||
else if (_tilemap.TryGetTile(position, layerIndex, out NavTile tile) && tile.IsWalkable())
|
||||
@@ -416,7 +419,7 @@ namespace Pal3.Actor
|
||||
position.z);
|
||||
|
||||
Vector2Int tilePosition = _tilemap.GetTilePosition(position, layerIndex);
|
||||
Debug.LogWarning($"Portal to: {position}, " +
|
||||
Debug.LogWarning($"[{nameof(ActorMovementController)}] Portal to: {position}, " +
|
||||
$"layer: {layerIndex}, " +
|
||||
$"tile: {tilePosition} DistanceToNearestObstacle: {tile.DistanceToNearestObstacle}, FloorKind: {tile.FloorKind}");
|
||||
}
|
||||
@@ -464,8 +467,7 @@ namespace Pal3.Actor
|
||||
Transform currentTransform = transform;
|
||||
Vector3 currentPosition = currentTransform.position;
|
||||
|
||||
// TODO: Use speed info from datascript\scene.txt file when _actor.Info.Speed == 0
|
||||
var moveSpeed = _actor.Info.Speed <= 0 ? (movementMode == MovementMode.Run ? 11f : 5f) : _actor.Info.Speed / 11f;
|
||||
float moveSpeed = _actor.GetMoveSpeed(movementMode);
|
||||
|
||||
if (!_actor.IsMainActor()) moveSpeed /= 2f;
|
||||
|
||||
@@ -781,7 +783,7 @@ namespace Pal3.Actor
|
||||
else
|
||||
{
|
||||
_movementWaiter?.CancelWait();
|
||||
Debug.LogError($"Failed to find path from tile position {fromTilePosition} " +
|
||||
Debug.LogError($"[{nameof(ActorMovementController)}] Failed to find path from tile position {fromTilePosition} " +
|
||||
$"to tile position: {toTilePosition}");
|
||||
}
|
||||
yield break;
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Pal3.Actor
|
||||
private const float ROTATION_SPEED = 10f;
|
||||
private const float ROTATION_SYNCING_DISTANCE = 2f;
|
||||
private const float FOLLOW_TARGET_MIN_DISTANCE = 1f;
|
||||
private const float FOLLOW_TARGET_FLY_SPEED_CHANEG_DISTANCE = 8f;
|
||||
private const float FOLLOW_TARGET_FLY_SPEED_CHANGE_DISTANCE = 8f;
|
||||
private const float FOLLOW_TARGET_MAX_DISTANCE = 15f;
|
||||
private const float FOLLOW_TARGET_X_OFFSET = 0.8f;
|
||||
private const float FOLLOW_TARGET_Y_OFFSET = -0.8f;
|
||||
@@ -127,10 +127,10 @@ namespace Pal3.Actor
|
||||
}
|
||||
|
||||
// Increase fly speed if the distance is greater than a threshold
|
||||
var flySpeed = distanceToTarget > FOLLOW_TARGET_FLY_SPEED_CHANEG_DISTANCE ? MaxFlySpeed : DefaultFlySpeed;
|
||||
var flySpeed = distanceToTarget > FOLLOW_TARGET_FLY_SPEED_CHANGE_DISTANCE ? MaxFlySpeed : DefaultFlySpeed;
|
||||
|
||||
_actorActionController.PerformAction(
|
||||
Vector3.Distance(myNewPosition, transform.position) < FOLLOW_TARGET_FLY_SPEED_CHANEG_DISTANCE - 1f
|
||||
Vector3.Distance(myNewPosition, transform.position) < FOLLOW_TARGET_FLY_SPEED_CHANGE_DISTANCE - 1f
|
||||
? _actor.GetMovementAction(MovementMode.Walk)
|
||||
: _actor.GetMovementAction(MovementMode.Run));
|
||||
|
||||
|
||||
@@ -1,224 +0,0 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Pal3.Actor
|
||||
{
|
||||
using System;
|
||||
using Command;
|
||||
using Command.InternalCommands;
|
||||
using Command.SceCommands;
|
||||
using Core.DataLoader;
|
||||
using Core.DataReader.Mov;
|
||||
using Core.DataReader.Msh;
|
||||
using Core.Utils;
|
||||
using Data;
|
||||
using MetaData;
|
||||
using Renderer;
|
||||
using Script.Waiter;
|
||||
using UnityEngine;
|
||||
|
||||
public class MovActorActionController : ActorActionController,
|
||||
ICommandExecutor<ActorAutoStandCommand>,
|
||||
ICommandExecutor<ActorStopActionCommand>
|
||||
{
|
||||
private GameResourceProvider _resourceProvider;
|
||||
private IMaterialFactory _materialFactory;
|
||||
private Actor _actor;
|
||||
private Color _tintColor;
|
||||
|
||||
private bool _autoStand = true;
|
||||
|
||||
// private MovModelRenderer _movAnimationRenderer;
|
||||
// private WaitUntilCanceled _animationLoopPointWaiter;
|
||||
|
||||
private Bounds _rendererBounds;
|
||||
private Bounds _meshBounds;
|
||||
|
||||
public void Init(GameResourceProvider resourceProvider,
|
||||
Actor actor,
|
||||
bool hasColliderAndRigidBody,
|
||||
bool isDropShadowEnabled,
|
||||
Color tintColor)
|
||||
{
|
||||
base.Init(resourceProvider, actor, hasColliderAndRigidBody, isDropShadowEnabled);
|
||||
|
||||
_resourceProvider = resourceProvider;
|
||||
_actor = actor;
|
||||
_tintColor = tintColor;
|
||||
_materialFactory = resourceProvider.GetMaterialFactory();
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
CommandExecutorRegistry<ICommand>.Instance.Register(this);
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
CommandExecutorRegistry<ICommand>.Instance.UnRegister(this);
|
||||
DeActivate();
|
||||
base.DeActivate();
|
||||
}
|
||||
|
||||
public override void PerformAction(string actionName,
|
||||
bool overwrite = false,
|
||||
int loopCount = -1,
|
||||
WaitUntilCanceled waiter = null)
|
||||
{
|
||||
if (!overwrite && string.Equals(GetCurrentAction(), actionName, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_actor.HasAction(actionName))
|
||||
{
|
||||
Debug.LogError($"Action {actionName} not found for actor {_actor.Info.Name}.");
|
||||
waiter?.CancelWait();
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.LogWarning($"Actor {_actor.Info.Name} is performing bone action {actionName}.");
|
||||
|
||||
MovFile movFile;
|
||||
MshFile mshFile;
|
||||
ITextureResourceProvider textureProvider;
|
||||
try
|
||||
{
|
||||
string movFilePath = _actor.GetActionFilePath(actionName);
|
||||
movFile = _resourceProvider.GetGameResourceFile<MovFile>(movFilePath);
|
||||
textureProvider = _resourceProvider.CreateTextureResourceProvider(
|
||||
Utility.GetRelativeDirectoryPath(movFilePath));
|
||||
|
||||
string mshFilePath = _actor.GetMeshFilePath(actionName);
|
||||
mshFile = _resourceProvider.GetGameResourceFile<MshFile>(mshFilePath);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogError(ex);
|
||||
waiter?.CancelWait();
|
||||
return;
|
||||
}
|
||||
|
||||
DisposeCurrentAction();
|
||||
|
||||
// _animationLoopPointWaiter = waiter;
|
||||
// _movAnimationRenderer = gameObject.GetOrAddComponent<MovModelRenderer>();
|
||||
//
|
||||
// ActorActionType actionType = ActorConstants.ActionNames
|
||||
// .FirstOrDefault(_ => string.Equals(_.Value, actionName, StringComparison.OrdinalIgnoreCase)).Key;
|
||||
//
|
||||
// if (movFile.TagNodes is {Length: > 0} && _actor.GetWeaponName() is {} weaponName &&
|
||||
// ActorConstants.ActionNameToWeaponArmTypeMap[actionType] != WeaponArmType.None)
|
||||
// {
|
||||
// var separator = CpkConstants.DirectorySeparator;
|
||||
//
|
||||
// var weaponPath = $"{FileConstants.BaseDataCpkPathInfo.cpkName}{separator}" +
|
||||
// $"{FileConstants.WeaponFolderName}{separator}{weaponName}{separator}{weaponName}.pol";
|
||||
//
|
||||
// (PolFile polFile, ITextureResourceProvider weaponTextureProvider) = _resourceProvider.GetPol(weaponPath);
|
||||
// _movAnimationRenderer.Init(movFile,
|
||||
// _materialFactory,
|
||||
// textureProvider,
|
||||
// _tintColor,
|
||||
// polFile,
|
||||
// weaponTextureProvider);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// _movAnimationRenderer.Init(movFile,
|
||||
// _materialFactory,
|
||||
// textureProvider,
|
||||
// _tintColor);
|
||||
// }
|
||||
//
|
||||
// _movAnimationRenderer.AnimationLoopPointReached += AnimationLoopPointReached;
|
||||
// _movAnimationRenderer.StartAnimation(loopCount);
|
||||
//
|
||||
// _rendererBounds = _movAnimationRenderer.GetRendererBounds();
|
||||
// _meshBounds = _movAnimationRenderer.GetMeshBounds();
|
||||
|
||||
base.PerformAction(actionName, overwrite, loopCount, waiter);
|
||||
}
|
||||
|
||||
// public override float GetActorHeight()
|
||||
// {
|
||||
// if (_movAnimationRenderer == null || !_movAnimationRenderer.IsVisible())
|
||||
// {
|
||||
// return _meshBounds.size.y;
|
||||
// }
|
||||
//
|
||||
// return _movAnimationRenderer.GetMeshBounds().size.y;
|
||||
// }
|
||||
//
|
||||
// public override Bounds GetRendererBounds()
|
||||
// {
|
||||
// return (_movAnimationRenderer == null || !_movAnimationRenderer.IsVisible()) ? _rendererBounds :
|
||||
// _movAnimationRenderer.GetRendererBounds();
|
||||
// }
|
||||
//
|
||||
// public override Bounds GetMeshBounds()
|
||||
// {
|
||||
// return (_movAnimationRenderer == null || !_movAnimationRenderer.IsVisible()) ? _meshBounds :
|
||||
// _movAnimationRenderer.GetMeshBounds();
|
||||
// }
|
||||
|
||||
internal override void DisposeCurrentAction()
|
||||
{
|
||||
// _animationLoopPointWaiter?.CancelWait();
|
||||
//
|
||||
// if (_movAnimationRenderer != null)
|
||||
// {
|
||||
// _movAnimationRenderer.AnimationLoopPointReached -= AnimationLoopPointReached;
|
||||
// _movAnimationRenderer.DisposeAnimation();
|
||||
// }
|
||||
|
||||
base.DisposeCurrentAction();
|
||||
}
|
||||
|
||||
internal override void DeActivate()
|
||||
{
|
||||
DisposeCurrentAction();
|
||||
|
||||
// if (_movAnimationRenderer != null)
|
||||
// {
|
||||
// Destroy(_movAnimationRenderer);
|
||||
// }
|
||||
|
||||
base.DeActivate();
|
||||
}
|
||||
|
||||
public void Execute(ActorAutoStandCommand command)
|
||||
{
|
||||
if (command.ActorId == _actor.Info.Id) _autoStand = (command.AutoStand == 1);
|
||||
}
|
||||
|
||||
public void Execute(ActorStopActionCommand command)
|
||||
{
|
||||
// if (command.ActorId != _actor.Info.Id ||
|
||||
// _movAnimationRenderer == null ||
|
||||
// !_movAnimationRenderer.IsVisible()) return;
|
||||
//
|
||||
// if (_movAnimationRenderer.IsActionInHoldState())
|
||||
// {
|
||||
// _animationLoopPointWaiter?.CancelWait();
|
||||
// _animationLoopPointWaiter = new WaitUntilCanceled();
|
||||
// CommandDispatcher<ICommand>.Instance.Dispatch(
|
||||
// new ScriptRunnerAddWaiterRequest(_animationLoopPointWaiter));
|
||||
//
|
||||
// _movAnimationRenderer.ResumeAction();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// _movAnimationRenderer.PauseAnimation();
|
||||
// _animationLoopPointWaiter?.CancelWait();
|
||||
//
|
||||
// if (_autoStand && _movAnimationRenderer.IsVisible())
|
||||
// {
|
||||
// PerformAction(_actor.GetIdleAction());
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,183 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Pal3.Actor
|
||||
{
|
||||
using System;
|
||||
using Command;
|
||||
using Command.SceCommands;
|
||||
using Core.DataLoader;
|
||||
using Core.DataReader.Cpk;
|
||||
using Core.DataReader.Mov;
|
||||
using Core.DataReader.Msh;
|
||||
using Core.DataReader.Mtl;
|
||||
using Core.Extensions;
|
||||
using Core.Utils;
|
||||
using Data;
|
||||
using Renderer;
|
||||
using Script.Waiter;
|
||||
using UnityEngine;
|
||||
|
||||
public class SkeletalAnimationActorActionController : ActorActionController,
|
||||
ICommandExecutor<ActorAutoStandCommand>,
|
||||
ICommandExecutor<ActorStopActionCommand>
|
||||
{
|
||||
private GameResourceProvider _resourceProvider;
|
||||
private IMaterialFactory _materialFactory;
|
||||
private Actor _actor;
|
||||
private Color _tintColor;
|
||||
|
||||
private bool _autoStand = true;
|
||||
|
||||
private SkeletalModelRenderer _skeletalModelRenderer;
|
||||
|
||||
private Bounds _rendererBounds;
|
||||
private Bounds _meshBounds;
|
||||
|
||||
public void Init(GameResourceProvider resourceProvider,
|
||||
Actor actor,
|
||||
bool hasColliderAndRigidBody,
|
||||
bool isDropShadowEnabled,
|
||||
Color tintColor)
|
||||
{
|
||||
base.Init(resourceProvider, actor, hasColliderAndRigidBody, isDropShadowEnabled);
|
||||
|
||||
_resourceProvider = resourceProvider;
|
||||
_actor = actor;
|
||||
_tintColor = tintColor;
|
||||
_materialFactory = resourceProvider.GetMaterialFactory();
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
CommandExecutorRegistry<ICommand>.Instance.Register(this);
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
CommandExecutorRegistry<ICommand>.Instance.UnRegister(this);
|
||||
DeActivate();
|
||||
base.DeActivate();
|
||||
}
|
||||
|
||||
public override void PerformAction(string actionName,
|
||||
bool overwrite = false,
|
||||
int loopCount = -1,
|
||||
WaitUntilCanceled waiter = null)
|
||||
{
|
||||
if (!overwrite && string.Equals(GetCurrentAction(), actionName, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_actor.HasAction(actionName))
|
||||
{
|
||||
Debug.LogError($"[{nameof(SkeletalAnimationActorActionController)}] Action {actionName} not found for actor {_actor.Info.Name}.");
|
||||
waiter?.CancelWait();
|
||||
return;
|
||||
}
|
||||
|
||||
MshFile mshFile;
|
||||
MtlFile mtlFile;
|
||||
MovFile movFile;
|
||||
ITextureResourceProvider textureProvider;
|
||||
try
|
||||
{
|
||||
string mshFilePath = _actor.GetMeshFilePath(actionName);
|
||||
mshFile = _resourceProvider.GetGameResourceFile<MshFile>(mshFilePath);
|
||||
|
||||
string mtlFilePath = _actor.GetMaterialFilePath(actionName);
|
||||
mtlFile = _resourceProvider.GetGameResourceFile<MtlFile>(mtlFilePath);
|
||||
|
||||
string movFilePath = _actor.GetActionFilePath(actionName);
|
||||
movFile = _resourceProvider.GetGameResourceFile<MovFile>(movFilePath);
|
||||
|
||||
textureProvider = _resourceProvider.CreateTextureResourceProvider(
|
||||
Utility.GetDirectoryName(mtlFilePath, CpkConstants.DirectorySeparatorChar));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogError($"[{nameof(SkeletalAnimationActorActionController)}] Exception: {ex}");
|
||||
waiter?.CancelWait();
|
||||
return;
|
||||
}
|
||||
|
||||
DisposeCurrentAction();
|
||||
|
||||
_skeletalModelRenderer = gameObject.GetOrAddComponent<SkeletalModelRenderer>();
|
||||
|
||||
_skeletalModelRenderer.Init(mshFile,
|
||||
mtlFile,
|
||||
_materialFactory,
|
||||
textureProvider,
|
||||
_tintColor);
|
||||
|
||||
_skeletalModelRenderer.StartAnimation(movFile, loopCount);
|
||||
|
||||
_rendererBounds = _skeletalModelRenderer.GetRendererBounds();
|
||||
_meshBounds = _skeletalModelRenderer.GetMeshBounds();
|
||||
|
||||
base.PerformAction(actionName, overwrite, loopCount, waiter);
|
||||
}
|
||||
|
||||
public override float GetActorHeight()
|
||||
{
|
||||
if (_skeletalModelRenderer == null || !_skeletalModelRenderer.IsVisible())
|
||||
{
|
||||
return _meshBounds.size.y;
|
||||
}
|
||||
|
||||
return _skeletalModelRenderer.GetMeshBounds().size.y;
|
||||
}
|
||||
|
||||
public override Bounds GetRendererBounds()
|
||||
{
|
||||
return (_skeletalModelRenderer == null || !_skeletalModelRenderer.IsVisible()) ? _rendererBounds :
|
||||
_skeletalModelRenderer.GetRendererBounds();
|
||||
}
|
||||
|
||||
public override Bounds GetMeshBounds()
|
||||
{
|
||||
return (_skeletalModelRenderer == null || !_skeletalModelRenderer.IsVisible()) ? _meshBounds :
|
||||
_skeletalModelRenderer.GetMeshBounds();
|
||||
}
|
||||
|
||||
internal override void DisposeCurrentAction()
|
||||
{
|
||||
if (_skeletalModelRenderer != null)
|
||||
{
|
||||
_skeletalModelRenderer.Dispose();
|
||||
_skeletalModelRenderer = null;
|
||||
}
|
||||
|
||||
base.DisposeCurrentAction();
|
||||
}
|
||||
|
||||
internal override void DeActivate()
|
||||
{
|
||||
DisposeCurrentAction();
|
||||
base.DeActivate();
|
||||
}
|
||||
|
||||
public void Execute(ActorAutoStandCommand command)
|
||||
{
|
||||
if (command.ActorId == _actor.Info.Id) _autoStand = (command.AutoStand == 1);
|
||||
}
|
||||
|
||||
public void Execute(ActorStopActionCommand command)
|
||||
{
|
||||
if (command.ActorId != _actor.Info.Id ||
|
||||
_skeletalModelRenderer == null ||
|
||||
!_skeletalModelRenderer.IsVisible()) return;
|
||||
|
||||
_skeletalModelRenderer.PauseAnimation();
|
||||
|
||||
if (_autoStand && _skeletalModelRenderer.IsVisible())
|
||||
{
|
||||
PerformAction(_actor.GetIdleAction());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File renamed without changes.
+35
-44
@@ -22,7 +22,7 @@ namespace Pal3.Actor
|
||||
using Script.Waiter;
|
||||
using UnityEngine;
|
||||
|
||||
public class Mv3ActorActionController : ActorActionController,
|
||||
public class VertexAnimationActorActionController : ActorActionController,
|
||||
ICommandExecutor<ActorAutoStandCommand>,
|
||||
ICommandExecutor<ActorStopActionCommand>,
|
||||
ICommandExecutor<ActorChangeTextureCommand>
|
||||
@@ -34,7 +34,7 @@ namespace Pal3.Actor
|
||||
|
||||
private bool _autoStand = true;
|
||||
|
||||
private Mv3ModelRenderer _mv3AnimationRenderer;
|
||||
private Mv3ModelRenderer _mv3ModelRenderer;
|
||||
private WaitUntilCanceled _animationLoopPointWaiter;
|
||||
|
||||
private Bounds _rendererBounds;
|
||||
@@ -98,7 +98,7 @@ namespace Pal3.Actor
|
||||
|
||||
if (!_actor.HasAction(actionName))
|
||||
{
|
||||
Debug.LogError($"Action {actionName} not found for actor {_actor.Info.Name}.");
|
||||
Debug.LogError($"[{nameof(VertexAnimationActorActionController)}] Action {actionName} not found for actor {_actor.Info.Name}.");
|
||||
_animationLoopPointWaiter?.CancelWait();
|
||||
waiter?.CancelWait();
|
||||
return;
|
||||
@@ -111,11 +111,11 @@ namespace Pal3.Actor
|
||||
string mv3FilePath = _actor.GetActionFilePath(actionName);
|
||||
mv3File = _resourceProvider.GetGameResourceFile<Mv3File>(mv3FilePath);
|
||||
textureProvider = _resourceProvider.CreateTextureResourceProvider(
|
||||
Utility.GetRelativeDirectoryPath(mv3FilePath));
|
||||
Utility.GetDirectoryName(mv3FilePath, CpkConstants.DirectorySeparatorChar));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogError(ex);
|
||||
Debug.LogError($"[{nameof(VertexAnimationActorActionController)}] Exception: {ex}");
|
||||
_animationLoopPointWaiter?.CancelWait();
|
||||
waiter?.CancelWait();
|
||||
return;
|
||||
@@ -124,7 +124,7 @@ namespace Pal3.Actor
|
||||
DisposeCurrentAction();
|
||||
|
||||
_animationLoopPointWaiter = waiter;
|
||||
_mv3AnimationRenderer = gameObject.GetOrAddComponent<Mv3ModelRenderer>();
|
||||
_mv3ModelRenderer = gameObject.GetOrAddComponent<Mv3ModelRenderer>();
|
||||
|
||||
ActorActionType? actionType = ActorConstants.NameToActionMap.ContainsKey(actionName.ToLower()) ?
|
||||
ActorConstants.NameToActionMap[actionName.ToLower()] : null;
|
||||
@@ -134,15 +134,11 @@ namespace Pal3.Actor
|
||||
_actor.GetWeaponName() is {} weaponName &&
|
||||
ActorConstants.ActionNameToWeaponArmTypeMap[actionType.Value] != WeaponArmType.None)
|
||||
{
|
||||
var separator = CpkConstants.DirectorySeparator;
|
||||
|
||||
var weaponPath = $"{FileConstants.BaseDataCpkPathInfo.cpkName}{separator}" +
|
||||
$"{FileConstants.WeaponFolderName}{separator}{weaponName}{separator}{weaponName}.pol";
|
||||
|
||||
string weaponPath = FileConstants.GetWeaponModelFileVirtualPath(weaponName);
|
||||
PolFile polFile = _resourceProvider.GetGameResourceFile<PolFile>(weaponPath);
|
||||
ITextureResourceProvider weaponTextureProvider = _resourceProvider.CreateTextureResourceProvider(
|
||||
Utility.GetRelativeDirectoryPath(weaponPath));
|
||||
_mv3AnimationRenderer.Init(mv3File,
|
||||
Utility.GetDirectoryName(weaponPath, CpkConstants.DirectorySeparatorChar));
|
||||
_mv3ModelRenderer.Init(mv3File,
|
||||
_materialFactory,
|
||||
textureProvider,
|
||||
_tintColor,
|
||||
@@ -151,49 +147,49 @@ namespace Pal3.Actor
|
||||
}
|
||||
else
|
||||
{
|
||||
_mv3AnimationRenderer.Init(mv3File,
|
||||
_mv3ModelRenderer.Init(mv3File,
|
||||
_materialFactory,
|
||||
textureProvider,
|
||||
_tintColor);
|
||||
}
|
||||
|
||||
_mv3AnimationRenderer.AnimationLoopPointReached += AnimationLoopPointReached;
|
||||
_mv3AnimationRenderer.StartAnimation(loopCount);
|
||||
_mv3ModelRenderer.AnimationLoopPointReached += AnimationLoopPointReached;
|
||||
_mv3ModelRenderer.StartAnimation(loopCount);
|
||||
|
||||
_rendererBounds = _mv3AnimationRenderer.GetRendererBounds();
|
||||
_meshBounds = _mv3AnimationRenderer.GetMeshBounds();
|
||||
_rendererBounds = _mv3ModelRenderer.GetRendererBounds();
|
||||
_meshBounds = _mv3ModelRenderer.GetMeshBounds();
|
||||
|
||||
base.PerformAction(actionName, overwrite, loopCount, waiter);
|
||||
}
|
||||
|
||||
public override void PauseAnimation()
|
||||
{
|
||||
if (_mv3AnimationRenderer != null)
|
||||
if (_mv3ModelRenderer != null)
|
||||
{
|
||||
_mv3AnimationRenderer.PauseAnimation();
|
||||
_mv3ModelRenderer.PauseAnimation();
|
||||
}
|
||||
}
|
||||
|
||||
public override float GetActorHeight()
|
||||
{
|
||||
if (_mv3AnimationRenderer == null || !_mv3AnimationRenderer.IsVisible())
|
||||
if (_mv3ModelRenderer == null || !_mv3ModelRenderer.IsVisible())
|
||||
{
|
||||
return _meshBounds.size.y;
|
||||
}
|
||||
|
||||
return _mv3AnimationRenderer.GetMeshBounds().size.y;
|
||||
return _mv3ModelRenderer.GetMeshBounds().size.y;
|
||||
}
|
||||
|
||||
public override Bounds GetRendererBounds()
|
||||
{
|
||||
return (_mv3AnimationRenderer == null || !_mv3AnimationRenderer.IsVisible()) ? _rendererBounds :
|
||||
_mv3AnimationRenderer.GetRendererBounds();
|
||||
return (_mv3ModelRenderer == null || !_mv3ModelRenderer.IsVisible()) ? _rendererBounds :
|
||||
_mv3ModelRenderer.GetRendererBounds();
|
||||
}
|
||||
|
||||
public override Bounds GetMeshBounds()
|
||||
{
|
||||
return (_mv3AnimationRenderer == null || !_mv3AnimationRenderer.IsVisible()) ? _meshBounds :
|
||||
_mv3AnimationRenderer.GetMeshBounds();
|
||||
return (_mv3ModelRenderer == null || !_mv3ModelRenderer.IsVisible()) ? _meshBounds :
|
||||
_mv3ModelRenderer.GetMeshBounds();
|
||||
}
|
||||
|
||||
private void AnimationLoopPointReached(object _, int loopCount)
|
||||
@@ -203,10 +199,10 @@ namespace Pal3.Actor
|
||||
_animationLoopPointWaiter?.CancelWait();
|
||||
}
|
||||
|
||||
if (_autoStand && _mv3AnimationRenderer.IsVisible())
|
||||
if (_autoStand && _mv3ModelRenderer.IsVisible())
|
||||
{
|
||||
if (loopCount is 0 ||
|
||||
(loopCount is -2 && !_mv3AnimationRenderer.IsActionInHoldState()))
|
||||
(loopCount is -2 && !_mv3ModelRenderer.IsActionInHoldState()))
|
||||
{
|
||||
PerformAction(_actor.GetIdleAction());
|
||||
}
|
||||
@@ -217,10 +213,11 @@ namespace Pal3.Actor
|
||||
{
|
||||
_animationLoopPointWaiter?.CancelWait();
|
||||
|
||||
if (_mv3AnimationRenderer != null)
|
||||
if (_mv3ModelRenderer != null)
|
||||
{
|
||||
_mv3AnimationRenderer.AnimationLoopPointReached -= AnimationLoopPointReached;
|
||||
_mv3AnimationRenderer.Dispose();
|
||||
_mv3ModelRenderer.AnimationLoopPointReached -= AnimationLoopPointReached;
|
||||
_mv3ModelRenderer.Dispose();
|
||||
_mv3ModelRenderer = null;
|
||||
}
|
||||
|
||||
base.DisposeCurrentAction();
|
||||
@@ -229,12 +226,6 @@ namespace Pal3.Actor
|
||||
internal override void DeActivate()
|
||||
{
|
||||
DisposeCurrentAction();
|
||||
|
||||
if (_mv3AnimationRenderer != null)
|
||||
{
|
||||
Destroy(_mv3AnimationRenderer);
|
||||
}
|
||||
|
||||
base.DeActivate();
|
||||
}
|
||||
|
||||
@@ -246,23 +237,23 @@ namespace Pal3.Actor
|
||||
public void Execute(ActorStopActionCommand command)
|
||||
{
|
||||
if (command.ActorId != _actor.Info.Id ||
|
||||
_mv3AnimationRenderer == null ||
|
||||
!_mv3AnimationRenderer.IsVisible()) return;
|
||||
_mv3ModelRenderer == null ||
|
||||
!_mv3ModelRenderer.IsVisible()) return;
|
||||
|
||||
if (_mv3AnimationRenderer.IsActionInHoldState())
|
||||
if (_mv3ModelRenderer.IsActionInHoldState())
|
||||
{
|
||||
_animationLoopPointWaiter?.CancelWait();
|
||||
_animationLoopPointWaiter = new WaitUntilCanceled();
|
||||
CommandDispatcher<ICommand>.Instance.Dispatch(
|
||||
new ScriptRunnerAddWaiterRequest(_animationLoopPointWaiter));
|
||||
_mv3AnimationRenderer.ResumeAction();
|
||||
_mv3ModelRenderer.ResumeAction();
|
||||
}
|
||||
else
|
||||
{
|
||||
_mv3AnimationRenderer.PauseAnimation();
|
||||
_mv3ModelRenderer.PauseAnimation();
|
||||
_animationLoopPointWaiter?.CancelWait();
|
||||
|
||||
if (_autoStand && _mv3AnimationRenderer.IsVisible())
|
||||
if (_autoStand && _mv3ModelRenderer.IsVisible())
|
||||
{
|
||||
PerformAction(_actor.GetIdleAction());
|
||||
}
|
||||
@@ -272,7 +263,7 @@ namespace Pal3.Actor
|
||||
public void Execute(ActorChangeTextureCommand command)
|
||||
{
|
||||
if (_actor.Info.Id != command.ActorId) return;
|
||||
_mv3AnimationRenderer.ChangeTexture(command.TextureName);
|
||||
_mv3ModelRenderer.ChangeTexture(command.TextureName);
|
||||
}
|
||||
}
|
||||
}
|
||||
File renamed without changes.
@@ -138,8 +138,8 @@ namespace Pal3.Audio
|
||||
}
|
||||
|
||||
_currentMusicClipName = musicName;
|
||||
var musicFileVirtualPath = GetMusicFileVirtualPath(musicName);
|
||||
var musicFileCachePath = _resourceProvider.GetMp3FilePathInCacheFolder(musicFileVirtualPath);
|
||||
var musicFileVirtualPath = FileConstants.GetMusicFileVirtualPath(musicName);
|
||||
var musicFileCachePath = _resourceProvider.GetMusicFilePathInCacheFolder(musicName);
|
||||
|
||||
yield return PlayMusicAsync(musicName, musicFileVirtualPath, musicFileCachePath, -1);
|
||||
}
|
||||
@@ -257,13 +257,6 @@ namespace Pal3.Audio
|
||||
}
|
||||
}
|
||||
|
||||
private string GetMusicFileVirtualPath(string musicName)
|
||||
{
|
||||
var separator = CpkConstants.DirectorySeparator;
|
||||
return $"{FileConstants.MusicCpkPathInfo.cpkName}{separator}" +
|
||||
$"{FileConstants.MusicCpkPathInfo.relativePath}{separator}{musicName}.mp3";
|
||||
}
|
||||
|
||||
public IEnumerator PlayMusicAsync(string musicName,
|
||||
string musicFileVirtualPath,
|
||||
string musicFileCachePath,
|
||||
@@ -447,8 +440,8 @@ namespace Pal3.Audio
|
||||
|
||||
_currentScriptMusic = command.MusicName;
|
||||
_currentMusicClipName = command.MusicName;
|
||||
var musicFileVirtualPath = GetMusicFileVirtualPath(command.MusicName);
|
||||
var musicFileCachePath = _resourceProvider.GetMp3FilePathInCacheFolder(musicFileVirtualPath);
|
||||
var musicFileVirtualPath = FileConstants.GetMusicFileVirtualPath(command.MusicName);
|
||||
var musicFileCachePath = _resourceProvider.GetMusicFilePathInCacheFolder(musicFileVirtualPath);
|
||||
StartCoroutine(PlayMusicAsync(command.MusicName,
|
||||
musicFileVirtualPath,
|
||||
musicFileCachePath,
|
||||
|
||||
@@ -481,11 +481,8 @@ namespace Pal3.Camera
|
||||
Vector3 cameraFacingDirection = (cameraRotation * Vector3.forward).normalized;
|
||||
Vector3 cameraPosition = _lastLookAtPoint + cameraFacingDirection * -cameraDistance + yOffset;
|
||||
|
||||
Transform cameraTransform = _camera.transform;
|
||||
cameraTransform.rotation = cameraRotation;
|
||||
cameraTransform.position = cameraPosition;
|
||||
|
||||
_cameraOffset = cameraTransform.position - _lastLookAtPoint;
|
||||
_camera.transform.SetPositionAndRotation(cameraPosition, cameraRotation);
|
||||
_cameraOffset = cameraPosition - _lastLookAtPoint;
|
||||
}
|
||||
|
||||
public void Execute(CameraSetDefaultTransformCommand command)
|
||||
@@ -511,11 +508,12 @@ namespace Pal3.Camera
|
||||
command.GameBoxXPosition,
|
||||
command.GameBoxYPosition,
|
||||
command.GameBoxZPosition));
|
||||
Transform cameraTransform = _camera.transform;
|
||||
cameraTransform.position = cameraPosition;
|
||||
cameraTransform.rotation = GameBoxInterpreter.ToUnityRotation(command.Pitch, command.Yaw, 0f);
|
||||
Quaternion cameraRotation = GameBoxInterpreter.ToUnityRotation(command.Pitch, command.Yaw, 0f);
|
||||
|
||||
_lastLookAtPoint = cameraTransform.position +
|
||||
Transform cameraTransform = _camera.transform;
|
||||
cameraTransform.SetPositionAndRotation(cameraPosition, cameraRotation);
|
||||
|
||||
_lastLookAtPoint = cameraPosition +
|
||||
cameraTransform.forward * GameBoxInterpreter.ToUnityDistance(command.GameBoxDistance);
|
||||
_cameraOffset = cameraPosition - _lastLookAtPoint;
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace Pal3.Command
|
||||
}
|
||||
else if (Attribute.GetCustomAttribute(typeof(T), typeof(SceCommandAttribute)) != null)
|
||||
{
|
||||
Debug.LogWarning($"No command executor found for sce command: {typeof(T).Name}");
|
||||
Debug.LogWarning($"[{nameof(CommandDispatcher<TCommand>)}] No command executor found for sce command: {typeof(T).Name}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace Pal3.Command
|
||||
}
|
||||
else if (Attribute.GetCustomAttribute(command.GetType(), typeof(SceCommandAttribute)) != null)
|
||||
{
|
||||
Debug.LogWarning($"No command executor found for sce command: {command.GetType().Name}");
|
||||
Debug.LogWarning($"[{nameof(CommandDispatcher<TCommand>)}] No command executor found for sce command: {command.GetType().Name}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace Pal3.Command
|
||||
{
|
||||
if (_executors[typeof(ICommandExecutor<T>)].Contains(executor))
|
||||
{
|
||||
Debug.LogError($"Executor already registered: {executor.GetType()}");
|
||||
Debug.LogError($"[{nameof(CommandExecutorRegistry<TCommand>)}] Executor already registered: {executor.GetType()}");
|
||||
}
|
||||
else _executors[typeof(ICommandExecutor<T>)].Add(executor);
|
||||
}
|
||||
@@ -48,7 +48,7 @@ namespace Pal3.Command
|
||||
|
||||
if (executorTypes.Count == 0)
|
||||
{
|
||||
Debug.LogError($"No ICommandExecutor interface found for type: {executor.GetType()}");
|
||||
Debug.LogError($"[{nameof(CommandExecutorRegistry<TCommand>)}] No ICommandExecutor interface found for type: {executor.GetType()}");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace Pal3.Command
|
||||
{
|
||||
if (_executors[executorType].Contains(executor))
|
||||
{
|
||||
Debug.LogError($"Executor already registered: {executor.GetType()}");
|
||||
Debug.LogError($"[{nameof(CommandExecutorRegistry<TCommand>)}] Executor already registered: {executor.GetType()}");
|
||||
}
|
||||
else _executors[executorType].Add(executor);
|
||||
}
|
||||
@@ -74,7 +74,7 @@ namespace Pal3.Command
|
||||
{
|
||||
if (!_executors.ContainsKey(typeof(ICommandExecutor<T>)))
|
||||
{
|
||||
Debug.LogError($"Executor has not been registered yet: {executor.GetType()}");
|
||||
Debug.LogError($"[{nameof(CommandExecutorRegistry<TCommand>)}] Executor has not been registered yet: {executor.GetType()}");
|
||||
return;
|
||||
}
|
||||
_executors[typeof(ICommandExecutor<T>)].Remove(executor);
|
||||
@@ -92,7 +92,7 @@ namespace Pal3.Command
|
||||
|
||||
if (executorTypes.Count == 0)
|
||||
{
|
||||
Debug.LogError($"No ICommandExecutor interface found for type: {executor.GetType()}");
|
||||
Debug.LogError($"[{nameof(CommandExecutorRegistry<TCommand>)}] No ICommandExecutor interface found for type: {executor.GetType()}");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace Pal3.Command
|
||||
{
|
||||
if (!_executors.ContainsKey(executorType))
|
||||
{
|
||||
Debug.LogError($"Executor has not been registered yet: {executor.GetType()}");
|
||||
Debug.LogError($"[{nameof(CommandExecutorRegistry<TCommand>)}] Executor has not been registered yet: {executor.GetType()}");
|
||||
return;
|
||||
}
|
||||
_executors[executorType].Remove(executor);
|
||||
|
||||
@@ -775,6 +775,14 @@ namespace Pal3.Command
|
||||
new SceneCloseDoorCommand(objectId));
|
||||
}
|
||||
|
||||
// <auto-generated/>
|
||||
[ConsoleMethodAttribute("SceneEnableFog", "设置并开启场景内的雾气显示,参数:起始距离(原GameBox引擎下的距离单位),结束距离(原GameBox引擎下的距离单位),强度值,蓝色(0f-255f),绿色(0f-255f),红色(0f-255f),透明度(0f-1f)")]
|
||||
public static void SceneEnableFog(System.Single startDistance, System.Single endDistance, System.Single intensity, System.Single blue, System.Single green, System.Single red, System.Single alpha)
|
||||
{
|
||||
CommandDispatcher<ICommand>.Instance.Dispatch(
|
||||
new SceneEnableFogCommand(startDistance, endDistance, intensity, blue, green, red, alpha));
|
||||
}
|
||||
|
||||
// <auto-generated/>
|
||||
[ConsoleMethodAttribute("SceneLoad", "切换场景,参数:场景关(文件)名称,场景区块名称")]
|
||||
public static void SceneLoad(System.String sceneFileName, System.String sceneName)
|
||||
@@ -1175,14 +1183,6 @@ namespace Pal3.Command
|
||||
new UIShowSmeltingMenuCommand(smeltingScriptId));
|
||||
}
|
||||
|
||||
// <auto-generated/>
|
||||
[ConsoleMethodAttribute("Unknown162", "仙三外设置场景内的雾气特效和颜色???")]
|
||||
public static void Unknown162(System.Single unknown1, System.Single unknown2, System.Single unknown3, System.Single red, System.Single green, System.Single blue, System.Single unknown7)
|
||||
{
|
||||
CommandDispatcher<ICommand>.Instance.Dispatch(
|
||||
new UnknownCommand162(unknown1, unknown2, unknown3, red, green, blue, unknown7));
|
||||
}
|
||||
|
||||
// <auto-generated/>
|
||||
[ConsoleMethodAttribute("Unknown166", "???")]
|
||||
public static void Unknown166(System.Int32 unknown1, System.Int32 unknown2)
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Pal3.Command.SceCommands
|
||||
{
|
||||
#if PAL3A
|
||||
[AvailableInConsole]
|
||||
[SceCommand(162, "设置并开启场景内的雾气显示," +
|
||||
"参数:起始距离(原GameBox引擎下的距离单位),结束距离(原GameBox引擎下的距离单位),强度值," +
|
||||
"蓝色(0f-255f),绿色(0f-255f),红色(0f-255f),透明度(0f-1f)")]
|
||||
public class SceneEnableFogCommand : ICommand
|
||||
{
|
||||
public SceneEnableFogCommand(
|
||||
float startDistance,
|
||||
float endDistance,
|
||||
float intensity,
|
||||
float blue,
|
||||
float green,
|
||||
float red,
|
||||
float alpha)
|
||||
{
|
||||
StartDistance = startDistance;
|
||||
EndDistance = endDistance;
|
||||
Intensity = intensity;
|
||||
Blue = blue;
|
||||
Green = green;
|
||||
Red = red;
|
||||
Alpha = alpha;
|
||||
}
|
||||
|
||||
public float StartDistance { get; }
|
||||
public float EndDistance { get; }
|
||||
public float Intensity { get; }
|
||||
public float Blue { get; }
|
||||
public float Green { get; }
|
||||
public float Red { get; }
|
||||
public float Alpha { get; }
|
||||
}
|
||||
#endif
|
||||
}
|
||||
File renamed without changes.
@@ -1,40 +0,0 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Pal3.Command.SceCommands
|
||||
{
|
||||
#if PAL3A
|
||||
[AvailableInConsole]
|
||||
[SceCommand(162, "仙三外设置场景内的雾气特效和颜色???")]
|
||||
public class UnknownCommand162 : ICommand
|
||||
{
|
||||
public UnknownCommand162(
|
||||
float unknown1,
|
||||
float unknown2,
|
||||
float unknown3,
|
||||
float red,
|
||||
float green,
|
||||
float blue,
|
||||
float unknown7)
|
||||
{
|
||||
Unknown1 = unknown1;
|
||||
Unknown2 = unknown2;
|
||||
Unknown3 = unknown3;
|
||||
Red = red;
|
||||
Green = green;
|
||||
Blue = blue;
|
||||
Unknown7 = unknown7;
|
||||
}
|
||||
|
||||
public float Unknown1 { get; }
|
||||
public float Unknown2 { get; }
|
||||
public float Unknown3 { get; }
|
||||
public float Red { get; }
|
||||
public float Green { get; }
|
||||
public float Blue { get; }
|
||||
public float Unknown7 { get; }
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -44,8 +44,8 @@ namespace Pal3.Data
|
||||
// Dispose current scene cpk
|
||||
if (!string.IsNullOrEmpty(_currentCityName))
|
||||
{
|
||||
var currentSceneFolderPath = _currentCityName + CpkConstants.FileExtension + CpkConstants.DirectorySeparator
|
||||
+ _currentSceneName;
|
||||
var currentSceneFolderPath = $"{_currentCityName}{CpkConstants.FileExtension}" +
|
||||
$"{CpkConstants.DirectorySeparatorChar}{_currentSceneName}";
|
||||
|
||||
if (_fileSystem.FileExistsInSegmentedArchive(currentSceneFolderPath, out string segmentedArchiveName))
|
||||
{
|
||||
@@ -59,8 +59,8 @@ namespace Pal3.Data
|
||||
|
||||
// Load new scene cpk into memory
|
||||
{
|
||||
var newSceneFolderPath = newCityName + CpkConstants.FileExtension + CpkConstants.DirectorySeparator
|
||||
+ newSceneName;
|
||||
var newSceneFolderPath = $"{newCityName}{CpkConstants.FileExtension}" +
|
||||
$"{CpkConstants.DirectorySeparatorChar}{newSceneName}";
|
||||
|
||||
if (_fileSystem.FileExistsInSegmentedArchive(newSceneFolderPath, out string segmentedArchiveName))
|
||||
{
|
||||
|
||||
@@ -22,6 +22,8 @@ namespace Pal3.Data
|
||||
using Core.DataReader.Ini;
|
||||
using Core.DataReader.Lgt;
|
||||
using Core.DataReader.Mov;
|
||||
using Core.DataReader.Msh;
|
||||
using Core.DataReader.Mtl;
|
||||
using Core.DataReader.Mv3;
|
||||
using Core.DataReader.Nav;
|
||||
using Core.DataReader.Pol;
|
||||
@@ -46,7 +48,7 @@ namespace Pal3.Data
|
||||
private const string CACHE_FOLDER_NAME = "CacheData";
|
||||
private const string MV3_ACTOR_CONFIG_HEADER = ";#MV3#";
|
||||
|
||||
private const char PathSeparator = CpkConstants.DirectorySeparator;
|
||||
private const char DirSeparator = CpkConstants.DirectorySeparatorChar;
|
||||
|
||||
private readonly ICpkFileSystem _fileSystem;
|
||||
private readonly ITextureLoaderFactory _textureLoaderFactory;
|
||||
@@ -83,15 +85,17 @@ namespace Pal3.Data
|
||||
_litMaterialFactory = litMaterialFactory; // Lit materials are not required
|
||||
_gameSettings = Requires.IsNotNull(gameSettings, nameof(gameSettings));
|
||||
|
||||
var gdbFilePath =
|
||||
$"{FileConstants.BaseDataCpkPathInfo.cpkName}{PathSeparator}" +
|
||||
$"{FileConstants.CombatDataFolderName}{PathSeparator}{GameConstants.AppName}_Softstar.gdb";
|
||||
|
||||
_gameDatabase = GetGameResourceFileReader<GdbFile>().Read(_fileSystem.ReadAllBytes(gdbFilePath));
|
||||
_gameDatabase = GetGameDatabaseFile(); // Initialize game database file
|
||||
|
||||
CommandExecutorRegistry<ICommand>.Instance.Register(this);
|
||||
}
|
||||
|
||||
private GdbFile GetGameDatabaseFile()
|
||||
{
|
||||
var gdbFilePath = FileConstants.GameDatabaseFileVirtualPath;
|
||||
return GetGameResourceFileReader<GdbFile>().Read(_fileSystem.ReadAllBytes(gdbFilePath));
|
||||
}
|
||||
|
||||
private IFileReader<T> GetGameResourceFileReader<T>()
|
||||
{
|
||||
return ServiceLocator.Instance.Get<IFileReader<T>>();
|
||||
@@ -104,6 +108,7 @@ namespace Pal3.Data
|
||||
_gameResourceFileCache.Clear();
|
||||
_actorConfigCache.Clear();
|
||||
_audioClipCache.Clear();
|
||||
_vfxEffectPrefabCache.Clear();
|
||||
CommandExecutorRegistry<ICommand>.Instance.UnRegister(this);
|
||||
}
|
||||
|
||||
@@ -136,18 +141,18 @@ namespace Pal3.Data
|
||||
new TextureProvider(_fileSystem, _textureLoaderFactory, relativeDirectoryPath);
|
||||
}
|
||||
|
||||
public T GetGameResourceFile<T>(string filePath, bool useCache = true)
|
||||
public T GetGameResourceFile<T>(string fileVirtualPath, bool useCache = true)
|
||||
{
|
||||
filePath = filePath.ToLower();
|
||||
fileVirtualPath = fileVirtualPath.ToLower();
|
||||
|
||||
if (useCache &&
|
||||
_gameResourceFileCache.ContainsKey(typeof(T)) &&
|
||||
_gameResourceFileCache[typeof(T)].ContainsKey(filePath))
|
||||
_gameResourceFileCache[typeof(T)].ContainsKey(fileVirtualPath))
|
||||
{
|
||||
return (T)_gameResourceFileCache[typeof(T)][filePath];
|
||||
return (T)_gameResourceFileCache[typeof(T)][fileVirtualPath];
|
||||
}
|
||||
|
||||
T file = GetGameResourceFileReader<T>().Read(_fileSystem.ReadAllBytes(filePath));
|
||||
T file = GetGameResourceFileReader<T>().Read(_fileSystem.ReadAllBytes(fileVirtualPath));
|
||||
|
||||
if (useCache)
|
||||
{
|
||||
@@ -156,61 +161,40 @@ namespace Pal3.Data
|
||||
{
|
||||
_gameResourceFileCache[typeof(T)] = new Dictionary<string, object>();
|
||||
}
|
||||
_gameResourceFileCache[typeof(T)][filePath] = file;
|
||||
_gameResourceFileCache[typeof(T)][fileVirtualPath] = file;
|
||||
}
|
||||
|
||||
return file;
|
||||
}
|
||||
|
||||
public LgtFile GetLgt(string lgtFilePath)
|
||||
public NavFile GetNavFile(string sceneFileName, string sceneName)
|
||||
{
|
||||
return GetGameResourceFileReader<LgtFile>().Read(_fileSystem.ReadAllBytes(lgtFilePath));
|
||||
}
|
||||
|
||||
public NavFile GetNav(string sceneFileName, string sceneName)
|
||||
{
|
||||
#if PAL3
|
||||
var navFilePath = $"{sceneFileName}{CpkConstants.FileExtension}{PathSeparator}" +
|
||||
$"{sceneName}{PathSeparator}{sceneName}.nav";
|
||||
#elif PAL3A
|
||||
var navFilePath = $"{FileConstants.ScnCpkPathInfo.cpkName}{PathSeparator}SCN{PathSeparator}" +
|
||||
$"{sceneFileName}{PathSeparator}{sceneName}{PathSeparator}{sceneName}.nav";
|
||||
#endif
|
||||
|
||||
var navFilePath = FileConstants.GetNavFileVirtualPath(sceneFileName, sceneName);
|
||||
return GetGameResourceFileReader<NavFile>().Read(_fileSystem.ReadAllBytes(navFilePath));
|
||||
}
|
||||
|
||||
public ScnFile GetScn(string sceneFileName, string sceneName)
|
||||
public ScnFile GetScnFile(string sceneFileName, string sceneName)
|
||||
{
|
||||
#if PAL3
|
||||
var scnFilePath = $"{sceneFileName}{CpkConstants.FileExtension}{PathSeparator}{sceneName}.scn";
|
||||
#elif PAL3A
|
||||
var scnFilePath = $"{FileConstants.ScnCpkPathInfo.cpkName}{PathSeparator}SCN{PathSeparator}" +
|
||||
$"{sceneFileName}{PathSeparator}{sceneFileName}_{sceneName}.scn";
|
||||
#endif
|
||||
|
||||
var scnFilePath = FileConstants.GetScnFileVirtualPath(sceneFileName, sceneName);
|
||||
return GetGameResourceFileReader<ScnFile>().Read(_fileSystem.ReadAllBytes(scnFilePath));
|
||||
}
|
||||
|
||||
public SceFile GetSceneSce(string sceneFileName)
|
||||
public SceFile GetSceneSceFile(string sceneFileName)
|
||||
{
|
||||
#if PAL3
|
||||
var sceFilePath = $"{sceneFileName}{CpkConstants.FileExtension}{PathSeparator}{sceneFileName}.sce";
|
||||
#elif PAL3A
|
||||
var sceFilePath = $"{FileConstants.SceCpkPathInfo.cpkName}{PathSeparator}Sce{PathSeparator}{sceneFileName}.sce";
|
||||
#endif
|
||||
|
||||
var sceFilePath = FileConstants.GetSceneSceFileVirtualPath(sceneFileName);
|
||||
return GetGameResourceFileReader<SceFile>().Read(_fileSystem.ReadAllBytes(sceFilePath));
|
||||
}
|
||||
|
||||
public SceFile GetSystemSce()
|
||||
public SceFile GetSystemSceFile()
|
||||
{
|
||||
return GetGameResourceFileReader<SceFile>().Read(_fileSystem.ReadAllBytes(FileConstants.SystemSceFileVirtualPath));
|
||||
var systemSceFilePath = FileConstants.SystemSceFileVirtualPath;
|
||||
return GetGameResourceFileReader<SceFile>().Read(_fileSystem.ReadAllBytes(systemSceFilePath));
|
||||
}
|
||||
|
||||
public SceFile GetBigMapSce()
|
||||
public SceFile GetBigMapSceFile()
|
||||
{
|
||||
return GetGameResourceFileReader<SceFile>().Read(_fileSystem.ReadAllBytes(FileConstants.BigMapSceFileVirtualPath));
|
||||
var bigMapSceFilePath = FileConstants.BigMapSceFileVirtualPath;
|
||||
return GetGameResourceFileReader<SceFile>().Read(_fileSystem.ReadAllBytes(bigMapSceFilePath));
|
||||
}
|
||||
|
||||
public Dictionary<int, GameItem> GetGameItems()
|
||||
@@ -222,15 +206,16 @@ namespace Pal3.Data
|
||||
/// Get music file path in cache folder.
|
||||
/// </summary>
|
||||
/// <param name="musicFileVirtualPath">music file virtual path</param>
|
||||
/// <returns>Mp3 file path in cache folder</returns>
|
||||
public string GetMp3FilePathInCacheFolder(string musicFileVirtualPath)
|
||||
/// <returns>Music file path in cache folder</returns>
|
||||
public string GetMusicFilePathInCacheFolder(string musicFileVirtualPath)
|
||||
{
|
||||
return Application.persistentDataPath
|
||||
+ Path.DirectorySeparatorChar
|
||||
+ CACHE_FOLDER_NAME
|
||||
+ Path.DirectorySeparatorChar
|
||||
+ musicFileVirtualPath.Replace(PathSeparator, Path.DirectorySeparatorChar)
|
||||
.Replace(CpkConstants.FileExtension, string.Empty);
|
||||
+ musicFileVirtualPath
|
||||
.Replace(CpkConstants.DirectorySeparatorChar, Path.DirectorySeparatorChar)
|
||||
.Replace(CpkConstants.FileExtension, string.Empty);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -244,7 +229,7 @@ namespace Pal3.Data
|
||||
{
|
||||
if (File.Exists(musicFileCachePath)) yield break;
|
||||
|
||||
Debug.Log($"Writing MP3 file to App's persistent folder: {musicFileVirtualPath}");
|
||||
Debug.Log($"[{nameof(GameResourceProvider)}] Writing MP3 file to App's persistent folder: {musicFileVirtualPath}");
|
||||
var dataMovementThread = new Thread(() =>
|
||||
{
|
||||
try
|
||||
@@ -306,22 +291,34 @@ namespace Pal3.Data
|
||||
audioType,
|
||||
streamAudio,
|
||||
audioClip =>
|
||||
{
|
||||
if (shouldCache && audioClip != null)
|
||||
{
|
||||
_audioClipCache[fileName] = audioClip;
|
||||
}
|
||||
if (shouldCache && audioClip != null)
|
||||
{
|
||||
_audioClipCache[fileName] = audioClip;
|
||||
}
|
||||
|
||||
onLoaded?.Invoke(audioClip);
|
||||
});
|
||||
onLoaded?.Invoke(audioClip);
|
||||
});
|
||||
}
|
||||
|
||||
public Sprite GetLogoSprite()
|
||||
{
|
||||
#if PAL3
|
||||
const string mainLogoTextureFileName = "11.tga";
|
||||
Rect mainLogoTextureRect = new Rect(0, 600, 375, 145);
|
||||
#elif PAL3A
|
||||
const string mainLogoTextureFileName = "12.tga";
|
||||
Rect mainLogoTextureRect = new Rect(0, 770, 500, 253);
|
||||
#endif
|
||||
|
||||
ITextureResourceProvider uiLibTextureProvider = CreateTextureResourceProvider(FileConstants.UILibFolderVirtualPath);
|
||||
Texture2D logoTexture = uiLibTextureProvider.GetTexture(mainLogoTextureFileName);
|
||||
return Sprite.Create(logoTexture, mainLogoTextureRect, new Vector2(0.5f, 0.5f));
|
||||
}
|
||||
|
||||
private Texture2D GetActorAvatarTexture(string actorName, string avatarTextureName)
|
||||
{
|
||||
var roleAvatarTextureRelativePath =
|
||||
$"{FileConstants.BaseDataCpkPathInfo.cpkName}{PathSeparator}" +
|
||||
$"{FileConstants.ActorFolderName}{PathSeparator}{actorName}{PathSeparator}";
|
||||
|
||||
var roleAvatarTextureRelativePath = FileConstants.GetActorFolderVirtualPath(actorName);
|
||||
ITextureResourceProvider textureProvider = CreateTextureResourceProvider(roleAvatarTextureRelativePath);
|
||||
return textureProvider.GetTexture($"{avatarTextureName}.tga");
|
||||
}
|
||||
@@ -351,20 +348,14 @@ namespace Pal3.Data
|
||||
|
||||
private Texture2D GetEmojiSpriteSheetTexture(ActorEmojiType emojiType)
|
||||
{
|
||||
var emojiSpriteSheetRelativePath =
|
||||
$"{FileConstants.BaseDataCpkPathInfo.cpkName}{PathSeparator}" +
|
||||
$"{FileConstants.UIFolderName}{PathSeparator}{FileConstants.EmojiFolderName}{PathSeparator}";
|
||||
|
||||
string emojiSpriteSheetRelativePath = FileConstants.EmojiSpriteSheetFolderVirtualPath;
|
||||
ITextureResourceProvider textureProvider = CreateTextureResourceProvider(emojiSpriteSheetRelativePath);
|
||||
return textureProvider.GetTexture($"EM_{(int)emojiType:00}.tga");
|
||||
}
|
||||
|
||||
public Texture2D GetCaptionTexture(string name)
|
||||
{
|
||||
var captionTextureRelativePath =
|
||||
$"{FileConstants.BaseDataCpkPathInfo.cpkName}{PathSeparator}" +
|
||||
$"{FileConstants.CaptionFolderName}{PathSeparator}";
|
||||
|
||||
var captionTextureRelativePath = FileConstants.CaptionFolderVirtualPath;
|
||||
// No need to cache caption texture since it is a one time thing
|
||||
ITextureResourceProvider textureProvider = CreateTextureResourceProvider(captionTextureRelativePath, useCache: false);
|
||||
return textureProvider.GetTexture($"{name}.tga");
|
||||
@@ -372,16 +363,16 @@ namespace Pal3.Data
|
||||
|
||||
public Texture2D[] GetSkyBoxTextures(int skyBoxId)
|
||||
{
|
||||
var relativeFilePath = string.Format(SceneConstants.SkyBoxTexturePathFormat.First(), skyBoxId);
|
||||
var relativeFilePath = string.Format(FileConstants.SkyBoxTexturePathFormat.First(), skyBoxId);
|
||||
|
||||
ITextureResourceProvider textureProvider = CreateTextureResourceProvider(
|
||||
Utility.GetRelativeDirectoryPath(relativeFilePath));
|
||||
Utility.GetDirectoryName(relativeFilePath, DirSeparator));
|
||||
|
||||
var textures = new Texture2D[SceneConstants.SkyBoxTexturePathFormat.Length];
|
||||
for (var i = 0; i < SceneConstants.SkyBoxTexturePathFormat.Length; i++)
|
||||
var textures = new Texture2D[FileConstants.SkyBoxTexturePathFormat.Length];
|
||||
for (var i = 0; i < FileConstants.SkyBoxTexturePathFormat.Length; i++)
|
||||
{
|
||||
var textureNameFormat = Utility.GetFileName(
|
||||
string.Format(SceneConstants.SkyBoxTexturePathFormat[i], skyBoxId), PathSeparator);
|
||||
string.Format(FileConstants.SkyBoxTexturePathFormat[i], skyBoxId), DirSeparator);
|
||||
Texture2D texture = textureProvider.GetTexture(string.Format(textureNameFormat, i));
|
||||
// Set wrap mode to clamp to remove "edges" between sides
|
||||
texture.wrapMode = TextureWrapMode.Clamp;
|
||||
@@ -393,10 +384,7 @@ namespace Pal3.Data
|
||||
|
||||
public Texture2D GetEffectTexture(string name, out bool hasAlphaChannel)
|
||||
{
|
||||
var effectFolderRelativePath =
|
||||
$"{FileConstants.BaseDataCpkPathInfo.cpkName}{PathSeparator}" +
|
||||
$"{FileConstants.EffectFolderName}{PathSeparator}";
|
||||
|
||||
var effectFolderRelativePath = FileConstants.EffectFolderVirtualPath;
|
||||
ITextureResourceProvider textureProvider = CreateTextureResourceProvider(effectFolderRelativePath);
|
||||
return textureProvider.GetTexture(name, out hasAlphaChannel);
|
||||
}
|
||||
@@ -435,7 +423,7 @@ namespace Pal3.Data
|
||||
|
||||
public Sprite[] GetJumpIndicatorSprites()
|
||||
{
|
||||
var relativePath = FileConstants.UISceneFolderVirtualPath + PathSeparator;
|
||||
var relativePath = FileConstants.UISceneFolderVirtualPath;
|
||||
var textureProvider = CreateTextureResourceProvider(relativePath);
|
||||
|
||||
var sprites = new Sprite[4];
|
||||
@@ -464,8 +452,10 @@ namespace Pal3.Data
|
||||
return sprites;
|
||||
}
|
||||
|
||||
public ActorActionConfig GetActorActionConfig(string actorConfigFilePath)
|
||||
public ActorActionConfig GetActorActionConfig(string actorName, string configFileName)
|
||||
{
|
||||
string actorConfigFilePath = FileConstants.GetActorFolderVirtualPath(actorName) + configFileName;
|
||||
|
||||
actorConfigFilePath = actorConfigFilePath.ToLower();
|
||||
|
||||
if (_actorConfigCache.TryGetValue(actorConfigFilePath, out ActorActionConfig actorActionConfig))
|
||||
@@ -524,7 +514,7 @@ namespace Pal3.Data
|
||||
public (Texture2D texture, bool hasAlphaChannel)[] GetEffectTextures(GraphicsEffect effect, string texturePathFormat)
|
||||
{
|
||||
ITextureResourceProvider textureProvider = CreateTextureResourceProvider(
|
||||
Utility.GetRelativeDirectoryPath(texturePathFormat));
|
||||
Utility.GetDirectoryName(texturePathFormat, DirSeparator));
|
||||
|
||||
if (effect == GraphicsEffect.Fire)
|
||||
{
|
||||
@@ -532,7 +522,7 @@ namespace Pal3.Data
|
||||
var textures = new (Texture2D texture, bool hasAlphaChannel)[numberOfFrames];
|
||||
for (var i = 0; i < numberOfFrames; i++)
|
||||
{
|
||||
var textureNameFormat = Utility.GetFileName(texturePathFormat, PathSeparator);
|
||||
var textureNameFormat = Utility.GetFileName(texturePathFormat, DirSeparator);
|
||||
Texture2D texture = textureProvider.GetTexture(string.Format(textureNameFormat, i + 1), out var hasAlphaChannel);
|
||||
textures[i] = (texture, hasAlphaChannel);
|
||||
}
|
||||
@@ -559,7 +549,7 @@ namespace Pal3.Data
|
||||
|
||||
if (vfxPrefab == null)
|
||||
{
|
||||
Debug.LogWarning("VFX prefab not found: " + effectGroupId);
|
||||
Debug.LogWarning($"[{nameof(GameResourceProvider)}] VFX prefab not found: " + effectGroupId);
|
||||
}
|
||||
|
||||
_vfxEffectPrefabCache[effectGroupId] = vfxPrefab;
|
||||
@@ -582,11 +572,11 @@ namespace Pal3.Data
|
||||
|
||||
if (request.asset == null)
|
||||
{
|
||||
Debug.LogWarning("VFX prefab not found: " + effectGroupId);
|
||||
Debug.LogWarning($"[{nameof(GameResourceProvider)}] VFX prefab not found: " + effectGroupId);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("VFX prefab preloaded: " + effectGroupId);
|
||||
Debug.Log($"[{nameof(GameResourceProvider)}] VFX prefab preloaded: " + effectGroupId);
|
||||
}
|
||||
|
||||
_vfxEffectPrefabCache[effectGroupId] = request.asset;
|
||||
@@ -594,49 +584,12 @@ namespace Pal3.Data
|
||||
|
||||
public Texture2D GetCursorTexture()
|
||||
{
|
||||
var cursorSpriteRelativePath =
|
||||
$"{FileConstants.BaseDataCpkPathInfo.cpkName}{PathSeparator}" +
|
||||
$"{FileConstants.UIFolderName}{PathSeparator}{FileConstants.CursorFolderName}{PathSeparator}";
|
||||
|
||||
var cursorSpriteRelativePath = FileConstants.CursorSpriteFolderVirtualPath;
|
||||
ITextureResourceProvider textureProvider = CreateTextureResourceProvider(cursorSpriteRelativePath);
|
||||
Texture2D cursorTexture = textureProvider.GetTexture($"jt.tga");
|
||||
return cursorTexture;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To warm up the main actor action cache to reduce gameplay shutters.
|
||||
/// </summary>
|
||||
public void PreLoadMainActorMv3()
|
||||
{
|
||||
var cachedActions = new HashSet<string>()
|
||||
{
|
||||
ActorConstants.ActionToNameMap[ActorActionType.Stand],
|
||||
ActorConstants.ActionToNameMap[ActorActionType.Walk],
|
||||
ActorConstants.ActionToNameMap[ActorActionType.Run],
|
||||
ActorConstants.ActionToNameMap[ActorActionType.StepBack],
|
||||
};
|
||||
|
||||
foreach (var name in ActorConstants.MainActorNameMap.Values)
|
||||
{
|
||||
var actorConfigFile = $"{FileConstants.BaseDataCpkPathInfo.cpkName}{PathSeparator}" +
|
||||
$"{FileConstants.ActorFolderName}{PathSeparator}{name}{PathSeparator}{name}.ini";
|
||||
|
||||
ActorActionConfig actorActionConfig = GetActorActionConfig(actorConfigFile);
|
||||
|
||||
foreach (ActorAction actorAction in actorActionConfig.ActorActions)
|
||||
{
|
||||
// Cache known actions only.
|
||||
if (!cachedActions.Contains(actorAction.ActionName.ToLower())) continue;
|
||||
|
||||
var mv3FilePath = $"{FileConstants.BaseDataCpkPathInfo.cpkName}{PathSeparator}" +
|
||||
$"{FileConstants.ActorFolderName}{PathSeparator}{name}{PathSeparator}" +
|
||||
$"{actorAction.ActionFileName}";
|
||||
|
||||
_ = GetGameResourceFile<Mv3File>(mv3FilePath); // Call GetMv3 to cache the mv3 file.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private string _currentCityName;
|
||||
public void Execute(ScenePreLoadingNotification notification)
|
||||
{
|
||||
@@ -650,54 +603,60 @@ namespace Pal3.Data
|
||||
|
||||
if (!newCityName.Equals(_currentCityName, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
// Clean up cache after exiting current scene block
|
||||
_textureCache?.DisposeAll();
|
||||
|
||||
foreach (Sprite sprite in _spriteCache.Values)
|
||||
{
|
||||
Object.Destroy(sprite);
|
||||
}
|
||||
_spriteCache.Clear();
|
||||
|
||||
if (_gameResourceFileCache.ContainsKey(typeof(PolFile)))
|
||||
{
|
||||
_gameResourceFileCache[typeof(PolFile)]?.Clear();
|
||||
}
|
||||
|
||||
if (_gameResourceFileCache.ContainsKey(typeof(CvdFile)))
|
||||
{
|
||||
_gameResourceFileCache[typeof(CvdFile)]?.Clear();
|
||||
}
|
||||
|
||||
if (_gameResourceFileCache.ContainsKey(typeof(MovFile)))
|
||||
{
|
||||
_gameResourceFileCache[typeof(MovFile)]?.Clear();
|
||||
}
|
||||
|
||||
if (_gameResourceFileCache.ContainsKey(typeof(Mv3File)))
|
||||
{
|
||||
var mv3FileCache = _gameResourceFileCache[typeof(Mv3File)];
|
||||
|
||||
// Dispose non-main actor mv3 files
|
||||
// All main actor names start with "1"
|
||||
var mainActorMv3 = $"{FileConstants.ActorFolderName}{PathSeparator}1".ToLower();
|
||||
var mv3FilesToDispose = mv3FileCache.Keys
|
||||
.Where(mv3FilePath => !mv3FilePath.Contains(mainActorMv3))
|
||||
.ToArray();
|
||||
foreach (var mv3File in mv3FilesToDispose)
|
||||
{
|
||||
mv3FileCache.Remove(mv3File);
|
||||
}
|
||||
}
|
||||
|
||||
// clear all vfx prefabs in cache
|
||||
_vfxEffectPrefabCache.Clear();
|
||||
|
||||
DisposeTemporaryInMemoryGameResources();
|
||||
_currentCityName = newCityName;
|
||||
}
|
||||
|
||||
// Unloads assets that are not used (textures etc.)
|
||||
Resources.UnloadUnusedAssets();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dispose temporary in-memory resources that are only used in current scene block.
|
||||
/// </summary>
|
||||
private void DisposeTemporaryInMemoryGameResources()
|
||||
{
|
||||
// Clean up texture cache after exiting current scene block
|
||||
_textureCache?.DisposeAll();
|
||||
|
||||
// Clean up sprite cache after exiting current scene block
|
||||
foreach (Sprite sprite in _spriteCache.Values)
|
||||
{
|
||||
Object.Destroy(sprite);
|
||||
}
|
||||
_spriteCache.Clear();
|
||||
|
||||
// Dispose in-memory game resource files
|
||||
foreach (var fileCache in _gameResourceFileCache)
|
||||
{
|
||||
if (fileCache.Key == typeof(Mv3File))
|
||||
{
|
||||
// Dispose non-main actor mv3 files
|
||||
// All main actor names start with "1"
|
||||
var mainActorMv3 = $"{FileConstants.GetActorFolderName()}{DirSeparator}1".ToLower();
|
||||
var mv3FilesToDispose = fileCache.Value.Keys
|
||||
.Where(mv3FilePath => !mv3FilePath.Contains(mainActorMv3))
|
||||
.ToArray();
|
||||
foreach (var mv3File in mv3FilesToDispose)
|
||||
{
|
||||
fileCache.Value.Remove(mv3File);
|
||||
}
|
||||
}
|
||||
else if (fileCache.Key == typeof(GdbFile) ||
|
||||
fileCache.Key == typeof(Mv3ActionConfig) ||
|
||||
fileCache.Key == typeof(MovActionConfig))
|
||||
{
|
||||
// These files are used/cached across scenes
|
||||
// Do not dispose them since they will be used in next scene block
|
||||
}
|
||||
else // Dispose all other files during scene block transition
|
||||
{
|
||||
fileCache.Value.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
// clear all vfx prefabs in cache
|
||||
_vfxEffectPrefabCache.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
namespace Pal3.Data
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -24,7 +23,7 @@ namespace Pal3.Data
|
||||
|
||||
if (_textureCache.ContainsKey(key))
|
||||
{
|
||||
Debug.LogError($"Texture {key} already existed in cache.");
|
||||
Debug.LogError($"[{nameof(TextureCache)}] Texture {key} already existed in cache.");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -50,7 +49,7 @@ namespace Pal3.Data
|
||||
|
||||
public void DisposeAll()
|
||||
{
|
||||
Debug.Log($"Disposing all cached textures: {_textureCache.Count}");
|
||||
Debug.Log($"[{nameof(TextureCache)}] Disposing all cached textures: {_textureCache.Count}");
|
||||
foreach ((Texture2D texture, _) in _textureCache.Values)
|
||||
{
|
||||
UnityEngine.Object.Destroy(texture);
|
||||
|
||||
@@ -17,21 +17,21 @@ namespace Pal3.Data
|
||||
private readonly ICpkFileSystem _fileSystem;
|
||||
private readonly ITextureLoaderFactory _textureLoaderFactory;
|
||||
private readonly TextureCache _textureCache;
|
||||
private readonly string _relativePath;
|
||||
private readonly string _relativeDirectoryPath;
|
||||
|
||||
public TextureProvider(ICpkFileSystem fileSystem,
|
||||
ITextureLoaderFactory textureLoaderFactory,
|
||||
string relativePath,
|
||||
string relativeDirectoryPath,
|
||||
TextureCache textureCache = null)
|
||||
{
|
||||
if (!relativePath.EndsWith(CpkConstants.DirectorySeparator))
|
||||
if (!relativeDirectoryPath.EndsWith(CpkConstants.DirectorySeparatorChar))
|
||||
{
|
||||
relativePath += CpkConstants.DirectorySeparator;
|
||||
relativeDirectoryPath += CpkConstants.DirectorySeparatorChar;
|
||||
}
|
||||
|
||||
_fileSystem = fileSystem;
|
||||
_textureLoaderFactory = textureLoaderFactory;
|
||||
_relativePath = relativePath.ToLower(); // Texture path is case insensitive
|
||||
_relativeDirectoryPath = relativeDirectoryPath.ToLower(); // Texture path is case insensitive
|
||||
_textureCache = textureCache;
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace Pal3.Data
|
||||
|
||||
public string GetTexturePath(string name)
|
||||
{
|
||||
return _relativePath + name;
|
||||
return _relativeDirectoryPath + name;
|
||||
}
|
||||
|
||||
public Texture2D GetTexture(string name)
|
||||
@@ -66,7 +66,7 @@ namespace Pal3.Data
|
||||
return Texture2D.whiteTexture;
|
||||
}
|
||||
|
||||
var texturePath = _relativePath + name;
|
||||
var texturePath = _relativeDirectoryPath + name;
|
||||
|
||||
// Note: Most texture files used in (.pol, .cvd) files are stored inside Pal3's CPack
|
||||
// archives and they are pre-compressed to DXT format (DXT1 & DXT3). So we need to
|
||||
@@ -78,7 +78,7 @@ namespace Pal3.Data
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogWarning($"Failed to change path extension for texture: {texturePath}, ex: {ex}");
|
||||
Debug.LogWarning($"[{nameof(TextureProvider)}] Failed to change path extension for texture: {texturePath}, ex: {ex}");
|
||||
hasAlphaChannel = false;
|
||||
return Texture2D.whiteTexture;
|
||||
}
|
||||
@@ -113,7 +113,7 @@ namespace Pal3.Data
|
||||
{
|
||||
textureLoader = _textureLoaderFactory.GetTextureLoader(Path.GetExtension(name));
|
||||
texture = base.GetTexture(_fileSystem, texturePath, textureLoader, out hasAlphaChannel);
|
||||
if (texture == null) Debug.LogWarning($"Texture not found: {texturePath}");
|
||||
if (texture == null) Debug.LogWarning($"[{nameof(TextureProvider)}] Texture not found: {texturePath}");
|
||||
else _textureCache?.Add(texturePath, texture, hasAlphaChannel);
|
||||
}
|
||||
|
||||
|
||||
@@ -705,6 +705,7 @@ namespace Pal3.Dev
|
||||
ActorSetNavLayer -1 0
|
||||
ActorSetTilePosition -1 190 20
|
||||
TeamAddOrRemoveActor 0 1
|
||||
TaskOpen 077
|
||||
CameraFadeIn"},
|
||||
{"蜀山\n\n第一次回家", @"
|
||||
ScriptVarSetValue -32768 20800
|
||||
@@ -715,6 +716,7 @@ namespace Pal3.Dev
|
||||
ActorSetNavLayer -1 0
|
||||
ActorSetTilePosition -1 91 114
|
||||
TeamAddOrRemoveActor 0 1
|
||||
TaskOpen 083
|
||||
CameraFadeIn"},
|
||||
{"蜀山\n\n绿萝嶂", @"
|
||||
ScriptVarSetValue -32768 30101
|
||||
@@ -730,6 +732,7 @@ namespace Pal3.Dev
|
||||
ActorSetTilePosition -1 342 137
|
||||
TeamAddOrRemoveActor 0 1
|
||||
TeamAddOrRemoveActor 1 1
|
||||
TaskOpen 086
|
||||
CameraFadeIn"},
|
||||
{"地脉门户\n\n少阳三焦", @"
|
||||
ScriptVarSetValue -32768 40200
|
||||
@@ -750,6 +753,7 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 2 2
|
||||
BigMapEnableRegion 4 2
|
||||
BigMapEnableRegion 5 2
|
||||
TaskOpen 089
|
||||
CameraFadeIn"},
|
||||
{"第一次进入里蜀山", @"
|
||||
ScriptVarSetValue -32768 41100
|
||||
@@ -772,6 +776,7 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 4 2
|
||||
BigMapEnableRegion 5 2
|
||||
BigMapEnableRegion 6 1
|
||||
TaskOpen 092
|
||||
CameraFadeIn"},
|
||||
{"里蜀山外城南\n\n厥阴心包", @"
|
||||
ScriptVarSetValue -32768 50200
|
||||
@@ -794,6 +799,7 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 4 2
|
||||
BigMapEnableRegion 5 2
|
||||
BigMapEnableRegion 6 1
|
||||
TaskOpen 097
|
||||
CameraFadeIn"},
|
||||
{"厥阴心包\n\n胜州", @"
|
||||
ScriptVarSetValue -32768 50500
|
||||
@@ -816,6 +822,7 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 4 2
|
||||
BigMapEnableRegion 5 2
|
||||
BigMapEnableRegion 6 1
|
||||
TaskOpen 098
|
||||
CameraFadeIn"},
|
||||
{"蜀山\n\n深夜去经库", @"
|
||||
ScriptVarSetValue -32768 60500
|
||||
@@ -840,6 +847,7 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 6 1
|
||||
BigMapEnableRegion 7 2
|
||||
BigMapEnableRegion 8 2
|
||||
TaskOpen 107
|
||||
CameraFadeIn"},
|
||||
{"地脉门户大厅\n\n阳名百纳", @"
|
||||
ScriptVarSetValue -32768 70100
|
||||
@@ -863,6 +871,7 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 6 1
|
||||
BigMapEnableRegion 7 2
|
||||
BigMapEnableRegion 8 2
|
||||
TaskOpen 111
|
||||
CameraFadeIn"},
|
||||
{"血濡回魂\n\n初入京城", @"
|
||||
ScriptVarSetValue -32768 70700
|
||||
@@ -886,6 +895,7 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 7 2
|
||||
BigMapEnableRegion 8 2
|
||||
BigMapEnableRegion 9 1
|
||||
TaskOpen 112
|
||||
CameraFadeIn"},
|
||||
{"失散\n\n双溪", @"
|
||||
ScriptVarSetValue -32768 80100
|
||||
@@ -912,6 +922,7 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 8 2
|
||||
BigMapEnableRegion 9 1
|
||||
BigMapEnableRegion 10 2
|
||||
TaskOpen 120
|
||||
CameraFadeIn"},
|
||||
{"双溪\n\n里蜀山", @"
|
||||
ScriptVarSetValue -32768 80700
|
||||
@@ -939,6 +950,7 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 8 2
|
||||
BigMapEnableRegion 9 1
|
||||
BigMapEnableRegion 10 2
|
||||
TaskOpen 122
|
||||
CameraFadeIn"},
|
||||
{"里蜀山外城南\n\n太阴归尘", @"
|
||||
ScriptVarSetValue -32768 80700
|
||||
@@ -966,6 +978,7 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 8 2
|
||||
BigMapEnableRegion 9 1
|
||||
BigMapEnableRegion 10 2
|
||||
TaskOpen 123
|
||||
CameraFadeIn"},
|
||||
{"太阴归尘\n\n蜀山故道", @"
|
||||
ScriptVarSetValue -32768 90300
|
||||
@@ -991,6 +1004,7 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 8 2
|
||||
BigMapEnableRegion 9 1
|
||||
BigMapEnableRegion 10 2
|
||||
TaskOpen 127
|
||||
CameraFadeIn"},
|
||||
{"蜀山深夜\n\n养父常纪房间", @"
|
||||
ScriptVarSetValue -32768 100400
|
||||
@@ -1018,6 +1032,7 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 9 1
|
||||
BigMapEnableRegion 10 2
|
||||
BigMapEnableRegion 11 1
|
||||
TaskOpen 134
|
||||
CameraFadeIn"},
|
||||
{"无极阁找掌门去锁妖塔", @"
|
||||
ScriptVarSetValue -32768 100701
|
||||
@@ -1046,6 +1061,7 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 10 2
|
||||
BigMapEnableRegion 11 1
|
||||
CameraSetDefaultTransform 2
|
||||
TaskOpen 137
|
||||
CameraFadeIn"},
|
||||
{"新安当", @"
|
||||
ScriptVarSetValue -32768 101500
|
||||
@@ -1075,6 +1091,7 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 11 1
|
||||
BigMapEnableRegion 12 1
|
||||
BigMapEnableRegion 13 2
|
||||
TaskOpen 140
|
||||
CameraFadeIn"},
|
||||
{"地脉门户\n\n太阳华池", @"
|
||||
ScriptVarSetValue -32768 110200
|
||||
@@ -1101,6 +1118,7 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 10 2
|
||||
BigMapEnableRegion 11 1
|
||||
BigMapEnableRegion 13 2
|
||||
TaskOpen 144
|
||||
CameraFadeIn"},
|
||||
{"小秘屋会和", @"
|
||||
ScriptVarSetValue -32768 120300
|
||||
@@ -1128,6 +1146,7 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 10 2
|
||||
BigMapEnableRegion 11 1
|
||||
BigMapEnableRegion 13 2
|
||||
TaskOpen 147
|
||||
CameraFadeIn"},
|
||||
{"里蜀山\n\n魔界之门", @"
|
||||
ScriptVarSetValue -32768 120400
|
||||
@@ -1156,6 +1175,7 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 10 2
|
||||
BigMapEnableRegion 11 1
|
||||
BigMapEnableRegion 13 2
|
||||
TaskOpen 148
|
||||
CameraFadeIn"},
|
||||
{"里蜀山外城北\n\n少阴凝碧", @"
|
||||
ScriptVarSetValue -32768 130100
|
||||
@@ -1184,6 +1204,7 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 10 2
|
||||
BigMapEnableRegion 11 1
|
||||
BigMapEnableRegion 13 2
|
||||
TaskOpen 150
|
||||
CameraFadeIn"},
|
||||
{"施洞", @"
|
||||
ScriptVarSetValue -32768 140200
|
||||
@@ -1213,6 +1234,7 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 10 2
|
||||
BigMapEnableRegion 11 1
|
||||
BigMapEnableRegion 13 2
|
||||
TaskOpen 154
|
||||
CameraFadeIn"},
|
||||
{"出发去月光城", @"
|
||||
ScriptVarSetValue -32768 140400
|
||||
@@ -1242,6 +1264,7 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 10 2
|
||||
BigMapEnableRegion 11 1
|
||||
BigMapEnableRegion 13 2
|
||||
TaskOpen 155
|
||||
CameraFadeIn"},
|
||||
{"蜀山\n\n重回绿萝山", @"
|
||||
ScriptVarSetValue -32768 150300
|
||||
@@ -1271,6 +1294,7 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 11 1
|
||||
BigMapEnableRegion 13 2
|
||||
BigMapEnableRegion 14 2
|
||||
TaskOpen 160
|
||||
CameraFadeIn"},
|
||||
{"地脉门户\n\n少阳参天", @"
|
||||
ScriptVarSetValue -32768 150400
|
||||
@@ -1299,6 +1323,7 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 11 1
|
||||
BigMapEnableRegion 13 2
|
||||
BigMapEnableRegion 14 2
|
||||
TaskOpen 161
|
||||
CameraFadeIn"},
|
||||
{"回里蜀山秘密基地", @"
|
||||
ScriptVarSetValue -32768 160101
|
||||
@@ -1328,6 +1353,7 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 11 1
|
||||
BigMapEnableRegion 13 2
|
||||
BigMapEnableRegion 14 2
|
||||
TaskOpen 163
|
||||
CameraFadeIn"},
|
||||
{"里蜀山内城\n\n厥阴蔽日", @"
|
||||
ScriptVarSetValue -32768 170200
|
||||
@@ -1358,6 +1384,7 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 11 1
|
||||
BigMapEnableRegion 13 2
|
||||
BigMapEnableRegion 14 2
|
||||
TaskOpen 171
|
||||
CameraFadeIn"},
|
||||
{"地脉门户\n\n蜀山前山", @"
|
||||
ScriptVarSetValue -32768 171200
|
||||
@@ -1386,6 +1413,7 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 11 1
|
||||
BigMapEnableRegion 13 2
|
||||
BigMapEnableRegion 14 2
|
||||
TaskOpen 174
|
||||
CameraFadeIn"},
|
||||
{"花圃\n\n温慧最高好感", @"
|
||||
ScriptVarSetValue -32768 180600
|
||||
@@ -1414,6 +1442,7 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 11 1
|
||||
BigMapEnableRegion 13 2
|
||||
BigMapEnableRegion 14 2
|
||||
TaskOpen 180
|
||||
FavorAdd 1 50
|
||||
FavorAdd 2 10
|
||||
CameraFadeIn"},
|
||||
@@ -1444,6 +1473,7 @@ namespace Pal3.Dev
|
||||
BigMapEnableRegion 11 1
|
||||
BigMapEnableRegion 13 2
|
||||
BigMapEnableRegion 14 2
|
||||
TaskOpen 180
|
||||
FavorAdd 1 10
|
||||
FavorAdd 2 50
|
||||
CameraFadeIn"},
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Pal3.Dev
|
||||
{
|
||||
using System;
|
||||
using System.Collections;
|
||||
using MetaData;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Networking;
|
||||
|
||||
public static class GithubReleaseVersionFetcher
|
||||
{
|
||||
public static IEnumerator GetLatestReleaseVersionAsync(string owner, string repo, Action<string> callback)
|
||||
{
|
||||
// Construct the GitHub release API URL
|
||||
string apiUrl = $"https://api.github.com/repos/{owner}/{repo}/releases/latest";
|
||||
|
||||
using UnityWebRequest unityWebRequest = UnityWebRequest.Get(apiUrl);
|
||||
|
||||
// Set the user agent header
|
||||
unityWebRequest.SetRequestHeader("User-Agent", GameConstants.AppName);
|
||||
|
||||
// Wait for the request to complete
|
||||
yield return unityWebRequest.SendWebRequest();
|
||||
|
||||
if (unityWebRequest.result != UnityWebRequest.Result.Success)
|
||||
{
|
||||
Debug.LogError($"[{nameof(GithubReleaseVersionFetcher)}] Error fetching the latest release: {unityWebRequest.error}");
|
||||
}
|
||||
else
|
||||
{
|
||||
JObject releaseInfo = JObject.Parse(unityWebRequest.downloadHandler.text);
|
||||
callback.Invoke(releaseInfo["tag_name"]?.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e410f551c4c25234586cd0aefc2622a4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -192,6 +192,8 @@ namespace Pal3.Dev
|
||||
}
|
||||
_initViewCameraOrbitAnimationCts = new CancellationTokenSource();
|
||||
StartCoroutine(StartCameraOrbitAnimationAsync(_initViewCameraOrbitAnimationCts.Token));
|
||||
|
||||
_gameStateManager.GoToState(GameState.Cutscene);
|
||||
}
|
||||
|
||||
private IEnumerator StartCameraOrbitAnimationAsync(CancellationToken cancellationToken)
|
||||
@@ -340,19 +342,19 @@ namespace Pal3.Dev
|
||||
SelectFirstButtonForEventSystem();
|
||||
|
||||
UpdateRectTransformWidthAndHeight(_backgroundTransform,
|
||||
_contentGridLayoutGroup.cellSize.x + 100f,
|
||||
_contentGridLayoutGroup.cellSize.x,
|
||||
(_contentGridLayoutGroup.cellSize.y + _contentGridLayoutGroup.spacing.y) * _menuItems.Count
|
||||
- _contentGridLayoutGroup.spacing.y + 100f);
|
||||
- _contentGridLayoutGroup.spacing.y);
|
||||
}
|
||||
|
||||
private void SetupSettingButtons()
|
||||
{
|
||||
SetupMenuLayout(isVertical: true);
|
||||
|
||||
const string lightingEnabledText = "实时光影:已开启";
|
||||
const string lightingDisabledText = "实时光影:已关闭";
|
||||
const string ssaoEnabledText = "环境光遮蔽:已开启";
|
||||
const string ssaoDisabledText = "环境光遮蔽:已关闭";
|
||||
const string lightingEnabledText = "实时光影:开启";
|
||||
const string lightingDisabledText = "实时光影:关闭";
|
||||
const string ssaoEnabledText = "环境光遮蔽:开启";
|
||||
const string ssaoDisabledText = "环境光遮蔽:关闭";
|
||||
|
||||
// Toon materials are not available in open source build.
|
||||
// so lighting and shadow will not work, thus we remove the option.
|
||||
@@ -416,8 +418,8 @@ namespace Pal3.Dev
|
||||
}
|
||||
|
||||
#if UNITY_STANDALONE
|
||||
const string vsyncEnabledText = "垂直同步:已开启";
|
||||
const string vsyncDisabledText = "垂直同步:已关闭";
|
||||
const string vsyncEnabledText = "垂直同步:开启";
|
||||
const string vsyncDisabledText = "垂直同步:关闭";
|
||||
string GetVsyncButtonText() => _gameSettings.VSyncCount == 0 ? vsyncDisabledText : vsyncEnabledText;
|
||||
CreateMenuButton(GetVsyncButtonText(), buttonTextUGUI => delegate
|
||||
{
|
||||
@@ -477,8 +479,8 @@ namespace Pal3.Dev
|
||||
// });
|
||||
// #endif
|
||||
|
||||
const string musicEnabledText = "音乐:已开启";
|
||||
const string musicDisabledText = "音乐:已关闭";
|
||||
const string musicEnabledText = "音乐:开启";
|
||||
const string musicDisabledText = "音乐:关闭";
|
||||
string GetMusicButtonText() => _gameSettings.MusicVolume == 0f ? musicDisabledText : musicEnabledText;
|
||||
CreateMenuButton(GetMusicButtonText(), buttonTextUGUI => delegate
|
||||
{
|
||||
@@ -490,8 +492,8 @@ namespace Pal3.Dev
|
||||
(_gameSettings.MusicVolume == 0f ? "关闭" : "开启") + ""));
|
||||
});
|
||||
|
||||
const string sfxEnabledText = "音效:已开启";
|
||||
const string sfxDisabledText = "音效:已关闭";
|
||||
const string sfxEnabledText = "音效:开启";
|
||||
const string sfxDisabledText = "音效:关闭";
|
||||
string GetSfxButtonText() => _gameSettings.SfxVolume == 0f ? sfxDisabledText : sfxEnabledText;
|
||||
CreateMenuButton(GetSfxButtonText(), buttonTextUGUI => delegate
|
||||
{
|
||||
@@ -515,9 +517,9 @@ namespace Pal3.Dev
|
||||
SelectFirstButtonForEventSystem();
|
||||
|
||||
UpdateRectTransformWidthAndHeight(_backgroundTransform,
|
||||
_contentGridLayoutGroup.cellSize.x + 100f,
|
||||
_contentGridLayoutGroup.cellSize.x,
|
||||
(_contentGridLayoutGroup.cellSize.y + _contentGridLayoutGroup.spacing.y) * _menuItems.Count
|
||||
- _contentGridLayoutGroup.spacing.y + 100f);
|
||||
- _contentGridLayoutGroup.spacing.y);
|
||||
}
|
||||
|
||||
private void SetupSaveMenuButtons()
|
||||
@@ -558,9 +560,9 @@ namespace Pal3.Dev
|
||||
SelectFirstButtonForEventSystem();
|
||||
|
||||
UpdateRectTransformWidthAndHeight(_backgroundTransform,
|
||||
_contentGridLayoutGroup.cellSize.x + 100f,
|
||||
_contentGridLayoutGroup.cellSize.x,
|
||||
(_contentGridLayoutGroup.cellSize.y + _contentGridLayoutGroup.spacing.y) * _menuItems.Count
|
||||
- _contentGridLayoutGroup.spacing.y + 100f);
|
||||
- _contentGridLayoutGroup.spacing.y);
|
||||
}
|
||||
|
||||
private void SetupLoadMenuButtons()
|
||||
@@ -628,9 +630,9 @@ namespace Pal3.Dev
|
||||
SelectFirstButtonForEventSystem();
|
||||
|
||||
UpdateRectTransformWidthAndHeight(_backgroundTransform,
|
||||
_contentGridLayoutGroup.cellSize.x + 100f,
|
||||
_contentGridLayoutGroup.cellSize.x,
|
||||
(_contentGridLayoutGroup.cellSize.y + _contentGridLayoutGroup.spacing.y) * _menuItems.Count
|
||||
- _contentGridLayoutGroup.spacing.y + 100f);
|
||||
- _contentGridLayoutGroup.spacing.y);
|
||||
}
|
||||
|
||||
private void SetupStorySelectionButtons()
|
||||
@@ -661,14 +663,15 @@ namespace Pal3.Dev
|
||||
|
||||
UpdateRectTransformWidthAndHeight(_backgroundTransform,
|
||||
(_contentGridLayoutGroup.cellSize.x + _contentGridLayoutGroup.spacing.x) * _menuItems.Count
|
||||
- _contentGridLayoutGroup.spacing.x + 100f,
|
||||
_contentGridLayoutGroup.cellSize.y + 100f);
|
||||
- _contentGridLayoutGroup.spacing.x,
|
||||
_contentGridLayoutGroup.cellSize.y);
|
||||
}
|
||||
|
||||
private void UpdateRectTransformWidthAndHeight(RectTransform rectTransform, float width, float height)
|
||||
{
|
||||
rectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, width);
|
||||
rectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, height);
|
||||
const float padding = 60f;
|
||||
rectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, width + padding);
|
||||
rectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, height + padding);
|
||||
rectTransform.ForceUpdateRectTransforms();
|
||||
}
|
||||
|
||||
@@ -779,6 +782,10 @@ namespace Pal3.Dev
|
||||
// Add main actor to the team
|
||||
_teamManager.AddActor(0);
|
||||
|
||||
#if PAL3A // Add initial task
|
||||
CommandDispatcher<ICommand>.Instance.Dispatch(new TaskOpenCommand(TaskConstants.InitTaskId));
|
||||
#endif
|
||||
|
||||
_gameStateManager.GoToState(GameState.Cutscene);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,5 @@ namespace Pal3.Dev
|
||||
{
|
||||
[SerializeField] public GameBoxBlendFlag blendFlag;
|
||||
[SerializeField] public GameBoxMaterial material;
|
||||
[SerializeField] public string[] textureNames;
|
||||
}
|
||||
}
|
||||
@@ -6,21 +6,22 @@
|
||||
namespace Pal3.Dev
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
||||
using Command;
|
||||
using Core.DataReader;
|
||||
using Newtonsoft.Json;
|
||||
using Script;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
[Obsolete]
|
||||
public static class UnknownSceCommandAnalyzer
|
||||
{
|
||||
public static void AnalyzeCommand(BinaryReader reader,
|
||||
public static void AnalyzeCommand(SafeBinaryReader reader,
|
||||
int commandId,
|
||||
ushort parameterFlag,
|
||||
int codepage)
|
||||
{
|
||||
Debug.LogError($"Unknown Command Id: {commandId} ParameterFlag: {parameterFlag}");
|
||||
Debug.LogError($"[{nameof(UnknownSceCommandAnalyzer)}] Unknown Command Id: {commandId} ParameterFlag: {parameterFlag}");
|
||||
|
||||
var initPosition = reader.BaseStream.Position;
|
||||
var length = 0;
|
||||
@@ -40,7 +41,7 @@ namespace Pal3.Dev
|
||||
if (nextCmdType != null)
|
||||
{
|
||||
ICommand command = SceCommandParser.ParseSceCommand(reader, id, flag, codepage);
|
||||
Debug.Log($"Possible length: {length}, " +
|
||||
Debug.Log($"[{nameof(UnknownSceCommandAnalyzer)}] Possible length: {length}, " +
|
||||
$"next command: {nextCmdType.Name}-{id}-{flag}-{JsonConvert.SerializeObject(command)}");
|
||||
|
||||
maxSearchCount--;
|
||||
|
||||
@@ -7,6 +7,7 @@ namespace Pal3.Effect
|
||||
{
|
||||
using System;
|
||||
using Core.DataLoader;
|
||||
using Core.DataReader.Cpk;
|
||||
using Core.DataReader.Pol;
|
||||
using Core.Renderer;
|
||||
using Core.Utils;
|
||||
@@ -35,7 +36,7 @@ namespace Pal3.Effect
|
||||
{
|
||||
PolFile polFile = resourceProvider.GetGameResourceFile<PolFile>(info.ModelPath);
|
||||
ITextureResourceProvider textureProvider = resourceProvider.CreateTextureResourceProvider(
|
||||
Utility.GetRelativeDirectoryPath(info.ModelPath));
|
||||
Utility.GetDirectoryName(info.ModelPath, CpkConstants.DirectorySeparatorChar));
|
||||
_sceneObjectRenderer = gameObject.AddComponent<PolyModelRenderer>();
|
||||
_sceneObjectRenderer.Render(polFile,
|
||||
textureProvider,
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
|
||||
namespace Pal3.Effect.PostProcessing
|
||||
{
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Command;
|
||||
using Command.InternalCommands;
|
||||
using Command.SceCommands;
|
||||
@@ -164,33 +162,6 @@ namespace Pal3.Effect.PostProcessing
|
||||
ToggleAmbientOcclusionBasedOnSetting();
|
||||
TogglePostProcessLayerWhenNeeded();
|
||||
}
|
||||
|
||||
#if UNITY_IOS || UNITY_STANDALONE_OSX
|
||||
if (command.SettingName is nameof(GameSettings.ResolutionScale))
|
||||
{
|
||||
StartCoroutine(ReloadAmbientOcclusionSettingAsync());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if UNITY_IOS || UNITY_STANDALONE_OSX
|
||||
private IEnumerator Start()
|
||||
{
|
||||
yield return ReloadAmbientOcclusionSettingAsync();
|
||||
}
|
||||
|
||||
// On iOS and MacOS, the SSAO and Resolution changing are causing the RoundedFrostedGlass
|
||||
// shader to malfunction. This is a workaround to disable and re-enable SSAO to fix the issue.
|
||||
private IEnumerator ReloadAmbientOcclusionSettingAsync()
|
||||
{
|
||||
if (_gameSettings.IsAmbientOcclusionEnabled)
|
||||
{
|
||||
yield return null;
|
||||
_gameSettings.IsAmbientOcclusionEnabled = false;
|
||||
yield return null;
|
||||
_gameSettings.IsAmbientOcclusionEnabled = true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -880,7 +880,7 @@ namespace Pal3.GamePlay
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError($"Scene object not found or not activated yet: {command.SceneObjectId}.");
|
||||
Debug.LogError($"[{nameof(PlayerGamePlayController)}] Scene object not found or not activated yet: {command.SceneObjectId}.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -891,7 +891,7 @@ namespace Pal3.GamePlay
|
||||
GameObject climbableObject = climbableSceneObject.GetGameObject();
|
||||
if (climbableObject == null)
|
||||
{
|
||||
Debug.LogError($"Scene object not found or not activated yet: {command.ObjectId}.");
|
||||
Debug.LogError($"[{nameof(PlayerGamePlayController)}] Scene object not found or not activated yet: {command.ObjectId}.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -961,18 +961,18 @@ namespace Pal3.GamePlay
|
||||
|
||||
_playerActorActionController.PerformAction(climbUp ? ActorActionType.Climb : ActorActionType.ClimbDown);
|
||||
|
||||
_playerActorGameObject.transform.position = new Vector3(lowerPosition.x,
|
||||
_playerActorGameObject.transform.position.y, lowerPosition.z);
|
||||
|
||||
Vector3 newPosition = new Vector3(lowerPosition.x, _playerActorGameObject.transform.position.y, lowerPosition.z);
|
||||
var objectRotationY = climbableObject.transform.rotation.eulerAngles.y;
|
||||
_playerActorGameObject.transform.rotation = Quaternion.Euler(0f, objectRotationY + 180f, 0f);
|
||||
Quaternion newRotation = Quaternion.Euler(0f, objectRotationY + 180f, 0f);
|
||||
|
||||
_playerActorGameObject.transform.SetPositionAndRotation(newPosition, newRotation);
|
||||
|
||||
if (climbUp)
|
||||
{
|
||||
var currentHeight = 0f;
|
||||
while (currentHeight < climbableHeight)
|
||||
{
|
||||
var delta = Time.deltaTime * ActorConstants.ActorClimbSpeed;
|
||||
var delta = Time.deltaTime * ActorConstants.PlayerActorClimbSpeed;
|
||||
currentHeight += delta;
|
||||
_playerActorGameObject.transform.position += new Vector3(0f, delta, 0f);
|
||||
yield return null;
|
||||
@@ -990,7 +990,7 @@ namespace Pal3.GamePlay
|
||||
var currentHeight = climbableHeight;
|
||||
while (currentHeight > 0f)
|
||||
{
|
||||
var delta = Time.deltaTime * ActorConstants.ActorClimbSpeed;
|
||||
var delta = Time.deltaTime * ActorConstants.PlayerActorClimbSpeed;
|
||||
currentHeight -= delta;
|
||||
_playerActorGameObject.transform.position -= new Vector3(0f, delta, 0f);
|
||||
yield return null;
|
||||
@@ -1030,8 +1030,8 @@ namespace Pal3.GamePlay
|
||||
// Check if actor is player actor.
|
||||
if (!Enum.IsDefined(typeof(PlayerActorId), command.ActorId))
|
||||
{
|
||||
Debug.LogError($"Cannot enable player control for actor {command.ActorId} " +
|
||||
$"since actor is not a player actor.");
|
||||
Debug.LogError($"[{nameof(PlayerGamePlayController)}] Cannot enable player control for actor " +
|
||||
$"{command.ActorId} since actor is not a player actor.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1058,8 +1058,9 @@ namespace Pal3.GamePlay
|
||||
_playerActorController.IsActive)
|
||||
{
|
||||
lastActivePlayerActorNavLayerIndex = _playerActorMovementController.GetCurrentLayerIndex();
|
||||
lastActivePlayerActorPosition = _playerActorGameObject.transform.position;
|
||||
lastActivePlayerActorRotation = _playerActorGameObject.transform.rotation;
|
||||
_playerActorGameObject.transform.GetPositionAndRotation(out Vector3 currentPosition, out Quaternion currentRotation);
|
||||
lastActivePlayerActorPosition = currentPosition;
|
||||
lastActivePlayerActorRotation = currentRotation;
|
||||
CommandDispatcher<ICommand>.Instance.Dispatch(new ActorActivateCommand(_playerActor.Info.Id, 0));
|
||||
}
|
||||
|
||||
|
||||
@@ -21,11 +21,13 @@ namespace Pal3
|
||||
using Core.DataReader.Lgt;
|
||||
using Core.DataReader.Mov;
|
||||
using Core.DataReader.Msh;
|
||||
using Core.DataReader.Mtl;
|
||||
using Core.DataReader.Mv3;
|
||||
using Core.DataReader.Nav;
|
||||
using Core.DataReader.Pol;
|
||||
using Core.DataReader.Sce;
|
||||
using Core.DataReader.Scn;
|
||||
using Core.DataReader.Txt;
|
||||
using Core.FileSystem;
|
||||
using Core.Services;
|
||||
using Data;
|
||||
@@ -81,6 +83,8 @@ namespace Pal3
|
||||
|
||||
private IEnumerator InitResourceAsync()
|
||||
{
|
||||
Debug.Log($"[{nameof(GameResourceInitializer)}] Initializing game resources...");
|
||||
|
||||
// TODO: let user to choose language? Or auto-detect encoding?
|
||||
int codepage = DEFAULT_CODE_PAGE;
|
||||
|
||||
@@ -106,7 +110,7 @@ namespace Pal3
|
||||
|
||||
if (gameDataFolderSearchLocations.Count == 0)
|
||||
{
|
||||
Debug.LogError("No game data folder search locations found.");
|
||||
Debug.LogError($"[{nameof(GameResourceInitializer)}] No game data folder search locations found.");
|
||||
yield break;
|
||||
}
|
||||
|
||||
@@ -141,7 +145,7 @@ namespace Pal3
|
||||
|
||||
string userPickedGameDataFolderPath = null;
|
||||
|
||||
yield return WaitForUserToPickGameDataFolder((path) => userPickedGameDataFolderPath = path);
|
||||
yield return WaitForUserToPickGameDataFolderAsync(path => userPickedGameDataFolderPath = path);
|
||||
|
||||
if (!string.IsNullOrEmpty(userPickedGameDataFolderPath))
|
||||
{
|
||||
@@ -163,6 +167,7 @@ namespace Pal3
|
||||
ServiceLocator.Instance.Register<IFileReader<Mv3File>>(new Mv3FileReader(codepage));
|
||||
ServiceLocator.Instance.Register<IFileReader<MovFile>>(new MovFileReader(codepage));
|
||||
ServiceLocator.Instance.Register<IFileReader<MshFile>>(new MshFileReader(codepage));
|
||||
ServiceLocator.Instance.Register<IFileReader<MtlFile>>(new MtlFileReader(codepage));
|
||||
ServiceLocator.Instance.Register<IFileReader<PolFile>>(new PolFileReader(codepage));
|
||||
ServiceLocator.Instance.Register<IFileReader<GdbFile>>(new GdbFileReader(codepage));
|
||||
ServiceLocator.Instance.Register<IFileReader<LgtFile>>(new LgtFileReader());
|
||||
@@ -172,6 +177,7 @@ namespace Pal3
|
||||
ServiceLocator.Instance.Register<IFileReader<EffectDefinitionFile>>(new EffectDefinitionFileReader());
|
||||
ServiceLocator.Instance.Register<IFileReader<SceFile>>(new SceFileReader(codepage));
|
||||
ServiceLocator.Instance.Register<IFileReader<ScnFile>>(new ScnFileReader(codepage));
|
||||
ServiceLocator.Instance.Register<IFileReader<TaskDefinitionFile>>(new TaskDefinitionFileReader(codepage));
|
||||
|
||||
// Init TextureLoaderFactory
|
||||
TextureLoaderFactory textureLoaderFactory = new ();
|
||||
@@ -195,8 +201,7 @@ namespace Pal3
|
||||
gameSettings);
|
||||
ServiceLocator.Instance.Register(resourceProvider);
|
||||
|
||||
// Cache warm up
|
||||
resourceProvider.PreLoadMainActorMv3();
|
||||
Debug.Log($"[{nameof(GameResourceInitializer)}] Game resources initialized.");
|
||||
|
||||
// Instantiate starting component
|
||||
GameObject startingGameObject = Instantiate(startingComponent, null);
|
||||
@@ -207,7 +212,7 @@ namespace Pal3
|
||||
FinalizeInit();
|
||||
}
|
||||
|
||||
private IEnumerator WaitForUserToPickGameDataFolder(Action<string> callback)
|
||||
private IEnumerator WaitForUserToPickGameDataFolderAsync(Action<string> callback)
|
||||
{
|
||||
string userPickedGameDataFolderPath = null;
|
||||
|
||||
@@ -287,7 +292,8 @@ namespace Pal3
|
||||
timer.Start();
|
||||
cpkFileSystem = InitializeCpkFileSystem(path, crcHash, codepage);
|
||||
timer.Stop();
|
||||
Debug.Log($"All cpk files mounted successfully under {path}. Total time: {timer.Elapsed.TotalSeconds:0.000}s");
|
||||
Debug.Log($"[{nameof(GameResourceInitializer)}] All .cpk files mounted successfully. " +
|
||||
$"Total time: {timer.Elapsed.TotalSeconds:0.000}s");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -332,37 +338,25 @@ namespace Pal3
|
||||
{
|
||||
ICpkFileSystem cpkFileSystem = new CpkFileSystem(gameRootPath, crcHash);
|
||||
|
||||
var filesToMount = new List<string>();
|
||||
|
||||
var baseDataCpk = FileConstants.BaseDataCpkPathInfo.relativePath +
|
||||
Path.DirectorySeparatorChar + FileConstants.BaseDataCpkPathInfo.cpkName;
|
||||
|
||||
filesToMount.Add(baseDataCpk);
|
||||
|
||||
var musicCpk = FileConstants.MusicCpkPathInfo.relativePath +
|
||||
Path.DirectorySeparatorChar + FileConstants.MusicCpkPathInfo.cpkName;
|
||||
|
||||
filesToMount.Add(musicCpk);
|
||||
|
||||
foreach ((string cpkName, string relativePath) sceneCpkPathInfo in FileConstants.SceneCpkPathInfos)
|
||||
List<string> filesToMount = new ()
|
||||
{
|
||||
var sceneCpkPath = sceneCpkPathInfo.relativePath + Path.DirectorySeparatorChar +
|
||||
sceneCpkPathInfo.cpkName;
|
||||
filesToMount.Add(sceneCpkPath);
|
||||
FileConstants.BaseDataCpkFileRelativePath,
|
||||
FileConstants.MusicCpkFileRelativePath
|
||||
};
|
||||
|
||||
foreach (var sceneCpkFileName in FileConstants.SceneCpkFileNames)
|
||||
{
|
||||
filesToMount.Add(FileConstants.GetSceneCpkFileRelativePath(sceneCpkFileName));
|
||||
}
|
||||
|
||||
#if PAL3A
|
||||
var scnCpk = FileConstants.ScnCpkPathInfo.relativePath +
|
||||
Path.DirectorySeparatorChar + FileConstants.ScnCpkPathInfo.cpkName;
|
||||
filesToMount.Add(scnCpk);
|
||||
var sceCpk = FileConstants.SceCpkPathInfo.relativePath +
|
||||
Path.DirectorySeparatorChar + FileConstants.SceCpkPathInfo.cpkName;
|
||||
filesToMount.Add(sceCpk);
|
||||
filesToMount.Add(FileConstants.ScnCpkFileRelativePath);
|
||||
filesToMount.Add(FileConstants.SceCpkFileRelativePath);
|
||||
#endif
|
||||
|
||||
foreach (var cpkFilePath in filesToMount)
|
||||
foreach (var cpkFileRelativePath in filesToMount)
|
||||
{
|
||||
cpkFileSystem.Mount(cpkFilePath, codepage);
|
||||
cpkFileSystem.Mount(cpkFileRelativePath, codepage);
|
||||
}
|
||||
|
||||
return cpkFileSystem;
|
||||
|
||||
@@ -219,11 +219,11 @@ namespace Pal3.GameSystem
|
||||
}
|
||||
|
||||
float width = (_bigMapCanvasGridLayoutGroup.cellSize.x + _bigMapCanvasGridLayoutGroup.spacing.x) *
|
||||
_selectionButtons.Count - _bigMapCanvasGridLayoutGroup.spacing.x + 80f;
|
||||
float height = _bigMapCanvasGridLayoutGroup.cellSize.y + 100f;
|
||||
_selectionButtons.Count - _bigMapCanvasGridLayoutGroup.spacing.x;
|
||||
float height = _bigMapCanvasGridLayoutGroup.cellSize.y;
|
||||
|
||||
_bigMapBackgroundTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, width);
|
||||
_bigMapBackgroundTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, height);
|
||||
_bigMapBackgroundTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, width + 50f);
|
||||
_bigMapBackgroundTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, height + 60f);
|
||||
_bigMapBackgroundTransform.ForceUpdateRectTransforms();
|
||||
|
||||
_bigMapCanvas.alpha = 1f;
|
||||
|
||||
@@ -10,6 +10,7 @@ namespace Pal3.GameSystem
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using Command;
|
||||
using Command.InternalCommands;
|
||||
using Command.SceCommands;
|
||||
@@ -28,6 +29,7 @@ namespace Pal3.GameSystem
|
||||
using UnityEngine.InputSystem;
|
||||
using UnityEngine.InputSystem.DualShock;
|
||||
using UnityEngine.UI;
|
||||
using Debug = UnityEngine.Debug;
|
||||
|
||||
public sealed class DialogueManager : MonoBehaviour,
|
||||
ICommandExecutor<DialogueRenderActorAvatarCommand>,
|
||||
@@ -37,8 +39,9 @@ namespace Pal3.GameSystem
|
||||
ICommandExecutor<ResetGameStateCommand>
|
||||
{
|
||||
private const float LIMIT_TIME_DIALOGUE_PLAYER_MAX_REACTION_TIME_IN_SECONDS = 4f;
|
||||
private const float DIALOGUE_SHOW_HIDE_ANIMATION_DURATION = 0.1f;
|
||||
private const float DIALOGUE_SHOW_HIDE_ANIMATION_DURATION = 0.12f;
|
||||
private const float DIALOGUE_SHOW_HIDE_ANIMATION_Y_OFFSET = -30f;
|
||||
private const float DIALOGUE_FLASHING_ANIMATION_DURATION = 0.5f;
|
||||
|
||||
private const string INFORMATION_TEXT_COLOR_HEX = "#ffff05";
|
||||
|
||||
@@ -53,6 +56,7 @@ namespace Pal3.GameSystem
|
||||
private Canvas _dialogueSelectionButtonsCanvas;
|
||||
private GameObject _dialogueSelectionButtonPrefab;
|
||||
private Image _dialogueBackgroundImage;
|
||||
private RoundedFrostedGlassImage _backgroundFrostedGlassImage;
|
||||
|
||||
private Image _avatarImageLeft;
|
||||
private Image _avatarImageRight;
|
||||
@@ -68,6 +72,8 @@ namespace Pal3.GameSystem
|
||||
private int _lastSelectedButtonIndex;
|
||||
private readonly List<GameObject> _selectionButtons = new();
|
||||
private double _totalTimeUsedBeforeSkippingTheLastDialogue;
|
||||
private readonly Stopwatch _reactionTimer = new ();
|
||||
private CancellationTokenSource _flashingAnimationCts = new ();
|
||||
|
||||
private DialogueRenderActorAvatarCommand _lastAvatarCommand;
|
||||
private readonly Queue<IEnumerator> _dialogueRenderQueue = new();
|
||||
@@ -95,6 +101,8 @@ namespace Pal3.GameSystem
|
||||
|
||||
_dialogueCanvasGroup = Requires.IsNotNull(dialogueCanvasGroup, nameof(dialogueCanvasGroup));
|
||||
_dialogueBackgroundImage = Requires.IsNotNull(dialogueBackgroundImage, nameof(dialogueBackgroundImage));
|
||||
_backgroundFrostedGlassImage = Requires.IsNotNull(dialogueBackgroundImage.GetComponent<RoundedFrostedGlassImage>(),
|
||||
nameof(dialogueBackgroundImage));
|
||||
|
||||
_avatarImageLeft = Requires.IsNotNull(avatarImageLeft, nameof(avatarImageLeft));
|
||||
_avatarImageRight = Requires.IsNotNull(avatarImageRight, nameof(avatarImageRight));
|
||||
@@ -240,6 +248,7 @@ namespace Pal3.GameSystem
|
||||
Action onFinished = null)
|
||||
{
|
||||
CommandDispatcher<ICommand>.Instance.Dispatch(new DialogueRenderingStartedNotification());
|
||||
_totalTimeUsedBeforeSkippingTheLastDialogue = 0f;
|
||||
|
||||
bool isRightAligned = true;
|
||||
bool isAvatarPresented = false;
|
||||
@@ -266,19 +275,28 @@ namespace Pal3.GameSystem
|
||||
|
||||
TextMeshProUGUI dialogueTextUI = GetRenderingTextUI(isAvatarPresented, isRightAligned);
|
||||
|
||||
// TODO: when trackReactionTime set to true, we should also show alert on UI
|
||||
// to let player know
|
||||
|
||||
var timer = new Stopwatch();
|
||||
timer.Start();
|
||||
_dialogueBackgroundImage.enabled = true;
|
||||
_dialogueCanvasGroup.alpha = 0f;
|
||||
_dialogueCanvasGroup.enabled = true;
|
||||
_isSkipDialogueRequested = false;
|
||||
|
||||
yield return StartDialogueAnimationAsync(true);
|
||||
yield return PlayDialogueBackgroundPopAnimationAsync(true);
|
||||
_isSkipDialogueRequested = false; // Ignore skip request during dialogue rendering animation
|
||||
|
||||
if (trackReactionTime) // Setup timer and start flashing animation
|
||||
{
|
||||
_reactionTimer.Restart();
|
||||
if (!_flashingAnimationCts.IsCancellationRequested)
|
||||
{
|
||||
_flashingAnimationCts.Cancel();
|
||||
}
|
||||
_flashingAnimationCts = new CancellationTokenSource();
|
||||
StartCoroutine(PlayDialogueBackgroundFlashingAnimationAsync(
|
||||
duration: LIMIT_TIME_DIALOGUE_PLAYER_MAX_REACTION_TIME_IN_SECONDS,
|
||||
_flashingAnimationCts.Token));
|
||||
}
|
||||
|
||||
// Render dialogue text typing animation
|
||||
foreach (var dialogue in GetSubDialoguesAsync(text))
|
||||
{
|
||||
IEnumerator renderDialogue = RenderDialogueTextWithAnimationAsync(dialogueTextUI, dialogue);
|
||||
@@ -296,13 +314,15 @@ namespace Pal3.GameSystem
|
||||
}
|
||||
}
|
||||
|
||||
timer.Stop();
|
||||
if (trackReactionTime)
|
||||
if (trackReactionTime) // Stop flashing animation and timer
|
||||
{
|
||||
_totalTimeUsedBeforeSkippingTheLastDialogue = timer.Elapsed.TotalSeconds;
|
||||
_flashingAnimationCts.Cancel();
|
||||
_reactionTimer.Stop();
|
||||
_totalTimeUsedBeforeSkippingTheLastDialogue = _reactionTimer.Elapsed.TotalSeconds;
|
||||
Debug.LogWarning($"[{nameof(DialogueManager)}] Reaction time: {_totalTimeUsedBeforeSkippingTheLastDialogue:0.00f}");
|
||||
}
|
||||
|
||||
yield return StartDialogueAnimationAsync(false);
|
||||
yield return PlayDialogueBackgroundPopAnimationAsync(false);
|
||||
|
||||
ResetUI();
|
||||
|
||||
@@ -311,7 +331,39 @@ namespace Pal3.GameSystem
|
||||
onFinished?.Invoke();
|
||||
}
|
||||
|
||||
private IEnumerator StartDialogueAnimationAsync(bool showDialogue)
|
||||
private IEnumerator PlayDialogueBackgroundFlashingAnimationAsync(float duration, CancellationToken cancellationToken)
|
||||
{
|
||||
float startTime = Time.realtimeSinceStartup;
|
||||
float initialBlurAmount = _backgroundFrostedGlassImage.blurAmount;
|
||||
float initialTransparency = _backgroundFrostedGlassImage.transparency;
|
||||
const float minThresholdPercentage = 0.65f;
|
||||
|
||||
while (!cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
yield return CoreAnimation.EnumerateValueAsync(1f, minThresholdPercentage, DIALOGUE_FLASHING_ANIMATION_DURATION / 2f,
|
||||
AnimationCurveType.Linear, value =>
|
||||
{
|
||||
_backgroundFrostedGlassImage.SetMaterialBlurAmount(initialBlurAmount * value);
|
||||
_backgroundFrostedGlassImage.SetMaterialTransparency(initialTransparency * value);
|
||||
}, cancellationToken);
|
||||
|
||||
if (Time.realtimeSinceStartup - startTime >= duration) break;
|
||||
|
||||
yield return CoreAnimation.EnumerateValueAsync(minThresholdPercentage, 1f, DIALOGUE_FLASHING_ANIMATION_DURATION / 2f,
|
||||
AnimationCurveType.Linear, value =>
|
||||
{
|
||||
_backgroundFrostedGlassImage.SetMaterialBlurAmount(initialBlurAmount * value);
|
||||
_backgroundFrostedGlassImage.SetMaterialTransparency(initialTransparency * value);
|
||||
}, cancellationToken);
|
||||
|
||||
if (Time.realtimeSinceStartup - startTime >= duration) break;
|
||||
}
|
||||
|
||||
_backgroundFrostedGlassImage.SetMaterialBlurAmount(initialBlurAmount);
|
||||
_backgroundFrostedGlassImage.SetMaterialTransparency(initialTransparency);
|
||||
}
|
||||
|
||||
private IEnumerator PlayDialogueBackgroundPopAnimationAsync(bool showDialogue)
|
||||
{
|
||||
const float yOffset = DIALOGUE_SHOW_HIDE_ANIMATION_Y_OFFSET;
|
||||
Transform dialogueCanvasGroupTransform = _dialogueCanvasGroup.transform;
|
||||
@@ -326,12 +378,18 @@ namespace Pal3.GameSystem
|
||||
dialogueCanvasGroupTransform.position = startPosition;
|
||||
}
|
||||
|
||||
var initialBlurAmount = _backgroundFrostedGlassImage.blurAmount;
|
||||
var initialTransparency = _backgroundFrostedGlassImage.transparency;
|
||||
yield return CoreAnimation.EnumerateValueAsync(startValue, endValue, DIALOGUE_SHOW_HIDE_ANIMATION_DURATION,
|
||||
AnimationCurveType.Linear, value =>
|
||||
AnimationCurveType.EaseIn, value =>
|
||||
{
|
||||
_dialogueCanvasGroup.transform.position = finalPosition + new Vector3(0f, yOffset * (1 - value), 0);
|
||||
_dialogueCanvasGroup.alpha = value;
|
||||
_backgroundFrostedGlassImage.SetMaterialBlurAmount(initialBlurAmount * value);
|
||||
_backgroundFrostedGlassImage.SetMaterialTransparency(initialTransparency * value);
|
||||
});
|
||||
_backgroundFrostedGlassImage.SetMaterialBlurAmount(initialBlurAmount);
|
||||
_backgroundFrostedGlassImage.SetMaterialTransparency(initialTransparency);
|
||||
|
||||
_dialogueCanvasGroup.transform.position = finalPosition; // Always set to final position
|
||||
_dialogueCanvasGroup.alpha = showDialogue ? 1f : 0f;
|
||||
@@ -380,10 +438,10 @@ namespace Pal3.GameSystem
|
||||
"另外,画面\\i左下角\\r那东西叫作\\i“司南”\\r,只要点一下,就能看到地图,认清方向了。"))
|
||||
#endif
|
||||
{
|
||||
text = $"知道吗?您现在玩的{GameConstants.AppNameCNFull}是由\\i柒才\\r使用C#/Unity开发的复刻版,免费开源且支持全平台。" +
|
||||
text = $"知道吗?您现在玩的{GameConstants.AppNameCNFull}是由\\i柒才\\r使用C#/Unity开发(完全重写)的复刻版,免费开源且支持全平台(Win/Mac/Linux/iOS/Android)。" +
|
||||
"如果您是花钱得到的,那么恭喜您成为盗版游戏的受害者。" +
|
||||
$"当前游戏还在开发中,包括战斗在内的很多功能尚未实现,请耐心等待,也欢迎加入本游戏QQ群与作者联系:\\i252315306\\r," +
|
||||
"或者您也可以在B站关注Up主\\i@柒才\\r!";
|
||||
$"当前游戏还在开发中,包括战斗在内的很多功能尚未实现,请耐心等待,也欢迎加入本游戏QQ群与作者联系或下载最新版:\\i252315306\\r," +
|
||||
"您也可以在B站关注Up主\\i@柒才\\r获取最新开发信息!另外,全平台都支持手柄哦~";
|
||||
}
|
||||
|
||||
var formattedText = text.Replace("\\n", "\n");
|
||||
@@ -579,6 +637,14 @@ namespace Pal3.GameSystem
|
||||
_lastAvatarCommand = null;
|
||||
_totalTimeUsedBeforeSkippingTheLastDialogue = 0f;
|
||||
_dialogueRenderQueue.Clear();
|
||||
_reactionTimer?.Reset();
|
||||
|
||||
if (!_flashingAnimationCts.IsCancellationRequested)
|
||||
{
|
||||
_flashingAnimationCts.Cancel();
|
||||
_flashingAnimationCts = new CancellationTokenSource();
|
||||
}
|
||||
|
||||
ResetUI();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace Pal3.GameSystem
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError($"Actor ID {command.ActorId} is not supported for favor system. " +
|
||||
Debug.LogError($"[{nameof(FavorManager)}] Actor ID {command.ActorId} is not supported for favor system. " +
|
||||
$"Valid IDs are: {string.Join(", ", _actorFavor.Keys)}");
|
||||
}
|
||||
}
|
||||
|
||||
Loaded 100 of 190 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user