private void GoalSetting() { foreach (Goal goal in level.goals) { if (goal is CollectBlockGoal) { CollectBlockGoal block = goal as CollectBlockGoal; block.amount_plus = 0; gameState.collectedBlocks.Add(block.blockType, 0); } else if (goal is CollectBoosterGoal) { CollectBoosterGoal booster = goal as CollectBoosterGoal; if (booster.boosterType != BoosterType.rainbow) { gameState.collectedBoosters.Add(booster.boosterType, 0); } else { if (booster.colorType == ColorType.none) { booster.colorType = (ColorType)UnityEngine.Random.Range((int)ColorType.red, (int)ColorType.purple + 1); } gameState.collectedRainbows.Add(booster.colorType, 0); } } else if (goal is CollectBlockerGoal) { CollectBlockerGoal blocker = goal as CollectBlockerGoal; blocker.amount_plus = 0; gameState.collectedBlockers.Add(blocker.blockerType, 0); } } currentLimit = level.limit; UpdateLimitCount(); GameObject obj = Resources.Load <GoalUIElement>("Prefabs/GoalUIElement").gameObject; gameUI.SetGoals(level.goals, obj); }
private void GoalSetting() { foreach (Goal goal in level.goals) { if (goal is CollectBlockGoal) { CollectBlockGoal block = goal as CollectBlockGoal; gameState.collectedBlocks.Add(block.blockType, 0); } else if (goal is CollectBlockerGoal) { CollectBlockerGoal blocker = goal as CollectBlockerGoal; gameState.collectedBlockers.Add(blocker.blockerType, 0); } } currentLimit = level.limit; UpdateLimitCount(); GameObject obj = Resources.Load <GoalUIElement>("Prefabs/GoalUIElement").gameObject; gameUI.SetGoals(level.goals, obj); }