NetworkEntityBehaviour
An abstract class in Root.Township, Alta.Networking.
Base class for game components that live on a NetworkEntity. Override its hooks to run code when the entity is set up, spawned by the server, or sent to a player.
- Listed in Networking and servers
- Inherits or implements
MonoBehaviour,INetworkEntityBehaviour - Derived types
ActionItem,AdditionalStaticContent,MeltingModel,Recycler,Smelter,BuilderDock,ChisellingDeck,TimberBlock,TimberBlockSpawner,CaveLayerManager,CaveTeleporter,CaveTeleporterManager,GenerationBase,LevelSelector,CaveLayerStaticObject,CaveLayerStreamer,Chunk,ChunkPositionSurface,StaticCaveChunk,WorldLandmarkManager,Cookable,CookingGarnishComponent,CookingLiquid,CookingPot,FruitNinja,StewComponent,StewManager,CraftingPart,CraftingTester,DecraftingComponent,GenericCraftingComponent,GenericCraftingResult,GenericCraftingStation,JointPoint,Enchantable,AtmosphereManager,ForestDefinedAtmosphere,GrassManager,ForestGenerator,ForestPopulationArea,HandShakeOffDetector,HeatArea,HeatSourceBase,HitModifierEffect,ImpactDetectorCentral,ImpactModifier,SparkSecondaryDetector,RotateToTargetWorldXZ,SeedSpray,SeedSprayManager,Target,CommunalStorage,DockArray,DockedOffset,GlobalCommunalStorageValues,Lock,LockableHinge,OnlyAllowDockingWhenEmpty,PersonalChunk,LiquidContainerLidand 235 more - Attributes
RequireComponent - Documented in Entity sync
Constructors
| Member | What it is |
|---|---|
protected NetworkEntityBehaviour() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
1 private and internal field
| Member | What it is |
|---|---|
private NetworkEntity entity | Backing field for Entity, filled from the same GameObject. |
Properties
| Member | What it is |
|---|---|
NetworkEntity Entity { get; } | The NetworkEntity on the same GameObject, filled in at bake time. |
Methods
| Member | What it is |
|---|---|
virtual void Initialize() | Called on both sides when the entity is initialized. Empty by default. |
virtual void InitializeAsServer(SpawnData spawnData) | Server: called once when the server sets up the entity, whether freshly spawned or loaded from a save, with its SpawnData. Empty by default. |
virtual void OnConnected(Player player) | Server: called when the entity is sent to a player, so you can send that player any extra state. Empty by default. |
virtual void OnDisconnected(Player player) | Server: called when the entity stops being synced to a player. Empty by default. |