Exemple #1
0
 IEnumerator WaitForAuthority(CommandNoArguments cmd)
 {
     if (!isServer)
     {
         GetAuthority();
         NetworkIdentity netIdentity = GetComponent <NetworkIdentity>();
         while (!netIdentity.hasAuthority)
         {
             yield return(new WaitForSeconds(0.01f));
         }
     }
     cmd();
 }
Exemple #2
0
 public Coroutine RunCommand(CommandNoArguments cmd) => StartCoroutine(WaitForAuthority(cmd));