improv: added reference to movement for UnitComponent.cs

This commit is contained in:
Chris
2025-10-23 21:48:05 -04:00
parent 392f24a916
commit 129a5226c5

View File

@@ -5,16 +5,18 @@ namespace Reset.Units{
private bool enabledAsHost = true; private bool enabledAsHost = true;
private Unit _unit; private Unit _unit;
internal Unit Unit{ internal Unit Unit{
get { get {
if (_unit != null) { if (_unit == null) { _unit = GetComponent<Unit>(); }
return _unit; return _unit;
} }
}
_unit = GetComponent<Unit>(); private UnitMovementHandler _movement;
internal UnitMovementHandler Movement{
return _unit; get {
if (_movement == null) { _movement = GetComponent<UnitMovementHandler>(); }
return _movement;
} }
} }