Projekt_SI_automatyczny_kelner/Assets/Logic/Graph/Obstacle.cs

33 lines
623 B
C#

using System.Linq;
using UnityEngine;
namespace Logic.Graph
{
public enum ObstacleType
{
Bar,
Water
}
[System.Serializable]
public class ObstacleData
{
public ObstacleType type;
public float penalty;
}
public class Obstacle : MonoBehaviour
{
[SerializeField] private ObstacleType obstacleType;
public float GETMovementPenaltyCost()
{
var obstacleData = SceneContext.Instance.obstacles.First(x => x.type == obstacleType);
return obstacleData.penalty;
}
}
}