public void SetUp() { _midScreenWidth = (float)Screen.width / 2; _driver = new Driver(); NetworkView = new Mock<INetworkView>(); NetworkViewOther = new Mock<INetworkView>(); _gameObject = Object.Instantiate(Resources.LoadAssetAtPath("Assets/CarRed.prefab", typeof(GameObject))) as GameObject; if (_gameObject == null) return; _autoBehaviour = _gameObject.AddComponent<CarBehaviour>(); _autoBehaviour.NetworkView = NetworkView.Object; _gameObjectOther = Object.Instantiate(Resources.LoadAssetAtPath("Assets/CarBlue.prefab", typeof(GameObject))) as GameObject; if (_gameObjectOther == null) return; _autoBehaviourOther = _gameObjectOther.AddComponent<CarBehaviour>(); _autoBehaviourOther.NetworkView = NetworkViewOther.Object; _carDriver = new Car(_autoBehaviour); _player = new Player(_carDriver, _driver); _carOther = new Car(_autoBehaviourOther); _gameObjectCountDownController = GameObject.CreatePrimitive(PrimitiveType.Cube); _countdownController = _gameObjectCountDownController.AddComponent<CountdownController>(); MainScript.SelfPlayer = new Player { Role = new Driver() }; MainScript.SelfCar = _carDriver; }
public void SetUp() { Player = new Player(); DriverRole = new Driver(); Car = new Car(); PlayerPar = new Player(Car, DriverRole); }