mirror of
https://projects.caleb-brown.dev/UDRI-XRT/UDRIGEEKCup2024.git
synced 2025-01-21 22:58:50 -05:00
Merge branch 'development' into feature/FloorRamp
# Conflicts: # Assets/CoursePrefabs/Animations.meta # Assets/Obstacles.meta # Assets/PolygonDungeon/URP_ExtractMe.unitypackage.meta # Assets/Scenes/TestControls.unity
This commit is contained in:
commit
89b9912466
12
Assets/Obstacles.meta
Normal file
12
Assets/Obstacles.meta
Normal file
@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
<<<<<<<< HEAD:Assets/CoursePrefabs/Animations.meta
|
||||
guid: b07b2f4daee7db041b8f76c1337386be
|
||||
========
|
||||
guid: 90c198bbdb56e8841ae012a98d9191cc
|
||||
>>>>>>>> development:Assets/Obstacles.meta
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
12
Assets/Obstacles/Animations.meta
Normal file
12
Assets/Obstacles/Animations.meta
Normal file
@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
<<<<<<<< HEAD:Assets/CoursePrefabs/Animations.meta
|
||||
guid: 263cce79111ec124580c2a910d24c83c
|
||||
========
|
||||
guid: 90c198bbdb56e8841ae012a98d9191cc
|
||||
>>>>>>>> development:Assets/Obstacles.meta
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
67
Assets/Obstacles/Bomb.cs
Normal file
67
Assets/Obstacles/Bomb.cs
Normal file
@ -0,0 +1,67 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MAVRIC.GEEKCup.Obstacles
|
||||
{
|
||||
public class Bomb : MonoBehaviour
|
||||
{
|
||||
public float explosionTimeSeconds = 0.1f;
|
||||
public float force = 10.0f;
|
||||
public GameObject modelObject;
|
||||
public SphereCollider explosionCollider;
|
||||
public ParticleSystem ParticleSystem;
|
||||
public float maxExplosionRadius = 10.0f;
|
||||
public float maxDonutRadius = 10.0f;
|
||||
|
||||
|
||||
public ParticleSystem.ShapeModule editableShape;
|
||||
|
||||
public bool primed;
|
||||
|
||||
private void OnCollisionEnter(Collision collision)
|
||||
{
|
||||
if (!primed)
|
||||
{
|
||||
primed = true;
|
||||
return;
|
||||
}
|
||||
ParticleSystem.gameObject.SetActive(true);
|
||||
|
||||
editableShape = ParticleSystem.shape;
|
||||
|
||||
StartCoroutine(Disappear());
|
||||
|
||||
IEnumerator Disappear()
|
||||
{
|
||||
yield return new WaitForSeconds(explosionTimeSeconds / 3.0f);
|
||||
modelObject.SetActive(false);
|
||||
ParticleSystem.gameObject.transform.SetParent(null);
|
||||
ParticleSystem.gameObject.transform.rotation = Quaternion.identity;
|
||||
ParticleSystem.Play();
|
||||
explosionCollider.gameObject.SetActive(true);
|
||||
for (float timer = 0; timer < explosionTimeSeconds; timer += Time.deltaTime)
|
||||
{
|
||||
float percent = timer / explosionTimeSeconds;
|
||||
float radius = Mathf.Lerp(1, maxExplosionRadius, percent);
|
||||
float donut = Mathf.Lerp(1, maxDonutRadius, percent);
|
||||
editableShape.radius = radius;
|
||||
editableShape.donutRadius = donut;
|
||||
yield return null;
|
||||
}
|
||||
while (ParticleSystem.IsAlive()) yield return null;
|
||||
Destroy(gameObject);
|
||||
Destroy(ParticleSystem.gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void OnTriggerEnter(Collider other)
|
||||
{
|
||||
Rigidbody body = other.attachedRigidbody;
|
||||
if (body == null) return;
|
||||
|
||||
body.AddExplosionForce(force,transform.position,explosionCollider.radius);
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Obstacles/Bomb.cs.meta
Normal file
11
Assets/Obstacles/Bomb.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0c719ae2953191a48ada2f5515be5d00
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
5119
Assets/Obstacles/BombObstacle.prefab
Normal file
5119
Assets/Obstacles/BombObstacle.prefab
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,6 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 263cce79111ec124580c2a910d24c83c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
guid: c5a8f57575aacb64984560694a4962a8
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
30
Assets/Obstacles/ObjectSpawner.cs
Normal file
30
Assets/Obstacles/ObjectSpawner.cs
Normal file
@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
namespace MAVRIC.GEEKCup.Obstacles
|
||||
{
|
||||
public class ObjectSpawner : MonoBehaviour
|
||||
{
|
||||
public float minTimeToSpawn = 1.0f;
|
||||
public float maxTimeToSpawn = 5.0f;
|
||||
|
||||
public GameObject spawningObject;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
StartCoroutine(Spawning());
|
||||
|
||||
IEnumerator Spawning()
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
float randTime = Random.Range(minTimeToSpawn, maxTimeToSpawn);
|
||||
yield return new WaitForSeconds(randTime);
|
||||
Instantiate(spawningObject, transform.position, Quaternion.identity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Obstacles/ObjectSpawner.cs.meta
Normal file
11
Assets/Obstacles/ObjectSpawner.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b9732855f00e46e4384b94135940ca5e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
14
Assets/PhysicsMaterial/BombMatPhysic.physicMaterial
Normal file
14
Assets/PhysicsMaterial/BombMatPhysic.physicMaterial
Normal file
@ -0,0 +1,14 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!134 &13400000
|
||||
PhysicMaterial:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: BombMatPhysic
|
||||
dynamicFriction: 0.6
|
||||
staticFriction: 0.6
|
||||
bounciness: 0.6
|
||||
frictionCombine: 0
|
||||
bounceCombine: 0
|
@ -1,8 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ebc9ccb2398c6104e9fab5c61998edd3
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
guid: 43aa182c5dba33845b289b152ab6f206
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 13400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -897,6 +897,74 @@ MonoBehaviour:
|
||||
m_Flags: 0
|
||||
m_Reference: {fileID: 0}
|
||||
m_ButtonPressPoint: 0.5
|
||||
--- !u!1001 &196185785
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 332309251395339152, guid: c5a8f57575aacb64984560694a4962a8,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: -3.6199121
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 332309251395339152, guid: c5a8f57575aacb64984560694a4962a8,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0.13900007
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 332309251395339152, guid: c5a8f57575aacb64984560694a4962a8,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: -0.40911227
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 332309251395339152, guid: c5a8f57575aacb64984560694a4962a8,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 332309251395339152, guid: c5a8f57575aacb64984560694a4962a8,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 332309251395339152, guid: c5a8f57575aacb64984560694a4962a8,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 332309251395339152, guid: c5a8f57575aacb64984560694a4962a8,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 332309251395339152, guid: c5a8f57575aacb64984560694a4962a8,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 332309251395339152, guid: c5a8f57575aacb64984560694a4962a8,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 332309251395339152, guid: c5a8f57575aacb64984560694a4962a8,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2419579388047602335, guid: c5a8f57575aacb64984560694a4962a8,
|
||||
type: 3}
|
||||
propertyPath: m_Name
|
||||
value: BombObstacle
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: c5a8f57575aacb64984560694a4962a8, type: 3}
|
||||
--- !u!1 &363616410
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -3177,6 +3245,11 @@ PrefabInstance:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 4882983041807392655, guid: c7d059a48bc21424f9abd65c5d24b322,
|
||||
type: 3}
|
||||
propertyPath: forceScale
|
||||
value: 6
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5770048628783089053, guid: c7d059a48bc21424f9abd65c5d24b322,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
@ -5022,3 +5095,4 @@ SceneRoots:
|
||||
- {fileID: 2041401174}
|
||||
- {fileID: 1895921797}
|
||||
- {fileID: 1885907698}
|
||||
- {fileID: 196185785}
|
||||
|
Loading…
Reference in New Issue
Block a user