public override void OnGiveAuthority() { base.OnGiveAuthority(); controller = NetIdentity.connectionToOwnerClient.GetPlayerController <ExamplePlayerController>(ownerPlayerControllerId); controller.GetPawn(this); }
public void PawnRequest(ExamplePlayerController controller) { ExamplePawn newPawn = Instantiate(GameManager.instance.pawnPrefab, SpawnPointManager.GetSpawnPoint(), Quaternion.identity); newPawn.ownerPlayerControllerId = controller.playerControllerId; newPawn.PlayerName = (controller).userName; serverManager.SpawnWithClientAuthority(newPawn.gameObject, controller.Conn); }
public override void OnStartAuthority() { base.OnStartAuthority(); controller = TinyNetClient.instance.connToHost.GetPlayerController <ExamplePlayerController>(ownerPlayerControllerId); controller.GetPawn(this); cameraTransform = GameObject.FindGameObjectWithTag("MainCamera").transform; }
void Start () { // store our var myController = GetComponent<ExamplePlayerController>(); health = maxHealth; deadScreen.SetActive( false ); }
public override void OnNetworkDestroy() { base.OnNetworkDestroy(); if (hasAuthority) { controller.LosePawn(); controller = null; } }