육지도착
This commit is contained in:
32
Assets/02_Scripts/Cave/DamageObstacle.cs
Normal file
32
Assets/02_Scripts/Cave/DamageObstacle.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class DamageObstacle : MonoBehaviour
|
||||
{
|
||||
public enum ObstacleType
|
||||
{
|
||||
Rock,
|
||||
Rhino,
|
||||
ClamBite
|
||||
}
|
||||
|
||||
[Header("Damage")]
|
||||
[SerializeField] private ObstacleType obstacleType = ObstacleType.Rock;
|
||||
[SerializeField] private int damage = 10;
|
||||
|
||||
[Header("Options")]
|
||||
[SerializeField] private bool canDamage = true;
|
||||
|
||||
public ObstacleType Type => obstacleType;
|
||||
public int Damage => damage;
|
||||
public bool CanDamage => canDamage;
|
||||
|
||||
public void SetCanDamage(bool value)
|
||||
{
|
||||
canDamage = value;
|
||||
}
|
||||
|
||||
public void SetDamage(int value)
|
||||
{
|
||||
damage = Mathf.Max(0, value);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user