private void Restart() { Rotation[] level = LevelGenerator.Create().GetRandomRotations(GameStore.instance.weight); while (IsSameAsBefore(level)) { level = LevelGenerator.Create().GetRandomRotations(GameStore.instance.weight); } prev = level; if (!GameStore.instance.preserve) { GameStore.instance.SetLevel(level); } GameStore.instance.SetTriangles(GenerateTriangles(GameStore.instance.level)); LogUtils.LogState(GetType().Name); }
private void Restart() { if (routine != null) { behaviour.StopCoroutine(routine); } Rotation[] rotations = Array.Empty <Rotation>(); while (IsSameAsLevel(rotations)) { rotations = LevelGenerator.Create().GetRandomRotations(GameStore.instance.weight); } GameStore.instance.SetTriangles(GenerateTriangles(rotations)); routine = WatchForWin(); behaviour.StartCoroutine(routine); LogUtils.LogState(GetType().Name); }