Exemplo n.º 1
0
 IEnumerator WaitForAuthority <T>(CommandOneArgument <T> cmd, T arg)
 {
     if (!isServer)
     {
         GetAuthority();
         NetworkIdentity netIdentity = GetComponent <NetworkIdentity>();
         while (!netIdentity.hasAuthority)
         {
             yield return(new WaitForSeconds(0.01f));
         }
     }
     cmd(arg);
 }
Exemplo n.º 2
0
 public Coroutine RunCommand <T>(CommandOneArgument <T> cmd, T arg) => StartCoroutine(WaitForAuthority(cmd, arg));