AdditionalClass
Namespace: SynicSugar.P2P
Description
The partial class that has NetworkPlayer or NetworkCommons is generated an additional part for the connection by SourceGenerator.
If we use VisualStudio or Rider, wa can read these parts from the Reference -> Analyzer.
Some may be moved to ILPostProcess for security.
Both
API | description |
SynicSugarRpc_XXX | For RPC and TargetRpc |
SynicXXX | For SyncVar |
StartSynicXXX | For SyncVar |
isWaitingXXX | For SyncVar |
NetworkPlayer
API | description |
isLocal | If this instance is operated in this local, return true |
OwnerUserID | This instance owner' UserID |
SetOwnerID | Set UserID to this instance |
NetworkCommons
API | description |
isHost | If this Local is Lobby Host, return true |
isRemotoCall | Not to Sync again the RPC on remote call |
// <auto-generated>
// THIS (.cs) FILE IS GENERATED BY SynicSugarGenerator. DO NOT CHANGE IT.
// </auto-generated>
using UnityEngine;
using SynicSugar.P2P;
using System;
using System.Threading;
using Cysharp.Threading.Tasks;
public partial class SampleClass : INetworkOwner, IGetPlayer {
UserId _ownerUserID;
public UserId OwnerUserID {
get { return _ownerUserID; }
set {
_ownerUserID = new UserId(value);
ConnectHub.Instance.RegisterInstance(_ownerUserID, this);
}
}
public void SetOwnerID(UserId value){
OwnerUserID = value;
}
/// <summary>
/// Is this the instance's local? Invalid in Awake.
/// </summary>
public bool isLocal { get { return _ownerUserID == p2pConfig.Instance.userIds.LocalUserId; } }
//
//
}