Skip to content
SimonAlteruna edited this page Oct 4, 2022 · 27 revisions

Alteruna Namespace

Primary namespace for Alteruna Multiplayer

Classes

Avatar Avatar is used to represent a player in a Room.
Bucket Class Bucket is a collection of players used to define NetLOD behaviour.
BucketBehavior  
CommunicationBridge Holds reference for active Multiplayer component.
Encryption  
Endpoint  
InputSynchronizable Synchronize inputs (255 buttons and 255 axis maximum) The input vales will update on this and other clients simultaneously.

Example

Sync inputs and move transform based on those inputs. Note that this does not sync position, after a while the positions could become unsynced.

C#

using UnityEngine;
public class SyncedPlayerMovement : MonoBehaviour
{
    //reference to a InputSynchronizable object in the scene with a avatar.
    public InputSynchronizable InputSync;
    public float Speed = 5;

    private void Start() {
        InputSync.AddAxis(new[] {"Horizontal", "Vertical"});
    }

    private void Update() {
        float scaledSpeed = Speed * Time.deltaTime;
        transform.Translate(
            scaledSpeed * InputSync.AxesValues[0],
            scaledSpeed * InputSync.AxesValues[1],
            0);
    }
 }
Multiplayer The component Multiplayer gives access to all functionality and communication for Alteruna Multiplayer.
NameGenerator Class NameGenerator generates names from a random animal and adjective.
ProcedureParameters Parameters containing data to be sent together with Remote Procedure Calls.
Reader Class Writer is used to write data to be sent to other Users through a Synchronizable.
Rigidbody2DSynchronizable Rigidbody2DSynchronizable is a Synchronizable that synchronizes the state of a Rigidbody2D component.
RigidbodySynchronizable RigidbodySynchronizable is a Synchronizable that synchronizes the state of a Rigidbody component.
Room  
Service  
ServiceState  
Spawner Class Spawner defines a component which can instantiate and destrot objects on all clients in the Room simultaneously.
Synchronizable Class Synchronizable defines a base contaning data to be synchronized with other clients in the Room.
TransformSynchronizable Class TransformSynchronizable defines a component which synchronizes its gameobjects transform with other clients in the Playroom.
UniqueAvatarChild Instantiate a prefab as a child from a array. If avatar index goes beyond the lenght of the array, it will loop.
UniqueAvatarColor Change Hue to a unlike color based on avatar index.
UniqueID Class UniqueID defines an application-wide unique ID for identifying objects to be synced between Users in a Room.
UnityLog Class UnityLog is responsible for logging internal messages and events.
UnityReader Class UnityReader is used to write Unity types to a IPacketProcessor.
UnityWriter Class UnityWriter is used to write Unity types to a IPacketProcessor.
User  
Writer Class Reader is used to read data recieved from another User.

Interfaces

IServiceListener  
IServiceStateListener  

Delegates

RemoteProcedure  
RemoteProcedureAck  
RemoteProcedureReply  

Enumerations

UserId  

Clone this wiki locally