public void SetUp() { _gameObject = GameObject.CreatePrimitive(PrimitiveType.Cube); _graphicalUiController = _gameObject.AddComponent<GraphicalUIController>(); _partsConfigurationMain = new PartsConfiguration(new MainPart()); _partsConfigurationTutorial = new PartsConfiguration(new TutorialPart()); }
public void Initialize() { Server = (Server)GameObject.FindGameObjectWithTag("Network").GetComponent(typeof(Server)); Client = (Client)GameObject.FindGameObjectWithTag("Network").GetComponent(typeof(Client)); // Use the NetworkWrapper so that the Server maintains it's actual functionallity. Server.Network = new NetworkWrapper(); Cars = new List<Car>(); for (int i = 0; i < GameData.CARS_AMOUNT; i++) { Cars.Add(new Car()); } NetworkController = (NetworkController)GameObject.FindGameObjectWithTag("Network").GetComponent(typeof(NetworkController)); GuiController = (GraphicalUIController)GameObject.FindGameObjectWithTag("GUI").GetComponent(typeof(GraphicalUIController)); CountdownController = (CountdownController)GameObject.FindGameObjectWithTag("CountdownController").GetComponent(typeof(CountdownController)); }