Last active
October 21, 2019 20:41
-
-
Save icywind/9804224c53eee56580fc37ca18f60ff6 to your computer and use it in GitHub Desktop.
Partial list of TankManager.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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