public void Initialize(int difficulty) { timer = FindObjectOfType <TimeProgress>(); cityDisplayers = FindObjectsOfType <InformationDisplayer>(); europeAdjuster = FindObjectOfType <EuropeScreenAdjuster>(); spriteManager = GameObject.Find("Finland").GetComponent <SpriteManager>(); cameraController = Camera.main.GetComponent <CameraMotionController>(); gamePane = GameObject.FindGameObjectWithTag("GamePane"); random = new System.Random(); TuneLocations(difficulty); TuneTime(difficulty); TuneSprite(difficulty); TuneFlipping(difficulty); // Tuning the positions of the cities is unfinished(?) // TuneFinlandRotation(difficulty); if (difficulty > 8) { gyroInstructions = GameObject.Find("GyroInstructionsPane"); gyroInstructions.GetComponent <Canvas>().enabled = true; gyroInstructions.GetComponentsInChildren <SpriteRenderer>().ToList().ForEach(sr => sr.enabled = true); PlaceCityManager mgr = FindObjectOfType <PlaceCityManager>(); gyroInstructions.GetComponent <FadingInstructor>().Fade(1f, 2f, mgr.initialInstructionDuration + mgr.initialInstructionFadeDuration); if (random.Next(0, 2) == 0) { TunePaneRotationInXYPlane(difficulty); } else { TunePanePanning(difficulty); } } }
public async void ConfigureForNewMinigame() { inMinigame = true; minigameEnded = false; while (!timer || (minigameManager == null)) { await Task.Delay(33); MonoBehaviour[] list = FindObjectsOfType <MonoBehaviour>(); IMinigameEnder suitable = null; for (int i = 0; i < list.Length; i++) { if (list[i] is IMinigameEnder) { suitable = (IMinigameEnder)list[i]; } } if (suitable != null) { minigameManager = suitable; timer = FindObjectOfType <TimeProgress>(); } } }
protected virtual void Start() { timebar = FindObjectOfType <TimeProgress>(); timebar.TimerReadyMethods.RemoveAllListeners(); timebar.TimerReadyMethods.AddListener(OnTimerEnd); ConfigureDifficulty(DataController.GetDifficulty()); }
public override void ProcessArrayList(ArrayList sentArrayList) { for (int i = 0; i < sentArrayList.Count; i++) { if (sentArrayList[i] is TimeProgress) { TimeProgress progress = (TimeProgress)sentArrayList[i]; gameTime = progress.GameTime; } } }
private void SetupTimer(int difficulty) { TimeProgress timer = FindObjectOfType <TimeProgress>(); float time; //input the number of seconds you want to have per level switch (difficulty) { case 1: time = 10f; break; case 2: time = 8.5f; break; case 3: time = 10f; break; case 4: time = 8.5f; break; case 5: time = 10f; break; case 6: time = 10f; break; case 7: time = 10f; break; case 8: time = 8.5f; break; case 9: time = 7.5f; break; case 10: time = 6f; break; default: time = 5f; break; } timer.SetTime(time); }
private async void DisplayInstructionsBeforeGame() { TimeProgress timer = FindObjectOfType <TimeProgress>(); timer.TogglePause(); FadingInstructor fade = FindObjectsOfType <FadingInstructor>().First(fi => fi.name.Equals("Instructions")); Time.timeScale = 0f; fade.Fade(initialInstructionDuration, initialInstructionFadeDuration); await new WaitForSecondsRealtime(initialInstructionDuration + initialInstructionFadeDuration); Time.timeScale = 1f; timer.TogglePause(); }
void Start() { endedGame = false; damage = 0; miniGameLogic = GameObject.FindObjectOfType <MinigameLogic>(); borders = GameObject.FindGameObjectsWithTag("Border"); jumpmanList = GameObject.FindGameObjectsWithTag("Jumpman"); supportRope = GameObject.Find("SupportRope"); infoText = GameObject.Find("InfoText"); brokenRope = GameObject.Find("BrokenSupportRopes"); brokenRope.SetActive(false); timer = FindObjectOfType <TimeProgress>(); timer.SetTime(15); }
public override void AddDataToArrayList(ArrayList sentArrayList) { TimeProgress progress = new TimeProgress(gameTime); sentArrayList.Add(progress); }
public void Start() { bar = GetComponent <TimeProgress>(); }
void Start() { timer = FindObjectOfType <TimeProgress>(); InitializeGame(); }
private void Initialize() { initialized = true; timer = FindObjectOfType <TimeProgress>(); }