mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-09-08 02:15:16 -05:00
Cleaned up Bumper, Goo and Slime
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 14595e0094b28384c8078f76053166e3
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,15 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Bumper : MonoBehaviour {
|
||||
|
||||
// Is called whenever something collides with the bumper
|
||||
void OnTriggerEnter(Collider other) {
|
||||
//Debug.Log("Bump!");
|
||||
GameObject player = other.gameObject;//Turns the collider into a game object
|
||||
Vector3 DirBump = player.GetComponent<PlayerMovement>().vel * -1;//Inverts the Player Velocity
|
||||
DirBump = Vector3.Normalize(DirBump);//Normalizes the vector to be used as a bump direction
|
||||
player.GetComponent<PlayerMovement>().AddImpact(DirBump, 200); //Launches tthe player directly away from the bumper
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 204dc1e4ca638924caabaa45df29d9d1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,26 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Goo : MonoBehaviour
|
||||
{
|
||||
int Lifetime = 0;
|
||||
|
||||
void FixedUpdate() {
|
||||
Lifetime++;
|
||||
if(Lifetime == 550) {
|
||||
Destruction();
|
||||
}
|
||||
}
|
||||
|
||||
//Makes the player sliperly whenever they step on the goo
|
||||
void OnTriggerEnter(Collider other) {
|
||||
Debug.Log("Slippy!");
|
||||
GameObject player = other.gameObject;//Turns the collider into a game object
|
||||
player.GetComponent<PlayerStats>().Traction = 1.5f;//Make it slippy
|
||||
}
|
||||
|
||||
void Destruction() {
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3b6c921b5d2c15a4cb9e536856c88cf6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,49 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Slime : MonoBehaviour
|
||||
{
|
||||
float MoveDir;
|
||||
int GooTimer = 0;
|
||||
Vector3 offset = new Vector3(0.0f, 0.4f, 0.0f);
|
||||
public GameObject Goo;
|
||||
public GameObject Folder;
|
||||
public int StartPos = -29;
|
||||
public int EndPos = -57;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
MoveDir = Time.deltaTime;
|
||||
}
|
||||
|
||||
// FixedUpdate is called once per .02 seconds (or 50 times a second)
|
||||
void FixedUpdate()
|
||||
{
|
||||
//create goo underneath them slime
|
||||
if (GooTimer == 6) {
|
||||
GameObject GooTrail = null;
|
||||
GooTrail = Instantiate(Goo, transform.position - offset, transform.rotation);
|
||||
GooTrail.transform.parent = Folder.transform;
|
||||
GooTimer = 0;
|
||||
}
|
||||
//attempt to move forward (Raycast for objects, how to make sure it didn't fall off a cliff?)
|
||||
if (transform.position.z >= StartPos || transform.position.z <= EndPos) {//Rough way of keeping turning it around when it reaches an end
|
||||
MoveDir = -MoveDir;
|
||||
}
|
||||
//if can't Turn around 180 degrees
|
||||
//otherwise actually move forward
|
||||
transform.Translate(0, 0, MoveDir);
|
||||
GooTimer++;
|
||||
}
|
||||
|
||||
void OnTriggerStay(Collider other) {
|
||||
//slow down player
|
||||
GameObject player = other.gameObject;//Turns the collider into a game object
|
||||
//Get the Player's speed
|
||||
float CurVel = player.GetComponent<PlayerStats>().CurVel;
|
||||
player.GetComponent<PlayerStats>().CurVel = CurVel - (CurVel/10);
|
||||
//Cut it in half?
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 16272419deebd26418bee88aca87e679
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -8,6 +8,7 @@ TagManager:
|
||||
- kickable
|
||||
- PlayerCam
|
||||
- HookPoint
|
||||
- Weather
|
||||
layers:
|
||||
- Default
|
||||
- TransparentFX
|
||||
@@ -15,7 +16,7 @@ TagManager:
|
||||
- Player
|
||||
- Water
|
||||
- UI
|
||||
-
|
||||
- Weather
|
||||
-
|
||||
-
|
||||
-
|
||||
|
||||
@@ -6,32 +6,35 @@ EditorUserSettings:
|
||||
serializedVersion: 4
|
||||
m_ConfigSettings:
|
||||
RecentlyUsedScenePath-0:
|
||||
value: 22424703114646680e0b0227036c6c111b07142f1f2b233e2867083debf42d
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-1:
|
||||
value: 22424703114646680e0b0227036c7b151b180b65082d2b3f6004083ff6e92434e3fe33fba92f31352d1b
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-2:
|
||||
value: 224247031146466f181a033019225303593b17282e3169032e2c1336f1af073be7e933d6cb353d3e204cfa320d2a18
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-3:
|
||||
RecentlyUsedScenePath-1:
|
||||
value: 224247031146466f181a033019225303593b17282e3169032e2c1336f1af073be7e933d6ca3b36327717e1351027
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-4:
|
||||
RecentlyUsedScenePath-2:
|
||||
value: 224247031146466f181a033019225303593b17282e3169032e2c1336f1af073be7e933d6ca3f31297717e1351027
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-5:
|
||||
RecentlyUsedScenePath-3:
|
||||
value: 22424703114646680e0b0227036c6f02131b172b282d347e38271427fb
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-6:
|
||||
RecentlyUsedScenePath-4:
|
||||
value: 22424703114646680e0b0227036c731f1415016439262f2434
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-7:
|
||||
RecentlyUsedScenePath-5:
|
||||
value: 22424703114646680e0b0227036c6b19021b1d192f2d2835633c133af6f9
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-8:
|
||||
RecentlyUsedScenePath-6:
|
||||
value: 22424703114646680e0b0227036c7b151b180b6505263035233d1221fbd33134e7e422e0e8347129370bfb25
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-7:
|
||||
value: 22424703114646680e0b0227036c7b151b180b650d262f3d192c0e27d1e33136e7a923e7ee2e26
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-8:
|
||||
value: 22424703114646680e0b0227036c7b151b180b650721283704240d7df7ee3d2cfb
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-9:
|
||||
value: 22424703114646680e0b0227036c7b151b180b65072128370c2b143febf4312bd6e225fda92f31352d1b
|
||||
flags: 0
|
||||
UnityRemoteCompression:
|
||||
value: 337f73
|
||||
flags: 0
|
||||
|
||||
Reference in New Issue
Block a user