GetInstance
Namespace: SynicSugar.P2P
Class: ConnectHub
public T GetInstance<T>()
Description
Get a NerworkCommons instanse registered to ConnectHub.
If we want to use this, pass true to Network class attributes.
using SynicSugar.P2P;
using UnityEngine;
[NetworkCommons(true)]
public partial class p2pSample {
void Start(){
ConnectHub.Instance.RegisterInstance(this);
}
}
public class p2pSample2 {
void p2pSampleMethod(){
p2pSample pSample = ConnectHub.Instance.GetInstance<p2pSample>();
}
}