Skip to content

Instantly share code, notes, and snippets.

@icywind
Last active October 21, 2019 20:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save icywind/9804224c53eee56580fc37ca18f60ff6 to your computer and use it in GitHub Desktop.
Save icywind/9804224c53eee56580fc37ca18f60ff6 to your computer and use it in GitHub Desktop.
Partial list of TankManager.cs
// new code
GameManager.AddTank(this);
StartCoroutine(SetupVideoSurface(player));
} // end of Initialize(TanksNetworkPlayer player)
IEnumerator SetupVideoSurface(TanksNetworkPlayer player)
{
Debug.Log("Tank initializing player:" + player);
yield return new WaitForFixedUpdate();
if (player.hasAuthority)
{
DisableShooting();
}
player.CmdSetReady();
if (player.isLocalPlayer)
{
if (videoSurface != null)
{
videoSurface.gameObject.name = "video-local";
}
}
else
{
uint uid = AgoraPlayerController.instance.GetAgoraID(player);
if (uid != 0 && videoSurface != null)
{
videoSurface.gameObject.name = LocalTankVideoName;
videoSurface.SetForUser(uid);
}
else
{
Debug.Assert( uid != 0, "Couldn't find uid for player:" + player.playerId);
Debug.Assert(videoSurface != null, "videoSurface = null");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment