Implemented Item Scripts into objects

Implemented Ragdoll kinda
There are some issues with getting hit while ragdolling that need to be
fixed
Adjusted Dash
Dash still needs some adjustments before being fully implemented
This commit is contained in:
Melbyj1125
2021-10-25 03:38:56 -05:00
parent cc99ababff
commit 702bb555f0
33 changed files with 290 additions and 319 deletions

View File

@@ -20,7 +20,7 @@ public class Item: ScriptableObject {
public float playerGravM;
public int costM;
public virtual void Equip(PlayerStats p){
public virtual void Equip(PlayerStats p, GameObject player){
if(maxVelM != 0){
p.MaxVel += maxVelM;
}
@@ -50,7 +50,7 @@ public class Item: ScriptableObject {
}
}
public virtual void Unequip(PlayerStats p){
public virtual void Unequip(PlayerStats p, GameObject player){
if(maxVelM != 0){
p.MaxVel -= maxVelM;
}

View File

@@ -33,3 +33,4 @@ MonoBehaviour:
hasNitroM: 0
hasDashM: 0
cooldownM: 0
scriptM: {fileID: 11500000, guid: 5162a84172831f4449df60b9ad0ce22f, type: 3}

View File

@@ -33,3 +33,4 @@ MonoBehaviour:
hasNitroM: 0
hasDashM: 0
cooldownM: 0
scriptM: {fileID: 11500000, guid: 535009eaa735a4c4e95c6fc270e32741, type: 3}

View File

@@ -1,6 +1,7 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
[CreateAssetMenu]
public class SpecialItem : Item
@@ -12,8 +13,9 @@ public class SpecialItem : Item
public bool hasNitroM;
public bool hasDashM;
public float cooldownM;
public MonoScript scriptM;
public override void Equip(PlayerStats p){
public override void Equip(PlayerStats p, GameObject player){
if(maxVelM != 0){
p.MaxVel += maxVelM;
}
@@ -59,9 +61,12 @@ public class SpecialItem : Item
if(hasDashM != false){
p.HasDash = hasDashM;
}
if(scriptM != null){
player.AddComponent(scriptM.GetClass());
}
}
public override void Unequip(PlayerStats p){
public override void Unequip(PlayerStats p, GameObject player){
if(maxVelM != 0){
p.MaxVel -= maxVelM;
}
@@ -89,23 +94,26 @@ public class SpecialItem : Item
if(playerGravM != 0){
p.PlayerGrav -= playerGravM;
}
if(hasWallrunM != true){
p.HasWallrun = hasWallrunM;
if(hasWallrunM != false){
p.HasWallrun = false;
}
if(hasBlinkM != true){
p.HasBlink = hasBlinkM;
if(hasBlinkM != false){
p.HasBlink = false;
}
if(hasGrappleM != true){
p.HasGrapple = hasGrappleM;
if(hasGrappleM != false){
p.HasGrapple = false;
}
if(hasGliderM != true){
p.HasGlider = hasGliderM;
if(hasGliderM != false){
p.HasGlider = false;
}
if(hasNitroM != true){
p.HasNitro = hasNitroM;
if(hasNitroM != false){
p.HasNitro = false;
}
if(hasDashM != true){
p.HasDash = hasDashM;
if(hasDashM != false){
p.HasDash = false;
}
if(scriptM != null){
Destroy(player.GetComponent(scriptM.GetClass()));
}
}
}

View File

@@ -1,15 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class WallRunItem : Item
{
public void Equip(PlayerStats p){
p.HasWallrun = true;
}
public void Unequip(PlayerStats p)
{
p.HasWallrun = false;
}
}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d808f60ee05185d43a154521748992a0
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,99 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Blink : MonoBehaviour{
// Start is called before the first frame update
private Camera cam;
public CharacterController controller;
//Blink Variables
private LineRenderer beam;
private Vector3 origin;
private Vector3 endPoint;
private Vector3 mousePos;
private RaycastHit hit;
LayerMask ignoreP;
/////
private void Awake()
{
beam = gameObject.AddComponent<LineRenderer>();
beam.startWidth = 0.2f;
beam.endWidth = 0.2f;
beam.enabled = false;
ignoreP = LayerMask.GetMask("Player");
controller = GetComponent<CharacterController>();
}
void Start(){
// Grab the main camera.
//camera transform
cam = GetComponentInChildren<Camera>();
}
//ADJUST SO DISTANCE IS DETERMINED BY SCROLL WHEEL
//blinks the player forwards
private void BlinkMove()
{
if (Input.GetMouseButton(1))
{
// Finding the origin and end point of laser.
origin = transform.position + transform.forward * transform.lossyScale.z;
// Finding mouse pos in 3D space.
mousePos = Input.mousePosition;
mousePos.z = 20f;
endPoint = cam.ScreenToWorldPoint(mousePos);
// Find direction of beam.
Vector3 dir = endPoint - origin;
dir.Normalize();
// Are we hitting any colliders?
if (Physics.Raycast(origin, dir, out hit, 20f))
{
// If yes, then set endpoint to hit-point.
endPoint = hit.point;
}
// Set end point of laser.
beam.SetPosition(0, origin);
beam.SetPosition(1, endPoint);
// Draw the laser!
beam.enabled = true;
/*Ray ray = camera.ScreenPointToRay(Input.mousePosition);
RaycastHit raycastHit;
if (Physics.Raycast(ray, out raycastHit, 5.0f)){
LineRenderer.SetPosition(1, raycastHit.point);
}*/
}
else if (!Input.GetMouseButton(1) && beam.enabled == true)
{
beam.enabled = false;
//if teleporting due to hit to object, bump them a bit outside normal
if (hit.point != null)
{
transform.position = endPoint + hit.normal * 1.25f;
}
//if teleporting in the air or something, just spawn at endpoint
else
{
transform.position = endPoint;
}
//reenable character controller
}
}
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 80dbcf4212f11a74ebd5289c2b5eb309
guid: 5162a84172831f4449df60b9ad0ce22f
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -0,0 +1,39 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Dash : MonoBehaviour{
public Vector3 moveDirection;
public const float maxDashTime = 1.0f;
public float dashDistance = 10;
public float dashStoppingSpeed = 0.1f;
float currentDashTime = maxDashTime;
float dashSpeed = 12;
CharacterController characterController;
void Start(){
characterController = this.gameObject.GetComponent<CharacterController>();
}
//UPDATE CHECK FOR MOVEMENT ONLY WHEN DASHING
void FixedUpdate(){
if (Input.GetKeyDown(KeyCode.E))
{
currentDashTime = 0;
}
if(currentDashTime < maxDashTime)
{
moveDirection = transform.forward * dashDistance;
currentDashTime += dashStoppingSpeed;
}
else
{
moveDirection = Vector3.zero;
}
characterController.Move(moveDirection * Time.deltaTime * dashSpeed);
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 980b3f40ede2d8a4c96587100cf71d02
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,25 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Kick : MonoBehaviour
{
private float kickForce = 50f;
// Start is called before the first frame update
void Start(){
}
// Update is called once per frame
void Update(){
}
private void OnCollisionEnter(Collision collision)
{
if (collision.transform.CompareTag("kickable")){
Vector3 direction = this.transform.forward;
Debug.Log(direction);
collision.rigidbody.AddForce(direction * kickForce, ForceMode.Impulse);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: f9b52b0ade3c44e47a3a4dc48c47ec1c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,55 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class KickController : MonoBehaviour
{
//Important, may want to change blink code to only work for trigger collider
// so that the player doesn't teleport to their leg
public GameObject leg;
private bool isKicking = false;
//slightly bad practice, when merging find a better work around
private bool isDiveKicking = false;
private CharacterController characterController;
void Start(){
characterController = this.gameObject.GetComponent<CharacterController>();
}
void Update(){
//Note: when we merge this into PlayerMovement, we may want to change isgrounded to our
//custom is grounded
if (Input.GetKeyDown(KeyCode.F) && isKicking == false && characterController.isGrounded == false)
{
Debug.Log("dive");
// if kicking in air, kick until grounded (maybe add some foward momentum if needeD)
isKicking = true;
isDiveKicking = true;
leg.SetActive(true);
}
//otherwise do ground kick for .3 seconds
else if (Input.GetKeyDown(KeyCode.F) && isKicking == false){
Debug.Log("kick");
StartCoroutine(Kicking(.3f));
}
//once dive kick touches ground, set back to normal state
if(characterController.isGrounded == true && isDiveKicking == true){
isDiveKicking = false;
isKicking = false;
leg.SetActive(false);
}
}
private IEnumerator Kicking(float waitTime){
isKicking = true;
leg.SetActive(true);
yield return new WaitForSeconds(waitTime);
isKicking = false;
leg.SetActive(false);
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0c0aad94b3b1332408ef8e7d07f3b321
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,20 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Nitro : MonoBehaviour
{
private PlayerStats playerStats;
// Start is called before the first frame update
void Start(){
playerStats = this.gameObject.GetComponent<PlayerStats>();
}
// Update is called once per frame
void Update(){
//once cooldowns are implemented, put this on one (a long one)
if (Input.GetKeyDown(KeyCode.LeftShift)){
playerStats.CurVel = playerStats.MaxVel;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1a8c22589436d2449a89cf3a40b6d252
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,74 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//Mote: This should be refactored at some point
public class Slide : MonoBehaviour{
//this may be deprecated at some poiint later in development if we start ussing a rigid bod
public Camera playerCam;
private bool isSliding = false;
private CharacterController charController;
private PlayerStats playerStats;
private float orignalTraction;
private RaycastHit ray;
private Vector3 up;
// Start is called before the first frame update
void Start(){
}
private void Awake(){
charController = this.gameObject.GetComponentInParent<CharacterController>();
playerStats = this.gameObject.GetComponentInParent<PlayerStats>();
up = this.gameObject.GetComponentInParent<Transform>().up;
}
// Update is called once per frame
void Update(){
//Debug.DrawRay(this.gameObject.transform.position, up, Color.red, 5.0f);
//NOTE::
//if button is held down, start sliding
if (Input.GetKey(KeyCode.Q)){
if (isSliding == false){
orignalTraction = playerStats.Traction;
this.gameObject.transform.eulerAngles = new Vector3(this.transform.eulerAngles.x - 90, this.transform.eulerAngles.y, this.transform.eulerAngles.z);
isSliding = true;
charController.height = 1.0f;
playerStats.Traction = 0.01f;
}
}
//NOTE: potentialy change this to only allow player back up if there is nothing above them
if (Input.GetKeyUp(KeyCode.Q)) {
//if nothing is above the object, stop slidding
if (Physics.Raycast(this.gameObject.transform.position, up, out ray, 5f) == false)
{
this.gameObject.transform.eulerAngles = new Vector3(this.transform.eulerAngles.x - 90, this.transform.eulerAngles.y, this.transform.eulerAngles.z);
isSliding = false;
charController.height = 2.0f;
playerStats.Traction = orignalTraction;
}
else{
Debug.Log("Object above you");
}
}
//if button is not held down, and still slidding (if they let go but something was above them) check to see if something is still above them, if not
else if (Input.GetKey(KeyCode.Q) == false && isSliding==true){
//if nothing is above the object, stop slidding
if (Physics.Raycast(this.gameObject.transform.position, up, out ray, 5f) == false)
{
this.gameObject.transform.eulerAngles = new Vector3(this.transform.eulerAngles.x - 90, this.transform.eulerAngles.y, this.transform.eulerAngles.z);
isSliding = false;
charController.height = 2.0f;
playerStats.Traction = orignalTraction;
}
else
{
Debug.Log("Object above you");
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: aa419fd069f632e479eda138a7764362
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -21,7 +21,7 @@ public class PlayerInventory : MonoBehaviour
if(!items.Contains(item) && ableToAdd){
Debug.Log("Item Added");
items.Add(item);
item.Equip(pStats);
item.Equip(pStats, this.gameObject);
}
else if(!ableToAdd && !items.Contains(item)){
Debug.Log("Item Cannot Be Added");
@@ -42,7 +42,7 @@ public class PlayerInventory : MonoBehaviour
public void RemoveItem(Item item){
if(items.Remove(item)){
item.Unequip(pStats);
item.Unequip(pStats, this.gameObject);
}
}

View File

@@ -24,13 +24,14 @@ public class PlayerMovement : MonoBehaviour
//Jump value
private int curJumpNum;
private bool jumpPressed;
bool tempSet = false;
float tempTraction = 0.0f;
//Jump physics
private float mass = 5.0F; // defines the character mass
private Vector3 impact = Vector3.zero;
private float distToGround;
//Wallrunning
private WallRun wallRun;
@@ -43,7 +44,6 @@ public class PlayerMovement : MonoBehaviour
private Ray groundRay;
private RaycastHit groundHit;
//Camera Variables
private LayerMask ignoreP;
private Vector3 camRotation;
@@ -56,26 +56,20 @@ public class PlayerMovement : MonoBehaviour
[Range(50, 500)]
public int sensitivity = 200;
//Blink Variables
private LineRenderer beam;
private Vector3 origin;
private Vector3 endPoint;
private Vector3 mousePos;
private RaycastHit hit;
/////
//Ragdoll variables
private Vector3 hit;
private Rigidbody rB;
private bool firstHit = false;
private bool heldDown = false;
private Vector3 prevRot;
private Vector3 hitForce;
void Awake()
{
//Initialize Components
moveController = GetComponent<CharacterController>();
rB = GetComponent<Rigidbody>();
pStats = GetComponent<PlayerStats>();
ignoreP = LayerMask.GetMask("Player");
beam = gameObject.AddComponent<LineRenderer>();
beam.startWidth = 0.2f;
beam.endWidth = 0.2f;
beam.enabled = false;
//camera transform
cam = GetComponentInChildren<Camera>();
@@ -84,9 +78,6 @@ public class PlayerMovement : MonoBehaviour
//wallRun = gameObject.GetComponent<WallRun>();
}
void Start()
{
distToGround = GetComponent<Collider>().bounds.extents.y;
@@ -98,7 +89,7 @@ public class PlayerMovement : MonoBehaviour
{
//Controls for camera
Rotate();
Rotation();
if(moveController.enabled == true){
@@ -110,11 +101,34 @@ public class PlayerMovement : MonoBehaviour
// consumes the impact energy each cycle:
impact = Vector3.Lerp(impact, Vector3.zero, 5*Time.deltaTime);
Blink();
}
else{
Debug.Log("MoveController is either Disabled or wasn't retrieved correctly");
//if suffiecient impact magnitude is applied then move player
if (rB.velocity.magnitude < 0.2f){
firstHit = false;
DisableRagdoll();
}
//Gravity without moveController
vel.y -= pStats.PlayerGrav * Time.deltaTime;
rB.AddForce(new Vector3(0,vel.y,0));
//Debug.LogWarning("MoveController is either Disabled or wasn't retrieved correctly");
}
//TESTING RAGDOLL STUFF NEEDS SOME WORk
/*
if (Input.GetMouseButton(1) && heldDown == false){
Debug.Log("yup");
getHit(new Vector3(1,1,1), 2000);
heldDown = true;
}
*/
if(!Input.GetMouseButton(1)){
heldDown = false;
}
//Checks if player should respawn
@@ -207,8 +221,6 @@ public class PlayerMovement : MonoBehaviour
lastTimeJumped = Time.time;
//NEEDS TO BE MASSIVELY CHANGE LIKELY USE RAYCAST TO CHECK IF ACTUALLY ON GROUND
//CANNOT USE CHARACTERCONTROLLER.ISGROUNDED IT IS UNRELIABLE
//If grounded no jumps have been used
if(isGrounded){
curJumpNum = 0;
@@ -218,6 +230,9 @@ public class PlayerMovement : MonoBehaviour
if (Input.GetAxis("Jump") == 0) jumpPressed = false;
}
//PlayerScript
public bool GetJumpPressed(){
return jumpPressed;
}
@@ -237,8 +252,10 @@ public class PlayerMovement : MonoBehaviour
vel = newVelocity;
}
//Camera
private void Rotate()
//Camera and Player Rotation
private void Rotation()
{
transform.Rotate(Vector3.up * sensitivity * Time.deltaTime * Input.GetAxis("Mouse X"));
@@ -260,13 +277,12 @@ public class PlayerMovement : MonoBehaviour
}
}
//Gravity Function for adjusting y-vel due to wallrun/glide/etc
private void Gravity(){
//Temp Values for Glider
float tempTraction = 0.0f;
bool tempSet = false;
//ADD CHECKER FOR GLIDER WHEN FULLY IMPLEMENTED
//Gliding
if(jumpPressed && pStats.HasGlider){
vel.y -= (pStats.PlayerGrav-18) * Time.deltaTime;
@@ -275,7 +291,6 @@ public class PlayerMovement : MonoBehaviour
pStats.Traction = 1.0f;
tempSet = true;
}
}
else{
@@ -287,13 +302,15 @@ public class PlayerMovement : MonoBehaviour
//Normal Gravity
vel.y -= pStats.PlayerGrav * Time.deltaTime;
}
//Wallrunning
if (pStats.HasWallrun) { wallRun.WallRunRoutine(); } //adjusted later if we are wallrunning
//If gliding
//Go down slowly
}
void GroundCheck()
{
// Make sure that the ground check distance while already in air is very small, to prevent suddenly snapping to ground
@@ -316,62 +333,27 @@ public class PlayerMovement : MonoBehaviour
}
}
//ADJUST SO DISTANCE IS DETERMINED BY SCROLL WHEEL
//blinks the player forwards
private void Blink()
{
if (Input.GetMouseButton(1))
{
// Finding the origin and end point of laser.
origin = transform.position + transform.forward * transform.lossyScale.z;
// Finding mouse pos in 3D space.
mousePos = Input.mousePosition;
mousePos.z = 20f;
endPoint = cam.ScreenToWorldPoint(mousePos);
// Find direction of beam.
Vector3 dir = endPoint - origin;
//Ragdoll Functions
private void getHit(Vector3 dir, float force){
if(firstHit == false){
EnableRagdoll();
dir.Normalize();
// Are we hitting any colliders?
if (Physics.Raycast(origin, dir, out hit, 20f))
{
// If yes, then set endpoint to hit-point.
endPoint = hit.point;
}
// Set end point of laser.
beam.SetPosition(0, origin);
beam.SetPosition(1, endPoint);
// Draw the laser!
beam.enabled = true;
/*Ray ray = camera.ScreenPointToRay(Input.mousePosition);
RaycastHit raycastHit;
if (Physics.Raycast(ray, out raycastHit, 5.0f)){
LineRenderer.SetPosition(1, raycastHit.point);
}*/
rB.AddForce(dir * force);
firstHit = true;
}
}
private void EnableRagdoll(){
prevRot = transform.localEulerAngles;
moveController.enabled = false;
rB.isKinematic = false;
rB.detectCollisions = true;
}
else if (!Input.GetMouseButton(1) && beam.enabled == true)
{
beam.enabled = false;
//if teleporting due to hit to object, bump them a bit outside normal
if (hit.point != null)
{
transform.position = endPoint + hit.normal * 1.25f;
}
//if teleporting in the air or something, just spawn at endpoint
else
{
transform.position = endPoint;
}
//reenable character controller
}
private void DisableRagdoll(){
moveController.enabled = true;
rB.isKinematic = true;
rB.detectCollisions = false;
transform.localEulerAngles = prevRot;
}

View File

@@ -1,11 +1,11 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Assertions;
public class PlayerStats : MonoBehaviour
{
//Maximum possible player speed
[SerializeField]
private float maxVel = 25.0f;
public float MaxVel{
get{ return maxVel; }
@@ -13,7 +13,6 @@ public class PlayerStats : MonoBehaviour
}
//Minimum possible player speed
[SerializeField]
private float minVel = 2.0f;
public float MinVel{
get{ return minVel; }
@@ -21,7 +20,6 @@ public class PlayerStats : MonoBehaviour
}
//Current player speed
[SerializeField]
private float curVel = 0.0f;
public float CurVel{
get{ return curVel; }
@@ -29,7 +27,6 @@ public class PlayerStats : MonoBehaviour
}
//Player Jump power
[SerializeField]
private float acc = 0.1f;
public float Acc{
get{ return acc; }
@@ -37,7 +34,6 @@ public class PlayerStats : MonoBehaviour
}
//Player Jump power
[SerializeField]
private float jumpPow = 300.0f;
public float JumpPow{
get{ return jumpPow; }
@@ -45,7 +41,6 @@ public class PlayerStats : MonoBehaviour
}
//Players Number of Jumps
[SerializeField]
private int jumpNum = 2; ////// UPDATE TO 2 WHEN THE JUMP ISSUE IS FIXED
public int JumpNum{
get{ return jumpNum; }
@@ -53,7 +48,6 @@ public class PlayerStats : MonoBehaviour
}
//Player Traction
[SerializeField]
private float traction = 3.0f;
public float Traction{
get{ return traction; }
@@ -61,7 +55,6 @@ public class PlayerStats : MonoBehaviour
}
//Player Kick Power
[SerializeField]
private float kickPow;
public float KickPow{
get{ return kickPow; }
@@ -69,7 +62,6 @@ public class PlayerStats : MonoBehaviour
}
//Player Recovery Time When Knocked Down
[SerializeField]
private float recovTime;
public float RecovTime{
get{ return recovTime; }
@@ -78,7 +70,6 @@ public class PlayerStats : MonoBehaviour
//MAY BE UNNECCESARY DEPENDING ON HOW GLIDER TURNS OUT
//Gravity Affecting the player
[SerializeField]
private float playerGrav = 20.0f;
public float PlayerGrav{
get{ return playerGrav; }
@@ -86,7 +77,6 @@ public class PlayerStats : MonoBehaviour
}
//If The Player Has Blink
[SerializeField]
private bool hasBlink = false;
public bool HasBlink{
get{ return hasBlink; }
@@ -94,7 +84,6 @@ public class PlayerStats : MonoBehaviour
}
//If The Player Has Glider
[SerializeField]
private bool hasGlider = false;
public bool HasGlider{
get{ return hasGlider; }
@@ -102,7 +91,6 @@ public class PlayerStats : MonoBehaviour
}
//If The Player Has Grapple
[SerializeField]
private bool hasGrapple = false;
public bool HasGrapple{
get{ return hasGrapple; }
@@ -110,7 +98,6 @@ public class PlayerStats : MonoBehaviour
}
//If The Player Has Wallrun
[SerializeField]
private bool hasWallrun = false;
public bool HasWallrun{
get{ return hasWallrun; }
@@ -118,7 +105,6 @@ public class PlayerStats : MonoBehaviour
}
//If The Player Has Nitro
[SerializeField]
private bool hasNitro = false;
public bool HasNitro{
get{ return hasNitro; }
@@ -126,17 +112,24 @@ public class PlayerStats : MonoBehaviour
}
//If The Player Has Dash
[SerializeField]
private bool hasDash = false;
public bool HasDash{
get{ return hasDash; }
set{ hasDash = value; }
}
[SerializeField]
private int playerPoints = 15;
public int PlayerPoints{
get{ return playerPoints; }
set{ playerPoints = value; }
}
// void Update(){
// VariableValidation();
// }
// void VariableValidation(){
// Debug.Assert((playerPoints != null && playerPoints > 0), "Not valid value");
// }
}