did left and right foot smoke
This commit is contained in:
parent
f4d361e1e9
commit
6ddc5c35cb
|
@ -2899,7 +2899,7 @@
|
||||||
- EID: 2
|
- EID: 2
|
||||||
Name: Player
|
Name: Player
|
||||||
IsActive: true
|
IsActive: true
|
||||||
NumberOfChildren: 7
|
NumberOfChildren: 8
|
||||||
Components:
|
Components:
|
||||||
Transform Component:
|
Transform Component:
|
||||||
Translate: {x: 2.35245037, y: 0.0613552481, z: 7.10571432}
|
Translate: {x: 2.35245037, y: 0.0613552481, z: 7.10571432}
|
||||||
|
@ -2963,6 +2963,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: [10, 4, 10]
|
throwForce: [10, 4, 10]
|
||||||
|
@ -3118,17 +3120,17 @@
|
||||||
IsActive: true
|
IsActive: true
|
||||||
Scripts: ~
|
Scripts: ~
|
||||||
- EID: 573
|
- EID: 573
|
||||||
Name: Smoke
|
Name: LeftSmoke
|
||||||
IsActive: true
|
IsActive: true
|
||||||
NumberOfChildren: 0
|
NumberOfChildren: 0
|
||||||
Components:
|
Components:
|
||||||
Transform Component:
|
Transform Component:
|
||||||
Translate: {x: -0.00712490082, y: 0.056717217, z: -0.0870996416}
|
Translate: {x: 0.0899999142, y: 0.100000001, z: -6.25735765e-08}
|
||||||
Rotate: {x: -5.83341553e-08, y: -3.14159274, z: 1.10461471e-08}
|
Rotate: {x: -5.83341553e-08, y: -3.14159274, z: 1.10461471e-08}
|
||||||
Scale: {x: 1.00000012, y: 1, z: 1.00000012}
|
Scale: {x: 1.00000012, y: 1, z: 1.00000012}
|
||||||
IsActive: true
|
IsActive: true
|
||||||
classSHADE::SHParticleEmitterComponent:
|
classSHADE::SHParticleEmitterComponent:
|
||||||
Emission Count: 2
|
Emission Count: 8
|
||||||
Is Passive: false
|
Is Passive: false
|
||||||
Emission Interval: 0
|
Emission Interval: 0
|
||||||
Min Life: 0.100000001
|
Min Life: 0.100000001
|
||||||
|
@ -3144,7 +3146,37 @@
|
||||||
Texture Asset ID: 56224060
|
Texture Asset ID: 56224060
|
||||||
Custom Update Shader Asset ID: 42141152
|
Custom Update Shader Asset ID: 42141152
|
||||||
Color Tint: {x: 1, y: 1, z: 1, w: 1}
|
Color Tint: {x: 1, y: 1, z: 1, w: 1}
|
||||||
Acceleration: {x: 0, y: 0, z: 0}
|
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
|
IsActive: true
|
||||||
Scripts: ~
|
Scripts: ~
|
||||||
- EID: 239
|
- EID: 239
|
||||||
|
|
|
@ -6,6 +6,7 @@ public class PlayerRunState : BaseState
|
||||||
{
|
{
|
||||||
private float timer;
|
private float timer;
|
||||||
private float delay = 0.25f;
|
private float delay = 0.25f;
|
||||||
|
private bool left = true;
|
||||||
|
|
||||||
public PlayerRunState(StateMachine stateMachine) : base(stateMachine)
|
public PlayerRunState(StateMachine stateMachine) : base(stateMachine)
|
||||||
{
|
{
|
||||||
|
@ -15,6 +16,7 @@ public class PlayerRunState : BaseState
|
||||||
{
|
{
|
||||||
//Debug.Log("WALK ENTER");
|
//Debug.Log("WALK ENTER");
|
||||||
AudioHandler.audioClipHandlers["footsteps"].Play();
|
AudioHandler.audioClipHandlers["footsteps"].Play();
|
||||||
|
timer = delay;
|
||||||
if (PlayerAnimations.Instance)
|
if (PlayerAnimations.Instance)
|
||||||
{
|
{
|
||||||
PlayerAnimations.Instance.playerAnimator.Play(PlayerAnimations.Instance.playerRunClip);
|
PlayerAnimations.Instance.playerAnimator.Play(PlayerAnimations.Instance.playerRunClip);
|
||||||
|
@ -30,8 +32,28 @@ public class PlayerRunState : BaseState
|
||||||
|
|
||||||
if (timer > delay)
|
if (timer > delay)
|
||||||
{
|
{
|
||||||
|
if (left)
|
||||||
|
{
|
||||||
|
if (machine.GetScript<PlayerController>().tranform.LocalEulerAngles.y > 0.0f)
|
||||||
|
machine.GetScript<PlayerController>().Leftsmoke.AngularOffsets = new Vector2(machine.GetScript<PlayerController>().tranform.LocalEulerAngles.y - (MathF.PI * 1.5f), machine.GetScript<PlayerController>().Leftsmoke.AngularOffsets.y);
|
||||||
|
else
|
||||||
|
machine.GetScript<PlayerController>().Leftsmoke.AngularOffsets = new Vector2(machine.GetScript<PlayerController>().tranform.LocalEulerAngles.y + (MathF.PI * 0.5f), machine.GetScript<PlayerController>().Leftsmoke.AngularOffsets.y);
|
||||||
|
|
||||||
|
machine.GetScript<PlayerController>().Leftsmoke.Emit();
|
||||||
|
left = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (machine.GetScript<PlayerController>().tranform.LocalEulerAngles.y > 0.0f)
|
||||||
|
machine.GetScript<PlayerController>().Rightsmoke.AngularOffsets = new Vector2(machine.GetScript<PlayerController>().tranform.LocalEulerAngles.y - (MathF.PI * 1.5f), machine.GetScript<PlayerController>().Rightsmoke.AngularOffsets.y);
|
||||||
|
else
|
||||||
|
machine.GetScript<PlayerController>().Rightsmoke.AngularOffsets = new Vector2(machine.GetScript<PlayerController>().tranform.LocalEulerAngles.y + (MathF.PI * 0.5f), machine.GetScript<PlayerController>().Rightsmoke.AngularOffsets.y);
|
||||||
|
|
||||||
|
machine.GetScript<PlayerController>().Rightsmoke.Emit();
|
||||||
|
left = true;
|
||||||
|
}
|
||||||
|
|
||||||
AudioHandler.audioClipHandlers["footsteps"].Play();
|
AudioHandler.audioClipHandlers["footsteps"].Play();
|
||||||
machine.GetScript<PlayerController>().smoke.Emit();
|
|
||||||
timer = 0;
|
timer = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ public class PlayerWalkState : BaseState
|
||||||
{
|
{
|
||||||
private float timer;
|
private float timer;
|
||||||
private float delay = 0.4f;
|
private float delay = 0.4f;
|
||||||
|
private bool left = true;
|
||||||
public PlayerWalkState(StateMachine stateMachine) : base(stateMachine)
|
public PlayerWalkState(StateMachine stateMachine) : base(stateMachine)
|
||||||
{
|
{
|
||||||
stateName = "Walk State";
|
stateName = "Walk State";
|
||||||
|
@ -13,7 +14,6 @@ public class PlayerWalkState : 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>().playLandedAnimation = false;
|
||||||
|
@ -48,14 +48,28 @@ public class PlayerWalkState : BaseState
|
||||||
|
|
||||||
if (timer > delay)
|
if (timer > delay)
|
||||||
{
|
{
|
||||||
|
if (left)
|
||||||
|
{
|
||||||
|
if (machine.GetScript<PlayerController>().tranform.LocalEulerAngles.y > 0.0f)
|
||||||
|
machine.GetScript<PlayerController>().Leftsmoke.AngularOffsets = new Vector2(machine.GetScript<PlayerController>().tranform.LocalEulerAngles.y - (MathF.PI * 1.5f), machine.GetScript<PlayerController>().Leftsmoke.AngularOffsets.y);
|
||||||
|
else
|
||||||
|
machine.GetScript<PlayerController>().Leftsmoke.AngularOffsets = new Vector2(machine.GetScript<PlayerController>().tranform.LocalEulerAngles.y + (MathF.PI * 0.5f), machine.GetScript<PlayerController>().Leftsmoke.AngularOffsets.y);
|
||||||
|
|
||||||
if (machine.GetScript<PlayerController>().tranform.LocalEulerAngles.y > 0.0f)
|
machine.GetScript<PlayerController>().Leftsmoke.Emit();
|
||||||
machine.GetScript<PlayerController>().smoke.AngularOffsets = new Vector2(machine.GetScript<PlayerController>().tranform.LocalEulerAngles.y - (MathF.PI * 1.5f), machine.GetScript<PlayerController>().smoke.AngularOffsets.y);
|
left = false;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
machine.GetScript<PlayerController>().smoke.AngularOffsets = new Vector2(machine.GetScript<PlayerController>().tranform.LocalEulerAngles.y + (MathF.PI * 0.5f), machine.GetScript<PlayerController>().smoke.AngularOffsets.y);
|
{
|
||||||
|
if (machine.GetScript<PlayerController>().tranform.LocalEulerAngles.y > 0.0f)
|
||||||
|
machine.GetScript<PlayerController>().Rightsmoke.AngularOffsets = new Vector2(machine.GetScript<PlayerController>().tranform.LocalEulerAngles.y - (MathF.PI * 1.5f), machine.GetScript<PlayerController>().Rightsmoke.AngularOffsets.y);
|
||||||
|
else
|
||||||
|
machine.GetScript<PlayerController>().Rightsmoke.AngularOffsets = new Vector2(machine.GetScript<PlayerController>().tranform.LocalEulerAngles.y + (MathF.PI * 0.5f), machine.GetScript<PlayerController>().Rightsmoke.AngularOffsets.y);
|
||||||
|
|
||||||
|
machine.GetScript<PlayerController>().Rightsmoke.Emit();
|
||||||
|
left = true;
|
||||||
|
}
|
||||||
|
|
||||||
AudioHandler.audioClipHandlers["footsteps"].Play();
|
AudioHandler.audioClipHandlers["footsteps"].Play();
|
||||||
machine.GetScript<PlayerController>().smoke.Emit();
|
|
||||||
timer = 0;
|
timer = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,8 @@ public class PlayerController : Script
|
||||||
public CameraArm camArm { get; set; }
|
public CameraArm camArm { get; set; }
|
||||||
private PickAndThrow pat;
|
private PickAndThrow pat;
|
||||||
public StateMachine stateMachine { get; set; }
|
public StateMachine stateMachine { get; set; }
|
||||||
public ParticleEmitter smoke { get; set; }
|
public ParticleEmitter Leftsmoke { get; set; }
|
||||||
|
public ParticleEmitter Rightsmoke { get; set; }
|
||||||
|
|
||||||
public bool holdItem { get; set; }
|
public bool holdItem { get; set; }
|
||||||
public bool isAiming { get; set; }
|
public bool isAiming { get; set; }
|
||||||
|
@ -93,6 +94,10 @@ public class PlayerController : Script
|
||||||
|
|
||||||
public bool playLandedAnimation { get; set; }
|
public bool playLandedAnimation { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public GameObject leftParticle;
|
||||||
|
public GameObject rightParticle;
|
||||||
|
|
||||||
protected override void awake()
|
protected override void awake()
|
||||||
{
|
{
|
||||||
//default setup
|
//default setup
|
||||||
|
@ -147,9 +152,12 @@ public class PlayerController : Script
|
||||||
|
|
||||||
playLandedAnimation = false;
|
playLandedAnimation = false;
|
||||||
|
|
||||||
smoke = GetComponentInChildren<ParticleEmitter>();
|
Leftsmoke = leftParticle.GetComponent<ParticleEmitter>();
|
||||||
if (!smoke)
|
if (!Leftsmoke)
|
||||||
Debug.LogError("ParticleEmitter MISSING");
|
Debug.LogError("left ParticleEmitter MISSING");
|
||||||
|
Rightsmoke = rightParticle.GetComponent<ParticleEmitter>();
|
||||||
|
if (!Leftsmoke)
|
||||||
|
Debug.LogError("right ParticleEmitter MISSING");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void start()
|
protected override void start()
|
||||||
|
|
Loading…
Reference in New Issue