角色预制体创建
This commit is contained in:
43
Assets/Resources/CameraCfg.asset
Normal file
43
Assets/Resources/CameraCfg.asset
Normal file
@@ -0,0 +1,43 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 0}
|
||||
m_Name: CameraCfg
|
||||
m_EditorClassIdentifier: Assembly-CSharp:NBF:CameraScriptObject
|
||||
ScaleTime: 6
|
||||
ThirdCfg:
|
||||
Mode: 0
|
||||
UpdateMode: 1
|
||||
SmoothTime: 0
|
||||
NearClipPlane: 1
|
||||
FarClipPlane: 300
|
||||
Near: {x: 0, y: 2, z: -4}
|
||||
Far: {x: 0, y: 8, z: -11}
|
||||
BestRatio: 1
|
||||
Yaw: -45
|
||||
YawAtThird: 0
|
||||
PitchBest: 0
|
||||
PitchMin: 0
|
||||
PitchMax: 0
|
||||
FreeCfg:
|
||||
Mode: 1
|
||||
UpdateMode: 1
|
||||
SmoothTime: 0
|
||||
NearClipPlane: 0.2
|
||||
FarClipPlane: 500
|
||||
Near: {x: 0, y: 0, z: -4}
|
||||
Far: {x: 0, y: 0, z: -20}
|
||||
BestRatio: 0.8
|
||||
Yaw: 220
|
||||
YawAtThird: 0
|
||||
PitchBest: 30
|
||||
PitchMin: 25
|
||||
PitchMax: 85
|
||||
8
Assets/Resources/CameraCfg.asset.meta
Normal file
8
Assets/Resources/CameraCfg.asset.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dd437198c6676d14b977d0fc362d3fbf
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -307,6 +307,8 @@ SkinnedMeshRenderer:
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_SmallMeshCulling: 1
|
||||
m_ForceMeshLod: -1
|
||||
m_MeshLodSelectionBias: 0
|
||||
m_RenderingLayerMask: 4294967295
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
@@ -328,6 +330,7 @@ SkinnedMeshRenderer:
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_GlobalIlluminationMeshLod: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
@@ -1068,6 +1071,8 @@ SkinnedMeshRenderer:
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_SmallMeshCulling: 1
|
||||
m_ForceMeshLod: -1
|
||||
m_MeshLodSelectionBias: 0
|
||||
m_RenderingLayerMask: 4294967295
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
@@ -1089,6 +1094,7 @@ SkinnedMeshRenderer:
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_GlobalIlluminationMeshLod: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
@@ -1273,6 +1279,8 @@ SkinnedMeshRenderer:
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_SmallMeshCulling: 1
|
||||
m_ForceMeshLod: -1
|
||||
m_MeshLodSelectionBias: 0
|
||||
m_RenderingLayerMask: 4294967295
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
@@ -1294,6 +1302,7 @@ SkinnedMeshRenderer:
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_GlobalIlluminationMeshLod: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
@@ -1417,6 +1426,8 @@ SkinnedMeshRenderer:
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_SmallMeshCulling: 1
|
||||
m_ForceMeshLod: -1
|
||||
m_MeshLodSelectionBias: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
@@ -1438,6 +1449,7 @@ SkinnedMeshRenderer:
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_GlobalIlluminationMeshLod: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
@@ -1531,7 +1543,7 @@ GameObject:
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6486351463993281101}
|
||||
- component: {fileID: 8288789360753940629}
|
||||
- component: {fileID: 1870019855647915305}
|
||||
m_Layer: 9
|
||||
m_Name: ex_LeftShoulder
|
||||
m_TagString: Untagged
|
||||
@@ -1555,7 +1567,7 @@ Transform:
|
||||
- {fileID: 1567761239455292317}
|
||||
m_Father: {fileID: 4643797430188658138}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: -0, z: -0}
|
||||
--- !u!114 &8288789360753940629
|
||||
--- !u!114 &1870019855647915305
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
@@ -1564,9 +1576,9 @@ MonoBehaviour:
|
||||
m_GameObject: {fileID: 1759296708590676342}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 0d621debd7244988afb98b7c06605f63, type: 3}
|
||||
m_Script: {fileID: 11500000, guid: f85286904d2d45738c4b415f3503d4ab, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::NBF.PlayerShoulder
|
||||
TestZ: 0
|
||||
--- !u!1 &1788666327886274707
|
||||
GameObject:
|
||||
@@ -1609,7 +1621,7 @@ GameObject:
|
||||
m_Component:
|
||||
- component: {fileID: 1567761239455292317}
|
||||
- component: {fileID: 2527974312428153040}
|
||||
- component: {fileID: 889920278132032738}
|
||||
- component: {fileID: 7901441639198270294}
|
||||
m_Layer: 9
|
||||
m_Name: ex_LeftArm
|
||||
m_TagString: Untagged
|
||||
@@ -1690,7 +1702,7 @@ MonoBehaviour:
|
||||
maintainRotationWeight: 0
|
||||
bendModifierWeight: 1
|
||||
bendGoal: {fileID: 0}
|
||||
--- !u!114 &889920278132032738
|
||||
--- !u!114 &7901441639198270294
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
@@ -1699,15 +1711,15 @@ MonoBehaviour:
|
||||
m_GameObject: {fileID: 1819416041127449463}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 99467c6c370b440d8bdb517bbbcf22cf, type: 3}
|
||||
m_Script: {fileID: 11500000, guid: ed33e261a2784ee0814ceaa6c88aefdf, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::NBF.PlayerArm
|
||||
IsLeft: 1
|
||||
IK: {fileID: 2527974312428153040}
|
||||
RodContainer: {fileID: 5034659192527894323}
|
||||
LeftRigMagnet: {fileID: 2815101121166790886}
|
||||
FingerRig: {fileID: 5588049097361271665}
|
||||
Shoulder: {fileID: 8288789360753940629}
|
||||
Shoulder: {fileID: 1870019855647915305}
|
||||
interactionTargetWeight: 0
|
||||
--- !u!1 &1859516214001922058
|
||||
GameObject:
|
||||
@@ -2607,7 +2619,7 @@ GameObject:
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2857419113832061261}
|
||||
- component: {fileID: 7463744131801554541}
|
||||
- component: {fileID: 4210803098231656990}
|
||||
m_Layer: 9
|
||||
m_Name: ex_RightShoulder
|
||||
m_TagString: Untagged
|
||||
@@ -2631,7 +2643,7 @@ Transform:
|
||||
- {fileID: 7587706008879176572}
|
||||
m_Father: {fileID: 246890519160273793}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: -0, z: -0}
|
||||
--- !u!114 &7463744131801554541
|
||||
--- !u!114 &4210803098231656990
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
@@ -2640,9 +2652,9 @@ MonoBehaviour:
|
||||
m_GameObject: {fileID: 3576770042947972705}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 0d621debd7244988afb98b7c06605f63, type: 3}
|
||||
m_Script: {fileID: 11500000, guid: f85286904d2d45738c4b415f3503d4ab, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::NBF.PlayerShoulder
|
||||
TestZ: 0
|
||||
--- !u!1 &3637974307122593870
|
||||
GameObject:
|
||||
@@ -3334,17 +3346,23 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Version: 3
|
||||
m_UsePipelineSettings: 1
|
||||
m_AdditionalLightsShadowResolutionTier: 2
|
||||
m_LightLayerMask: 1
|
||||
m_RenderingLayers: 1
|
||||
m_CustomShadowLayers: 0
|
||||
m_ShadowLayerMask: 1
|
||||
m_ShadowRenderingLayers: 1
|
||||
m_LightCookieSize: {x: 1, y: 1}
|
||||
m_LightCookieOffset: {x: 0, y: 0}
|
||||
m_SoftShadowQuality: 0
|
||||
m_RenderingLayersMask:
|
||||
serializedVersion: 0
|
||||
m_Bits: 1
|
||||
m_ShadowRenderingLayersMask:
|
||||
serializedVersion: 0
|
||||
m_Bits: 1
|
||||
m_Version: 4
|
||||
m_LightLayerMask: 1
|
||||
m_ShadowLayerMask: 1
|
||||
m_RenderingLayers: 1
|
||||
m_ShadowRenderingLayers: 1
|
||||
--- !u!1 &4475576859136830028
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -3511,10 +3529,10 @@ Rigidbody:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4686840058173970751}
|
||||
serializedVersion: 4
|
||||
serializedVersion: 5
|
||||
m_Mass: 1
|
||||
m_Drag: 0
|
||||
m_AngularDrag: 0.05
|
||||
m_LinearDamping: 0
|
||||
m_AngularDamping: 0.05
|
||||
m_CenterOfMass: {x: 0, y: 0, z: 0}
|
||||
m_InertiaTensor: {x: 1, y: 1, z: 1}
|
||||
m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
@@ -3583,6 +3601,8 @@ SkinnedMeshRenderer:
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_SmallMeshCulling: 1
|
||||
m_ForceMeshLod: -1
|
||||
m_MeshLodSelectionBias: 0
|
||||
m_RenderingLayerMask: 4294967295
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
@@ -3604,6 +3624,7 @@ SkinnedMeshRenderer:
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_GlobalIlluminationMeshLod: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
@@ -3822,6 +3843,8 @@ SkinnedMeshRenderer:
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_SmallMeshCulling: 1
|
||||
m_ForceMeshLod: -1
|
||||
m_MeshLodSelectionBias: 0
|
||||
m_RenderingLayerMask: 4294967295
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
@@ -3843,6 +3866,7 @@ SkinnedMeshRenderer:
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_GlobalIlluminationMeshLod: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
@@ -4128,12 +4152,10 @@ GameObject:
|
||||
- component: {fileID: 523589534089097102}
|
||||
- component: {fileID: 3149647016773794308}
|
||||
- component: {fileID: 6567531271687267359}
|
||||
- component: {fileID: 4874838258577666918}
|
||||
- component: {fileID: 8072573713298176091}
|
||||
- component: {fileID: 4304401782308419094}
|
||||
- component: {fileID: 6041496193769315420}
|
||||
- component: {fileID: 5826410683169617913}
|
||||
- component: {fileID: 1590585097371921393}
|
||||
- component: {fileID: 6556378698144161009}
|
||||
m_Layer: 9
|
||||
m_Name: male
|
||||
m_TagString: Untagged
|
||||
@@ -4192,10 +4214,10 @@ Rigidbody:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5559475303044247694}
|
||||
serializedVersion: 4
|
||||
serializedVersion: 5
|
||||
m_Mass: 1
|
||||
m_Drag: 0
|
||||
m_AngularDrag: 0.05
|
||||
m_LinearDamping: 0
|
||||
m_AngularDamping: 0.05
|
||||
m_CenterOfMass: {x: 0, y: 0, z: 0}
|
||||
m_InertiaTensor: {x: 1, y: 1, z: 1}
|
||||
m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
@@ -4309,88 +4331,6 @@ AudioSource:
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
--- !u!114 &4874838258577666918
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5559475303044247694}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 492fca36d1134a788a47e5bf6f2fdc1e, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
Data:
|
||||
PlayerID: 0
|
||||
currentGear:
|
||||
Type: 1
|
||||
rod:
|
||||
id: 0
|
||||
configId: 0
|
||||
reel:
|
||||
id: 0
|
||||
configId: 0
|
||||
currentSpeed: 0.5
|
||||
currentDrag: 0.7
|
||||
bobber:
|
||||
id: 0
|
||||
configId: 0
|
||||
lastSetGroundValue: 0
|
||||
hook:
|
||||
id: 0
|
||||
configId: 0
|
||||
bait:
|
||||
id: 0
|
||||
configId: 0
|
||||
lure:
|
||||
id: 0
|
||||
configId: 0
|
||||
weight:
|
||||
id: 0
|
||||
configId: 0
|
||||
line:
|
||||
id: 0
|
||||
configId: 0
|
||||
leader:
|
||||
id: 0
|
||||
configId: 0
|
||||
feeder:
|
||||
id: 0
|
||||
configId: 0
|
||||
position: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0, w: 0}
|
||||
currentReelingSpeed: 0
|
||||
isHandOnHandle: 0
|
||||
lineLength: 0
|
||||
reelSpeed: 0
|
||||
openLight: 0
|
||||
openTelescope: 0
|
||||
state: 0
|
||||
lineCutTimer: 0
|
||||
selectorRodSetting: 0
|
||||
CameraRoot: {fileID: 5273066534610348271}
|
||||
PlayerAnimatorCtrl: {fileID: 0}
|
||||
Gears: {fileID: 0}
|
||||
LureTrajectorySimulator: {fileID: 0}
|
||||
Light: {fileID: 4424852676135480966}
|
||||
BackSpine: {fileID: 2935101413777606001}
|
||||
Collider: {fileID: 0}
|
||||
Rigidbody: {fileID: 3149647016773794308}
|
||||
--- !u!114 &8072573713298176091
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5559475303044247694}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: bd3b33ae0a9148e09ab618b222f8def5, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
Player: {fileID: 4874838258577666918}
|
||||
animator: {fileID: 0}
|
||||
--- !u!120 &4304401782308419094
|
||||
LineRenderer:
|
||||
serializedVersion: 2
|
||||
@@ -4412,6 +4352,8 @@ LineRenderer:
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_SmallMeshCulling: 1
|
||||
m_ForceMeshLod: -1
|
||||
m_MeshLodSelectionBias: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
@@ -4433,6 +4375,7 @@ LineRenderer:
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_GlobalIlluminationMeshLod: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
@@ -4595,7 +4538,7 @@ CharacterController:
|
||||
m_SkinWidth: 0.08
|
||||
m_MinMoveDistance: 0.001
|
||||
m_Center: {x: 0, y: 0.82, z: 0}
|
||||
--- !u!114 &1590585097371921393
|
||||
--- !u!114 &6556378698144161009
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
@@ -4604,12 +4547,10 @@ MonoBehaviour:
|
||||
m_GameObject: {fileID: 5559475303044247694}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5cf18b87277f477ab6a9b59759ee17cb, type: 3}
|
||||
m_Script: {fileID: 11500000, guid: cddbe2f2da274f6196485f744b618c86, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
CharacterController: {fileID: 0}
|
||||
CollisionFlags: 0
|
||||
IsSelf: 0
|
||||
m_EditorClassIdentifier: Assembly-CSharp::NBF.PlayerAnimator
|
||||
animator: {fileID: 523589534089097102}
|
||||
--- !u!1 &5735120231836046354
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -5132,7 +5073,7 @@ GameObject:
|
||||
m_Component:
|
||||
- component: {fileID: 7587706008879176572}
|
||||
- component: {fileID: 9220448411272401149}
|
||||
- component: {fileID: 6797890359994452233}
|
||||
- component: {fileID: 2638586216203132228}
|
||||
m_Layer: 9
|
||||
m_Name: ex_RightArm
|
||||
m_TagString: Untagged
|
||||
@@ -5213,7 +5154,7 @@ MonoBehaviour:
|
||||
maintainRotationWeight: 0
|
||||
bendModifierWeight: 1
|
||||
bendGoal: {fileID: 0}
|
||||
--- !u!114 &6797890359994452233
|
||||
--- !u!114 &2638586216203132228
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
@@ -5222,15 +5163,15 @@ MonoBehaviour:
|
||||
m_GameObject: {fileID: 6827275499489474676}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 99467c6c370b440d8bdb517bbbcf22cf, type: 3}
|
||||
m_Script: {fileID: 11500000, guid: ed33e261a2784ee0814ceaa6c88aefdf, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::NBF.PlayerArm
|
||||
IsLeft: 0
|
||||
IK: {fileID: 9220448411272401149}
|
||||
RodContainer: {fileID: 8468459431733240144}
|
||||
LeftRigMagnet: {fileID: 0}
|
||||
FingerRig: {fileID: 0}
|
||||
Shoulder: {fileID: 7463744131801554541}
|
||||
Shoulder: {fileID: 0}
|
||||
interactionTargetWeight: 0
|
||||
--- !u!1 &6853846614962554204
|
||||
GameObject:
|
||||
@@ -5508,6 +5449,8 @@ SkinnedMeshRenderer:
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_SmallMeshCulling: 1
|
||||
m_ForceMeshLod: -1
|
||||
m_MeshLodSelectionBias: 0
|
||||
m_RenderingLayerMask: 4294967295
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
@@ -5529,6 +5472,7 @@ SkinnedMeshRenderer:
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_GlobalIlluminationMeshLod: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
@@ -5779,6 +5723,8 @@ SkinnedMeshRenderer:
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_SmallMeshCulling: 1
|
||||
m_ForceMeshLod: -1
|
||||
m_MeshLodSelectionBias: 0
|
||||
m_RenderingLayerMask: 4294967295
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
@@ -5800,6 +5746,7 @@ SkinnedMeshRenderer:
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_GlobalIlluminationMeshLod: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
@@ -6810,6 +6757,8 @@ SkinnedMeshRenderer:
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_SmallMeshCulling: 1
|
||||
m_ForceMeshLod: -1
|
||||
m_MeshLodSelectionBias: 0
|
||||
m_RenderingLayerMask: 4294967295
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
@@ -6831,6 +6780,7 @@ SkinnedMeshRenderer:
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_GlobalIlluminationMeshLod: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
|
||||
@@ -175,7 +175,6 @@ MonoBehaviour:
|
||||
m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_RequiresDepthTexture: 0
|
||||
m_RequiresColorTexture: 0
|
||||
m_Version: 2
|
||||
m_TaaSettings:
|
||||
m_Quality: 3
|
||||
m_FrameInfluence: 0.1
|
||||
@@ -183,6 +182,7 @@ MonoBehaviour:
|
||||
m_MipBias: 0
|
||||
m_VarianceClampScale: 0.9
|
||||
m_ContrastAdaptiveSharpening: 0
|
||||
m_Version: 2
|
||||
--- !u!20 &174907468
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -500,17 +500,23 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Version: 3
|
||||
m_UsePipelineSettings: 1
|
||||
m_AdditionalLightsShadowResolutionTier: 2
|
||||
m_LightLayerMask: 1
|
||||
m_RenderingLayers: 1
|
||||
m_CustomShadowLayers: 0
|
||||
m_ShadowLayerMask: 1
|
||||
m_ShadowRenderingLayers: 1
|
||||
m_LightCookieSize: {x: 1, y: 1}
|
||||
m_LightCookieOffset: {x: 0, y: 0}
|
||||
m_SoftShadowQuality: 1
|
||||
m_RenderingLayersMask:
|
||||
serializedVersion: 0
|
||||
m_Bits: 1
|
||||
m_ShadowRenderingLayersMask:
|
||||
serializedVersion: 0
|
||||
m_Bits: 1
|
||||
m_Version: 4
|
||||
m_LightLayerMask: 1
|
||||
m_ShadowLayerMask: 1
|
||||
m_RenderingLayers: 1
|
||||
m_ShadowRenderingLayers: 1
|
||||
--- !u!114 &410087043
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -923,7 +929,6 @@ MonoBehaviour:
|
||||
m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_RequiresDepthTexture: 0
|
||||
m_RequiresColorTexture: 0
|
||||
m_Version: 2
|
||||
m_TaaSettings:
|
||||
m_Quality: 3
|
||||
m_FrameInfluence: 0.1
|
||||
@@ -931,6 +936,7 @@ MonoBehaviour:
|
||||
m_MipBias: 0
|
||||
m_VarianceClampScale: 0.9
|
||||
m_ContrastAdaptiveSharpening: 0
|
||||
m_Version: 2
|
||||
--- !u!4 &6098876000977740681
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -985,6 +991,7 @@ GameObject:
|
||||
- component: {fileID: 6098876000977740681}
|
||||
- component: {fileID: 1341717235351337375}
|
||||
- component: {fileID: 7388915548948935574}
|
||||
- component: {fileID: 7388915548948935575}
|
||||
m_Layer: 0
|
||||
m_Name: Init
|
||||
m_TagString: Untagged
|
||||
@@ -1010,6 +1017,18 @@ MonoBehaviour:
|
||||
uiGroup: {fileID: -7702456625070306757, guid: 66dbad8598d60494fab0927844c88cc0, type: 2}
|
||||
ambientGroup: {fileID: -4979278990015000519, guid: 66dbad8598d60494fab0927844c88cc0, type: 2}
|
||||
playerGroup: {fileID: -5706599233093607984, guid: 66dbad8598d60494fab0927844c88cc0, type: 2}
|
||||
--- !u!114 &7388915548948935575
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7388915548948935573}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 55a2b6b470ce459c8ca8cda7eadb8934, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::NBF.Global
|
||||
--- !u!1660057539 &9223372036854775807
|
||||
SceneRoots:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@@ -7,13 +7,22 @@ namespace NBF
|
||||
public int Error { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 相机模式切换
|
||||
/// </summary>
|
||||
public struct CameraChangeMode
|
||||
{
|
||||
public CameraShowMode Mode;
|
||||
public MapUnit Unit;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 开始切换场景
|
||||
/// </summary>
|
||||
public struct SceneChangeStart
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Loading进度变化
|
||||
/// </summary>
|
||||
|
||||
68
Assets/Scripts/Configs/Mem/CameraCfg.cs
Normal file
68
Assets/Scripts/Configs/Mem/CameraCfg.cs
Normal file
@@ -0,0 +1,68 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public enum CameraUpdateMode
|
||||
{
|
||||
Smooth,
|
||||
Immediate,
|
||||
}
|
||||
|
||||
public enum CameraMode
|
||||
{
|
||||
Third,
|
||||
Free,
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class CameraCfg
|
||||
{
|
||||
public CameraMode Mode;
|
||||
public CameraUpdateMode UpdateMode;
|
||||
|
||||
public float SmoothTime;
|
||||
|
||||
public float NearClipPlane = 1;
|
||||
public float FarClipPlane = 500;
|
||||
|
||||
public Vector3 Near;
|
||||
public Vector3 Far;
|
||||
public float BestRatio = 0.5f;
|
||||
|
||||
public Vector3 Distance
|
||||
{
|
||||
get { return this.Far - this.Near; }
|
||||
}
|
||||
|
||||
public Vector3 Best
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (Mode)
|
||||
{
|
||||
case CameraMode.Third:
|
||||
return this.Near + (this.Far - this.Near) * this.BestRatio;
|
||||
default:
|
||||
return Quaternion.Euler(this.PitchBest, 0, 0) *
|
||||
(Vector3.back * (this.Near + (this.Far - this.Near) * this.BestRatio).magnitude);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public float Yaw;
|
||||
public bool YawAtThird;
|
||||
|
||||
public float PitchBest;
|
||||
public float PitchMin;
|
||||
public float PitchMax;
|
||||
}
|
||||
|
||||
[CreateAssetMenu(menuName = "ET/CreateCameraConfig", fileName = "CameraCfg", order = 1)]
|
||||
public class CameraScriptObject : ScriptableObject
|
||||
{
|
||||
public float ScaleTime = 6;
|
||||
public CameraCfg ThirdCfg;
|
||||
public CameraCfg FreeCfg;
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/Configs/Mem/CameraCfg.cs.meta
Normal file
3
Assets/Scripts/Configs/Mem/CameraCfg.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5f43c20e40ae42239e4381c12ad7cc00
|
||||
timeCreated: 1756823027
|
||||
3
Assets/Scripts/Fishing2/Camera.meta
Normal file
3
Assets/Scripts/Fishing2/Camera.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0eb35ab0b70344b4a2b6054f7a7ecd1b
|
||||
timeCreated: 1756822717
|
||||
67
Assets/Scripts/Fishing2/Camera/CameraComponent.cs
Normal file
67
Assets/Scripts/Fishing2/Camera/CameraComponent.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
using NBC;
|
||||
using NBC.Entitas;
|
||||
using NBC.Entitas.Interface;
|
||||
using NBC.Event;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
public enum CameraShowMode
|
||||
{
|
||||
Player,
|
||||
Free,
|
||||
}
|
||||
|
||||
public class CameraComponent : Entity
|
||||
{
|
||||
public CameraShowMode Mode;
|
||||
public Camera Camera;
|
||||
public MapUnit MapUnit;
|
||||
}
|
||||
|
||||
public static class CameraComponentSystem
|
||||
{
|
||||
public class CameraComponentAwakeSystem : AwakeSystem<CameraComponent>
|
||||
{
|
||||
protected override void Awake(CameraComponent self)
|
||||
{
|
||||
self.Camera = BaseCamera.Main;
|
||||
}
|
||||
}
|
||||
|
||||
public class CameraChangeModeEvent : EventSystem<CameraChangeMode>
|
||||
{
|
||||
protected override void Handler(CameraChangeMode self)
|
||||
{
|
||||
var cameraComponent = App.Main.GetComponent<CameraComponent>();
|
||||
cameraComponent.Mode = self.Mode;
|
||||
cameraComponent.MapUnit = self.Unit;
|
||||
cameraComponent.ChangeCameraMode();
|
||||
}
|
||||
}
|
||||
|
||||
public static void ChangeCameraMode(this CameraComponent self)
|
||||
{
|
||||
if (self.Mode == CameraShowMode.Player)
|
||||
{
|
||||
if (self.MapUnit != null)
|
||||
{
|
||||
var unityComponent = self.MapUnit.GetComponent<UnitUnityComponent>();
|
||||
if (unityComponent != null)
|
||||
{
|
||||
var root = unityComponent.Transform.Find("FPSCamera");
|
||||
self.Camera.transform.SetParent(root);
|
||||
self.Camera.transform.localPosition = Vector3.zero;
|
||||
self.Camera.transform.localRotation = Quaternion.identity;
|
||||
self.Camera.transform.localScale = Vector3.one;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (self.Mode == CameraShowMode.Free)
|
||||
{
|
||||
self.Camera.transform.SetParent(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/Fishing2/Camera/CameraComponent.cs.meta
Normal file
3
Assets/Scripts/Fishing2/Camera/CameraComponent.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aee3947bbf944ecb9e955d2ac1d9e3a5
|
||||
timeCreated: 1756822741
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
public class MoveComponent : Entity
|
||||
public class InputComponent : Entity
|
||||
{
|
||||
|
||||
}
|
||||
3
Assets/Scripts/Fishing2/Camera/InputComponent.cs.meta
Normal file
3
Assets/Scripts/Fishing2/Camera/InputComponent.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 09132878c89a444a88421b7434394235
|
||||
timeCreated: 1756826439
|
||||
9
Assets/Scripts/Fishing2/Camera/SettingComponent.cs
Normal file
9
Assets/Scripts/Fishing2/Camera/SettingComponent.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using NBC.Entitas;
|
||||
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
public class SettingComponent : Entity
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/Fishing2/Camera/SettingComponent.cs.meta
Normal file
3
Assets/Scripts/Fishing2/Camera/SettingComponent.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7c6adcf67ef545f99c590d1078a76eea
|
||||
timeCreated: 1756826460
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 67d5b3b1b06a4f60875ee66ec05d6205
|
||||
timeCreated: 1756364079
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7924ca863f4b4ce8a7018a42852431a6
|
||||
timeCreated: 1756564816
|
||||
@@ -1,12 +0,0 @@
|
||||
using NBC.Entitas;
|
||||
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
/// <summary>
|
||||
/// 背包
|
||||
/// </summary>
|
||||
public class Bag : Entity
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2176086bd28445acb23a458c20d016ab
|
||||
timeCreated: 1756564836
|
||||
@@ -1,21 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using NBC.Entitas;
|
||||
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
public class Map : Entity
|
||||
{
|
||||
public int MapId;
|
||||
/// <summary>
|
||||
/// 好友房地图
|
||||
/// </summary>
|
||||
public bool IsRoomMap;
|
||||
|
||||
/// <summary>
|
||||
/// 地图中的单位
|
||||
/// </summary>
|
||||
public Dictionary<long, MapUnit> Units = new Dictionary<long, MapUnit>();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
using NBC;
|
||||
using NBC.Entitas;
|
||||
using NBC.Entitas.Interface;
|
||||
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
public class Role : Entity
|
||||
{
|
||||
public long RoomId { get; set; }
|
||||
public RoleInfo Info { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8e7f0c94a8514f5fa23bcc283e7abdc4
|
||||
timeCreated: 1756049392
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6e4715bc722c4438ae8603fab6232e81
|
||||
timeCreated: 1756049567
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 56a84b9175e14d59ad68a999f549a821
|
||||
timeCreated: 1756738863
|
||||
@@ -1,28 +0,0 @@
|
||||
using NBC;
|
||||
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
public static class UnitSystem
|
||||
{
|
||||
public static void SetUnitInfo(this MapUnit self, MapUnitInfo unitInfo)
|
||||
{
|
||||
NumericComponent numericComponent = self.AddComponent<NumericComponent>();
|
||||
foreach (var kv in unitInfo.KV)
|
||||
{
|
||||
numericComponent.Set(kv.Key, kv.Value);
|
||||
}
|
||||
}
|
||||
|
||||
public static UnitConfig Config(this MapUnit self)
|
||||
{
|
||||
return UnitConfig.Get(self.ConfigId);
|
||||
}
|
||||
|
||||
public static UnitType Type(this MapUnit self)
|
||||
{
|
||||
return self.Config().Type;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1e34ab621bcb45b1af37fca0b06878bb
|
||||
timeCreated: 1756049584
|
||||
@@ -1,6 +1,8 @@
|
||||
using System;
|
||||
using NBC;
|
||||
using NBC.Entitas;
|
||||
using UnityEngine;
|
||||
using Object = System.Object;
|
||||
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
@@ -83,9 +85,9 @@ namespace NBF.Fishing2
|
||||
public static async FTask LoadMap(this Map self)
|
||||
{
|
||||
var sceneName = "Map99";
|
||||
self.CreteSelfMapUnit();
|
||||
//加载场景==
|
||||
await SceneHelper.LoadScene(sceneName);
|
||||
self.CreteSelfMapUnit();
|
||||
await self.LoadAllUnit();
|
||||
FishingPanel.Show();
|
||||
|
||||
@@ -96,12 +98,22 @@ namespace NBF.Fishing2
|
||||
#endregion
|
||||
|
||||
#region Unit
|
||||
|
||||
/// <summary>
|
||||
/// 加载所有unit单位
|
||||
/// </summary>
|
||||
/// <param name="self"></param>
|
||||
public static async FTask LoadAllUnit(this Map self)
|
||||
{
|
||||
MapUnit mapUnit = null;
|
||||
foreach (var (_, unit) in self.Units)
|
||||
{
|
||||
var unitUnity = unit.AddComponent<UnitUnityComponent>();
|
||||
await unitUnity.InitUnityObject();
|
||||
mapUnit = unit;
|
||||
}
|
||||
|
||||
self.Scene.EventComponent.Publish(new CameraChangeMode() { Mode = CameraShowMode.Player, Unit = mapUnit });
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
24
Assets/Scripts/Fishing2/Helper/MoveHelper.cs
Normal file
24
Assets/Scripts/Fishing2/Helper/MoveHelper.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.Collections.Generic;
|
||||
using NBC;
|
||||
using Unity.Mathematics;
|
||||
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
public static class MoveHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// 可以多次调用,多次调用的话会取消上一次的协程
|
||||
/// </summary>
|
||||
/// <param name="unit"></param>
|
||||
/// <param name="targetPos"></param>
|
||||
/// <returns></returns>
|
||||
public static async FTask<int> MoveToAsync(this MapUnit unit, float3 targetPos)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static async FTask MoveToAsync(this MapUnit unit, List<float3> path)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/Fishing2/Helper/MoveHelper.cs.meta
Normal file
3
Assets/Scripts/Fishing2/Helper/MoveHelper.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2ce11e50e0d749bfa5915208b1ce1a44
|
||||
timeCreated: 1756822516
|
||||
@@ -1,27 +1,43 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using NBC;
|
||||
using NBC.Entitas;
|
||||
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
public static class MapSystem
|
||||
public class Map : Entity
|
||||
{
|
||||
public int MapId;
|
||||
|
||||
/// <summary>
|
||||
/// 好友房地图
|
||||
/// </summary>
|
||||
public bool IsRoomMap;
|
||||
|
||||
/// <summary>
|
||||
/// 地图中的单位
|
||||
/// </summary>
|
||||
public Dictionary<long, MapUnit> Units = new Dictionary<long, MapUnit>();
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 创建地图单位
|
||||
/// </summary>
|
||||
/// <param name="map"></param>
|
||||
public static void CreteSelfMapUnit(this Map map)
|
||||
public void CreteSelfMapUnit()
|
||||
{
|
||||
//创建自己
|
||||
var role = map.Scene.GetComponent<Role>();
|
||||
var role = Scene.GetComponent<Role>();
|
||||
var mapUnitInfo = role.GetMapUnitInfo();
|
||||
map.CreteMapUnit(mapUnitInfo);
|
||||
CreteMapUnit(mapUnitInfo);
|
||||
}
|
||||
|
||||
public static void CreteMapUnit(this Map map, MapUnitInfo unitInfo)
|
||||
public void CreteMapUnit(MapUnitInfo unitInfo)
|
||||
{
|
||||
var mapUnit = Entity.Create<MapUnit>(map.Scene, unitInfo.RoleInfo.RoleId, true, true);
|
||||
map.Add(mapUnit);
|
||||
var mapUnit = Entity.Create<MapUnit>(Scene, unitInfo.RoleInfo.RoleId, true, true);
|
||||
Add(mapUnit);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -30,9 +46,9 @@ namespace NBF.Fishing2
|
||||
/// <param name="self"></param>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public static MapUnit GetUnit(this Map self, long id)
|
||||
public MapUnit GetUnit(long id)
|
||||
{
|
||||
return self.Units.GetValueOrDefault(id);
|
||||
return Units.GetValueOrDefault(id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -41,9 +57,9 @@ namespace NBF.Fishing2
|
||||
/// <param name="map"></param>
|
||||
/// <param name="unit"></param>
|
||||
/// <returns></returns>
|
||||
public static bool Add(this Map map, MapUnit unit)
|
||||
public bool Add(MapUnit unit)
|
||||
{
|
||||
map.Units.Add(unit.Id, unit);
|
||||
Units.Add(unit.Id, unit);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -53,9 +69,9 @@ namespace NBF.Fishing2
|
||||
/// <param name="self"></param>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public static bool Remove(this Map self, long id)
|
||||
public bool Remove(long id)
|
||||
{
|
||||
return self.Units.Remove(id);
|
||||
return Units.Remove(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/Fishing2/Mono.meta
Normal file
3
Assets/Scripts/Fishing2/Mono.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 53262d3faa5141deb0c8809a4354daa0
|
||||
timeCreated: 1756820602
|
||||
353
Assets/Scripts/Fishing2/Mono/PlayerAnimator.cs
Normal file
353
Assets/Scripts/Fishing2/Mono/PlayerAnimator.cs
Normal file
@@ -0,0 +1,353 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Serialization;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public enum ThrowModeEnum : int
|
||||
{
|
||||
Spin = 0,
|
||||
Float = 1,
|
||||
}
|
||||
|
||||
public enum HandItemType
|
||||
{
|
||||
Default = 0,
|
||||
HandRod = 1,
|
||||
SpinRod = 2,
|
||||
}
|
||||
|
||||
public class PlayerAnimator : MonoBehaviour
|
||||
{
|
||||
#region 参数定义
|
||||
|
||||
private static readonly int StartThrowHash = Animator.StringToHash("startThrow");
|
||||
private static readonly int LureThrownHash = Animator.StringToHash("lureThrown");
|
||||
private static readonly int PrepareThrowHash = Animator.StringToHash("prepareThrow");
|
||||
private static readonly int LeftHandHash = Animator.StringToHash("leftHand");
|
||||
private static readonly int MoveSpeedHash = Animator.StringToHash("moveSpeed");
|
||||
private static readonly int BoatVelocityHash = Animator.StringToHash("boatVelocity");
|
||||
private static readonly int BoatDirHash = Animator.StringToHash("boatDir");
|
||||
private static readonly int BoatHash = Animator.StringToHash("boat");
|
||||
private static readonly int CastingHash = Animator.StringToHash("casting");
|
||||
private static readonly int TelestickHash = Animator.StringToHash("telestick");
|
||||
private static readonly int TelestickPullHash = Animator.StringToHash("telestick_pull");
|
||||
private static readonly int UseRodPodHash = Animator.StringToHash("use_rod_pod");
|
||||
private static readonly int ItemSourceHash = Animator.StringToHash("item_source");
|
||||
private static readonly int ItemDestHash = Animator.StringToHash("item_dest");
|
||||
private static readonly int RodReadyHash = Animator.StringToHash("rod_ready");
|
||||
private static readonly int HitchRecoverDirHash = Animator.StringToHash("hitchRecoverDir");
|
||||
private static readonly int HitchRecoverHash = Animator.StringToHash("hitchRecover");
|
||||
private static readonly int SitOrStandHash = Animator.StringToHash("sitOrStand");
|
||||
private static readonly int ShtekerHash = Animator.StringToHash("shteker");
|
||||
private static readonly int ItemInHandsHash = Animator.StringToHash("item_in_hands");
|
||||
private static readonly int ChangeItemHash = Animator.StringToHash("change_item");
|
||||
private static readonly int ItemTypeHash = Animator.StringToHash("item_type");
|
||||
private static readonly int ItemActionHash = Animator.StringToHash("item_action");
|
||||
private static readonly int ItemActionPowerHash = Animator.StringToHash("item_action_power");
|
||||
private static readonly int PodsakActionHash = Animator.StringToHash("podsak_action");
|
||||
private static readonly int FishingFinalHash = Animator.StringToHash("fishing_final");
|
||||
private static readonly int SpinOrTeleHash = Animator.StringToHash("spin_or_tele");
|
||||
private static readonly int TwitchHash = Animator.StringToHash("twitch");
|
||||
private static readonly int TwitchDirHash = Animator.StringToHash("twitch_dir");
|
||||
private static readonly int ThrowSpeedMultHash = Animator.StringToHash("throw_speed_mult");
|
||||
private static readonly int ConvTestHash = Animator.StringToHash("conv_test");
|
||||
private static readonly int BoatPoseHash = Animator.StringToHash("boat_pose");
|
||||
private static readonly int QuadDirectionHash = Animator.StringToHash("quad_direction");
|
||||
private static readonly int StretchMaxHash = Animator.StringToHash("stretch_max");
|
||||
private static readonly int ExamineItemHash = Animator.StringToHash("examine_item");
|
||||
private static readonly int TillerDirectionHash = Animator.StringToHash("tiller_direction");
|
||||
private static readonly int TestTriggerHash = Animator.StringToHash("test_trigger");
|
||||
private static readonly int ThrowModeHash = Animator.StringToHash("throw_mode");
|
||||
private static readonly int PullUpRodHash = Animator.StringToHash("pull_up_rod");
|
||||
|
||||
public bool StartThrow
|
||||
{
|
||||
get => animator.GetBool(StartThrowHash);
|
||||
set => animator.SetBool(StartThrowHash, value);
|
||||
}
|
||||
|
||||
public bool LureThrown
|
||||
{
|
||||
get => animator.GetBool(LureThrownHash);
|
||||
set => animator.SetBool(LureThrownHash, value);
|
||||
}
|
||||
|
||||
public bool PrepareThrow
|
||||
{
|
||||
get => animator.GetBool(PrepareThrowHash);
|
||||
set => animator.SetBool(PrepareThrowHash, value);
|
||||
}
|
||||
|
||||
public bool LeftHand
|
||||
{
|
||||
get => animator.GetBool(LeftHandHash);
|
||||
set => animator.SetBool(LeftHandHash, value);
|
||||
}
|
||||
|
||||
public float MoveSpeed
|
||||
{
|
||||
get => animator.GetFloat(MoveSpeedHash);
|
||||
set => animator.SetFloat(MoveSpeedHash, value);
|
||||
}
|
||||
|
||||
public float BoatVelocity
|
||||
{
|
||||
get => animator.GetFloat(BoatVelocityHash);
|
||||
set => animator.SetFloat(BoatVelocityHash, value);
|
||||
}
|
||||
|
||||
public float BoatDir
|
||||
{
|
||||
get => animator.GetFloat(BoatDirHash);
|
||||
set => animator.SetFloat(BoatDirHash, value);
|
||||
}
|
||||
|
||||
public bool Boat
|
||||
{
|
||||
get => animator.GetBool(BoatHash);
|
||||
set => animator.SetBool(BoatHash, value);
|
||||
}
|
||||
|
||||
public bool Casting
|
||||
{
|
||||
get => animator.GetBool(CastingHash);
|
||||
set => animator.SetBool(CastingHash, value);
|
||||
}
|
||||
|
||||
public bool Telestick
|
||||
{
|
||||
get => animator.GetBool(TelestickHash);
|
||||
set => animator.SetBool(TelestickHash, value);
|
||||
}
|
||||
|
||||
public bool TelestickPull
|
||||
{
|
||||
get => animator.GetBool(TelestickPullHash);
|
||||
set => animator.SetBool(TelestickPullHash, value);
|
||||
}
|
||||
|
||||
public bool UseRodPod
|
||||
{
|
||||
get => animator.GetBool(UseRodPodHash);
|
||||
set => animator.SetBool(UseRodPodHash, value);
|
||||
}
|
||||
|
||||
public int ItemSource
|
||||
{
|
||||
get => animator.GetInteger(ItemSourceHash);
|
||||
set => animator.SetInteger(ItemSourceHash, value);
|
||||
}
|
||||
|
||||
public int ItemDest
|
||||
{
|
||||
get => animator.GetInteger(ItemDestHash);
|
||||
set => animator.SetInteger(ItemDestHash, value);
|
||||
}
|
||||
|
||||
public bool RodReady
|
||||
{
|
||||
get => animator.GetBool(RodReadyHash);
|
||||
set => animator.SetBool(RodReadyHash, value);
|
||||
}
|
||||
|
||||
public float HitchRecoverDir
|
||||
{
|
||||
get => animator.GetFloat(HitchRecoverDirHash);
|
||||
set => animator.SetFloat(HitchRecoverDirHash, value);
|
||||
}
|
||||
|
||||
public void SetHitchRecoverTrigger()
|
||||
{
|
||||
animator.SetTrigger(HitchRecoverHash);
|
||||
}
|
||||
|
||||
public void ResetHitchRecoverTrigger()
|
||||
{
|
||||
animator.ResetTrigger(HitchRecoverHash);
|
||||
}
|
||||
|
||||
public float SitOrStand
|
||||
{
|
||||
get => animator.GetFloat(SitOrStandHash);
|
||||
set => animator.SetFloat(SitOrStandHash, value);
|
||||
}
|
||||
|
||||
public bool Shteker
|
||||
{
|
||||
get => animator.GetBool(ShtekerHash);
|
||||
set => animator.SetBool(ShtekerHash, value);
|
||||
}
|
||||
|
||||
public bool ItemInHands
|
||||
{
|
||||
get => animator.GetBool(ItemInHandsHash);
|
||||
set => animator.SetBool(ItemInHandsHash, value);
|
||||
}
|
||||
|
||||
public bool ChangeItem
|
||||
{
|
||||
get => animator.GetBool(ChangeItemHash);
|
||||
set => animator.SetBool(ChangeItemHash, value);
|
||||
}
|
||||
|
||||
public HandItemType ItemType
|
||||
{
|
||||
get => (HandItemType)animator.GetInteger(ItemTypeHash);
|
||||
set => animator.SetInteger(ItemTypeHash, (int)value);
|
||||
}
|
||||
|
||||
public void SetItemActionTrigger()
|
||||
{
|
||||
animator.SetTrigger(ItemActionHash);
|
||||
}
|
||||
|
||||
public void ResetItemActionTrigger()
|
||||
{
|
||||
animator.ResetTrigger(ItemActionHash);
|
||||
}
|
||||
|
||||
public float ItemActionPower
|
||||
{
|
||||
get => animator.GetFloat(ItemActionPowerHash);
|
||||
set => animator.SetFloat(ItemActionPowerHash, value);
|
||||
}
|
||||
|
||||
public bool PodsakAction
|
||||
{
|
||||
get => animator.GetBool(PodsakActionHash);
|
||||
set => animator.SetBool(PodsakActionHash, value);
|
||||
}
|
||||
|
||||
public bool PullUpRod
|
||||
{
|
||||
get => animator.GetBool(PullUpRodHash);
|
||||
set => animator.SetBool(PullUpRodHash, value);
|
||||
}
|
||||
|
||||
public float FishingFinal
|
||||
{
|
||||
get => animator.GetFloat(FishingFinalHash);
|
||||
set => animator.SetFloat(FishingFinalHash, value);
|
||||
}
|
||||
|
||||
public float SpinOrTele
|
||||
{
|
||||
get => animator.GetFloat(SpinOrTeleHash);
|
||||
set => animator.SetFloat(SpinOrTeleHash, value);
|
||||
}
|
||||
|
||||
public void SetTwitchTrigger()
|
||||
{
|
||||
animator.SetTrigger(TwitchHash);
|
||||
}
|
||||
|
||||
public void ResetTwitchTrigger()
|
||||
{
|
||||
animator.ResetTrigger(TwitchHash);
|
||||
}
|
||||
|
||||
public float TwitchDir
|
||||
{
|
||||
get => animator.GetFloat(TwitchDirHash);
|
||||
set => animator.SetFloat(TwitchDirHash, value);
|
||||
}
|
||||
|
||||
public float ThrowSpeedMult
|
||||
{
|
||||
get => animator.GetFloat(ThrowSpeedMultHash);
|
||||
set => animator.SetFloat(ThrowSpeedMultHash, value);
|
||||
}
|
||||
|
||||
public void SetConvTestTrigger()
|
||||
{
|
||||
animator.SetTrigger(ConvTestHash);
|
||||
}
|
||||
|
||||
public void ResetConvTestTrigger()
|
||||
{
|
||||
animator.ResetTrigger(ConvTestHash);
|
||||
}
|
||||
|
||||
public int BoatPose
|
||||
{
|
||||
get => animator.GetInteger(BoatPoseHash);
|
||||
set => animator.SetInteger(BoatPoseHash, value);
|
||||
}
|
||||
|
||||
public float QuadDirection
|
||||
{
|
||||
get => animator.GetFloat(QuadDirectionHash);
|
||||
set => animator.SetFloat(QuadDirectionHash, value);
|
||||
}
|
||||
|
||||
public bool StretchMax
|
||||
{
|
||||
get => animator.GetBool(StretchMaxHash);
|
||||
set => animator.SetBool(StretchMaxHash, value);
|
||||
}
|
||||
|
||||
public void SetExamineItemTrigger()
|
||||
{
|
||||
animator.SetTrigger(ExamineItemHash);
|
||||
}
|
||||
|
||||
public void ResetExamineItemTrigger()
|
||||
{
|
||||
animator.ResetTrigger(ExamineItemHash);
|
||||
}
|
||||
|
||||
public float TillerDirection
|
||||
{
|
||||
get => animator.GetFloat(TillerDirectionHash);
|
||||
set => animator.SetFloat(TillerDirectionHash, value);
|
||||
}
|
||||
|
||||
public void SetTestTrigger()
|
||||
{
|
||||
animator.SetTrigger(TestTriggerHash);
|
||||
}
|
||||
|
||||
public void ResetTestTrigger()
|
||||
{
|
||||
animator.ResetTrigger(TestTriggerHash);
|
||||
}
|
||||
|
||||
public ThrowModeEnum ThrowMode
|
||||
{
|
||||
get
|
||||
{
|
||||
var val = animator.GetInteger(ThrowModeHash);
|
||||
return (ThrowModeEnum)val;
|
||||
}
|
||||
set => animator.SetInteger(ThrowModeHash, (int)value);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// public FPlayer Player;
|
||||
|
||||
public Animator animator;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
animator = GetComponent<Animator>();
|
||||
}
|
||||
|
||||
|
||||
#region 动画事件回调
|
||||
|
||||
/// <summary>
|
||||
/// 抛竿开始
|
||||
/// </summary>
|
||||
public void RodForceThrowStart()
|
||||
{
|
||||
// if (Player.Fsm.CurrentState is PlayerThrow playerThrow)
|
||||
// {
|
||||
// playerThrow.RodForceThrowStart();
|
||||
// }
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/Fishing2/Mono/PlayerAnimator.cs.meta
Normal file
3
Assets/Scripts/Fishing2/Mono/PlayerAnimator.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cddbe2f2da274f6196485f744b618c86
|
||||
timeCreated: 1756820608
|
||||
58
Assets/Scripts/Fishing2/Mono/PlayerArm.cs
Normal file
58
Assets/Scripts/Fishing2/Mono/PlayerArm.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
using RootMotion.FinalIK;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public class PlayerArm : MonoBehaviour
|
||||
{
|
||||
public bool IsLeft;
|
||||
public LimbIK IK;
|
||||
public Transform RodContainer;
|
||||
public Transform LeftRigMagnet;
|
||||
public FingerRig FingerRig;
|
||||
public PlayerShoulder Shoulder;//PlayerShoulder
|
||||
|
||||
[HideInInspector] public float interactionTargetWeight;
|
||||
|
||||
|
||||
public void SetReelHandle(ReelAsset asset)
|
||||
{
|
||||
IK.solver.target = asset.handle;
|
||||
IK.enabled = true;
|
||||
|
||||
// var fingers = FingerRig.fingers;
|
||||
// foreach (var finger in fingers)
|
||||
// {
|
||||
// finger.target = asset.handleEnd;
|
||||
// }
|
||||
|
||||
// // 启用整体控制
|
||||
// FingerRig.weight = 1f;
|
||||
//
|
||||
// // 绑定大拇指和食指的目标
|
||||
// FingerRig.fingers[0].target = asset.handleEnd; // Thumb
|
||||
// FingerRig.fingers[1].target = asset.handleEnd; // Index
|
||||
//
|
||||
// FingerRig.fingers[0].weight = 1f;
|
||||
// FingerRig.fingers[1].weight = 1f;
|
||||
|
||||
// 其余手指握拳(不绑定 target)
|
||||
for (int i = 2; i < 5; i++)
|
||||
{
|
||||
FingerRig.fingers[i].target = null;
|
||||
FingerRig.fingers[i].weight = 1f;
|
||||
}
|
||||
}
|
||||
|
||||
public void MoveTowardsInteraction()
|
||||
{
|
||||
if (!IK)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
IK.solver.SetIKPositionWeight(Mathf.MoveTowards(IK.solver.IKPositionWeight,
|
||||
interactionTargetWeight, Time.deltaTime * 2f));
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/Fishing2/Mono/PlayerArm.cs.meta
Normal file
3
Assets/Scripts/Fishing2/Mono/PlayerArm.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ed33e261a2784ee0814ceaa6c88aefdf
|
||||
timeCreated: 1756821001
|
||||
37
Assets/Scripts/Fishing2/Mono/PlayerShoulder.cs
Normal file
37
Assets/Scripts/Fishing2/Mono/PlayerShoulder.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public class PlayerShoulder : MonoBehaviour
|
||||
{
|
||||
private Vector3 startEulerAngles;
|
||||
private const int MaxAngle = 30;
|
||||
private const int MinAngle = -30;
|
||||
|
||||
|
||||
public float TestZ;
|
||||
private void Awake()
|
||||
{
|
||||
startEulerAngles = transform.localEulerAngles;
|
||||
}
|
||||
|
||||
public void SetCameraEulerAngleX(float value)
|
||||
{
|
||||
value = (value > 180f) ? value - 360f : value;
|
||||
Debug.Log($"value={value}");
|
||||
var addValue = value * -1;
|
||||
if (addValue > MaxAngle)
|
||||
{
|
||||
addValue = MaxAngle;
|
||||
}
|
||||
else if (addValue < MinAngle)
|
||||
{
|
||||
addValue = MinAngle;
|
||||
}
|
||||
|
||||
transform.localEulerAngles =
|
||||
new Vector3(addValue + startEulerAngles.x, startEulerAngles.y, TestZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/Fishing2/Mono/PlayerShoulder.cs.meta
Normal file
3
Assets/Scripts/Fishing2/Mono/PlayerShoulder.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f85286904d2d45738c4b415f3503d4ab
|
||||
timeCreated: 1756820965
|
||||
62
Assets/Scripts/Fishing2/Move/MoveComponent.cs
Normal file
62
Assets/Scripts/Fishing2/Move/MoveComponent.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
using System.Collections.Generic;
|
||||
using NBC;
|
||||
using NBC.Entitas;
|
||||
using Unity.Mathematics;
|
||||
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
public class MoveComponent : Entity
|
||||
{
|
||||
public float3 PreTarget
|
||||
{
|
||||
get { return this.Targets[this.N - 1]; }
|
||||
}
|
||||
|
||||
public float3 NextTarget
|
||||
{
|
||||
get { return this.Targets[this.N]; }
|
||||
}
|
||||
|
||||
// 开启移动协程的时间
|
||||
public long BeginTime;
|
||||
|
||||
// 每个点的开始时间
|
||||
public long StartTime { get; set; }
|
||||
|
||||
// 开启移动协程的Unit的位置
|
||||
public float3 StartPos;
|
||||
|
||||
public float3 RealPos
|
||||
{
|
||||
get { return this.Targets[0]; }
|
||||
}
|
||||
|
||||
private long needTime;
|
||||
|
||||
public long NeedTime
|
||||
{
|
||||
get { return this.needTime; }
|
||||
set { this.needTime = value; }
|
||||
}
|
||||
|
||||
public long MoveTimer;
|
||||
|
||||
public float Speed; // m/s
|
||||
|
||||
public FTask<bool> tcs;
|
||||
|
||||
public List<float3> Targets = new List<float3>();
|
||||
|
||||
public float3 FinalTarget
|
||||
{
|
||||
get { return this.Targets[^1]; }
|
||||
}
|
||||
|
||||
public int N;
|
||||
public int TurnTime;
|
||||
public bool IsTurnHorizontal;
|
||||
|
||||
public quaternion From;
|
||||
public quaternion To;
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,15 @@
|
||||
using NBC;
|
||||
using NBC.Entitas;
|
||||
using NBC.Entitas.Interface;
|
||||
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
public static class RoleSystem
|
||||
public class Role : Entity
|
||||
{
|
||||
public long RoomId { get; set; }
|
||||
public RoleInfo Info { get; set; }
|
||||
|
||||
|
||||
public class RoleDestroySystem : DestroySystem<Role>
|
||||
{
|
||||
protected override void Destroy(Role self)
|
||||
@@ -14,22 +19,21 @@ namespace NBF.Fishing2
|
||||
}
|
||||
}
|
||||
|
||||
public static async FTask GetRoleInfo(this Role self)
|
||||
public async FTask GetRoleInfo()
|
||||
{
|
||||
var response = (Game2C_GetRoleInfoResponse)await Net.Call(new C2Game_GetRoleInfoRequest());
|
||||
self.RoomId = response.RoomId;
|
||||
self.Info = response.RoleInfo;
|
||||
RoomId = response.RoomId;
|
||||
Info = response.RoleInfo;
|
||||
}
|
||||
|
||||
public static MapUnitInfo GetMapUnitInfo(this Role self)
|
||||
public MapUnitInfo GetMapUnitInfo()
|
||||
{
|
||||
MapUnitInfo mapUnit = new MapUnitInfo();
|
||||
mapUnit.Id = self.Id;
|
||||
mapUnit.Id = Id;
|
||||
mapUnit.RoleInfo = new RoleSimpleInfo()
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
|
||||
return mapUnit;
|
||||
}
|
||||
}
|
||||
@@ -61,5 +61,25 @@ namespace NBF.Fishing2
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
public void SetUnitInfo(MapUnitInfo unitInfo)
|
||||
{
|
||||
NumericComponent numericComponent = AddComponent<NumericComponent>();
|
||||
foreach (var kv in unitInfo.KV)
|
||||
{
|
||||
numericComponent.Set(kv.Key, kv.Value);
|
||||
}
|
||||
}
|
||||
|
||||
public UnitConfig Config()
|
||||
{
|
||||
return UnitConfig.Get(ConfigId);
|
||||
}
|
||||
|
||||
public UnitType UnitType()
|
||||
{
|
||||
return Config().Type;
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/Fishing2/Unit/Unity.meta
Normal file
3
Assets/Scripts/Fishing2/Unit/Unity.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b2120457449841468649709d6b193c35
|
||||
timeCreated: 1756821388
|
||||
49
Assets/Scripts/Fishing2/Unit/Unity/UnitUnityComponent.cs
Normal file
49
Assets/Scripts/Fishing2/Unit/Unity/UnitUnityComponent.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using NBC;
|
||||
using NBC.Entitas;
|
||||
using NBC.Entitas.Interface;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
/// <summary>
|
||||
/// Unit 对应的unity对象组件
|
||||
/// </summary>
|
||||
public class UnitUnityComponent : Entity
|
||||
{
|
||||
public GameObject GameObject { get; set; }
|
||||
|
||||
public Transform Transform { get; set; }
|
||||
|
||||
public Animator Animator { get; set; }
|
||||
|
||||
public async FTask InitUnityObject()
|
||||
{
|
||||
var gameObject = PrefabsHelper.CreatePlayer(SceneSettings.Instance.Node);
|
||||
GameObject = gameObject;
|
||||
Transform = gameObject.transform;
|
||||
Animator = gameObject.GetComponent<Animator>();
|
||||
}
|
||||
|
||||
|
||||
public class UnitUnityComponentDestroySystem : DestroySystem<UnitUnityComponent>
|
||||
{
|
||||
protected override void Destroy(UnitUnityComponent self)
|
||||
{
|
||||
self.Animator = null;
|
||||
self.GameObject = null;
|
||||
self.Transform = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// public static void InitGameObject(this UnitUnityComponent self)
|
||||
// {
|
||||
// var unit = self.Parent as MapUnit;
|
||||
// var prefab = PrefabsHelper.CreatePlayer(SceneSettings.Instance.Node);
|
||||
//
|
||||
// self.GameObject = prefab;
|
||||
// self.Transform = prefab.transform;
|
||||
// self.Animator = prefab.GetComponent<Animator>();
|
||||
// }
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 944bb9e5d3fe4517bc6d12f723f98f87
|
||||
timeCreated: 1756305300
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3148c2caaafd4a099b9bc156fce7a3f7
|
||||
timeCreated: 1756450740
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ce6182010e784256ba7127a8ffa8d056
|
||||
timeCreated: 1756364880
|
||||
@@ -1,39 +0,0 @@
|
||||
using NBC;
|
||||
using NBC.Entitas.Interface;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
public static partial class UnitUnityComponentSystem
|
||||
{
|
||||
public class UnitUnityComponentAwakeSystem : AwakeSystem<UnitUnityComponent>
|
||||
{
|
||||
protected override void Awake(UnitUnityComponent self)
|
||||
{
|
||||
Log.Info("UnitUnityComponentAwakeSystem");
|
||||
self.InitGameObject();
|
||||
}
|
||||
}
|
||||
|
||||
public class UnitUnityComponentDestroySystem : DestroySystem<UnitUnityComponent>
|
||||
{
|
||||
protected override void Destroy(UnitUnityComponent self)
|
||||
{
|
||||
self.Animator = null;
|
||||
self.GameObject = null;
|
||||
self.Transform = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void InitGameObject(this UnitUnityComponent self)
|
||||
{
|
||||
var unit = self.Parent as MapUnit;
|
||||
var prefab = PrefabsHelper.CreatePlayer(SceneSettings.Instance.Node);
|
||||
|
||||
self.GameObject = prefab;
|
||||
self.Transform = prefab.transform;
|
||||
self.Animator = prefab.GetComponent<Animator>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f218930cc1994aaf88752a49dc9aa4b1
|
||||
timeCreated: 1756049422
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a0e14a90077c49ed84df06845dc694f0
|
||||
timeCreated: 1755919232
|
||||
@@ -1,17 +0,0 @@
|
||||
using NBC.Entitas;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
/// <summary>
|
||||
/// Unit 对应的unity对象组件
|
||||
/// </summary>
|
||||
public class UnitUnityComponent : Entity
|
||||
{
|
||||
public GameObject GameObject { get; set; }
|
||||
|
||||
public Transform Transform { get; set; }
|
||||
|
||||
public Animator Animator { get; set; }
|
||||
}
|
||||
}
|
||||
26
Assets/Scripts/Global.cs
Normal file
26
Assets/Scripts/Global.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public class Global : MonoBehaviour
|
||||
{
|
||||
public static Global Instance { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 主摄像机
|
||||
/// </summary>
|
||||
public Camera MainCamera { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 摄像机配置
|
||||
/// </summary>
|
||||
public CameraScriptObject CameraConfig { get; private set; }
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
Instance = this;
|
||||
CameraConfig = Resources.Load<CameraScriptObject>(nameof(CameraConfig));
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/Global.cs.meta
Normal file
3
Assets/Scripts/Global.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 55a2b6b470ce459c8ca8cda7eadb8934
|
||||
timeCreated: 1756823233
|
||||
@@ -45,7 +45,6 @@ namespace NBF
|
||||
|
||||
QualitySettings.vSyncCount = 0;
|
||||
InitLanguage();
|
||||
InitService();
|
||||
InitUI();
|
||||
if (!playVideo)
|
||||
{
|
||||
@@ -98,30 +97,6 @@ namespace NBF
|
||||
|
||||
#endregion
|
||||
|
||||
#region Service
|
||||
|
||||
// private static readonly List<MonoService> Services = new List<MonoService>();
|
||||
private static readonly Dictionary<Type, MonoService> Services = new Dictionary<Type, MonoService>();
|
||||
|
||||
private void AddService<T>() where T : MonoService, new()
|
||||
{
|
||||
var service = this.GetComponent<T>();
|
||||
if (!service)
|
||||
{
|
||||
service = gameObject.AddComponent<T>();
|
||||
}
|
||||
|
||||
Services[typeof(T)] = service;
|
||||
}
|
||||
|
||||
private void InitService()
|
||||
{
|
||||
AddService<InputManager>();
|
||||
AddService<Settings>();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public void StartGame()
|
||||
{
|
||||
PermanentCommon.Init();
|
||||
@@ -135,13 +110,6 @@ namespace NBF
|
||||
private void LoadData()
|
||||
{
|
||||
ConfigAssets.Init();
|
||||
|
||||
// var inventoryManager = GetComponent<InventoryManager>();
|
||||
// if (inventoryManager == null)
|
||||
// {
|
||||
// inventoryManager = gameObject.AddComponent<InventoryManager>();
|
||||
// }
|
||||
//InventoryManager
|
||||
}
|
||||
|
||||
#region New
|
||||
|
||||
@@ -4,7 +4,7 @@ using UnityEngine;
|
||||
|
||||
namespace NBC
|
||||
{
|
||||
public class App : MonoBehaviour
|
||||
public partial class App : MonoBehaviour
|
||||
{
|
||||
public static App Inst { get; private set; }
|
||||
|
||||
|
||||
@@ -13,6 +13,9 @@ namespace NBF.Fishing2
|
||||
Log.Info("OnSceneCreate_Init=== root");
|
||||
scene.AddComponent<ObjectWait>();
|
||||
scene.AddComponent<MapManageComponent>();
|
||||
scene.AddComponent<CameraComponent>();
|
||||
scene.AddComponent<InputComponent>();
|
||||
scene.AddComponent<SettingComponent>();
|
||||
}
|
||||
|
||||
await FTask.CompletedTask;
|
||||
|
||||
Reference in New Issue
Block a user