mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-04-26 02:00:54 -05:00
slime functions added
This commit is contained in:
parent
652ffefb6a
commit
b1af892672
|
|
@ -3293,10 +3293,6 @@ PrefabInstance:
|
|||
m_Modification:
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 1707207228499037412, guid: 0ea305f96ab853340bb9f0ed320dac08, type: 3}
|
||||
propertyPath: minAngle
|
||||
value: -20
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5759777694531189237, guid: 0ea305f96ab853340bb9f0ed320dac08, type: 3}
|
||||
propertyPath: m_RootOrder
|
||||
value: 13
|
||||
|
|
@ -3345,9 +3341,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}
|
||||
|
|
|
|||
|
|
@ -10,14 +10,14 @@ public class PlayerStats : MonoBehaviour
|
|||
public enum Weather {Rain, Snow, Wind, Fog};
|
||||
|
||||
//Soft cap max speed a player can achieve they can achieve this speed by running
|
||||
[SerializeField] private float maxVel = 40.0f;
|
||||
[SerializeField] private float maxVel = 50.0f;
|
||||
public float MaxVel{
|
||||
get{ return maxVel; }
|
||||
set{ maxVel = value; }
|
||||
}
|
||||
|
||||
//Minimum possible player speed
|
||||
[SerializeField] private float minVel = 15.0f;
|
||||
[SerializeField] private float minVel = 18.0f;
|
||||
public float MinVel{
|
||||
get{ return minVel; }
|
||||
set{ minVel = value; }
|
||||
|
|
@ -172,6 +172,8 @@ public class PlayerStats : MonoBehaviour
|
|||
private float tempTraction;
|
||||
private float tempAcc;
|
||||
private float accModification;
|
||||
private bool weatherOn = false;
|
||||
////
|
||||
|
||||
void Start() {
|
||||
// Used mainly for respawning
|
||||
|
|
@ -197,9 +199,12 @@ public class PlayerStats : MonoBehaviour
|
|||
}
|
||||
}
|
||||
|
||||
////Weather Functions
|
||||
//sets weather effect on player
|
||||
public void SetWeather(Weather weather, Vector3 windDir = default(Vector3)){
|
||||
|
||||
weatherOn = true;
|
||||
|
||||
switch(weather){
|
||||
case Weather.Rain:{
|
||||
Debug.Log("Rain");
|
||||
|
|
@ -263,6 +268,8 @@ public class PlayerStats : MonoBehaviour
|
|||
//clears weather effects
|
||||
public void ClearWeather(){
|
||||
|
||||
weatherOn = false;
|
||||
|
||||
acc = tempAcc;
|
||||
traction = tempTraction;
|
||||
|
||||
|
|
@ -277,6 +284,32 @@ public class PlayerStats : MonoBehaviour
|
|||
}
|
||||
////
|
||||
|
||||
////Slime Functions
|
||||
//Apply slime body effect to the player
|
||||
|
||||
float tempSlimeTraction;
|
||||
bool midWeatherOn;
|
||||
|
||||
public void ApplySlimeBody(){
|
||||
maxVel = 25;
|
||||
curVel = minVel;
|
||||
}
|
||||
|
||||
//Clear slime body effect
|
||||
public void ClearSlimeBody(){
|
||||
maxVel = 50;
|
||||
}
|
||||
|
||||
//Apply slime trail effect to the player
|
||||
public void ApplySlimeTrail(){
|
||||
curTraction = 1;
|
||||
}
|
||||
|
||||
//Clear slime trail effect
|
||||
public void ClearSlimeTrail(){
|
||||
curTraction = traction;
|
||||
}
|
||||
////
|
||||
void Update(){
|
||||
VariableValidation();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user