blood crystal n shit

This commit is contained in:
SpoodyTheOne 2024-02-09 11:25:50 +01:00
parent 2a497e709b
commit b0ddba4661
12 changed files with 815 additions and 82 deletions

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,201 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &4381503231254675368
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1077053941215605897}
- component: {fileID: 3448570681267549935}
- component: {fileID: 8799638307818850525}
- component: {fileID: 5807956731245262098}
- component: {fileID: 172659813753747742}
- component: {fileID: 1284510814332683786}
m_Layer: 0
m_Name: BloodChristaal
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1077053941215605897
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4381503231254675368}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -7.134935, y: -15.29, z: -0.019925445}
m_LocalScale: {x: 2, y: 2, z: 2}
m_ConstrainProportionsScale: 1
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &3448570681267549935
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4381503231254675368}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9a04027c92babe63dbeef9eae4bffcbe, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!212 &8799638307818850525
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4381503231254675368}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2}
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: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 92b791df6229fa882ab01fc4ec5e82d2, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 0.7, y: 0.68}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!58 &5807956731245262098
CircleCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4381503231254675368}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_ForceSendLayers:
serializedVersion: 2
m_Bits: 4294967295
m_ForceReceiveLayers:
serializedVersion: 2
m_Bits: 4294967295
m_ContactCaptureLayers:
serializedVersion: 2
m_Bits: 4294967295
m_CallbackLayers:
serializedVersion: 2
m_Bits: 4294967295
m_IsTrigger: 0
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0, y: 0}
serializedVersion: 2
m_Radius: 0.38
--- !u!114 &172659813753747742
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4381503231254675368}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1fdfc885f1a69704b893825cf9e616ba, type: 3}
m_Name:
m_EditorClassIdentifier:
bloodRegen: 0
regen: 1000
onlyCallZeroHealthOnce: 1
maxHealth: 10
damageTickDelay: 0.25
OnHealthZero:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 3448570681267549935}
m_TargetAssemblyTypeName: BloodCrystal, Assembly-CSharp
m_MethodName: Break
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
OnHealthChange:
m_PersistentCalls:
m_Calls: []
minThreshold: 1
squezeDamageScalor: 1
--- !u!50 &1284510814332683786
Rigidbody2D:
serializedVersion: 4
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4381503231254675368}
m_BodyType: 0
m_Simulated: 1
m_UseFullKinematicContacts: 0
m_UseAutoMass: 0
m_Mass: 1
m_LinearDrag: 1
m_AngularDrag: 0.05
m_GravityScale: 0
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_Interpolate: 0
m_SleepingMode: 1
m_CollisionDetection: 0
m_Constraints: 0

View File

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

View File

@ -220,6 +220,7 @@ GameObject:
- component: {fileID: 853766927484383816}
- component: {fileID: 2397480649246164426}
- component: {fileID: -3164836453224246603}
- component: {fileID: 1212052729596031123}
m_Layer: 0
m_Name: Enemy5V1
m_TagString: Enemy
@ -256,12 +257,26 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 1fdfc885f1a69704b893825cf9e616ba, type: 3}
m_Name:
m_EditorClassIdentifier:
bloodRegen: 0
regen: 1000
onlyCallZeroHealthOnce: 1
maxHealth: 250
damageTickDelay: 0.25
OnHealthZero:
m_PersistentCalls:
m_Calls: []
m_Calls:
- m_Target: {fileID: 1212052729596031123}
m_TargetAssemblyTypeName: BloodCrystalSpawner, Assembly-CSharp
m_MethodName: Die
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
OnHealthChange:
m_PersistentCalls:
m_Calls: []
@ -394,6 +409,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 4cdfa33fd6ed7d647a720cbd59cea7df, type: 3}
m_Name:
m_EditorClassIdentifier:
rng: 1000
projectile: {fileID: 4224894887191976968, guid: 804480739064e874fa6551dc5b8c6d65, type: 3}
Patterns:
- sequence:
@ -403,6 +419,19 @@ MonoBehaviour:
Burst: 0
Cooldown: 1
currentPattern: 0
--- !u!114 &1212052729596031123
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6905705041633878913}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: aac7411d1af5481569ac493744ccb2f2, type: 3}
m_Name:
m_EditorClassIdentifier:
BloodCrystalPrefab: {fileID: 4381503231254675368, guid: 121cbd15b682f39c7bc817ae85dee708, type: 3}
--- !u!1001 &1544961106352958877
PrefabInstance:
m_ObjectHideFlags: 0

View File

@ -220,6 +220,7 @@ GameObject:
- component: {fileID: 1353826037353208613}
- component: {fileID: 1166639589295390852}
- component: {fileID: 6145143653343788094}
- component: {fileID: -6978539697383785262}
m_Layer: 0
m_Name: Enemy5V2
m_TagString: Enemy
@ -256,12 +257,26 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 1fdfc885f1a69704b893825cf9e616ba, type: 3}
m_Name:
m_EditorClassIdentifier:
bloodRegen: 0
regen: 1000
onlyCallZeroHealthOnce: 1
maxHealth: 250
damageTickDelay: 0.25
OnHealthZero:
m_PersistentCalls:
m_Calls: []
m_Calls:
- m_Target: {fileID: -6978539697383785262}
m_TargetAssemblyTypeName: BloodCrystalSpawner, Assembly-CSharp
m_MethodName: Die
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
OnHealthChange:
m_PersistentCalls:
m_Calls: []
@ -394,6 +409,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 4cdfa33fd6ed7d647a720cbd59cea7df, type: 3}
m_Name:
m_EditorClassIdentifier:
rng: 1000
projectile: {fileID: 4224894887191976968, guid: 804480739064e874fa6551dc5b8c6d65, type: 3}
Patterns:
- sequence:
@ -403,6 +419,19 @@ MonoBehaviour:
Burst: 0
Cooldown: 1
currentPattern: 0
--- !u!114 &-6978539697383785262
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6905705041633878913}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: aac7411d1af5481569ac493744ccb2f2, type: 3}
m_Name:
m_EditorClassIdentifier:
BloodCrystalPrefab: {fileID: 4381503231254675368, guid: 121cbd15b682f39c7bc817ae85dee708, type: 3}
--- !u!1001 &5603902875862274868
PrefabInstance:
m_ObjectHideFlags: 0

View File

@ -220,6 +220,7 @@ GameObject:
- component: {fileID: 1104779658182803384}
- component: {fileID: 6053117177104604418}
- component: {fileID: 2664353415873682946}
- component: {fileID: -5278124472999912130}
m_Layer: 0
m_Name: Enemy5V3
m_TagString: Enemy
@ -256,12 +257,26 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 1fdfc885f1a69704b893825cf9e616ba, type: 3}
m_Name:
m_EditorClassIdentifier:
bloodRegen: 0
regen: 1000
onlyCallZeroHealthOnce: 1
maxHealth: 250
damageTickDelay: 0.25
OnHealthZero:
m_PersistentCalls:
m_Calls: []
m_Calls:
- m_Target: {fileID: -5278124472999912130}
m_TargetAssemblyTypeName: BloodCrystalSpawner, Assembly-CSharp
m_MethodName: Die
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
OnHealthChange:
m_PersistentCalls:
m_Calls: []
@ -394,6 +409,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 4cdfa33fd6ed7d647a720cbd59cea7df, type: 3}
m_Name:
m_EditorClassIdentifier:
rng: 1000
projectile: {fileID: 4224894887191976968, guid: 804480739064e874fa6551dc5b8c6d65, type: 3}
Patterns:
- sequence:
@ -403,6 +419,19 @@ MonoBehaviour:
Burst: 0
Cooldown: 1
currentPattern: 0
--- !u!114 &-5278124472999912130
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6905705041633878913}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: aac7411d1af5481569ac493744ccb2f2, type: 3}
m_Name:
m_EditorClassIdentifier:
BloodCrystalPrefab: {fileID: 4381503231254675368, guid: 121cbd15b682f39c7bc817ae85dee708, type: 3}
--- !u!1001 &2018686273432440032
PrefabInstance:
m_ObjectHideFlags: 0

View File

@ -4406,6 +4406,10 @@ PrefabInstance:
propertyPath: players.Array.data[1]
value:
objectReference: {fileID: 1579580564}
- target: {fileID: 3603265075407754381, guid: c53e6971c95afb1429cd82616a7b6737, type: 3}
propertyPath: difficultyIncreasePerWave
value: 3
objectReference: {fileID: 0}
- target: {fileID: 4203055092890111090, guid: c53e6971c95afb1429cd82616a7b6737, type: 3}
propertyPath: offsetter
value:

View File

@ -48,6 +48,7 @@ public class BloodComputeShader : MonoBehaviour
const int InitDustKernel = 0;
const int UpdateDustKernel = 1;
const int CollectAllKernel = 2;
AsyncGPUReadbackRequest readbackRequest;
AsyncGPUReadbackRequest freeBloodReadRequest;
@ -89,6 +90,11 @@ public class BloodComputeShader : MonoBehaviour
// Init dust particle positions
bloodCompute.SetBuffer(InitDustKernel, "particles", particleBuffer);
bloodCompute.SetBuffer(InitDustKernel, "positions", positionBuffer);
bloodCompute.SetBuffer(CollectAllKernel, "particles", particleBuffer);
bloodCompute.SetBuffer(CollectAllKernel, "positions", positionBuffer);
bloodCompute.SetInt("numParticles", numParticles);
// Create args buffer
@ -135,6 +141,10 @@ public class BloodComputeShader : MonoBehaviour
bloodCompute.SetVector("mop2Pos", mop2.transform.position);
bloodCompute.SetFloat("CleanRadius", CleanRadius);
// if (Input.GetKeyUp(KeyCode.Alpha9)) {
// cleanAllBlood();
// }
if (readbackRequest.hasError)
{
RequestAllBloodStates();
@ -221,6 +231,10 @@ public class BloodComputeShader : MonoBehaviour
{
}
public void cleanAllBlood() {
ComputeHelper.Dispatch(bloodCompute, numParticles, 1, 1, CollectAllKernel);
}
public void createBlood(Vector3 wher, int muchies, float powah)
{
StartCoroutine(penisBlood(wher, muchies, powah));

View File

@ -0,0 +1,12 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BloodCrystalSpawner : MonoBehaviour
{
public GameObject BloodCrystalPrefab;
public void Die() {
Instantiate(BloodCrystalPrefab, transform.position, Quaternion.identity);
}
}

View File

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

View File

@ -1,5 +1,6 @@
#pragma kernel InitDust
#pragma kernel UpdateDust
#pragma kernel CollectAll
struct Particle {
float3 position;
@ -40,8 +41,8 @@ uint hash(uint state) {
float scaleToRange01(uint state) { return state / 4294967295.0; }
[numthreads(64, 1, 1)] void InitDust(uint3 id
: SV_DispatchThreadID) {
[numthreads(64, 1, 1)]
void InitDust(uint3 id: SV_DispatchThreadID) {
if (id.x > particlesToInitialize) {
return;
}
@ -91,8 +92,8 @@ float scaleToRange01(uint state) { return state / 4294967295.0; }
// InterlockedAdd(numParticlesInitialized[0],1);
}
[numthreads(64, 1, 1)] void UpdateDust(uint3 id
: SV_DispatchThreadID) {
[numthreads(64, 1, 1)]
void UpdateDust(uint3 id: SV_DispatchThreadID) {
uint i = id.x;
if (particles[i].enabled == 0) {
@ -137,3 +138,24 @@ float scaleToRange01(uint state) { return state / 4294967295.0; }
particles[i].position += particles[i].velocity * deltaTime;
positions[i] = float4(particles[i].position, particles[i].enabled * size);
}
[numthreads(64, 1, 1)]
void CollectAll(uint3 id: SV_DispatchThreadID) {
uint i = id.x;
if (particles[i].enabled == 0) {
return;
}
float3 pos = mop1Pos;
float state = hash(i);
if (scaleToRange01(state) < 0.5) {
pos = mop2Pos;
}
particles[i].velocity = pos - particles[i].position;
particles[i].velocity.z = 5;
particles[i].position.z = 0.01;
}

View File

@ -407,7 +407,7 @@ public class RopeSimulator : MonoBehaviour
private void HandleStaticCollidersOfPoint(Point p)
{
foreach (var hitCollider in Physics2D.OverlapCircleAll(p.position, ropeRadius, staticColliderMask))
foreach (var hitCollider in Physics2D.OverlapCircleAll(p.position, ropeRadius*1.1f, staticColliderMask))
{
if (hitCollider == null) continue;
if (hitCollider.isTrigger) continue;