private static void GenereateCorridor(Offset offset) { int d1 = Constants.CORRIDOR1A_PROBOBILITY + Constants.CORRIDOR1B_PROBOBILITY, d2 = d1 + Constants.CORRIDOR1C_PROBOBILITY, d3 = d2 + Constants.CORRIDOR2A_PROBOBILITY; int value = Random.Range(0, 100); Vector3 vector = new Vector3(offset.X, offset.Y, 0f); GameObject instance; if (Enumerable.Range(0, Constants.CORRIDOR1A_PROBOBILITY).Contains(value)) { instance = Object.Instantiate(TailGenerator.corridor1a, vector, Quaternion.identity); offset.ChangeOffset(0, 3); } if (Enumerable.Range(Constants.CORRIDOR1A_PROBOBILITY, Constants.CORRIDOR1B_PROBOBILITY).Contains(value)) { instance = Object.Instantiate(TailGenerator.corridor1b, vector, Quaternion.identity); offset.ChangeOffset(0, 3); } if (Enumerable.Range(d1, Constants.CORRIDOR1C_PROBOBILITY).Contains(value)) { instance = Object.Instantiate(TailGenerator.corridor1c, vector, Quaternion.identity); offset.ChangeOffset(0, 3); } if (Enumerable.Range(d2, Constants.CORRIDOR2A_PROBOBILITY).Contains(value)) { instance = Object.Instantiate(TailGenerator.corridor2a, vector, Quaternion.identity); offset.ChangeOffset(0, 4); } if (Enumerable.Range(d3, Constants.CORRIDOR2B_PROBOBILITY).Contains(value)) { instance = Object.Instantiate(TailGenerator.corridor2a, vector, Quaternion.identity); offset.ChangeOffset(1, 4); } }
public virtual void MakeInstance(int distance, Offset offset) { GenerateCoins(distance, offset); GenerateTraps(distance, offset); offset.ChangeOffset(0, 4); }