LocalFluxRoom
public sealed class LocalFluxRoom : MonoBehaviour, IFluxRoomNamespace NodeWorld.SDK.Client.PlayMode.
The room of Play mode: the local player alone, without a server. It is the master; an ownership request is granted at the next frame (not during the script call that asked for it); nothing is sent, the server clock is the editor's.
Constants
LocalPlayer
public const uint LocalPlayer = 1The local player's ID in Play mode.
Properties
LocalPlayerId
public uint LocalPlayerId { get; }The local player's ID: always LocalPlayer.
LocalAccountId
public string LocalAccountId { get; set; }The local player's account and name, from the NW World Config (PlayModeAccountId, PlayModeDisplayName).
LocalDisplayName
public string LocalDisplayName { get; set; }The local player's name in Play mode (from the NW World Config).
MasterId
public uint MasterId { get; }The master is the local player: alone in the room.
LocalJoinedAt
public double LocalJoinedAt { get; }The local player joined at the start of Play.
ServerTime
public double ServerTime { get; }Time since the start of Play, in seconds.
Players
public IReadOnlyList<FluxRoomPlayer> Players { get; }No other player in Play mode.
Methods
RequestOwnership
public void RequestOwnership(string objectId)Gives the object to the local player at once.
AnswerOwnership
public void AnswerOwnership(string objectId, uint requesterId, bool accept)Nothing to answer in Play mode.
SendObjectState
public void SendObjectState(string objectId, Vector3 position, Quaternion rotation, Vector3 velocity)Sends nothing in Play mode.
SendScriptState
public void SendScriptState(string objectId, byte slot, byte[] data, bool reliable)Sends nothing in Play mode.
SendScriptEvent
public void SendScriptEvent(string objectId, byte slot, byte target, uint toPlayerId, string name, byte[] data)Sends nothing in Play mode.
SetVoiceHearing
public void SetVoiceHearing(uint speakerId, float far)No voices in Play mode.
SpawnObject
public void SpawnObject(uint requestId, string templateId, Vector3 position, Quaternion rotation)The local player spawns: the copy gets an id of the room ("~1", "~2"...) on the next frame.
DespawnObject
public void DespawnObject(string networkId)The copy is removed on the next frame.
Events
PlayerJoined
public event Action<uint> PlayerJoinedNever raised in Play mode: nobody else joins.
PlayerLeft
public event Action<uint> PlayerLeftNever raised in Play mode.
MasterChanged
public event Action<uint> MasterChangedNever raised in Play mode.
ObjectStateReceived
public event Action<FluxObjectState> ObjectStateReceivedNever raised in Play mode: no other player sends object states.
OwnershipQueried
public event Action<string, uint> OwnershipQueriedNever raised in Play mode.
ScriptStateReceived
public event Action<FluxScriptState> ScriptStateReceivedNever raised in Play mode.
ScriptEventReceived
public event Action<FluxScriptEvent> ScriptEventReceivedNever raised in Play mode.
OwnershipChanged
public event Action<FluxOwnershipChange> OwnershipChangedRaised when the local player takes an object, at once (no server in Play mode).
ObjectSpawned
public event Action<FluxSpawnedObject> ObjectSpawnedA copy spawned in Play mode (the local player alone): it gets its id on the next frame.
ObjectSpawnRefused
public event Action<uint, byte> ObjectSpawnRefusedNever in Play mode.
ObjectDespawned
public event Action<string> ObjectDespawnedA copy removed in Play mode, on the next frame.
