public bool RPCSetLocalPlayer(int index) { playerTank = Players[index]; Global.GameState.playerID = index; playerCamera.Init(inputManager, Players[index].transform); statManager.Init(Players); crosshairManager.Init(playerTank.motion.tankComponents, playerCamera.GetComponentInChildren <Camera>()); instructionManager.SetCamera(playerCamera); instructionSender.StartSending(); return(true); }
public void Init() { enabled = true; GameState.nPlayer = 1; GameState.playerID = 0; statManager.Init(Players); Singletons.gameRoutineController.RegisterNewTank(); playerCamera = Instantiate(cameraPrefab).GetComponent <Base.CameraController>(); playerTank = Instantiate(playerPrefab, birthPoints.points[0].position, birthPoints.points[0].rotation).GetComponentInChildren <Tank>(); Players[0] = playerTank; playerTank.InitOnOfflineGame(0, instructionManager.GetInstruction()); playerCamera.Init(inputManager, playerTank.transform); instructionManager.SetCamera(playerCamera); crosshairManager.Init(playerTank.motion.tankComponents, playerCamera.GetComponentInChildren <Camera>()); statManager.AddTank(playerTank); mainGameUI.Init(statManager.GetAllStats()[0]); playerTank.UpdateTankInfo(); serverUIController.Init(); sensoringSimulator.Init(Players); }