protected void GenerateSection(Transform exit) { var candidate = IsAdvancedExit(exit) ? BuildSectionFromExit(exit.GetComponent <AdvancedExit>()) : BuildSectionFromExit(exit); if (LevelGenerator.IsSectionValid(candidate.Bounds, Bounds)) { candidate.Initialize(LevelGenerator, order); } else { DestroyImmediate(candidate.gameObject); PlaceDeadEnd(exit); } }
protected void GenerateSection(Transform exit) { var candidate = IsAdvancedExit(exit) ? BuildSectionFromExit(exit.GetComponent <AdvancedExit>()) : BuildSectionFromExit(exit); candidate.transform.localScale = candidate.transform.localScale * (1.0f / parentScale.x); candidate.transform.localScale += LevelGenerator.ScaleNoise * Vector3.one * Random.Range(-1.0f, 1.0f); if (LevelGenerator.IsSectionValid(candidate.Bounds, Bounds)) { // candidate.transform.localScale = Vector3.one; candidate.Initialize(LevelGenerator, order); } else { DestroyImmediate(candidate.gameObject); PlaceDeadEnd(exit); } }