md, droplet

This commit is contained in:
orsolya-st
2026-06-06 17:11:05 +02:00
parent 4bcba747b9
commit 9c29e3d9b1
4 changed files with 7 additions and 19 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ GameObject:
- component: {fileID: 8211840801622381919} - component: {fileID: 8211840801622381919}
m_Layer: 0 m_Layer: 0
m_Name: MiniDroplet m_Name: MiniDroplet
m_TagString: Untagged m_TagString: Minidrop
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
+1 -8
View File
@@ -64,13 +64,7 @@ public class DamageHandler : MonoBehaviour
if (fallSpeed < -threshold) if (fallSpeed < -threshold)
{ {
float fallDamage = (-fallSpeed - threshold) * multiplier; float fallDamage = (-fallSpeed - threshold) * multiplier;
// Debug.Log($"Fell with velocity:{fallSpeed}. Fall damage{fallDamage}");
UpdateHealth(health - fallDamage); UpdateHealth(health - fallDamage);
// Debug.Log($"New health:{health - fallDamage}");
}
else
{
// Debug.Log($"Fell with velocity:{fallSpeed}. No fall damage");
} }
} }
@@ -80,12 +74,11 @@ public class DamageHandler : MonoBehaviour
this.health = health; this.health = health;
Transform transform = GetComponent<Transform>(); Transform transform = GetComponent<Transform>();
float healthScaling = minSize + (1 - minSize) * (this.health / maxHealth); float healthScaling = minSize + (1 - minSize) * (this.health / maxHealth);
//adjust size based on health
transform.localScale = new Vector3(healthScaling,healthScaling,healthScaling); transform.localScale = new Vector3(healthScaling,healthScaling,healthScaling);
// Debug.Log("UpdatedScale and health");
if(this.health <= 0f) if(this.health <= 0f)
{ {
// Debug.Log("Die");
Die(); Die();
} }
} }
-6
View File
@@ -11,10 +11,4 @@ public class MiniDroplet : MonoBehaviour
transform.localScale = targetSize; transform.localScale = targetSize;
} }
// Update is called once per frame
void Update()
{
}
} }
+1
View File
@@ -6,6 +6,7 @@ TagManager:
tags: tags:
- Border - Border
- Hole - Hole
- Minidrop
layers: layers:
- Default - Default
- TransparentFX - TransparentFX