NodeWorld

LocalFluxRoom

La référence est en anglais : elle est générée à partir des commentaires du code, écrits en anglais.

csharp
public sealed class LocalFluxRoom : MonoBehaviour, IFluxRoom

Namespace 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

csharp
public const uint LocalPlayer = 1

The local player's ID in Play mode.

Properties

LocalPlayerId

csharp
public uint LocalPlayerId { get; }

The local player's ID: always LocalPlayer.

LocalAccountId

csharp
public string LocalAccountId { get; set; }

The local player's account and name, from the NW World Config (PlayModeAccountId, PlayModeDisplayName).

LocalDisplayName

csharp
public string LocalDisplayName { get; set; }

The local player's name in Play mode (from the NW World Config).

MasterId

csharp
public uint MasterId { get; }

The master is the local player: alone in the room.

LocalJoinedAt

csharp
public double LocalJoinedAt { get; }

The local player joined at the start of Play.

ServerTime

csharp
public double ServerTime { get; }

Time since the start of Play, in seconds.

Players

csharp
public IReadOnlyList<FluxRoomPlayer> Players { get; }

No other player in Play mode.

Methods

RequestOwnership

csharp
public void RequestOwnership(string objectId)

Gives the object to the local player at once.

AnswerOwnership

csharp
public void AnswerOwnership(string objectId, uint requesterId, bool accept)

Nothing to answer in Play mode.

SendObjectState

csharp
public void SendObjectState(string objectId, Vector3 position, Quaternion rotation, Vector3 velocity)

Sends nothing in Play mode.

SendScriptState

csharp
public void SendScriptState(string objectId, byte slot, byte[] data, bool reliable)

Sends nothing in Play mode.

SendScriptEvent

csharp
public void SendScriptEvent(string objectId, byte slot, byte target, uint toPlayerId, string name, byte[] data)

Sends nothing in Play mode.

SetVoiceHearing

csharp
public void SetVoiceHearing(uint speakerId, float far)

No voices in Play mode.

SpawnObject

csharp
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

csharp
public void DespawnObject(string networkId)

The copy is removed on the next frame.

Events

PlayerJoined

csharp
public event Action<uint> PlayerJoined

Never raised in Play mode: nobody else joins.

PlayerLeft

csharp
public event Action<uint> PlayerLeft

Never raised in Play mode.

MasterChanged

csharp
public event Action<uint> MasterChanged

Never raised in Play mode.

ObjectStateReceived

csharp
public event Action<FluxObjectState> ObjectStateReceived

Never raised in Play mode: no other player sends object states.

OwnershipQueried

csharp
public event Action<string, uint> OwnershipQueried

Never raised in Play mode.

ScriptStateReceived

csharp
public event Action<FluxScriptState> ScriptStateReceived

Never raised in Play mode.

ScriptEventReceived

csharp
public event Action<FluxScriptEvent> ScriptEventReceived

Never raised in Play mode.

OwnershipChanged

csharp
public event Action<FluxOwnershipChange> OwnershipChanged

Raised when the local player takes an object, at once (no server in Play mode).

ObjectSpawned

csharp
public event Action<FluxSpawnedObject> ObjectSpawned

A copy spawned in Play mode (the local player alone): it gets its id on the next frame.

ObjectSpawnRefused

csharp
public event Action<uint, byte> ObjectSpawnRefused

Never in Play mode.

ObjectDespawned

csharp
public event Action<string> ObjectDespawned

A copy removed in Play mode, on the next frame.