private void PlaceNewLane(float z) { ObjectPool.ObjectDifficulty difficulty = (ObjectPool.ObjectDifficulty)Enum.Parse(typeof(ObjectPool.ObjectDifficulty), DifficultyValues.ChooseByRandom()); Debug.Log("Lanedifficulty: " + difficulty.ToString()); PlaceNewLane(z, difficulty); GameManager.Instance.ScoreMultiplier = GameManager.Instance.ScoreMultiplier + ((int)difficulty + 1); GameManager.Instance.Score = GameManager.Instance.Score + 10 * GameManager.Instance.ScoreMultiplier * ((int)difficulty + 1); }
private void PlaceNewLane(float z, ObjectPool.ObjectDifficulty difficulty) { var lane = ObjectPool.Instance.GetLaneSectionFromPool(difficulty); if (lane != null) { lane.transform.position = new Vector3(0, 0, z); lane.SetActive(true); foreach (Transform child in lane.transform) { child.gameObject.SetActive(true); } } else { // Debug.Log("Error while getting Lane from Pool."); } }