// -------------------------------------------------------------------------------------------------------------------- // // Copyright (c) VRMADA, All rights reserved. // // -------------------------------------------------------------------------------------------------------------------- using System; using System.Collections.Generic; using UltimateXR.Avatar; using UnityEngine; namespace UltimateXR.Networking { /// /// Interface for network avatar components. Network avatar components are responsible for setting the avatar in the /// correct mode (local/external) and sending/receiving global component state changes. /// public interface IUxrNetworkAvatar { #region Public Types & Data /// /// Event called right after the avatar was spawned. /// event Action AvatarSpawned; /// /// Event called right after the avatar was despawned. /// event Action AvatarDespawned; /// /// Gets whether this avatar is the avatar controller by the user (true) or a remote avatar (false). /// bool IsLocal { get; } /// /// Gets the avatar component. /// UxrAvatar Avatar { get; } /// /// Gets the list of objects that will be disabled when the avatar is in local mode. This allows to avoid rendering the /// head or elements that could intersect with the camera. /// IList LocalDisabledGameObjects { get; } /// /// Gets or sets the avatar name. /// string AvatarName { get; set; } #endregion #region Public Methods /// /// Initializes an avatar. Should be called by the implementation right after the avatar was spawned. /// /// Avatar component /// Whether the avatar is local /// A unique Id to identify the avatar, usually the user unique network ID /// The name of the avatar, to assign it to the avatar GameObject and a label if there is a label void InitializeNetworkAvatar(UxrAvatar avatar, bool isLocal, string uniqueId, string avatarName); #endregion } }