mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-04-26 02:00:54 -05:00
Crumbling Platform
-Crumbling platform was added -Minor fixes and improvement to level -Added folders for WIP foothills obstacle sections
This commit is contained in:
parent
7f5527e28b
commit
5c0497be88
|
|
@ -1,25 +0,0 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class CrumblingPlatform : MonoBehaviour
|
||||
{
|
||||
private bool cooldown = false;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
IEnumerator Cooldown()
|
||||
{
|
||||
yield return new WaitForSecondsRealtime(1f);
|
||||
cooldown = false;
|
||||
}
|
||||
}
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
47
Assets/Scripts/Environment/CrumblingPlatform.cs
Normal file
47
Assets/Scripts/Environment/CrumblingPlatform.cs
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class CrumblingPlatform : MonoBehaviour
|
||||
{
|
||||
private bool cooldown = false;
|
||||
private MeshRenderer mesh;
|
||||
private BoxCollider[] boxColliders;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
mesh = gameObject.GetComponent<MeshRenderer>();
|
||||
boxColliders = gameObject.GetComponents<BoxCollider>();
|
||||
}
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
//Debug.Log("Collision detected");
|
||||
if (other.CompareTag("ArcherTarget") && cooldown == false)
|
||||
{
|
||||
//Debug.Log("Collided with player");
|
||||
cooldown = true;
|
||||
StartCoroutine(DeleteCooldown());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
IEnumerator DeleteCooldown()
|
||||
{
|
||||
//Debug.Log("Crumbling");
|
||||
yield return new WaitForSecondsRealtime(.25f);
|
||||
mesh.enabled = false;
|
||||
boxColliders[0].enabled = false;
|
||||
boxColliders[1].enabled = false;
|
||||
|
||||
//Debug.Log("Crumbled");
|
||||
yield return new WaitForSecondsRealtime(2.0f);
|
||||
mesh.enabled = true;
|
||||
boxColliders[0].enabled = true;
|
||||
boxColliders[1].enabled = true;
|
||||
|
||||
//Debug.Log("Respawned Platform");
|
||||
cooldown = false;
|
||||
}
|
||||
}
|
||||
|
|
@ -6,35 +6,35 @@ EditorUserSettings:
|
|||
serializedVersion: 4
|
||||
m_ConfigSettings:
|
||||
RecentlyUsedScenePath-0:
|
||||
value: 22424703114646680e0b0227036c6f1f05033f2b212d68252320092a
|
||||
value: 22424703114646680e0b0227036c7b151b180b6501273035202c1327d1e33136e7a923e7ee2e26
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-1:
|
||||
value: 22424703114646680e0b0227036c7b151b180b6501273035202c1327d1e33136e7a923e7ee2e26
|
||||
value: 22424703114646680e0b0227036c731f1415016439262f2434
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-2:
|
||||
value: 22424703114646680e0b0227036c731f1415016439262f2434
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-3:
|
||||
value: 22424703114646680e0b0227036c6b19021b1d192f2d2835633c133af6f9
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-4:
|
||||
RecentlyUsedScenePath-3:
|
||||
value: 22424703114646680e0b0227036c7b151b180b65093e273e12190f3cf6ef2021f2e225a7f234362820
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-5:
|
||||
RecentlyUsedScenePath-4:
|
||||
value: 22424703114646680e0b0227036c7b151b180b652b3a27292f260573f1e33136e7a923e7ee2e26
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-6:
|
||||
RecentlyUsedScenePath-5:
|
||||
value: 22424703114646680e0b0227036c7c021313113e3f66333e243d04
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-7:
|
||||
RecentlyUsedScenePath-6:
|
||||
value: 22424703114646680e0b0227036c731f1415016439262f2434
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-8:
|
||||
RecentlyUsedScenePath-7:
|
||||
value: 22424703114646680e0b0227036c6f02131b172b282d347e38271427fb
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-9:
|
||||
RecentlyUsedScenePath-8:
|
||||
value: 22424703114646680e0b0227036c7b151b180b6501273035202c1327d1e33136e7a923e7ee2e26
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-9:
|
||||
value: 22424703114646680e0b0227036c78111b125507233d28242c20137df7ee3d2cfb
|
||||
flags: 0
|
||||
vcSharedLogLevel:
|
||||
value: 0d5e400f0650
|
||||
flags: 0
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user