md, droplet
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,10 +11,4 @@ public class MiniDroplet : MonoBehaviour
|
|||||||
|
|
||||||
transform.localScale = targetSize;
|
transform.localScale = targetSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update is called once per frame
|
|
||||||
void Update()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ TagManager:
|
|||||||
tags:
|
tags:
|
||||||
- Border
|
- Border
|
||||||
- Hole
|
- Hole
|
||||||
|
- Minidrop
|
||||||
layers:
|
layers:
|
||||||
- Default
|
- Default
|
||||||
- TransparentFX
|
- TransparentFX
|
||||||
|
|||||||
Reference in New Issue
Block a user