This commit is contained in:
OliverS 2024-02-04 10:03:34 +01:00
commit adcf1b9f3e
6 changed files with 113 additions and 7 deletions

View File

@ -665,6 +665,38 @@ PrefabInstance:
propertyPath: m_IncludeLayers.m_Bits
value: 4294967295
objectReference: {fileID: 0}
- target: {fileID: 3086165646112058191, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3}
propertyPath: OnHealthZero.m_PersistentCalls.m_Calls.Array.size
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3086165646112058191, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3}
propertyPath: OnHealthZero.m_PersistentCalls.m_Calls.Array.data[0].m_Mode
value: 3
objectReference: {fileID: 0}
- target: {fileID: 3086165646112058191, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3}
propertyPath: OnHealthZero.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 1566837125}
- target: {fileID: 3086165646112058191, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3}
propertyPath: OnHealthZero.m_PersistentCalls.m_Calls.Array.data[0].m_CallState
value: 2
objectReference: {fileID: 0}
- target: {fileID: 3086165646112058191, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3}
propertyPath: OnHealthZero.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: playerDied
objectReference: {fileID: 0}
- target: {fileID: 3086165646112058191, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3}
propertyPath: OnHealthZero.m_PersistentCalls.m_Calls.Array.data[0].m_TargetAssemblyTypeName
value: GameManager, Assembly-CSharp
objectReference: {fileID: 0}
- target: {fileID: 3086165646112058191, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3}
propertyPath: OnHealthZero.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_IntArgument
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3086165646112058191, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3}
propertyPath: OnHealthZero.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName
value: UnityEngine.Object, UnityEngine
objectReference: {fileID: 0}
- target: {fileID: 3120938410244321186, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3}
propertyPath: m_Name
value: Player2
@ -1253,6 +1285,34 @@ PrefabInstance:
propertyPath: m_Parameters.widthCurve.m_Curve.Array.data[1].outWeight
value: 0.33333334
objectReference: {fileID: 0}
- target: {fileID: 3086165646112058191, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3}
propertyPath: OnHealthZero.m_PersistentCalls.m_Calls.Array.size
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3086165646112058191, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3}
propertyPath: OnHealthZero.m_PersistentCalls.m_Calls.Array.data[0].m_Mode
value: 3
objectReference: {fileID: 0}
- target: {fileID: 3086165646112058191, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3}
propertyPath: OnHealthZero.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 1566837125}
- target: {fileID: 3086165646112058191, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3}
propertyPath: OnHealthZero.m_PersistentCalls.m_Calls.Array.data[0].m_CallState
value: 2
objectReference: {fileID: 0}
- target: {fileID: 3086165646112058191, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3}
propertyPath: OnHealthZero.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: playerDied
objectReference: {fileID: 0}
- target: {fileID: 3086165646112058191, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3}
propertyPath: OnHealthZero.m_PersistentCalls.m_Calls.Array.data[0].m_TargetAssemblyTypeName
value: GameManager, Assembly-CSharp
objectReference: {fileID: 0}
- target: {fileID: 3086165646112058191, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3}
propertyPath: OnHealthZero.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName
value: UnityEngine.Object, UnityEngine
objectReference: {fileID: 0}
- target: {fileID: 3120938410244321186, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3}
propertyPath: m_Name
value: Player1
@ -3042,6 +3102,18 @@ MonoBehaviour:
textParent: {fileID: 1481267923}
damageTextPrefab: {fileID: 8357464303304312906, guid: 25c9a2db8fc5b7c4f8feebba5c73e7a3, type: 3}
lifeTime: 3
--- !u!114 &1566837125
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1566837117}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: cfcb795658e5b9d8bbbf6d6e238c21a0, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1579580564 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 3120938410244321186, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3}
@ -3234,6 +3306,9 @@ PrefabInstance:
- targetCorrespondingSourceObject: {fileID: 809911508645467208, guid: ec5007446d8bbca48bf02b3a7e752da1, type: 3}
insertIndex: -1
addedObject: {fileID: 1566837120}
- targetCorrespondingSourceObject: {fileID: 809911508645467208, guid: ec5007446d8bbca48bf02b3a7e752da1, type: 3}
insertIndex: -1
addedObject: {fileID: 1566837125}
m_SourcePrefab: {fileID: 100100000, guid: ec5007446d8bbca48bf02b3a7e752da1, type: 3}
--- !u!1001 &4158834148864819266
PrefabInstance:

View File

@ -163,7 +163,7 @@ public class BloodComputeShader : MonoBehaviour
activeParticles -= (int)totalBloodCleaned;
score += bufferData[0];
score += totalBloodCleaned;
// this doesnt exist but ok
// float mappedRumble = Convert.ToSingle(bufferData[0]).Remap(0, RumbleAmount, 0, 0.1f);

View File

@ -1,13 +1,33 @@
using System.Collections;
using System.Collections.Generic;
using System;
using UnityEngine;
using UnityEngine.Events;
public class GameManager : MonoBehaviour
{
// Start is called before the first frame update
public static GameManager Instance { get; private set; }
public Action OnPlayerDied;
void Awake()
{
if (Instance != null)
{
Instance = this;
DontDestroyOnLoad(gameObject);
}
Destroy(gameObject);
}
void Start()
{
}
public void playerDied(int who)
{
Debug.Break();
}
// Update is called once per frame

View File

@ -77,9 +77,10 @@ public class HealthComponent : MonoBehaviour, ISquezeDamageReceiver
if (BloodComputeShader.Instance != null)
{
int blood = (int)(maxHealth * 100.0f * BloodComputeShader.Instance.scoreMult);
float power = 10.0f + (maxHealth / 25.0f);
BloodComputeShader.Instance.createBlood(transform.position, blood / 2, maxHealth / 8.0f);
BloodComputeShader.Instance.createBlood(transform.position, blood / 2, maxHealth / 8.0f);
BloodComputeShader.Instance.createBlood(transform.position, blood / 2, power);
BloodComputeShader.Instance.createBlood(transform.position, blood / 2, power);
}
}
}

View File

@ -9,6 +9,8 @@ public class PlayerCollideAttack : MonoBehaviour
[SerializeField] AnimationCurve speedToDamage;
public float speedYouNeedToNotTakeDamageFromRammingOrSomtmh = 10f;
public void OnCollisionEnter2D(Collision2D collision)
{
if (collision.collider.tag != "Enemy") return;

View File

@ -18,6 +18,8 @@ public class PlayerMovement : MonoBehaviour
[Header("Whipping")]
[SerializeField]
RopeWhipAttack whipAttack;
public float whipSmashSpeed = 2f;
public float whipSmashDamageMult = 2f;
[SerializeField]
private float whipMoveSpeed = 25f;
@ -28,6 +30,7 @@ public class PlayerMovement : MonoBehaviour
private PlayerInput playerInput;
private HealthComponent hp;
private PlayerCollideAttack attack;
private void Start()
{
@ -85,7 +88,12 @@ public class PlayerMovement : MonoBehaviour
{
if (collision.collider.gameObject.CompareTag("Enemy"))
{ // Other object is an enemy
Debug.Log("Hit enememenemy");
if (whipAttack.IsBeingWhipped && rb.velocity.magnitude > attack.speedYouNeedToNotTakeDamageFromRammingOrSomtmh) {
// collision.collider.gameObject.GetComponent<HealthComponent>().TakeDamage(rb.velocity.magnitude * whipSmashDamageMult);
} else {
hp.TakeDamage(1f);
}
}
}
}