Explorar el Código

狼的路径规划使用网格限制

lvjincheng hace 4 años
padre
commit
95fe241ec3

+ 285 - 10
Assets/BowArrow/Scenes/GameChallengeScene/GameChallenge.unity

@@ -1534,7 +1534,7 @@ GameObject:
   - component: {fileID: 72051721}
   - component: {fileID: 72051720}
   - component: {fileID: 72051719}
-  m_Layer: 0
+  m_Layer: 3
   m_Name: TreeCollider (3)
   m_TagString: Untagged
   m_Icon: {fileID: 0}
@@ -6404,6 +6404,88 @@ Transform:
   m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: afaa0ff317d7c444f8f9c4c6d1b6a51a, type: 3}
   m_PrefabInstance: {fileID: 275716116}
   m_PrefabAsset: {fileID: 0}
+--- !u!1 &278234151
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 278234152}
+  - component: {fileID: 278234155}
+  - component: {fileID: 278234154}
+  m_Layer: 0
+  m_Name: Sphere
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 0
+--- !u!4 &278234152
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 278234151}
+  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1.2, y: 0.1, z: 1.2}
+  m_Children: []
+  m_Father: {fileID: 720035913}
+  m_RootOrder: 0
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!23 &278234154
+MeshRenderer:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 278234151}
+  m_Enabled: 1
+  m_CastShadows: 1
+  m_ReceiveShadows: 1
+  m_DynamicOccludee: 1
+  m_StaticShadowCaster: 0
+  m_MotionVectors: 1
+  m_LightProbeUsage: 1
+  m_ReflectionProbeUsage: 1
+  m_RayTracingMode: 2
+  m_RayTraceProcedural: 0
+  m_RenderingLayerMask: 1
+  m_RendererPriority: 0
+  m_Materials:
+  - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
+  m_StaticBatchInfo:
+    firstSubMesh: 0
+    subMeshCount: 0
+  m_StaticBatchRoot: {fileID: 0}
+  m_ProbeAnchor: {fileID: 0}
+  m_LightProbeVolumeOverride: {fileID: 0}
+  m_ScaleInLightmap: 1
+  m_ReceiveGI: 1
+  m_PreserveUVs: 0
+  m_IgnoreNormalsForChartDetection: 0
+  m_ImportantGI: 0
+  m_StitchLightmapSeams: 1
+  m_SelectedEditorRenderState: 3
+  m_MinimumChartSize: 4
+  m_AutoUVMaxDistance: 0.5
+  m_AutoUVMaxAngle: 89
+  m_LightmapParameters: {fileID: 0}
+  m_SortingLayerID: 0
+  m_SortingLayer: 0
+  m_SortingOrder: 0
+  m_AdditionalVertexStreams: {fileID: 0}
+--- !u!33 &278234155
+MeshFilter:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 278234151}
+  m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
 --- !u!1 &279869867
 GameObject:
   m_ObjectHideFlags: 0
@@ -6456,6 +6538,7 @@ Transform:
   - {fileID: 1541152743}
   - {fileID: 909015801}
   - {fileID: 1576391957}
+  - {fileID: 720035913}
   m_Father: {fileID: 0}
   m_RootOrder: 4
   m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0}
@@ -6834,7 +6917,7 @@ GameObject:
   - component: {fileID: 293987507}
   - component: {fileID: 293987506}
   - component: {fileID: 293987505}
-  m_Layer: 0
+  m_Layer: 3
   m_Name: TreeCollider (5)
   m_TagString: Untagged
   m_Icon: {fileID: 0}
@@ -14845,7 +14928,7 @@ GameObject:
   - component: {fileID: 662921954}
   - component: {fileID: 662921953}
   - component: {fileID: 662921952}
-  m_Layer: 0
+  m_Layer: 3
   m_Name: TreeCollider
   m_TagString: Untagged
   m_Icon: {fileID: 0}
@@ -15552,6 +15635,149 @@ CanvasRenderer:
   m_PrefabAsset: {fileID: 0}
   m_GameObject: {fileID: 691138087}
   m_CullTransparentMesh: 1
+--- !u!1 &697121820
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 697121821}
+  - component: {fileID: 697121822}
+  - component: {fileID: 697121823}
+  m_Layer: 0
+  m_Name: WolfLineRender
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 0
+--- !u!4 &697121821
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 697121820}
+  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_Children: []
+  m_Father: {fileID: 720035913}
+  m_RootOrder: 1
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!120 &697121822
+LineRenderer:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 697121820}
+  m_Enabled: 1
+  m_CastShadows: 0
+  m_ReceiveShadows: 0
+  m_DynamicOccludee: 1
+  m_StaticShadowCaster: 0
+  m_MotionVectors: 0
+  m_LightProbeUsage: 0
+  m_ReflectionProbeUsage: 0
+  m_RayTracingMode: 0
+  m_RayTraceProcedural: 0
+  m_RenderingLayerMask: 1
+  m_RendererPriority: 0
+  m_Materials:
+  - {fileID: 2100000, guid: 0896d82c8b66c024f87a3637f6644111, type: 2}
+  m_StaticBatchInfo:
+    firstSubMesh: 0
+    subMeshCount: 0
+  m_StaticBatchRoot: {fileID: 0}
+  m_ProbeAnchor: {fileID: 0}
+  m_LightProbeVolumeOverride: {fileID: 0}
+  m_ScaleInLightmap: 1
+  m_ReceiveGI: 1
+  m_PreserveUVs: 0
+  m_IgnoreNormalsForChartDetection: 0
+  m_ImportantGI: 0
+  m_StitchLightmapSeams: 1
+  m_SelectedEditorRenderState: 3
+  m_MinimumChartSize: 4
+  m_AutoUVMaxDistance: 0.5
+  m_AutoUVMaxAngle: 89
+  m_LightmapParameters: {fileID: 0}
+  m_SortingLayerID: 0
+  m_SortingLayer: 0
+  m_SortingOrder: 0
+  m_Positions:
+  - {x: 0, y: 0, z: 0}
+  - {x: 0, y: 0, z: 1}
+  m_Parameters:
+    serializedVersion: 3
+    widthMultiplier: 1
+    widthCurve:
+      serializedVersion: 2
+      m_Curve:
+      - serializedVersion: 3
+        time: 0
+        value: 0.06541168
+        inSlope: 0
+        outSlope: 0
+        tangentMode: 0
+        weightedMode: 0
+        inWeight: 0.33333334
+        outWeight: 0.33333334
+      m_PreInfinity: 2
+      m_PostInfinity: 2
+      m_RotationOrder: 4
+    colorGradient:
+      serializedVersion: 2
+      key0: {r: 1, g: 1, b: 1, a: 1}
+      key1: {r: 1, g: 1, b: 1, a: 1}
+      key2: {r: 1, g: 1, b: 1, a: 1}
+      key3: {r: 1, g: 1, b: 1, a: 1}
+      key4: {r: 1, g: 1, b: 1, a: 1}
+      key5: {r: 1, g: 1, b: 1, a: 1}
+      key6: {r: 1, g: 1, b: 1, a: 0.9411621}
+      key7: {r: 0, g: 0, b: 0, a: 0}
+      ctime0: 0
+      ctime1: 16384
+      ctime2: 32768
+      ctime3: 33924
+      ctime4: 49151
+      ctime5: 50115
+      ctime6: 65535
+      ctime7: 0
+      atime0: 0
+      atime1: 15613
+      atime2: 17348
+      atime3: 18311
+      atime4: 32768
+      atime5: 49151
+      atime6: 50115
+      atime7: 65535
+      m_Mode: 0
+      m_NumColorKeys: 7
+      m_NumAlphaKeys: 8
+    numCornerVertices: 0
+    numCapVertices: 0
+    alignment: 0
+    textureMode: 0
+    shadowBias: 0.5
+    generateLightingData: 0
+  m_UseWorldSpace: 1
+  m_Loop: 0
+--- !u!114 &697121823
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 697121820}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: ee039538a33cc6c409dcf7cea30ea8fc, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
 --- !u!1001 &699895177
 PrefabInstance:
   m_ObjectHideFlags: 0
@@ -15761,6 +15987,55 @@ PrefabInstance:
       objectReference: {fileID: 0}
     m_RemovedComponents: []
   m_SourcePrefab: {fileID: 100100000, guid: 962d29a3f95fdb94abaf02b9e6e30e89, type: 3}
+--- !u!1 &720035912
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 720035913}
+  - component: {fileID: 720035914}
+  m_Layer: 0
+  m_Name: WolfActGrid
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 0
+--- !u!4 &720035913
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 720035912}
+  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_Children:
+  - {fileID: 278234152}
+  - {fileID: 697121821}
+  m_Father: {fileID: 279869869}
+  m_RootOrder: 12
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!114 &720035914
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 720035912}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: f01cb7e6bc8c91642a02b2a836cf2c5b, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  jsonText: {fileID: 4900000, guid: bb5b077914c9e1043947dc9f64556e3a, type: 3}
+  sphereMaterials:
+  - {fileID: 2100000, guid: fc5566de11103b94a9b40926832bed2c, type: 2}
+  - {fileID: 2100000, guid: cbbee1f4f5a61824d838f04095b03582, type: 2}
 --- !u!4 &721551502 stripped
 Transform:
   m_CorrespondingSourceObject: {fileID: 481810, guid: c34dd698ff306f0439f184ee015a6a5e, type: 3}
@@ -20774,7 +21049,7 @@ RectTransform:
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 0}
   m_AnchorMax: {x: 0, y: 0}
-  m_AnchoredPosition: {x: 28.50107, y: 0}
+  m_AnchoredPosition: {x: 29.483395, y: 0}
   m_SizeDelta: {x: 0, y: 33}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!114 &1047161075
@@ -24095,7 +24370,7 @@ RectTransform:
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 0}
   m_AnchorMax: {x: 0, y: 0}
-  m_AnchoredPosition: {x: 28.50107, y: 0}
+  m_AnchoredPosition: {x: 29.483395, y: 0}
   m_SizeDelta: {x: 0, y: 33}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!114 &1203594963
@@ -25885,7 +26160,7 @@ GameObject:
   - component: {fileID: 1306490503}
   - component: {fileID: 1306490502}
   - component: {fileID: 1306490501}
-  m_Layer: 0
+  m_Layer: 3
   m_Name: TreeCollider (6)
   m_TagString: Untagged
   m_Icon: {fileID: 0}
@@ -28745,7 +29020,7 @@ GameObject:
   - component: {fileID: 1441200799}
   - component: {fileID: 1441200798}
   - component: {fileID: 1441200797}
-  m_Layer: 0
+  m_Layer: 3
   m_Name: TreeCollider (2)
   m_TagString: Untagged
   m_Icon: {fileID: 0}
@@ -29018,7 +29293,7 @@ GameObject:
   - component: {fileID: 1451008307}
   - component: {fileID: 1451008306}
   - component: {fileID: 1451008305}
-  m_Layer: 0
+  m_Layer: 3
   m_Name: TreeCollider (4)
   m_TagString: Untagged
   m_Icon: {fileID: 0}
@@ -34223,7 +34498,7 @@ GameObject:
   - component: {fileID: 1730287881}
   - component: {fileID: 1730287880}
   - component: {fileID: 1730287879}
-  m_Layer: 0
+  m_Layer: 3
   m_Name: TreeCollider (1)
   m_TagString: Untagged
   m_Icon: {fileID: 0}
@@ -42362,7 +42637,7 @@ RectTransform:
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 0}
   m_AnchorMax: {x: 0, y: 0}
-  m_AnchoredPosition: {x: 47.00214, y: 0}
+  m_AnchoredPosition: {x: 48.96679, y: 0}
   m_SizeDelta: {x: 0, y: 33}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!114 &2142579590

+ 8 - 0
Assets/BowArrow/Scenes/GameChallengeScene/WoldActGird.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: ee6096d78be438f43b0863327713c05f
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 79 - 0
Assets/BowArrow/Scenes/GameChallengeScene/WoldActGird/SphereColorRed.mat

@@ -0,0 +1,79 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!21 &2100000
+Material:
+  serializedVersion: 6
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_Name: SphereColorRed
+  m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
+  m_ShaderKeywords: 
+  m_LightmapFlags: 4
+  m_EnableInstancingVariants: 0
+  m_DoubleSidedGI: 0
+  m_CustomRenderQueue: -1
+  stringTagMap: {}
+  disabledShaderPasses: []
+  m_SavedProperties:
+    serializedVersion: 3
+    m_TexEnvs:
+    - _BumpMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _DetailAlbedoMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _DetailMask:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _DetailNormalMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _EmissionMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _MainTex:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _MetallicGlossMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _OcclusionMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _ParallaxMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    m_Ints: []
+    m_Floats:
+    - _BumpScale: 1
+    - _Cutoff: 0.5
+    - _DetailNormalMapScale: 1
+    - _DstBlend: 0
+    - _GlossMapScale: 1
+    - _Glossiness: 0.5
+    - _GlossyReflections: 1
+    - _Metallic: 0
+    - _Mode: 0
+    - _OcclusionStrength: 1
+    - _Parallax: 0.02
+    - _SmoothnessTextureChannel: 0
+    - _SpecularHighlights: 1
+    - _SrcBlend: 1
+    - _UVSec: 0
+    - _ZWrite: 1
+    m_Colors:
+    - _Color: {r: 1, g: 0, b: 0, a: 1}
+    - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
+  m_BuildTextureStacks: []

+ 8 - 0
Assets/BowArrow/Scenes/GameChallengeScene/WoldActGird/SphereColorRed.mat.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: cbbee1f4f5a61824d838f04095b03582
+NativeFormatImporter:
+  externalObjects: {}
+  mainObjectFileID: 2100000
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 79 - 0
Assets/BowArrow/Scenes/GameChallengeScene/WoldActGird/SphereColorWhite.mat

@@ -0,0 +1,79 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!21 &2100000
+Material:
+  serializedVersion: 6
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_Name: SphereColorWhite
+  m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
+  m_ShaderKeywords: 
+  m_LightmapFlags: 4
+  m_EnableInstancingVariants: 0
+  m_DoubleSidedGI: 0
+  m_CustomRenderQueue: -1
+  stringTagMap: {}
+  disabledShaderPasses: []
+  m_SavedProperties:
+    serializedVersion: 3
+    m_TexEnvs:
+    - _BumpMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _DetailAlbedoMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _DetailMask:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _DetailNormalMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _EmissionMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _MainTex:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _MetallicGlossMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _OcclusionMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _ParallaxMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    m_Ints: []
+    m_Floats:
+    - _BumpScale: 1
+    - _Cutoff: 0.5
+    - _DetailNormalMapScale: 1
+    - _DstBlend: 0
+    - _GlossMapScale: 1
+    - _Glossiness: 0.5
+    - _GlossyReflections: 1
+    - _Metallic: 0
+    - _Mode: 0
+    - _OcclusionStrength: 1
+    - _Parallax: 0.02
+    - _SmoothnessTextureChannel: 0
+    - _SpecularHighlights: 1
+    - _SrcBlend: 1
+    - _UVSec: 0
+    - _ZWrite: 1
+    m_Colors:
+    - _Color: {r: 1, g: 1, b: 1, a: 1}
+    - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
+  m_BuildTextureStacks: []

+ 8 - 0
Assets/BowArrow/Scenes/GameChallengeScene/WoldActGird/SphereColorWhite.mat.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: fc5566de11103b94a9b40926832bed2c
+NativeFormatImporter:
+  externalObjects: {}
+  mainObjectFileID: 2100000
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 294 - 0
Assets/BowArrow/Scenes/GameChallengeScene/WoldActGird/WolfActGrid.cs

@@ -0,0 +1,294 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using Newtonsoft.Json;
+
+/**
+狼的行动区域,为了避免狼的行动目的坐标重合的问题。 
+*/
+public class WolfActGrid : MonoBehaviour
+{
+    [SerializeField] TextAsset jsonText;
+    JsonConfig config;
+    [System.NonSerialized] public AreaMatrix areaMatrix = new AreaMatrix();
+    [SerializeField] Material[] sphereMaterials;
+
+    public static WolfActGrid ins;
+
+    //调试绘制模式-手动开关
+    bool debugDrawing = false;
+
+    void Awake()
+    {
+        ins = this;
+        areaMatrix.wolfActGrid = this;
+        config = JsonConfig.Load(jsonText.text);
+
+        loadAreaMatrix();
+        // createAreaMatrix();
+    }
+
+    //从配置中加载地域矩阵(前提是有保存在json配置文件内)
+    void loadAreaMatrix() {
+        List<List<Vector3>> posMatrix = areaMatrix.posMatrix = config.GetPosMatrix();
+        config.SetPosMatrixNull();
+        for (int r = 0; r < posMatrix.Count; r++) {
+            for (int c = 0; c < posMatrix[r].Count; c++) {
+                Vector3 pos = posMatrix[r][c];
+                DebugDrawSphere(pos, r, c);
+            }
+        }
+    }
+
+    //动态创建地域矩阵
+    void createAreaMatrix() {
+        float circleRadius = 0.6f;
+        Vector3 standardPosition = transform.position;
+        Vector3 standardPointer = transform.forward;
+        float minAngleY = -20f;
+        float maxAngleY = 23f;
+        for (float distance = 8.5f; distance <= 50f; distance += circleRadius * 2) {
+            List<Vector3> posList = new List<Vector3>();
+            areaMatrix.posMatrix.Add(posList);
+            float sinValue = circleRadius / distance;
+            float deltaAngle = 2f * Mathf.Asin(sinValue) / Mathf.PI * 180f;
+            for (int col = 0; ; col++) {
+                float angleY = minAngleY + deltaAngle * col;
+                if (angleY > maxAngleY) break;
+                Vector3 pointer = Quaternion.AngleAxis(angleY, Vector3.up) * standardPointer; 
+                Vector3 pointerWithLen = pointer * distance;
+                Vector3 newPos =  standardPosition + pointerWithLen;
+                #region 射线检测是否被树遮挡 
+                    float checkRayDistance = 60f;
+                    Vector3 rayPos = newPos;
+                    Vector3 rayDir = Quaternion.AngleAxis(180, Vector3.up) * pointer; 
+                    if (Physics.Raycast(rayPos, rayDir, checkRayDistance, LayerMask.GetMask("Test"))) {
+                        continue;
+                    }
+                    Vector3 pointerWithLen1 = Quaternion.AngleAxis(-deltaAngle / 3f, Vector3.up) * pointerWithLen;
+                    Vector3 rayPos1 = standardPosition + pointerWithLen1;
+                    Vector3 rayDir1 = Quaternion.AngleAxis(180, Vector3.up) * pointerWithLen1; 
+                    if (Physics.Raycast(rayPos1, rayDir1, checkRayDistance, LayerMask.GetMask("Test"))) {
+                        continue;
+                    }
+                    Vector3 pointerWithLen2 = Quaternion.AngleAxis(deltaAngle / 3f, Vector3.up) * pointerWithLen;
+                    Vector3 rayPos2 = standardPosition + pointerWithLen2;
+                    Vector3 rayDir2 = Quaternion.AngleAxis(180, Vector3.up) * pointerWithLen2; 
+                    if (Physics.Raycast(rayPos2, rayDir2, checkRayDistance, LayerMask.GetMask("Test"))) {
+                        continue;
+                    }
+                #endregion
+                posList.Add(newPos);
+                DebugDrawSphere(newPos, areaMatrix.posMatrix.Count - 1, posList.Count - 1);
+            }
+        }
+    }
+
+    void DebugDrawSphere(Vector3 pos, int r, int c) {
+        if (!debugDrawing) return;
+        GameObject sphere = transform.Find("Sphere").gameObject;
+        GameObject o = GameObject.Instantiate(sphere, pos, Quaternion.identity, transform);
+        o.name = r + "_" + c;
+        o.SetActive(true);
+    }
+
+    public void DebugOccupySphere(string name, bool occupy) {
+        if (!debugDrawing) return;
+        transform.Find(name).GetComponent<MeshRenderer>().material = occupy ? sphereMaterials[1] : sphereMaterials[0]; 
+    }
+
+    public class AreaMatrix {
+        public List<List<Vector3>> posMatrix = new List<List<Vector3>>();
+        //格式:"行_列"
+        public Dictionary<object, string> occupyDC = new Dictionary<object, string>();
+
+        public WolfActGrid wolfActGrid;
+
+        //计算水平距离
+        float calDis(Vector3 p1, Vector3 p2) {
+            return Mathf.Sqrt((p1.x - p2.x) * (p1.x - p2.x) + (p1.z - p2.z) * (p1.z - p2.z));  
+        }
+
+        // 占用距离最近的格子,如果最近的被占用则广度优先寻找附近较近的格子
+        public bool occupyPos(Vector3 p, object obj) {
+            float minDis = float.MaxValue;
+            int bestR = 0;
+            int bestC = 0;
+            for (int r = 0; r < posMatrix.Count; r++) {
+                for (int c = 0; c < posMatrix[r].Count; c++) {
+                    Vector3 pos = posMatrix[r][c];
+                    float dis = calDis(pos, p);
+                    if (dis < minDis) {
+                        minDis = dis;
+                        bestR = r;
+                        bestC = c;
+                    }
+                }
+            }
+            object cur_occupy_obj = checkOccupy(bestR, bestC);
+            //如果目标格子被其它对象占用,则过渡优先寻找附近的格子,因为矩阵是扇形,目前的fbs有偏差,但无妨
+            if (cur_occupy_obj != null && !obj.Equals(cur_occupy_obj)) {
+                int sr = bestR;
+                int sc = bestC;
+                List<string> openList = new List<string>(); 
+                openList.Add(sr + "_" + sc);
+                int scanIndex = 1;
+                bool breakBFS = false;
+                while (true) {
+                    int i = 0;
+                    while (i < 8) {
+                        i++;
+                        if (i == 1) { sc++; }
+                        if (i == 2) { sr--; }
+                        if (i == 3) { sc--; }
+                        if (i == 4) { sc--; }
+                        if (i == 5) { sr++; }
+                        if (i == 6) { sr++; }
+                        if (i == 7) { sc++; }
+                        if (i == 8) { sc++; }
+                        if (sr >= 0 && sr < posMatrix.Count && sc >= 0 && sc < posMatrix[sr].Count) {
+                            string keyName = sr + "_" + sc;
+                            if (!openList.Contains(keyName)) {
+                                object now_occupy_obj = checkOccupy(sr, sc);
+                                if (now_occupy_obj == null || obj.Equals(now_occupy_obj)) {
+                                    bestR = sr;
+                                    bestC = sc;
+                                    breakBFS = true;
+                                    break;
+                                }
+                                //加入
+                                openList.Add(keyName);
+                            }
+                        }
+                    }
+                    if (breakBFS) break;
+                    if (scanIndex < openList.Count) {
+                        string[] str = openList[scanIndex].Split('_');
+                        scanIndex++;
+                        sr = int.Parse(str[0]);
+                        sc = int.Parse(str[1]);
+                    } else {
+                        return false;
+                    }
+                }
+            }
+            //找到最佳的格子
+            Vector3 bestPoint = posMatrix[bestR][bestC];
+            p.x = bestPoint.x;
+            p.z = bestPoint.z;
+            //释放自己以前占用的格子
+            releaseOccupy(obj);
+            //占用目标格子
+            Occupy(bestR, bestC, obj);
+            return true;
+        }
+
+        public object checkOccupy(int r, int c) {
+            string keyName = r + "_" + c;
+            foreach (var item in occupyDC)
+            {
+                if (item.Value.Equals(keyName)) return item.Key;   
+            }
+            return null;
+        }
+
+        public void releaseOccupy(object obj) {
+            string keyName = null;
+            occupyDC.TryGetValue(obj, out keyName);
+            if (keyName == null) {
+                return;
+            }
+            occupyDC.Remove(obj);
+            wolfActGrid.DebugOccupySphere(keyName, false);
+        }
+
+        public void Occupy(int r, int c, object obj) {
+            string keyName = r + "_" + c;
+            occupyDC[obj] = keyName;
+            wolfActGrid.DebugOccupySphere(keyName, true);
+            if (!wolfActGrid.debugDrawing) return;
+            if (obj.GetType().Equals(typeof(Wolf))) {
+                Wolf wolf = (Wolf) obj;
+                WolfLineRender wolfLineRender = wolf.GetComponentInChildren<WolfLineRender>();
+                if (!wolfLineRender) {
+                    GameObject prefab = wolfActGrid.transform.Find("WolfLineRender").gameObject;
+                    GameObject o = GameObject.Instantiate(prefab, wolf.transform.position + Vector3.up * 0.8f, Quaternion.identity, wolf.transform);
+                    wolfLineRender = o.GetComponent<WolfLineRender>();
+                    o.SetActive(true);
+                }
+                wolfLineRender.SetDestination(posMatrix[r][c]);
+            }
+        }
+    }
+
+    class JsonConfig {
+        public string posMatrix = null;
+        //清空,避免占用内存
+        public void SetPosMatrixNull() {
+            posMatrix = null;
+        }
+        public List<List<Vector3>> GetPosMatrix() {
+            string[] lines = posMatrix.Split('\n');
+            List<List<Vector3>> list = new List<List<Vector3>>();
+            foreach (var line in lines)
+            {
+                if (line.Trim().Length == 0) continue;
+                string[] vectorStrs = line.Split(' ');
+                List<Vector3> childList = new List<Vector3>();
+                foreach (var vectorStr in vectorStrs)
+                {
+                    string[] valStrs = vectorStr.Split('_');
+                    Vector3 vec = new Vector3(
+                        float.Parse(valStrs[0]),
+                        float.Parse(valStrs[1]),
+                        float.Parse(valStrs[2])
+                    );
+                    childList.Add(vec);
+                }
+                list.Add(childList);
+            }
+            return list;
+        }
+        public void SetPosMatrix(List<List<Vector3>> list) {
+            posMatrix = "";
+            for (int i = 0; i < list.Count; i++) {
+                for (int j = 0; j < list[i].Count; j++) {
+                    Vector3 pos = list[i][j];
+                    posMatrix += pos.x + "_" + pos.y + "_" + pos.z;
+                    if (j < list[i].Count - 1) posMatrix += " ";
+                }
+                if (i < list.Count - 1) posMatrix += "\n";
+            };
+        }
+        public void Write() {
+            string filePath = 
+                "E:\\UnityProject\\SmartBow\\Assets\\BowArrow\\Scenes\\GameChallengeScene\\WolfActGrid.json";
+            if (!System.IO.File.Exists(filePath)) {
+                Debug.LogError("JsonConfig-File-NotExist");
+                return;
+            }
+            try
+            {
+                System.IO.StreamWriter writer = new System.IO.StreamWriter(filePath);
+                writer.Write(JsonConvert.SerializeObject(this));
+                writer.Close();
+            }
+            catch (System.Exception e)
+            {
+                Debug.LogError("JsonConfig-Write-Fail");
+                Debug.LogError(e.Message);
+            }
+        }
+        public static JsonConfig Load(string jsonText) {
+            JsonConfig jsonConfig = JsonConvert.DeserializeObject<JsonConfig>(jsonText);
+            if (jsonConfig == null) jsonConfig = new JsonConfig();
+            return jsonConfig;
+        }
+    }
+
+    [ContextMenu("SaveJsonConfig")]
+    void SaveJsonConfig() {
+        config.SetPosMatrix(areaMatrix.posMatrix);
+        config.Write();
+    }
+}

+ 11 - 0
Assets/BowArrow/Scenes/GameChallengeScene/WoldActGird/WolfActGrid.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: f01cb7e6bc8c91642a02b2a836cf2c5b
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
Assets/BowArrow/Scenes/GameChallengeScene/WoldActGird/WolfActGrid.json


+ 7 - 0
Assets/BowArrow/Scenes/GameChallengeScene/WoldActGird/WolfActGrid.json.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: bb5b077914c9e1043947dc9f64556e3a
+TextScriptImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 21 - 0
Assets/BowArrow/Scenes/GameChallengeScene/WoldActGird/WolfLineRender.cs

@@ -0,0 +1,21 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+/**狼到终点的引导线绘制,调试用的,配合WolfActGrid */
+public class WolfLineRender : MonoBehaviour
+{
+    LineRenderer lineRenderer;
+
+    void Awake() {
+        lineRenderer = GetComponent<LineRenderer>();
+    }
+
+    void Update() {
+        Vector3 src = transform.position;
+        lineRenderer.SetPosition(0, src);
+    }
+
+    public void SetDestination(Vector3 des) {
+        lineRenderer.SetPosition(1, des);
+    }
+}

+ 11 - 0
Assets/BowArrow/Scenes/GameChallengeScene/WoldActGird/WolfLineRender.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: ee039538a33cc6c409dcf7cea30ea8fc
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 79 - 0
Assets/BowArrow/Scenes/GameChallengeScene/WoldActGird/WolfLineRender.mat

@@ -0,0 +1,79 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!21 &2100000
+Material:
+  serializedVersion: 6
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_Name: WolfLineRender
+  m_Shader: {fileID: 10755, guid: 0000000000000000f000000000000000, type: 0}
+  m_ShaderKeywords: 
+  m_LightmapFlags: 4
+  m_EnableInstancingVariants: 0
+  m_DoubleSidedGI: 0
+  m_CustomRenderQueue: -1
+  stringTagMap: {}
+  disabledShaderPasses: []
+  m_SavedProperties:
+    serializedVersion: 3
+    m_TexEnvs:
+    - _BumpMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _DetailAlbedoMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _DetailMask:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _DetailNormalMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _EmissionMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _MainTex:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _MetallicGlossMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _OcclusionMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _ParallaxMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    m_Ints: []
+    m_Floats:
+    - _BumpScale: 1
+    - _Cutoff: 0.5
+    - _DetailNormalMapScale: 1
+    - _DstBlend: 0
+    - _GlossMapScale: 1
+    - _Glossiness: 0.5
+    - _GlossyReflections: 1
+    - _Metallic: 0
+    - _Mode: 0
+    - _OcclusionStrength: 1
+    - _Parallax: 0.02
+    - _SmoothnessTextureChannel: 0
+    - _SpecularHighlights: 1
+    - _SrcBlend: 1
+    - _UVSec: 0
+    - _ZWrite: 1
+    m_Colors:
+    - _Color: {r: 1, g: 0, b: 0, a: 1}
+    - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
+  m_BuildTextureStacks: []

+ 8 - 0
Assets/BowArrow/Scenes/GameChallengeScene/WoldActGird/WolfLineRender.mat.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 0896d82c8b66c024f87a3637f6644111
+NativeFormatImporter:
+  externalObjects: {}
+  mainObjectFileID: 2100000
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 11 - 1
Assets/BowArrow/Scenes/GameChallengeScene/Wolf.cs

@@ -23,7 +23,6 @@ public class Wolf : TargetAnimal
     void Start()
     {
         initAniListener();
-        this.agent.avoidancePriority = avoidancePriority;
     }
     static int _avoidancePriority = 0;
     static int avoidancePriority {
@@ -47,6 +46,10 @@ public class Wolf : TargetAnimal
         UpdateOutline();
     }
 
+    void OnDestroy() {
+        WolfActGrid.ins.areaMatrix.releaseOccupy(this);
+    }
+
     //可选皮肤材质
     [SerializeField] Material[] materials;
     [SerializeField] Material[] outlineMaterials;
@@ -129,11 +132,17 @@ public class Wolf : TargetAnimal
     void SetDestination(Vector3 pos) {
         state.ResetActionState();
         state.moving = true;
+        this.agent.isStopped = false;
+        bool occupySuccess = WolfActGrid.ins.areaMatrix.occupyPos(pos, this);
+        if (!occupySuccess) {
+            pos = transform.position;
+        }
         this.agent.destination = pos;
     }
     //寻路结束
     void OnReachDestination() {
         if (!state.moving) return;
+        this.agent.isStopped = true;
         state.ResetActionState();
     }
     //是否已经接近目的地(寻路完成判断)
@@ -434,6 +443,7 @@ public class Wolf : TargetAnimal
     void Stay(bool correct = false) {
         if (state.moving || correct) {
             this.agent.destination = this.agent.nextPosition;
+            this.agent.isStopped = true;
         }
         state.ResetActionState();
         state.staying = true;

+ 5 - 0
Assets/BowArrow/Scenes/GameChallengeScene/WolfHuntGameMode.cs

@@ -19,6 +19,7 @@ public class WolfHuntGameMode : ChallengeGameMode
 
     public override void Start() {
         UnbanBowReady();
+        GameMgr.ins.transform.Find("WolfActGrid").gameObject.SetActive(true);
         if (nextLevel != null) {
             SetLevel(int.Parse(nextLevel));
             AddHuntGameView();
@@ -76,6 +77,10 @@ public class WolfHuntGameMode : ChallengeGameMode
         animalObject.SetActive(true);
 
         Wolf wolf = animalObject.GetComponent<Wolf>();
+
+        WolfActGrid.ins.areaMatrix.occupyPos(newPos, wolf);
+        wolf.transform.position = newPos;
+
         wolf.hp = animalStyleID == 1 ? 5 : 8;
         wolf.ChangeColorByType(animalStyleID);
         wolf.RotateByWorldY(Random.value * 360);

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio