change MapElement to scriptable object

This commit is contained in:
2023-06-27 20:33:07 +03:00
parent 26daa563e8
commit a861712e6c
17 changed files with 87 additions and 47 deletions
+2 -2
View File
@@ -95,9 +95,9 @@ public class Character : MonoBehaviour
var raycastHit=Physics2D.BoxCast(_boxCollider.bounds.center, _boxCollider.bounds.size, 0f, direction, .1f, _mapLayer);
if (raycastHit)
{
var mapElement = raycastHit.transform.GetComponent<IMapElement>();
var mapElement = raycastHit.transform.GetComponent<MapElement>();
return mapElement == null ? MapElementType.Empty : mapElement.ElementType;
return mapElement == null ? MapElementType.Empty : mapElement.ElementSO.ElementType;
}
else
return MapElementType.Empty;