Vixen
02b45cc4
csharp
public abstract class NetworkBehaviour

A behaviour whose state the network carries.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

A NetworkModule with a Behavior's lifecycle attached to it. Declare SyncVar`1s and nested modules in the constructor; the layout is fixed when the behaviour is attached, and from then on setting one is a local assignment plus one write to a component, which is what puts the entity in the next capture.

Deriving from Behavior rather than being a component is what the whole package is for. Vixen.Net and Vixen.Engine are siblings and neither may reference the other — networking is optional and nothing below the engine is allowed to depend on it — so the type that needs to see both lives above both, here.

Fields and properties (4)

  • public NetworkId NetworkId

    Which networked object this is part of.

  • public bool IsServer

    Whether this end is the one that decides. Set by whoever attaches the behaviour.

  • public NetworkModule State

    The state this behaviour replicates, fixed the first time it is asked for.

  • public IReadOnlyList<ISyncList> Lists

    The lists this behaviour replicates, in the order they were declared.

Methods (4)

  • protected abstract NetworkModule Build()

    Declares what this behaviour replicates.

  • protected TList DeclareList<TList>(TList list, string name) where TList : ISyncList

    Declares a list. Call from a constructor, before the behaviour is used.

  • public void MarkListsChanged()

    Tells the ECS that one of this behaviour's lists changed.

  • public void MarkChanged()

    Tells the ECS that something in this behaviour changed, so the next capture looks at it.

Used by (6)

  • InventoryBehaviourVixen.Net.Engine.Tests
  • PlayerBehaviourVixen.Net.Engine.Tests
  • SyncListReplicationTestsVixen.Net.Engine.Tests
  • SyncListReplicatorVixen.Net.Engine
  • SyncStateReplicatorVixen.Net.Engine
  • SyncStateTestsVixen.Net.Engine.Tests