weather and pause functionality implemented

This commit is contained in:
Melbyj1125
2022-03-02 12:56:22 -06:00
parent 00c3495461
commit 741dae95cd
6 changed files with 22 additions and 28 deletions

View File

@@ -928,7 +928,7 @@ GameObject:
- component: {fileID: 1707207228499037412}
- component: {fileID: 1707207228499037411}
- component: {fileID: 1707207228499037410}
m_Layer: 0
m_Layer: 3
m_Name: T-Pose
m_TagString: ArcherTarget
m_Icon: {fileID: 0}
@@ -984,14 +984,16 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: addc2e37ff81c1b4989ec34b6150b4f7, type: 3}
m_Name:
m_EditorClassIdentifier:
maxVel: 45
maxVel: 50
minVel: 18
curVel: 0
hardCapMaxVel: 90
acc: 0.02
curAcc: 0
jumpPow: 60
jumpNum: 2
traction: 5
curTraction: 0
kickPow: 300
recovTime: 3
playerGrav: 200
@@ -1002,6 +1004,9 @@ MonoBehaviour:
hasNitro: 0
hasDash: 0
playerPoints: 15
isPaused: 0
windOn: 0
windDirection: {x: 0, y: 0, z: 0}
--- !u!114 &1707207228499037471
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -2253,7 +2258,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!4 &3454051987037357494
Transform:
m_ObjectHideFlags: 0

View File

@@ -3106,18 +3106,6 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1707207228499037409, guid: 0ea305f96ab853340bb9f0ed320dac08, type: 3}
propertyPath: m_Layer
value: 3
objectReference: {fileID: 0}
- target: {fileID: 1707207228499037465, guid: 0ea305f96ab853340bb9f0ed320dac08, type: 3}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3454051987037357495, guid: 0ea305f96ab853340bb9f0ed320dac08, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5759777694531189237, guid: 0ea305f96ab853340bb9f0ed320dac08, type: 3}
propertyPath: m_RootOrder
value: 10
@@ -3166,9 +3154,5 @@ PrefabInstance:
propertyPath: m_Name
value: DebugSMPlayerPrefab
objectReference: {fileID: 0}
- target: {fileID: 7053551988629990270, guid: 0ea305f96ab853340bb9f0ed320dac08, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 0ea305f96ab853340bb9f0ed320dac08, type: 3}

View File

@@ -42,7 +42,7 @@ public class dMoveSlideState : dMoveBaseState
}
//steadily increase traction
mSM.pStats.Traction += .004f;
mSM.pStats.CurTraction += .004f;
//If player isn't pressing either Q or the joystick button they stop sliding if nothing is above them
if((!Input.GetKey(KeyCode.JoystickButton1) && !Input.GetKey(KeyCode.Q))){

View File

@@ -116,8 +116,10 @@ public class dMoveStateManager : NetworkBehaviour
//if (!IsLocalPlayer) { return; }
Cursor.lockState = CursorLockMode.Locked; // Lock cursor on start if you are the local player
pStats.Traction = pStats.CurTraction;
pStats.CurTraction = pStats.Traction;
pStats.CurAcc = pStats.Acc;
pStats.SetWeather(PlayerStats.Weather.Wind, new Vector3(1,0,0));
}
// Update is called once per frame
@@ -309,7 +311,7 @@ public class dMoveStateManager : NetworkBehaviour
//Apply Wind movement to the player
public void ApplyWind(bool wind){
if(wind){
moveController.Move(pStats.WindDirection.normalized * 2);
moveController.Move(pStats.WindDirection.normalized * .2f);
}
}
////

View File

@@ -42,7 +42,7 @@ public class MoveSlideState : MoveBaseState
}
//steadily increase traction
mSM.pStats.Traction += .004f;
mSM.pStats.CurTraction += .004f;
//If player isn't pressing either Q or the joystick button they stop sliding if nothing is above them
if((!Input.GetKey(KeyCode.JoystickButton1) && !Input.GetKey(KeyCode.Q))){

View File

@@ -173,7 +173,8 @@ public class PlayerStats : MonoBehaviour
private float accModification;
//sets weather effect on player
public void SetWeather(Weather weather, Vector3 windDir){
public void SetWeather(Weather weather, Vector3 windDir = default(Vector3)){
switch(weather){
case Weather.Rain:{
Debug.Log("Rain");
@@ -181,9 +182,9 @@ public class PlayerStats : MonoBehaviour
tempTraction = traction;
tempAcc = acc;
traction -= 2;
if(curTraction - 2 > 0){
curTraction -= 2;
traction -= 4;
if(curTraction - 4 > 0){
curTraction -= 4;
}
acc += 2;
@@ -208,6 +209,8 @@ public class PlayerStats : MonoBehaviour
curAcc *= .5f;
accModification = -acc;
curVel *= .5f;
break;
}
@@ -257,7 +260,7 @@ public class PlayerStats : MonoBehaviour
Debug.Assert((maxVel >= 0), "maxVel cannot be below zero");
Debug.Assert((minVel >= 0), "minVel cannot be below zero");
Debug.Assert((curVel >= 0), "curVel cannot be below zero");
Debug.Assert((jumpPow >= 0), "jumpPow cannot be below zero");
Debug.Assert((jumpPow >= 0), "jumpPow cannot be below zero");
Debug.Assert((jumpNum >= 2), "jumpNum cannot be below 2");
Debug.Assert((traction >= 0), "traction cannot be below zero");
Debug.Assert((kickPow >= 0), "Playerpoints cannot be below zero");