Final gamerjam state #1

Merged
JanGross merged 18 commits from dev into master 2022-04-30 14:38:07 +02:00
19 changed files with 5467 additions and 45 deletions
Showing only changes of commit 095fc0742b - Show all commits

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 1cdaf06d2b32d1d468c55a8319dd4582
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -48,6 +48,7 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
name: Default Pattern name: Default Pattern
duration: 5 duration: 5
notified: 0
enemy: {fileID: 0} enemy: {fileID: 0}
speed: 42 speed: 42
--- !u!1 &4703034693679659937 --- !u!1 &4703034693679659937
@@ -335,7 +336,7 @@ ParticleSystem:
startSize: startSize:
serializedVersion: 2 serializedVersion: 2
minMaxState: 0 minMaxState: 0
scalar: 1 scalar: 1.98
minScalar: 1 minScalar: 1
maxCurve: maxCurve:
serializedVersion: 2 serializedVersion: 2
@@ -3662,9 +3663,9 @@ ParticleSystem:
m_NumAlphaKeys: 2 m_NumAlphaKeys: 2
range: {x: 0, y: 1} range: {x: 0, y: 1}
CollisionModule: CollisionModule:
enabled: 0 enabled: 1
serializedVersion: 4 serializedVersion: 4
type: 0 type: 1
collisionMode: 0 collisionMode: 0
colliderForce: 0 colliderForce: 0
multiplyColliderForceByParticleSize: 0 multiplyColliderForceByParticleSize: 0
@@ -3832,14 +3833,14 @@ ParticleSystem:
m_RotationOrder: 4 m_RotationOrder: 4
minKillSpeed: 0 minKillSpeed: 0
maxKillSpeed: 10000 maxKillSpeed: 10000
radiusScale: 1 radiusScale: 0.15
collidesWith: collidesWith:
serializedVersion: 2 serializedVersion: 2
m_Bits: 4294967295 m_Bits: 4294967295
maxCollisionShapes: 256 maxCollisionShapes: 256
quality: 0 quality: 0
voxelSize: 0.5 voxelSize: 0.5
collisionMessages: 0 collisionMessages: 1
collidesWithDynamic: 1 collidesWithDynamic: 1
interiorCollisions: 0 interiorCollisions: 0
TriggerModule: TriggerModule:
@@ -5147,7 +5148,7 @@ ParticleSystem:
startSize: startSize:
serializedVersion: 2 serializedVersion: 2
minMaxState: 0 minMaxState: 0
scalar: 1 scalar: 1.98
minScalar: 1 minScalar: 1
maxCurve: maxCurve:
serializedVersion: 2 serializedVersion: 2
@@ -8474,9 +8475,9 @@ ParticleSystem:
m_NumAlphaKeys: 2 m_NumAlphaKeys: 2
range: {x: 0, y: 1} range: {x: 0, y: 1}
CollisionModule: CollisionModule:
enabled: 0 enabled: 1
serializedVersion: 4 serializedVersion: 4
type: 0 type: 1
collisionMode: 0 collisionMode: 0
colliderForce: 0 colliderForce: 0
multiplyColliderForceByParticleSize: 0 multiplyColliderForceByParticleSize: 0
@@ -8644,14 +8645,14 @@ ParticleSystem:
m_RotationOrder: 4 m_RotationOrder: 4
minKillSpeed: 0 minKillSpeed: 0
maxKillSpeed: 10000 maxKillSpeed: 10000
radiusScale: 1 radiusScale: 0.15
collidesWith: collidesWith:
serializedVersion: 2 serializedVersion: 2
m_Bits: 4294967295 m_Bits: 4294967295
maxCollisionShapes: 256 maxCollisionShapes: 256
quality: 0 quality: 0
voxelSize: 0.5 voxelSize: 0.5
collisionMessages: 0 collisionMessages: 1
collidesWithDynamic: 1 collidesWithDynamic: 1
interiorCollisions: 0 interiorCollisions: 0
TriggerModule: TriggerModule:

View File

@@ -867,7 +867,7 @@ ParticleSystem:
rateOverTime: rateOverTime:
serializedVersion: 2 serializedVersion: 2
minMaxState: 0 minMaxState: 0
scalar: 5 scalar: 8
minScalar: 10 minScalar: 10
maxCurve: maxCurve:
serializedVersion: 2 serializedVersion: 2
@@ -3805,12 +3805,7 @@ ParticleSystem:
SubModule: SubModule:
serializedVersion: 2 serializedVersion: 2
enabled: 0 enabled: 0
subEmitters: subEmitters: []
- serializedVersion: 3
emitter: {fileID: 0}
type: 0
properties: 0
emitProbability: 1
LightsModule: LightsModule:
enabled: 0 enabled: 0
ratio: 0 ratio: 0
@@ -5679,7 +5674,7 @@ ParticleSystem:
rateOverTime: rateOverTime:
serializedVersion: 2 serializedVersion: 2
minMaxState: 0 minMaxState: 0
scalar: 5 scalar: 8
minScalar: 10 minScalar: 10
maxCurve: maxCurve:
serializedVersion: 2 serializedVersion: 2
@@ -8618,12 +8613,7 @@ ParticleSystem:
SubModule: SubModule:
serializedVersion: 2 serializedVersion: 2
enabled: 0 enabled: 0
subEmitters: subEmitters: []
- serializedVersion: 3
emitter: {fileID: 0}
type: 0
properties: 0
emitProbability: 1
LightsModule: LightsModule:
enabled: 0 enabled: 0
ratio: 0 ratio: 0
@@ -9677,7 +9667,7 @@ MonoBehaviour:
duration: 798987 duration: 798987
notified: 0 notified: 0
enemy: {fileID: 0} enemy: {fileID: 0}
speed: 100 speed: 50
--- !u!1 &7681109217013036522 --- !u!1 &7681109217013036522
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -10545,7 +10535,7 @@ ParticleSystem:
rateOverTime: rateOverTime:
serializedVersion: 2 serializedVersion: 2
minMaxState: 0 minMaxState: 0
scalar: 5 scalar: 8
minScalar: 10 minScalar: 10
maxCurve: maxCurve:
serializedVersion: 2 serializedVersion: 2
@@ -13483,12 +13473,7 @@ ParticleSystem:
SubModule: SubModule:
serializedVersion: 2 serializedVersion: 2
enabled: 0 enabled: 0
subEmitters: subEmitters: []
- serializedVersion: 3
emitter: {fileID: 0}
type: 0
properties: 0
emitProbability: 1
LightsModule: LightsModule:
enabled: 0 enabled: 0
ratio: 0 ratio: 0
@@ -15357,7 +15342,7 @@ ParticleSystem:
rateOverTime: rateOverTime:
serializedVersion: 2 serializedVersion: 2
minMaxState: 0 minMaxState: 0
scalar: 5 scalar: 8
minScalar: 10 minScalar: 10
maxCurve: maxCurve:
serializedVersion: 2 serializedVersion: 2
@@ -18295,12 +18280,7 @@ ParticleSystem:
SubModule: SubModule:
serializedVersion: 2 serializedVersion: 2
enabled: 0 enabled: 0
subEmitters: subEmitters: []
- serializedVersion: 3
emitter: {fileID: 0}
type: 0
properties: 0
emitProbability: 1
LightsModule: LightsModule:
enabled: 0 enabled: 0
ratio: 0 ratio: 0

View File

@@ -0,0 +1,113 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &7939944331332505904
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7939944331332505933}
- component: {fileID: 7939944331332505932}
- component: {fileID: 7939944331332505907}
- component: {fileID: 7939944331332505906}
- component: {fileID: 7939944331332505905}
m_Layer: 0
m_Name: BulletFreezeRemove
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7939944331332505933
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7939944331332505904}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -4.26, y: 0.50000095, z: 3.45}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &7939944331332505932
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7939944331332505904}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &7939944331332505907
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7939944331332505904}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!65 &7939944331332505906
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7939944331332505904}
m_Material: {fileID: 0}
m_IsTrigger: 1
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &7939944331332505905
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7939944331332505904}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6ca67d0a50f0bad4593ac6b57598a2c0, type: 3}
m_Name:
m_EditorClassIdentifier:
freezeParticles: {fileID: 7607355574132867090, guid: 1cdaf06d2b32d1d468c55a8319dd4582, type: 3}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: bf9774e8d9a471646a052a48d53734e7
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -110,5 +110,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: b7fc4a204d93a5744884d00c8aa7917c, type: 3} m_Script: {fileID: 11500000, guid: b7fc4a204d93a5744884d00c8aa7917c, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
extinguishEffect: {fileID: 7607355574132867090, guid: 1cdaf06d2b32d1d468c55a8319dd4582, type: 3}
player: {fileID: 0} player: {fileID: 0}
amount: 0.75 amount: 0.75

View File

@@ -0,0 +1,113 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &448384805825873017
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 448384805825873012}
- component: {fileID: 448384805825873013}
- component: {fileID: 448384805825873014}
- component: {fileID: 448384805825873015}
- component: {fileID: 448384805825873016}
m_Layer: 0
m_Name: NoTrail
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &448384805825873012
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 448384805825873017}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -3.9003305, y: 0.50000095, z: 3.661797}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &448384805825873013
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 448384805825873017}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &448384805825873014
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 448384805825873017}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!65 &448384805825873015
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 448384805825873017}
m_Material: {fileID: 0}
m_IsTrigger: 1
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &448384805825873016
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 448384805825873017}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 31ff5267abecebc4b85a296d075e48c5, type: 3}
m_Name:
m_EditorClassIdentifier:
noTrailDuration: 5

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 094d0ee7d7045c448bbe8a9a53e6b036
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,114 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &7515728833028880720
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7515728833028880683}
- component: {fileID: 7515728833028880724}
- component: {fileID: 7515728833028880725}
- component: {fileID: 7515728833028880726}
- component: {fileID: 7515728833028880727}
m_Layer: 0
m_Name: Slowmotion
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7515728833028880683
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7515728833028880720}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -2.68011, y: 0.5, z: 0.44165373}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &7515728833028880724
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7515728833028880720}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &7515728833028880725
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7515728833028880720}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!65 &7515728833028880726
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7515728833028880720}
m_Material: {fileID: 0}
m_IsTrigger: 1
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &7515728833028880727
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7515728833028880720}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 22f3fb16216e9164eafc1c9945d5016d, type: 3}
m_Name:
m_EditorClassIdentifier:
slowFactor: 0.5
slowDuration: 5

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 1438786204748de429da37ca2ec9374c
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -4,6 +4,7 @@ using UnityEngine;
public class Pickup : MonoBehaviour public class Pickup : MonoBehaviour
{ {
protected bool pickedUp = false;
public virtual void OnPickup() public virtual void OnPickup()
{ {
@@ -14,8 +15,18 @@ public class Pickup : MonoBehaviour
Debug.Log("Pickup"); Debug.Log("Pickup");
if (other.gameObject.tag == "Player") if (other.gameObject.tag == "Player")
{ {
pickedUp = true;
OnPickup(); OnPickup();
Destroy(gameObject);
} }
} }
//Draw text gizmo in editor to show class name
void OnDrawGizmos()
{
//get curren class name
string className = this.GetType().ToString();
GUI.color = Color.blue;
UnityEditor.Handles.Label(transform.position, className);
}
} }

View File

@@ -0,0 +1,63 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BulletFreezeRemove : Pickup
{
public ParticleSystem freezeParticles;
// Start is called before the first frame update
void Start()
{
}
public override void OnPickup()
{
//hide renderer
GetComponent<MeshRenderer>().enabled = false;
GetComponent<Collider>().enabled = false;
Debug.Log("Start thingy");
//find all particles in the scene and freeze them
ParticleSystem[] particleSystems = FindObjectsOfType<ParticleSystem>();
foreach (ParticleSystem particleSystem in particleSystems)
{
//if root gameobject has no pattern component it's not a pattern
GameObject root = particleSystem.transform.root.gameObject;
if (!root.GetComponent<Pattern>())
{
return;
}
int particleCount = particleSystem.particleCount;
ParticleSystem.Particle[] particles = new ParticleSystem.Particle[particleCount];
particleSystem.GetParticles(particles);
for (int i = 0; i < particleCount; i++)
{
particles[i].velocity = Vector3.zero;
}
particleSystem.SetParticles(particles, particleCount);
StartCoroutine(RemoveParticle(particles, particleCount, particleSystem));
}
}
//coroutine that takes a collection of particles and removes one at a time
IEnumerator RemoveParticle(ParticleSystem.Particle[] particles, int particleCount, ParticleSystem particleSystem)
{
//Remove all particles over a span of .5 seconds
for (int i = 0; i < particleCount; i++)
{
particles[i].remainingLifetime = 0.0f;
particleSystem.SetParticles(particles, particleCount);
//instantiate freeze particles at the position of the particle
Instantiate(freezeParticles, particles[i].position, Quaternion.identity);
yield return new WaitForSeconds(0.5f/particleCount);
}
}
}

View File

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

View File

@@ -4,6 +4,7 @@ using UnityEngine;
public class Extinguisher : Pickup public class Extinguisher : Pickup
{ {
public ParticleSystem extinguishEffect;
public Player player; public Player player;
[SerializeField] [SerializeField]
@@ -11,13 +12,38 @@ public class Extinguisher : Pickup
public override void OnPickup() public override void OnPickup()
{ {
// we have to stop the particle system before making changes ParticleSystem particleSystem = player.trail.GetComponent<ParticleSystem>();
ParticleSystem system = player.trail.GetComponent<ParticleSystem>();
system.Stop(); int particleCount = particleSystem.particleCount;
ParticleSystem.Particle[] particles = new ParticleSystem.Particle[particleCount];
particleSystem.GetParticles(particles);
system.startLifetime *= amount; for (int i = 0; i < particleCount; i++)
{
if (particles[i].remainingLifetime < particleSystem.main.startLifetime.constant * 0.5f)
{
particles[i].remainingLifetime = 0.0f;
}
//instantiate freeze particles at the position of the particle
}
particleSystem.SetParticles(particles, particleCount);
StartCoroutine(SpawnEffectsCoroutine(particles, particleCount, particleSystem));
}
IEnumerator SpawnEffectsCoroutine(ParticleSystem.Particle[] particles, int count, ParticleSystem system)
{
system.Play(); for (int i = 0; i < count; i+=20)
{
if (particles[i].remainingLifetime < system.main.startLifetime.constant * 0.5f)
{
//instantiate freeze particles at the position of the particle
Instantiate(extinguishEffect, particles[i].position, Quaternion.identity);
yield return null;
}
}
} }
// Start is called before the first frame update // Start is called before the first frame update

View File

@@ -0,0 +1,35 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NoTrail : Pickup
{
private Player player;
public float noTrailDuration = 5f;
// Start is called before the first frame update
void Start()
{
player = GameObject.Find("Player").GetComponent<Player>();
}
public override void OnPickup()
{
player.trail.SetActive(false);
}
// Update is called once per frame
void Update()
{
if (pickedUp)
{
noTrailDuration -= Time.deltaTime;
if (noTrailDuration <= 0)
{
player.trail.SetActive(true);
Destroy(gameObject);
}
}
}
}

View File

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

View File

@@ -0,0 +1,32 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Slowmotion : Pickup
{
public float slowFactor = 0.5f;
public float slowDuration = 5f;
private bool isSlow = false;
public override void OnPickup()
{
Debug.Log("Slowmotion");
isSlow = true;
Time.timeScale = Time.timeScale * slowFactor;
}
// Update is called once per frame
void Update()
{
if (isSlow)
{
slowDuration -= Time.deltaTime * (1 / slowFactor);
if (slowDuration <= 0)
{
Time.timeScale = Time.timeScale * (1 / slowFactor);
Destroy(gameObject);
}
}
}
}

View File

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