added: units can now have their movement settings set through rpc

This commit is contained in:
Chris
2025-10-08 22:55:55 -04:00
parent eb7ff08b50
commit 44e3a3ef7a
4 changed files with 119 additions and 38 deletions

View File

@@ -1,13 +1,25 @@
using Unity.Netcode;
public class UnitComponent : NetworkBehaviour{
private bool enabledAsHost = true;
void DisableComponents(){
enabledAsHost = false;
}
void Update(){
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;
}
}
}