added jump var changes

change jump to be in update
added audio for AI
This commit is contained in:
Glence 2022-11-25 22:53:38 +08:00
parent 92ce7c96a8
commit 1302a7e58d
5 changed files with 16 additions and 7 deletions

View File

@ -8526,8 +8526,8 @@
moveForce: 50 moveForce: 50
sprintMultiplier: 1.5 sprintMultiplier: 1.5
rotationFactorPerFrame: 5 rotationFactorPerFrame: 5
maxJumpHeight: 1 maxJumpHeight: 2
maxJumpTime: 0.5 maxJumpTime: 0.75
fallMultipler: 3 fallMultipler: 3
lightMultiper: 0.75 lightMultiper: 0.75
mediumMultiper: 0.5 mediumMultiper: 0.5
@ -8633,7 +8633,7 @@
IsActive: true IsActive: true
Renderable Component: Renderable Component:
Mesh: 140964851 Mesh: 140964851
Material: 126974645 Material: 124370424
IsActive: true IsActive: true
RigidBody Component: RigidBody Component:
Type: Dynamic Type: Dynamic
@ -8837,7 +8837,7 @@
IsActive: true IsActive: true
Renderable Component: Renderable Component:
Mesh: 140964851 Mesh: 140964851
Material: 126974645 Material: 124370424
IsActive: true IsActive: true
RigidBody Component: RigidBody Component:
Type: Dynamic Type: Dynamic
@ -9041,7 +9041,7 @@
IsActive: true IsActive: true
Renderable Component: Renderable Component:
Mesh: 140964851 Mesh: 140964851
Material: 126974645 Material: 124370424
IsActive: true IsActive: true
RigidBody Component: RigidBody Component:
Type: Dynamic Type: Dynamic

View File

@ -240,6 +240,8 @@ public partial class LeafPatrol : BehaviourTreeNode
{ {
//Debug.Log("Unalert"); //Debug.Log("Unalert");
Audio.PlaySFXOnce2D("event:/Homeowner/humming"); Audio.PlaySFXOnce2D("event:/Homeowner/humming");
Audio.StopAllSounds();
Audio.PlayBGMOnce2D("event:/Music/player_undetected");
} }
SetNodeData("isAlert", false); SetNodeData("isAlert", false);
} }

View File

@ -186,12 +186,18 @@ public partial class LeafSearch : BehaviourTreeNode
{ {
SetNodeData("isAlert", true); SetNodeData("isAlert", true);
Audio.PlaySFXOnce2D("event:/Homeowner/homeowner_detect_raccoon"); Audio.PlaySFXOnce2D("event:/Homeowner/homeowner_detect_raccoon");
Audio.PlaySFXOnce2D("event:/Music/stingers/player_detected");
Audio.StopAllSounds();
Audio.PlayBGMOnce2D("event:/Music/player_detected");
} }
else else
{ {
if (GetNodeData("isAlert") != null && (bool)GetNodeData("isAlert") == false) if (GetNodeData("isAlert") != null && (bool)GetNodeData("isAlert") == false)
{ {
Audio.PlaySFXOnce2D("event:/Homeowner/homeowner_detect_raccoon"); Audio.PlaySFXOnce2D("event:/Homeowner/homeowner_detect_raccoon");
Audio.PlaySFXOnce2D("event:/Music/stingers/player_detected");
Audio.StopAllSounds();
Audio.PlayBGMOnce2D("event:/Music/player_detected");
} }
SetNodeData("isAlert", true); SetNodeData("isAlert", true);
} }

View File

@ -119,7 +119,6 @@ public class PlayerController : Script
protected override void lateUpdate() protected override void lateUpdate()
{ {
//rb.FreezePositionY = false;
} }
protected override void update() protected override void update()
{ {
@ -152,6 +151,7 @@ public class PlayerController : Script
camArm = GetComponentInChildren<CameraArm>(); camArm = GetComponentInChildren<CameraArm>();
Rotation(); Rotation();
Jump();
GotCaught(); GotCaught();
//Debug.Log($"{currentState}"); //Debug.Log($"{currentState}");
//Debug.Log($" axisX: {axisMove.x} axisY:{axisMove.y}"); //Debug.Log($" axisX: {axisMove.x} axisY:{axisMove.y}");
@ -165,7 +165,6 @@ public class PlayerController : Script
MoveKey(); MoveKey();
Move(); Move();
Sprint(); Sprint();
Jump();
Gravity(); Gravity();
//Debug.Log($"X: {rb.LinearVelocity.x}" + $" Z: {rb.LinearVelocity.z}"); //Debug.Log($"X: {rb.LinearVelocity.x}" + $" Z: {rb.LinearVelocity.z}");
} }

View File

@ -14,12 +14,14 @@ public class EndScene : Script
if (Input.GetKey(Input.KeyCode.R)) if (Input.GetKey(Input.KeyCode.R))
{ {
Audio.PlaySFXOnce2D("event:/UI/mouse_down_element"); Audio.PlaySFXOnce2D("event:/UI/mouse_down_element");
Audio.StopAllSounds();
SceneManager.ChangeScene(mainGameScene); SceneManager.ChangeScene(mainGameScene);
} }
if (Input.GetKey(Input.KeyCode.M)) if (Input.GetKey(Input.KeyCode.M))
{ {
Audio.PlaySFXOnce2D("event:/UI/mouse_down_element"); Audio.PlaySFXOnce2D("event:/UI/mouse_down_element");
Audio.StopAllSounds();
SceneManager.ChangeScene(mainMainScene); SceneManager.ChangeScene(mainMainScene);
} }