Files
project-reset/Assets/Scripts/Units/Combat/UnitComponent.cs

25 lines
495 B
C#

using Unity.Netcode;
namespace Reset.Units{
public class UnitComponent : NetworkBehaviour{
private bool enabledAsHost = true;
private Unit _unit;
internal Unit Unit{
get {
if (_unit != null) {
return _unit;
}
_unit = GetComponent<Unit>();
return _unit;
}
}
void DisableComponent(){
enabledAsHost = false;
}
}
}