Skip to content

Commit

Permalink
修复敌方机器人走路方向错误bug,y轴按钮更改为防御,更新版本3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
664235822 committed Mar 7, 2022
1 parent 3eb6588 commit ba0d2a2
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 72 deletions.
7 changes: 4 additions & 3 deletions Assets/Gizmos/MoveAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ public override TaskStatus OnUpdate()
float distance = Vector3.Distance(transform.position, target.Value.position);
if (distance <= maxDistance.Value && distance > minDistance.Value)
{
transform.Translate((target.Value.position - transform.position).normalized * speed.Value * Time.deltaTime);
GetComponent<ActorController>().anim.SetFloat("forward",1);
transform.position += (target.Value.position - transform.position).normalized * speed.Value * Time.deltaTime;
transform.LookAt(target.Value);
GetComponent<ActorController>().anim.SetFloat("forward", 1);
return TaskStatus.Running;
}
else
{
GetComponent<ActorController>().anim.SetFloat("forward",0);
GetComponent<ActorController>().anim.SetFloat("forward", 0);
return TaskStatus.Failure;
}
}
Expand Down
26 changes: 14 additions & 12 deletions Assets/Scenes/GameScene.unity

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions Packages/manifest.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"dependencies": {
"com.unity.collab-proxy": "1.15.7",
"com.unity.ide.rider": "3.0.9",
"com.unity.ide.visualstudio": "2.0.12",
"com.unity.ide.vscode": "1.2.4",
"com.unity.collab-proxy": "1.15.12",
"com.unity.ide.rider": "3.0.12",
"com.unity.ide.visualstudio": "2.0.14",
"com.unity.ide.vscode": "1.2.5",
"com.unity.postprocessing": "3.2.0",
"com.unity.test-framework": "1.1.29",
"com.unity.textmeshpro": "3.0.6",
"com.unity.timeline": "1.6.3",
"com.unity.timeline": "1.6.4",
"com.unity.ugui": "1.0.0",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",
Expand Down
18 changes: 5 additions & 13 deletions Packages/packages-lock.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"dependencies": {
"com.unity.collab-proxy": {
"version": "1.15.7",
"version": "1.15.12",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.nuget.newtonsoft-json": "2.0.0",
"com.unity.services.core": "1.0.1"
},
"url": "https://packages.unity.cn"
Expand All @@ -18,7 +17,7 @@
"url": "https://packages.unity.cn"
},
"com.unity.ide.rider": {
"version": "3.0.9",
"version": "3.0.12",
"depth": 0,
"source": "registry",
"dependencies": {
Expand All @@ -27,7 +26,7 @@
"url": "https://packages.unity.cn"
},
"com.unity.ide.visualstudio": {
"version": "2.0.12",
"version": "2.0.14",
"depth": 0,
"source": "registry",
"dependencies": {
Expand All @@ -36,19 +35,12 @@
"url": "https://packages.unity.cn"
},
"com.unity.ide.vscode": {
"version": "1.2.4",
"version": "1.2.5",
"depth": 0,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.cn"
},
"com.unity.nuget.newtonsoft-json": {
"version": "2.0.0",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.cn"
},
"com.unity.postprocessing": {
"version": "3.2.0",
"depth": 0,
Expand Down Expand Up @@ -88,7 +80,7 @@
"url": "https://packages.unity.cn"
},
"com.unity.timeline": {
"version": "1.6.3",
"version": "1.6.4",
"depth": 0,
"source": "registry",
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions ProjectSettings/InputManager.asset
Git LFS file not shown
2 changes: 1 addition & 1 deletion ProjectSettings/ProjectSettings.asset
Git LFS file not shown
4 changes: 2 additions & 2 deletions ProjectSettings/ProjectVersion.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
m_EditorVersion: 2021.2.9f1c1
m_EditorVersionWithRevision: 2021.2.9f1c1 (4627e78ce1f7)
m_EditorVersion: 2021.2.14f1c1
m_EditorVersionWithRevision: 2021.2.14f1c1 (7c06c4af091b)
68 changes: 34 additions & 34 deletions UserSettings/Layouts/default-2021.dwlt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ MonoBehaviour:
width: 2560
height: 1349.3334
m_ShowMode: 4
m_Title: Game
m_Title: Hierarchy
m_RootView: {fileID: 6}
m_MinSize: {x: 875, y: 300}
m_MaxSize: {x: 10000, y: 10000}
Expand Down Expand Up @@ -48,7 +48,7 @@ MonoBehaviour:
m_MinSize: {x: 300, y: 200}
m_MaxSize: {x: 24288, y: 16192}
vertical: 0
controlID: 16
controlID: 26
--- !u!114 &3
MonoBehaviour:
m_ObjectHideFlags: 52
Expand Down Expand Up @@ -223,7 +223,7 @@ MonoBehaviour:
m_MinSize: {x: 200, y: 200}
m_MaxSize: {x: 16192, y: 16192}
vertical: 1
controlID: 17
controlID: 16
--- !u!114 &10
MonoBehaviour:
m_ObjectHideFlags: 52
Expand All @@ -248,7 +248,7 @@ MonoBehaviour:
m_MinSize: {x: 200, y: 100}
m_MaxSize: {x: 16192, y: 8096}
vertical: 0
controlID: 18
controlID: 17
--- !u!114 &11
MonoBehaviour:
m_ObjectHideFlags: 52
Expand All @@ -259,7 +259,7 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0}
m_Name: GameView
m_Name: SceneView
m_EditorClassIdentifier:
m_Children: []
m_Position:
Expand All @@ -270,12 +270,12 @@ MonoBehaviour:
height: 770.6667
m_MinSize: {x: 202, y: 221}
m_MaxSize: {x: 4002, y: 4021}
m_ActualView: {fileID: 16}
m_ActualView: {fileID: 15}
m_Panes:
- {fileID: 15}
- {fileID: 16}
m_Selected: 1
m_LastSelected: 0
m_Selected: 0
m_LastSelected: 1
--- !u!114 &12
MonoBehaviour:
m_ObjectHideFlags: 52
Expand Down Expand Up @@ -331,9 +331,9 @@ MonoBehaviour:
m_IsLocked: 0
m_FolderTreeState:
scrollPos: {x: 0, y: 0}
m_SelectedIDs: 16a90000
m_LastClickedID: 43286
m_ExpandedIDs: 0000000098a8000000ca9a3b
m_SelectedIDs: 48a90000
m_LastClickedID: 43336
m_ExpandedIDs: 0000000094a8000000ca9a3b
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
Expand Down Expand Up @@ -361,7 +361,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0}
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: 0000000098a80000
m_ExpandedIDs: 0000000094a80000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
Expand All @@ -388,7 +388,7 @@ MonoBehaviour:
m_ListAreaState:
m_SelectedInstanceIDs:
m_LastClickedInstanceID: 0
m_HadKeyboardFocusLastEvent: 0
m_HadKeyboardFocusLastEvent: 1
m_ExpandedInstanceIDs: c6230000
m_RenameOverlay:
m_UserAcceptedRename: 0
Expand All @@ -405,7 +405,7 @@ MonoBehaviour:
m_IsRenaming: 0
m_OriginalEventType: 11
m_IsRenamingFilename: 1
m_ClientGUIView: {fileID: 0}
m_ClientGUIView: {fileID: 5}
m_CreateAssetUtility:
m_EndAction: {fileID: 0}
m_InstanceID: 0
Expand Down Expand Up @@ -453,7 +453,7 @@ MonoBehaviour:
m_ControlHash: -371814159
m_PrefName: Preview_InspectorPreview
m_LastInspectedObjectInstanceID: -1
m_LastVerticalScrollValue: 1374
m_LastVerticalScrollValue: 0
m_GlobalObjectId:
m_InspectorMode: 0
m_LockTracker:
Expand Down Expand Up @@ -491,8 +491,8 @@ MonoBehaviour:
m_SceneHierarchy:
m_TreeViewState:
scrollPos: {x: 0, y: 0}
m_SelectedIDs: 568f0000
m_LastClickedID: 36694
m_SelectedIDs: 86930000
m_LastClickedID: 37766
m_ExpandedIDs: 0cfbffff
m_RenameOverlay:
m_UserAcceptedRename: 0
Expand Down Expand Up @@ -743,9 +743,9 @@ MonoBehaviour:
m_PlayAudio: 0
m_AudioPlay: 0
m_Position:
m_Target: {x: 2.428607, y: 0.69992924, z: -45.185333}
m_Target: {x: 1.989234, y: 1.3050522, z: -5.595991}
speed: 2
m_Value: {x: 2.428607, y: 0.69992924, z: -45.185333}
m_Value: {x: 1.9893636, y: 1.3051155, z: -5.5959907}
m_RenderMode: 0
m_CameraMode:
drawMode: 0
Expand Down Expand Up @@ -784,21 +784,21 @@ MonoBehaviour:
m_Fade:
m_Target: 0
speed: 2
m_Value: 0
m_Value: 1
m_Color: {r: 0.5, g: 0.5, b: 0.5, a: 0.4}
m_Pivot: {x: 0, y: 0, z: 0}
m_Size: {x: 0, y: 0}
m_Size: {x: 1, y: 1}
m_ShowGrid: 1
m_GridAxis: 1
m_gridOpacity: 0.5
m_Rotation:
m_Target: {x: -0.08717229, y: 0.89959055, z: -0.21045254, w: -0.3726226}
speed: 2
m_Value: {x: -0.08717229, y: 0.89959055, z: -0.21045254, w: -0.3726226}
m_Value: {x: 0.08717225, y: -0.89959013, z: 0.21045244, w: 0.3726236}
m_Size:
m_Target: 2.211893
m_Target: 1.6971612
speed: 2
m_Value: 2.211893
m_Value: 1.6973842
m_Ortho:
m_Target: 0
speed: 2
Expand All @@ -816,7 +816,7 @@ MonoBehaviour:
m_FarClip: 10000
m_DynamicClip: 1
m_OcclusionCulling: 0
m_LastSceneViewRotation: {x: 0, y: 0, z: 0, w: 0}
m_LastSceneViewRotation: {x: -0.08717229, y: 0.89959055, z: -0.21045254, w: -0.3726226}
m_LastSceneViewOrtho: 0
m_ReplacementShader: {fileID: 0}
m_ReplacementString:
Expand Down Expand Up @@ -858,7 +858,7 @@ MonoBehaviour:
m_ShowGizmos: 0
m_TargetDisplay: 0
m_ClearColor: {r: 0, g: 0, b: 0, a: 0}
m_TargetSize: {x: 2205, y: 1093}
m_TargetSize: {x: 1470, y: 728.6667}
m_TextureFilterMode: 0
m_TextureHideFlags: 61
m_RenderIMGUI: 1
Expand All @@ -873,10 +873,10 @@ MonoBehaviour:
m_VRangeLocked: 0
hZoomLockedByDefault: 0
vZoomLockedByDefault: 0
m_HBaseRangeMin: -735
m_HBaseRangeMax: 735
m_VBaseRangeMin: -364.33334
m_VBaseRangeMax: 364.33334
m_HBaseRangeMin: -490
m_HBaseRangeMax: 490
m_VBaseRangeMin: -242.8889
m_VBaseRangeMax: 242.8889
m_HAllowExceedBaseRangeMin: 1
m_HAllowExceedBaseRangeMax: 1
m_VAllowExceedBaseRangeMin: 1
Expand Down Expand Up @@ -937,10 +937,10 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 2249
y: 726.5
width: 920
height: 250
x: 0
y: 843.3334
width: 1955
height: 507.6667
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
Expand Down

0 comments on commit ba0d2a2

Please sign in to comment.