// protected virtual void OnPlayerFinishClickForVelocity() //{ // byte[] bytesToSend; // using (MemoryStream memStream = new MemoryStream(_rawData.Count * 36)) // { // foreach (var val in _rawData) // { // memStream.Write(BitConverter.GetBytes(val.MoveParam.x), 0, 4); // memStream.Write(BitConverter.GetBytes(val.MoveParam.y), 0, 4); // memStream.Write(BitConverter.GetBytes(val.MoveParam.z), 0, 4); // memStream.Write(BitConverter.GetBytes(val.VelocityParam.x), 0, 4); // memStream.Write(BitConverter.GetBytes(val.VelocityParam.y), 0, 4); // memStream.Write(BitConverter.GetBytes(val.VelocityParam.z), 0, 4); // memStream.Write(BitConverter.GetBytes(val.AngularVelocityParam.x), 0, 4); // memStream.Write(BitConverter.GetBytes(val.AngularVelocityParam.y), 0, 4); // memStream.Write(BitConverter.GetBytes(val.AngularVelocityParam.z), 0, 4); // } // bytesToSend = memStream.GetBuffer(); // } // if (bytesToSend != null) // { // _gameData.recordData = Convert.ToBase64String(bytesToSend); // } // _gameManager.Finish(); //} //protected virtual void OnPlayerFinishClickForInput() //{ // byte[] bytesToSend; // using (MemoryStream memStream = new MemoryStream(InputData.Count * 36)) // { // foreach (var val in InputData) // { // memStream.Write(BitConverter.GetBytes(val.steerInput), 0, 4); // memStream.Write(BitConverter.GetBytes(val.throttleInput), 0, 4); // memStream.Write(BitConverter.GetBytes(val.brakeInput), 0, 4); // memStream.Write(BitConverter.GetBytes(val.handbrakeInput), 0, 4); // memStream.Write(BitConverter.GetBytes(val.NitroPower), 0, 4); // memStream.Write(BitConverter.GetBytes(val.RotateAndroid), 0, 4); // memStream.Write(BitConverter.GetBytes(val.Sin), 0, 8); // memStream.Write(BitConverter.GetBytes(val.Cos), 0, 8); // } // bytesToSend = memStream.GetBuffer(); // } // if (bytesToSend != null) // { // _gameData.recordData = Convert.ToBase64String(bytesToSend); // } // _gameManager.Finish(); //} protected void SetShadowCarSettings() { _ghostCar = _carConstructor.CreateEnemyCar(_playerManager.selectedCar, _playerManager.selectedCar.current_color); Assert.AreNotEqual(null, _ghostCar); //_shadowCar.transform.tag = "Player"; _ghostCar.SetColorInGame(_playerManager.selectedCar.current_color); _ghostCar.Transform.position = new Vector3(0f, 3f, -2f); _ghostCar.controller.isEnemy = false; _ghostCar.controller.enabled = false; }
private void InitEnemyCar() { if (_gameData.replayData != null) { _enemyCar = new EnemyCar(); var _enemy_model = _gameData.player1_Id == _playerManager.PlayerId ? _gameData.player2_car : _gameData.player1_car; CarBase car = _carConstructor.CreateEnemyCar(_enemy_model, _enemy_model.current_color); _enemyCar.InitCar(car); _enemyCar.Init(); if (_gameData.replayData != "crash") { _enemyCar.GetReplayFrame(0); } } }