Added particle and bug fixes #437

Merged
glencelow merged 7 commits from PlayerController into main 2023-03-24 16:09:43 +08:00
9 changed files with 172 additions and 11 deletions
Showing only changes of commit 64bbc4d67a - Show all commits

View File

@ -7501,7 +7501,7 @@
- EID: 65775 - EID: 65775
Name: Player Name: Player
IsActive: true IsActive: true
NumberOfChildren: 6 NumberOfChildren: 8
Components: Components:
Transform Component: Transform Component:
Translate: {x: -8, y: 0.899999976, z: -4} Translate: {x: -8, y: 0.899999976, z: -4}
@ -7547,6 +7547,7 @@
Scripts: Scripts:
- Type: PlayerController - Type: PlayerController
Enabled: true Enabled: true
smokeCount: 4
respawnPoint: 65732 respawnPoint: 65732
currentState: 0 currentState: 0
walkMaxMoveVel: 2.5 walkMaxMoveVel: 2.5
@ -7565,6 +7566,8 @@
heavyMultiper: 0.5 heavyMultiper: 0.5
silhouettePlayer: 462 silhouettePlayer: 462
silhouetteBag: 465 silhouetteBag: 465
leftParticle: 573
rightParticle: 574
- Type: PickAndThrow - Type: PickAndThrow
Enabled: true Enabled: true
throwForce: [8, 4, 8] throwForce: [8, 4, 8]
@ -7723,6 +7726,66 @@
"Color Eval Rate ": 0.5 "Color Eval Rate ": 0.5
IsActive: true IsActive: true
Scripts: ~ Scripts: ~
- EID: 573
Name: LeftSmoke
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0.0899999142, y: 0.100000001, z: -6.25735765e-08}
Rotate: {x: -5.83341553e-08, y: -3.14159274, z: 1.10461471e-08}
Scale: {x: 1.00000012, y: 1, z: 1.00000012}
IsActive: true
classSHADE::SHParticleEmitterComponent:
Emission Count: 8
Is Passive: false
Emission Interval: 0
Min Life: 0.100000001
Max Life: 2
Minimum Speed: 1
Maximum Speed: 1.5
Minimum Size: 0.100000001
Maximum Size: 0.100000001
Size Decay: 0.907000005
Angular Ranges And Offset: {x: 0.779999971, y: 0, z: -1.57070005, w: 0}
Rotation Speed: 0.805999994
Rotation Decay: 0
Texture Asset ID: 56224060
Custom Update Shader Asset ID: 42141152
Color Tint: {x: 1, y: 1, z: 1, w: 1}
Acceleration: {x: 0, y: 0.0500000007, z: 0}
IsActive: true
Scripts: ~
- EID: 574
Name: RightSmoke
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -0.0900000036, y: 0.100000001, z: -1.03427794e-07}
Rotate: {x: -5.83341553e-08, y: -3.14159274, z: 1.10461471e-08}
Scale: {x: 1.00000012, y: 1, z: 1.00000012}
IsActive: true
classSHADE::SHParticleEmitterComponent:
Emission Count: 8
Is Passive: false
Emission Interval: 0
Min Life: 0.100000001
Max Life: 2
Minimum Speed: 1
Maximum Speed: 1.5
Minimum Size: 0.100000001
Maximum Size: 0.100000001
Size Decay: 0.907000005
Angular Ranges And Offset: {x: 0.779999971, y: 0, z: -1.57070005, w: 0}
Rotation Speed: 0.805999994
Rotation Decay: 0
Texture Asset ID: 56224060
Custom Update Shader Asset ID: 42141152
Color Tint: {x: 1, y: 1, z: 1, w: 1}
Acceleration: {x: 0, y: 0.0500000007, z: 0}
IsActive: true
Scripts: ~
- EID: 65732 - EID: 65732
Name: RespawnPoint Name: RespawnPoint
IsActive: true IsActive: true

View File

@ -11964,7 +11964,7 @@
- EID: 65775 - EID: 65775
Name: Player Name: Player
IsActive: true IsActive: true
NumberOfChildren: 6 NumberOfChildren: 8
Components: Components:
Transform Component: Transform Component:
Translate: {x: 5.5, y: 0.171148509, z: 10} Translate: {x: 5.5, y: 0.171148509, z: 10}
@ -12010,6 +12010,7 @@
Scripts: Scripts:
- Type: PlayerController - Type: PlayerController
Enabled: true Enabled: true
smokeCount: 4
respawnPoint: 66065 respawnPoint: 66065
currentState: 0 currentState: 0
walkMaxMoveVel: 2.5 walkMaxMoveVel: 2.5
@ -12028,6 +12029,8 @@
heavyMultiper: 0.5 heavyMultiper: 0.5
silhouettePlayer: 462 silhouettePlayer: 462
silhouetteBag: 465 silhouetteBag: 465
leftParticle: 66138
rightParticle: 66137
- Type: PickAndThrow - Type: PickAndThrow
Enabled: true Enabled: true
throwForce: [10, 4, 10] throwForce: [10, 4, 10]
@ -12182,6 +12185,66 @@
"Color Eval Rate ": 0.5 "Color Eval Rate ": 0.5
IsActive: true IsActive: true
Scripts: ~ Scripts: ~
- EID: 66138
Name: LeftSmoke
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0.0899999142, y: 0.100000001, z: -6.25735765e-08}
Rotate: {x: -5.83341553e-08, y: -3.14159274, z: 1.10461471e-08}
Scale: {x: 1.00000012, y: 1, z: 1.00000012}
IsActive: true
classSHADE::SHParticleEmitterComponent:
Emission Count: 8
Is Passive: false
Emission Interval: 0
Min Life: 0.100000001
Max Life: 2
Minimum Speed: 1
Maximum Speed: 1.5
Minimum Size: 0.100000001
Maximum Size: 0.100000001
Size Decay: 0.907000005
Angular Ranges And Offset: {x: 0.779999971, y: 0, z: -1.57070005, w: 0}
Rotation Speed: 0.805999994
Rotation Decay: 0
Texture Asset ID: 56224060
Custom Update Shader Asset ID: 42141152
Color Tint: {x: 1, y: 1, z: 1, w: 1}
Acceleration: {x: 0, y: 0.0500000007, z: 0}
IsActive: true
Scripts: ~
- EID: 66137
Name: RightSmoke
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -0.0900000036, y: 0.100000001, z: -1.03427794e-07}
Rotate: {x: -5.83341553e-08, y: -3.14159274, z: 1.10461471e-08}
Scale: {x: 1.00000012, y: 1, z: 1.00000012}
IsActive: true
classSHADE::SHParticleEmitterComponent:
Emission Count: 8
Is Passive: false
Emission Interval: 0
Min Life: 0.100000001
Max Life: 2
Minimum Speed: 1
Maximum Speed: 1.5
Minimum Size: 0.100000001
Maximum Size: 0.100000001
Size Decay: 0.907000005
Angular Ranges And Offset: {x: 0.779999971, y: 0, z: -1.57070005, w: 0}
Rotation Speed: 0.805999994
Rotation Decay: 0
Texture Asset ID: 56224060
Custom Update Shader Asset ID: 42141152
Color Tint: {x: 1, y: 1, z: 1, w: 1}
Acceleration: {x: 0, y: 0.0500000007, z: 0}
IsActive: true
Scripts: ~
- EID: 66065 - EID: 66065
Name: RespawnPoint Name: RespawnPoint
IsActive: true IsActive: true

View File

@ -25,6 +25,7 @@ public class Item : Script
private bool checkSound = false; private bool checkSound = false;
private bool homeownerOnce = true;
public float soundDistance = 10; public float soundDistance = 10;
private float highlightPos = 0.0f; private float highlightPos = 0.0f;
@ -98,8 +99,11 @@ public class Item : Script
rb.ClearTorque(); rb.ClearTorque();
} }
if(transform) if (transform)
{
transform.LocalEulerAngles = Vector3.Zero;
transform.LocalPosition = firstPostion; transform.LocalPosition = firstPostion;
}
returnBack = false; returnBack = false;
} }
@ -143,11 +147,11 @@ public class Item : Script
if(emitter) if(emitter)
emitter.Emit(); emitter.Emit();
Debug.Log("EMIT");
} }
if (info.GameObject.GetScript<Homeowner1>() && !returnBack) if (info.GameObject.GetScript<Homeowner1>() && homeownerOnce)
{ {
homeownerOnce = false;
returnBack = true; returnBack = true;
} }
} }
@ -156,6 +160,7 @@ public class Item : Script
{ {
playSound = true; playSound = true;
checkSound = true; checkSound = true;
homeownerOnce = true;
} }
} }

View File

@ -15,8 +15,11 @@ public class PlayerRunState : BaseState
public override void OnEnter() public override void OnEnter()
{ {
//Debug.Log("WALK ENTER"); //Debug.Log("WALK ENTER");
AudioHandler.audioClipHandlers["footsteps"].Play();
timer = delay; timer = delay;
machine.GetScript<PlayerController>().playLandedAnimation = false;
machine.GetScript<PlayerController>().Leftsmoke.EmissionCount = machine.GetScript<PlayerController>().smokeCount * 4;
machine.GetScript<PlayerController>().Rightsmoke.EmissionCount = machine.GetScript<PlayerController>().smokeCount * 4;
if (PlayerAnimations.Instance) if (PlayerAnimations.Instance)
{ {
PlayerAnimations.Instance.playerAnimator.Play(PlayerAnimations.Instance.playerRunClip); PlayerAnimations.Instance.playerAnimator.Play(PlayerAnimations.Instance.playerRunClip);

View File

@ -15,6 +15,8 @@ public class PlayerWalkState : BaseState
{ {
//Debug.Log("WALK ENTER"); //Debug.Log("WALK ENTER");
timer = delay; timer = delay;
machine.GetScript<PlayerController>().Leftsmoke.EmissionCount = machine.GetScript<PlayerController>().smokeCount;
machine.GetScript<PlayerController>().Rightsmoke.EmissionCount = machine.GetScript<PlayerController>().smokeCount;
machine.GetScript<PlayerController>().playLandedAnimation = false; machine.GetScript<PlayerController>().playLandedAnimation = false;

View File

@ -26,6 +26,7 @@ public class PlayerController : Script
public StateMachine stateMachine { get; set; } public StateMachine stateMachine { get; set; }
public ParticleEmitter Leftsmoke { get; set; } public ParticleEmitter Leftsmoke { get; set; }
public ParticleEmitter Rightsmoke { get; set; } public ParticleEmitter Rightsmoke { get; set; }
public int smokeCount = 4;
public bool holdItem { get; set; } public bool holdItem { get; set; }
public bool isAiming { get; set; } public bool isAiming { get; set; }
@ -222,7 +223,6 @@ public class PlayerController : Script
} }
} }
GotCaught(); GotCaught();
Rotation(); Rotation();
MoveKey(); MoveKey();
@ -305,11 +305,11 @@ public class PlayerController : Script
private void Move() private void Move()
{ {
if (rb != null && currentState != RaccoonStates.CAUGHT) if (rb && currentState != RaccoonStates.CAUGHT)
{ {
rb.LinearVelocity += new Vector3(axisMove.x * moveForce, 0.0f, axisMove.y * moveForce) * Time.DeltaTimeF; rb.LinearVelocity += new Vector3(axisMove.x * moveForce, 0.0f, axisMove.y * moveForce) * Time.DeltaTimeF;
if (isMoveKeyPress && rb) if (isMoveKeyPress)
{ {
Vector3 velNor = rb.LinearVelocity; Vector3 velNor = rb.LinearVelocity;
velNor.y = 0.0f; velNor.y = 0.0f;
@ -348,6 +348,13 @@ public class PlayerController : Script
} }
} }
if (Input.GetKey(Input.KeyCode.LeftShift) && !isMoveKeyPress && isGrounded)
{
currentState = RaccoonStates.IDLE;
if (stateMachine && !stateMachine.IsState(typeof(PlayerIdleState)))
stateMachine.SetState(typeof(PlayerIdleState));
}
if (Input.GetKeyUp(Input.KeyCode.LeftShift)) if (Input.GetKeyUp(Input.KeyCode.LeftShift))
{ {
if (isMoveKeyPress && isGrounded) if (isMoveKeyPress && isGrounded)
@ -356,7 +363,7 @@ public class PlayerController : Script
if (stateMachine && !stateMachine.IsState(typeof(PlayerWalkState))) if (stateMachine && !stateMachine.IsState(typeof(PlayerWalkState)))
stateMachine.SetState(typeof(PlayerWalkState)); stateMachine.SetState(typeof(PlayerWalkState));
} }
else if(!isMoveKeyPress && isGrounded) else if (!isMoveKeyPress && isGrounded)
{ {
currentState = RaccoonStates.IDLE; currentState = RaccoonStates.IDLE;
if (stateMachine && !stateMachine.IsState(typeof(PlayerIdleState))) if (stateMachine && !stateMachine.IsState(typeof(PlayerIdleState)))
@ -496,6 +503,7 @@ public class PlayerController : Script
if (holdItem) if (holdItem)
{ {
holdItem = false; holdItem = false;
Debug.Log("PLAYER RETURN");
pat.item.GetScript<Item>().returnBack = true; pat.item.GetScript<Item>().returnBack = true;
} }
if (isAiming) if (isAiming)

View File

@ -316,7 +316,8 @@ namespace SHADE
// Error handling // Error handling
if (!SHEntityManager::IsValidEID(entityID)) if (!SHEntityManager::IsValidEID(entityID))
{ {
SHLOG_ERROR("Entity {} is invalid!", entityID) //geting spamed called, need to look into it
SHLOG_ERROR_D("Entity {} is invalid!", entityID)
return; return;
} }

View File

@ -17,6 +17,16 @@ namespace SHADE
} }
System::Int32 ParticleEmitter::EmissionCount::get()
{
return (GetNativeComponent()->GetEmissionCount());
}
void ParticleEmitter::EmissionCount::set(System::Int32 val)
{
GetNativeComponent()->SetEmissionCount(val);
}
float ParticleEmitter::EmissionInterval::get() float ParticleEmitter::EmissionInterval::get()
{ {
return (GetNativeComponent()->GetEmissionInterval()); return (GetNativeComponent()->GetEmissionInterval());

View File

@ -24,6 +24,12 @@ namespace SHADE
void set(bool val); void set(bool val);
} }
property System::Int32 EmissionCount
{
System::Int32 get();
void set(System::Int32 val);
}
property float EmissionInterval property float EmissionInterval
{ {
float get(); float get();