Merge branch 'main' into Netcode

This commit is contained in:
BOT Alex 2024-02-27 18:28:12 +01:00
commit 48b92c3705
15 changed files with 868 additions and 140 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: 172659813753747742}
- component: {fileID: 1284510814332683786}
- component: {fileID: -366506843679355488}
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: 1, y: 1, z: 1}
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!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
--- !u!58 &-366506843679355488
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: 1.01

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: 853766927484383816}
- component: {fileID: 2397480649246164426} - component: {fileID: 2397480649246164426}
- component: {fileID: -3164836453224246603} - component: {fileID: -3164836453224246603}
- component: {fileID: 1212052729596031123}
m_Layer: 0 m_Layer: 0
m_Name: Enemy5V1 m_Name: Enemy5V1
m_TagString: Enemy m_TagString: Enemy
@ -256,12 +257,26 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 1fdfc885f1a69704b893825cf9e616ba, type: 3} m_Script: {fileID: 11500000, guid: 1fdfc885f1a69704b893825cf9e616ba, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
bloodRegen: 0
regen: 1000
onlyCallZeroHealthOnce: 1 onlyCallZeroHealthOnce: 1
maxHealth: 250 maxHealth: 250
damageTickDelay: 0.25 damageTickDelay: 0.25
OnHealthZero: OnHealthZero:
m_PersistentCalls: 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: OnHealthChange:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
@ -394,6 +409,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 4cdfa33fd6ed7d647a720cbd59cea7df, type: 3} m_Script: {fileID: 11500000, guid: 4cdfa33fd6ed7d647a720cbd59cea7df, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
rng: 1000
projectile: {fileID: 4224894887191976968, guid: 804480739064e874fa6551dc5b8c6d65, type: 3} projectile: {fileID: 4224894887191976968, guid: 804480739064e874fa6551dc5b8c6d65, type: 3}
Patterns: Patterns:
- sequence: - sequence:
@ -403,6 +419,19 @@ MonoBehaviour:
Burst: 0 Burst: 0
Cooldown: 1 Cooldown: 1
currentPattern: 0 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 --- !u!1001 &1544961106352958877
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@ -220,6 +220,7 @@ GameObject:
- component: {fileID: 1353826037353208613} - component: {fileID: 1353826037353208613}
- component: {fileID: 1166639589295390852} - component: {fileID: 1166639589295390852}
- component: {fileID: 6145143653343788094} - component: {fileID: 6145143653343788094}
- component: {fileID: -6978539697383785262}
m_Layer: 0 m_Layer: 0
m_Name: Enemy5V2 m_Name: Enemy5V2
m_TagString: Enemy m_TagString: Enemy
@ -256,12 +257,26 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 1fdfc885f1a69704b893825cf9e616ba, type: 3} m_Script: {fileID: 11500000, guid: 1fdfc885f1a69704b893825cf9e616ba, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
bloodRegen: 0
regen: 1000
onlyCallZeroHealthOnce: 1 onlyCallZeroHealthOnce: 1
maxHealth: 250 maxHealth: 250
damageTickDelay: 0.25 damageTickDelay: 0.25
OnHealthZero: OnHealthZero:
m_PersistentCalls: 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: OnHealthChange:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
@ -394,6 +409,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 4cdfa33fd6ed7d647a720cbd59cea7df, type: 3} m_Script: {fileID: 11500000, guid: 4cdfa33fd6ed7d647a720cbd59cea7df, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
rng: 1000
projectile: {fileID: 4224894887191976968, guid: 804480739064e874fa6551dc5b8c6d65, type: 3} projectile: {fileID: 4224894887191976968, guid: 804480739064e874fa6551dc5b8c6d65, type: 3}
Patterns: Patterns:
- sequence: - sequence:
@ -403,6 +419,19 @@ MonoBehaviour:
Burst: 0 Burst: 0
Cooldown: 1 Cooldown: 1
currentPattern: 0 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 --- !u!1001 &5603902875862274868
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@ -220,6 +220,7 @@ GameObject:
- component: {fileID: 1104779658182803384} - component: {fileID: 1104779658182803384}
- component: {fileID: 6053117177104604418} - component: {fileID: 6053117177104604418}
- component: {fileID: 2664353415873682946} - component: {fileID: 2664353415873682946}
- component: {fileID: -5278124472999912130}
m_Layer: 0 m_Layer: 0
m_Name: Enemy5V3 m_Name: Enemy5V3
m_TagString: Enemy m_TagString: Enemy
@ -256,12 +257,26 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 1fdfc885f1a69704b893825cf9e616ba, type: 3} m_Script: {fileID: 11500000, guid: 1fdfc885f1a69704b893825cf9e616ba, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
bloodRegen: 0
regen: 1000
onlyCallZeroHealthOnce: 1 onlyCallZeroHealthOnce: 1
maxHealth: 250 maxHealth: 250
damageTickDelay: 0.25 damageTickDelay: 0.25
OnHealthZero: OnHealthZero:
m_PersistentCalls: 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: OnHealthChange:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
@ -394,6 +409,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 4cdfa33fd6ed7d647a720cbd59cea7df, type: 3} m_Script: {fileID: 11500000, guid: 4cdfa33fd6ed7d647a720cbd59cea7df, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
rng: 1000
projectile: {fileID: 4224894887191976968, guid: 804480739064e874fa6551dc5b8c6d65, type: 3} projectile: {fileID: 4224894887191976968, guid: 804480739064e874fa6551dc5b8c6d65, type: 3}
Patterns: Patterns:
- sequence: - sequence:
@ -403,6 +419,19 @@ MonoBehaviour:
Burst: 0 Burst: 0
Cooldown: 1 Cooldown: 1
currentPattern: 0 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 --- !u!1001 &2018686273432440032
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

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

View File

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

@ -0,0 +1,11 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BloodCrystal : MonoBehaviour
{
public void Break() {
BloodComputeShader.Instance.cleanAllBlood();
Destroy(gameObject);
}
}

View File

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

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

@ -456,7 +456,7 @@ public class RopeSimulator : MonoBehaviour
private void HandleStaticCollidersOfPoint(Point p) 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 == null) continue;
if (hitCollider.isTrigger) continue; if (hitCollider.isTrigger) continue;

View File

@ -129,62 +129,6 @@ public class Upgrader : MonoBehaviour
if (canUpgrade()) if (canUpgrade())
{ {
//keyboard upgrade
if (Input.GetKeyUp(KeyCode.Alpha1))
{
bloodManager.score -= upgradeCost;
upgradeCost = (int)(upgradeCost * 1.2f);
UpgradeMopSize();
}
else if (Input.GetKeyUp(KeyCode.Alpha2))
{
bloodManager.score -= upgradeCost;
upgradeCost = (int)(upgradeCost * 1.2f);
UpgradeSpeed();
}
else if (Input.GetKeyUp(KeyCode.Alpha3))
{
bloodManager.score -= upgradeCost;
upgradeCost = (int)(upgradeCost * 1.2f);
RopeUpgrade();
}
else if (Input.GetKeyUp(KeyCode.Alpha4))
{
bloodManager.score -= upgradeCost;
upgradeCost = (int)(upgradeCost * 1.2f);
HealthUpgrade();
}
else if (Input.GetKeyUp(KeyCode.Alpha5))
{
bloodManager.score -= upgradeCost;
upgradeCost = (int)(upgradeCost * 1.2f);
DamageUpgrade();
}
else if (Input.GetKeyUp(KeyCode.Alpha6))
{
bloodManager.score -= upgradeCost;
upgradeCost = (int)(upgradeCost * 1.2f);
BloodUpgrade();
}
else if (Input.GetKeyUp(KeyCode.Alpha7))
{
bloodManager.score -= upgradeCost;
upgradeCost = (int)(upgradeCost * 1.2f);
ReelUpgrade();
}
else if (Input.GetKeyUp(KeyCode.Alpha8))
{
ReviveUpgrade();
bloodManager.score -= upgradeCost;
upgradeCost = (int)(upgradeCost * 1.2f);
}
if (!prevCouldUpgrade) if (!prevCouldUpgrade)
{ {
@ -201,6 +145,40 @@ public class Upgrader : MonoBehaviour
int p1a = getRegion(Player1Input.look.x, Player1Input.look.y, 8); int p1a = getRegion(Player1Input.look.x, Player1Input.look.y, 8);
int p2a = getRegion(Player2Input.look.x, Player2Input.look.y, 8); int p2a = getRegion(Player2Input.look.x, Player2Input.look.y, 8);
//keyboard upgrade
if (Input.GetKey(KeyCode.Alpha1))
{
p1a = p2a = 0;
}
else if (Input.GetKey(KeyCode.Alpha2))
{
p1a = p2a = 1;
}
else if (Input.GetKey(KeyCode.Alpha3))
{
p1a = p2a = 2;
}
else if (Input.GetKey(KeyCode.Alpha4))
{
p1a = p2a = 3;
}
else if (Input.GetKey(KeyCode.Alpha5))
{
p1a = p2a = 4;
}
else if (Input.GetKey(KeyCode.Alpha6))
{
p1a = p2a = 5;
}
else if (Input.GetKey(KeyCode.Alpha7))
{
p1a = p2a = 6;
}
else if (Input.GetKey(KeyCode.Alpha8))
{
p1a = p2a = 7;
}
if (p1a != -1 && p2a == p1a) if (p1a != -1 && p2a == p1a)
{ {
if (acceptTime > 2f) if (acceptTime > 2f)

View File

@ -141,8 +141,7 @@ PlayerSettings:
vulkanEnableCommandBufferRecycling: 1 vulkanEnableCommandBufferRecycling: 1
loadStoreDebugModeEnabled: 0 loadStoreDebugModeEnabled: 0
bundleVersion: 0.1 Alpha bundleVersion: 0.1 Alpha
preloadedAssets: preloadedAssets: []
- {fileID: 11400000, guid: de04e34f85a966e4da851d9b3d804fa1, type: 2}
metroInputSource: 0 metroInputSource: 0
wsaTransparentSwapchain: 0 wsaTransparentSwapchain: 0
m_HolographicPauseOnTrackingLoss: 1 m_HolographicPauseOnTrackingLoss: 1