// Start is called before the first frame update void Start() { // Get the grid boundaries (int maxX, int maxZ) = BoundariesUtil.CalculateMaxGridBoundaries(GridManager.Instance); _maxX = maxX; _maxZ = maxZ; // Set the correct LayerMask used in Raycasting _layerMask = LayerMask.GetMask("Default"); // Select a random spawn position (Vector3 randomPos, Quaternion rotation) = SelectSpawnPoint(); transform.position = randomPos; transform.rotation = rotation; // Loop through all children and check if a Proppeler exists for (int i = 0; i < transform.childCount; i++) { if (transform.GetChild(i).name == "Proppeler002") { _propeller = transform.GetChild(i).gameObject; } } // Set the minimum Buildings required for chaos MinimumBuildings = SettingsManager.Instance.Settings.Chaos.MinimumBuildings; }
/// <summary> /// Function to calculate the maximum boundaries for the camera. /// </summary> private void CalculateMaxCameraBoundaries() { (int maxX, int maxZ) = BoundariesUtil.CalculateMaxGridBoundaries(GridManager.Instance); _maxX = maxX; _maxZ = maxZ; }
void Start() { // We need the boundaries to add some effects to the top of a building _bounds = BoundariesUtil.GetMaxBounds(gameObject); }