IEnumerator DoComeOnScreen() { for (int i = 0; i < 10; i++) { controller.manager.SetToCannotInteract(); switch (i) { case 0: saveGamesUI_divider1.OnScreen(); break; case 1: saveGamesUI_titlePanel.OnScreen(); break; case 2: saveGamesUI_divider2.OnScreen(); break; case 3: saveGamesUI_createNewSavegameButton.OnScreen(); break; case 4: saveGamesUI_divider3.OnScreen(); break; case 5: saveGamesUI_goBackButton.OnScreen(); break; case 6: saveGamesUI_divider4.OnScreen(); break; case 7: saveGamesUI_sandBoxSavesTitlePanel.OnScreen(); break; case 8: saveGamesUI_careerSavesTitlePanel.OnScreen(); break; case 9: SavegamesListOnScreen(); break; } yield return(new WaitForSeconds(.045f)); } }
IEnumerator TitlePanelsDoComeOnScreen() { for (int i = 0; i < 4; i++) { controller.manager.SetToCannotInteract(); switch (i) { case 0: divider1.OnScreen(); break; case 1: titlePanel.OnScreen(); break; case 2: divider2.OnScreen(); break; case 3: goBackButton.OnScreen(); break; } yield return(new WaitForSeconds(.045f)); } }
IEnumerator DoComeOnScreen() { for (int i = 0; i < 5; i++) { switch (i) { case 0: dtLogo.OnScreen(); FillDividerBar(); break; case 1: strainTitleDisplay.OnScreen(); strainTitleText.OnScreen(); break; case 2: PPGDisplay.OnScreen(); PPGDisplayText1.OnScreen(); PPGDisplayText2.OnScreen(); break; case 3: THCGraph.OnScreen(); break; case 4: sativaGraph.OnScreen(); break; } yield return(new WaitForSeconds(.075f)); } }
IEnumerator DoCreateCareerSavegamesList() { int counter = 0; float prefabHeight = careerSavegamePrefab.gameObject.GetComponent <RectTransform>().rect.height; List <SaveGame> saveGames = database.GetCareerSaveGames(); foreach (SaveGame save in saveGames) { UIObjectAnimator newAnimator = Instantiate(careerSavegamePrefab, careerSavegamePrefab.transform.position, careerSavegamePrefab.transform.rotation, mainCareerScrollablePanel.transform); newAnimator.gameObject.SetActive(true); newAnimator.name = saveGames[counter].company.companyName; Text[] texts = newAnimator.GetComponentsInChildren <Text>(); texts[0].text = save.company.companyName; Vector2 prefabAnchorMin = careerSavegamePrefab.GetComponent <RectTransform>().anchorMin; Vector2 prefabAnchorMax = careerSavegamePrefab.GetComponent <RectTransform>().anchorMax; newAnimator.gameObject.SetActive(true); newAnimator.GetComponent <RectTransform>().anchorMin = prefabAnchorMin + new Vector2(0, -prefabHeight / 14 * counter); newAnimator.GetComponent <RectTransform>().anchorMax = prefabAnchorMax + new Vector2(0, -prefabHeight / 14 * counter); newAnimator.GetComponent <RectTransform>().anchoredPosition = new Vector2(0, -prefabHeight * counter); //newAnimator.transform.position = newAnimator.transform.position + new Vector3(0, -prefabHeight * (counter+3), 0); careerSavegameUIAnimators.Add(newAnimator); newAnimator.OnScreen(); counter++; yield return(new WaitForSeconds(.015f)); } }
IEnumerator CompanyTypeSelectorDoComeOnScreen() { for (int i = 0; i < 5; i++) { switch (i) { case 0: companyTypeSelectorTitlePanel.OnScreen(); break; case 1: companyTypeSelectorButtonPanel.OnScreen(); break; case 2: companyTypeSelector_sandBoxButton.OnScreen(); break; case 3: companyTypeSelector_careerButton.OnScreen(); break; case 4: companyTypeSelector_confirmButton.OnScreen(); break; } yield return(new WaitForSeconds(.045f)); } }
IEnumerator DoCreateDispensaryList() { int counter = 0; float prefabHeight = loadDifferentBuilding_dispensaryPrefab.gameObject.GetComponent <RectTransform>().rect.height; List <Dispensary_s> dispensaries = currentCompany.dispensaries; if (dispensaries == null) { yield break; } foreach (Dispensary_s dispensary in dispensaries) { UIObjectAnimator newAnimator = Instantiate(loadDifferentBuilding_dispensaryPrefab, loadDifferentBuilding_dispensaryPrefab.transform.position, loadDifferentBuilding_dispensaryPrefab.transform.rotation, mainDispensariesScrollablePanel.transform); newAnimator.gameObject.SetActive(true); newAnimator.name = dispensary.dispensaryName; Text[] texts = newAnimator.GetComponentsInChildren <Text>(); texts[0].text = dispensary.dispensaryName; Vector2 prefabAnchorMin = loadDifferentBuilding_dispensaryPrefab.GetComponent <RectTransform>().anchorMin; Vector2 prefabAnchorMax = loadDifferentBuilding_dispensaryPrefab.GetComponent <RectTransform>().anchorMax; newAnimator.gameObject.SetActive(true); newAnimator.GetComponent <RectTransform>().anchorMin = prefabAnchorMin + new Vector2(0, -prefabHeight / 14 * counter); newAnimator.GetComponent <RectTransform>().anchorMax = prefabAnchorMax + new Vector2(0, -prefabHeight / 14 * counter); newAnimator.GetComponent <RectTransform>().anchoredPosition = new Vector2(0, -prefabHeight * counter); //newAnimator.transform.position = newAnimator.transform.position + new Vector3(0, -prefabHeight * (counter+3), 0); dispensaryUIAnimators.Add(newAnimator); newAnimator.OnScreen(); counter++; yield return(new WaitForSeconds(.015f)); } }
IEnumerator DoComeOnScreen() { for (int i = 0; i < 5; i++) { switch (i) { case 0: mainPanel.OnScreen(); circleBG.OnScreen(); break; case 1: item1PercentDisplay.OnScreen(); break; case 2: item1TextDisplay.OnScreen(); break; case 3: item2PercentDisplay.OnScreen(); break; case 4: item2TextDisplay.OnScreen(); break; } yield return(new WaitForSeconds(.15f)); } }
IEnumerator ViewingCompanyDoComeOnScreen() { float timeToUse = 0.055f; for (int i = 0; i < 11; i++) { controller.manager.SetToCannotInteract(); switch (i) { case 0: companyBGPanel.OnScreen(); break; case 1: companyNetWorthPanel.OnScreen(); break; case 2: companyBuildingCountPanel.OnScreen(); break; case 3: buildingBGPanel.OnScreen(); break; case 4: buildingScreenshotImage.OnScreen(); break; case 5: buildingNamePanel.OnScreen(); timeToUse = 0.035f; break; case 6: buildingRatingPanel.OnScreen(); break; case 7: loadDifferentBuildingButton.OnScreen(); break; case 8: buildingStatsPanel1.OnScreen(); timeToUse = 0.01f; break; case 9: buildingStatsPanel2.OnScreen(); break; case 10: loadBuildingButton.OnScreen(); break; } yield return(new WaitForSeconds(timeToUse)); } }
IEnumerator CreateNewBuildingDoComeOnScreen() { for (int i = 0; i < 12; i++) { switch (i) { case 0: newBuildingBG.OnScreen(); break; case 1: newBuildingTypePanel.OnScreen(); break; case 2: newBuilding_dispensaryButton.OnScreen(); break; case 3: newBuilding_supplierButton.OnScreen(); break; case 4: newBuildingLogoImage.OnScreen(); break; case 5: newBuildingNameInputField.OnScreen(); break; case 6: newBuildingLogoImageField.OnScreen(); break; case 7: newBuildingChooseLogoButton.OnScreen(); break; case 8: newBuildingLocationImage.OnScreen(); break; case 9: newBuildingLocationField.OnScreen(); break; case 10: newBuildingChooseLocationButton.OnScreen(); break; case 11: finishCreatingNewBuildingButton.OnScreen(); break; } yield return(null); } }
public void MouseOverCreateNewBuildingButton() { if (!mouseOverCreateNewBuildingButton) { mouseOverCreateNewBuildingButton = true; createNewBuildingExpandedButton.MouseOver(); createNewBuildingButton.MouseOver(); createNewBuildingExpandedButton.OnScreen(); divider3.OffScreen(); goBackButton.OffScreen(); } }
public void MouseOverCreateNewSavegameButton() { if (!mouseOverCreateNewSavegameButton) { mouseOverCreateNewSavegameButton = true; saveGamesUI_createNewSavegamesExpandedButton.MouseOver(); saveGamesUI_createNewSavegameButton.MouseOver(); saveGamesUI_createNewSavegamesExpandedButton.OnScreen(); saveGamesUI_divider3.OffScreen(); saveGamesUI_goBackButton.OffScreen(); } }
IEnumerator ViewingCompanyTitlePanelsDoComeOnScreen() { float timeToUse = 0.055f; for (int i = 0; i < 7; i++) { switch (i) { case 0: divider1.OnScreen(); timeToUse = 0.055f; break; case 1: companyNamePanel.OnScreen(); break; case 2: divider2.OnScreen(); break; case 3: createNewBuildingButton.OnScreen(); break; case 4: divider3.OnScreen(); break; case 5: goBackButton.OnScreen(); break; case 6: divider4.OnScreen(); break; } yield return(new WaitForSeconds(timeToUse)); } }
IEnumerator DoCreateLogoList() { int columnCounter = 0; int rowCounter = 0; float prefabHeight = chooseLogoPrefab.gameObject.GetComponent <RectTransform>().rect.height; Logo[] logos = controller.manager.db.logos; if (logos == null) { yield break; } for (int i = currentLogoListMin; i < currentLogoListMax; i++) { Logo logo = null; try { logo = logos[i]; } catch (System.IndexOutOfRangeException) { break; } UIObjectAnimator newAnimator = Instantiate(chooseLogoPrefab, chooseLogoPrefab.transform.position, chooseLogoPrefab.transform.rotation, mainChooseLogoContentPanel.transform); newAnimator.gameObject.SetActive(true); newAnimator.name = "Logo " + logo.ID; Image img = newAnimator.GetComponent <Image>(); if (img != null) { img.sprite = logo.sprite; img.color = logo.GetColor(); } Vector2 prefabAnchorMin = chooseLogoPrefab.GetComponent <RectTransform>().anchorMin; Vector2 prefabAnchorMax = chooseLogoPrefab.GetComponent <RectTransform>().anchorMax; newAnimator.gameObject.SetActive(true); newAnimator.GetComponent <RectTransform>().anchorMin = prefabAnchorMin + new Vector2(7.875f / 40 * columnCounter, -7.875f / 21 * rowCounter); newAnimator.GetComponent <RectTransform>().anchorMax = prefabAnchorMax + new Vector2(7.875f / 40 * columnCounter, -7.875f / 21 * rowCounter); //newAnimator.GetComponent<RectTransform>().anchoredPosition = new Vector2(7.875f / 14* columnCounter, -7.875f / 14* rowCounter); //newAnimator.transform.position = newAnimator.transform.position + new Vector3(0, -prefabHeight * (counter+3), 0); logosBeingDisplayed.Add(new DisplayedLogo(logo, newAnimator, new Vector2(columnCounter, rowCounter))); newAnimator.OnScreen(); columnCounter++; if (columnCounter > 4) { rowCounter++; columnCounter = 0; } yield return(new WaitForSeconds(.015f)); } }
IEnumerator DoComeOnScreen() { for (int i = 0; i < 9; i++) { mainManager.SetToCannotInteract(); switch (i) { case 0: barImage.OnScreen(); backToMainMenuButton.OnScreen(); backToMainMenuButton_keybindingGraphic.OnScreen(); break; case 1: backToMainMenuButton_divider.OnScreen(); break; case 2: backToMainMenuButton_actionGraphic.OnScreen(); break; case 3: browseCurrentCatalogButton.OnScreen(); browseCurrentCatalogButton_keybindingGraphic.OnScreen(); break; case 4: browseCurrentCatalogButton_divider.OnScreen(); break; case 5: browseCurrentCatalogButton_actionGraphic.OnScreen(); break; case 6: browseNextCategoryButton.OnScreen(); browseNextCategoryButton_keybindingGraphic.OnScreen(); break; case 7: browseNextCategoryButton_divider.OnScreen(); break; case 8: browseNextCategoryButton_actionGraphic.OnScreen(); break; } yield return(new WaitForSeconds(.075f)); } }
IEnumerator CreateCompanyUIGroupingDoComeOnScreen() { for (int i = 0; i < 10; i++) { switch (i) { case 0: createCompanyBG.OnScreen(); break; case 1: companyLogoImage.OnScreen(); break; case 2: companyNameInputField.OnScreen(); break; case 3: companyLogoField.OnScreen(); break; case 4: chooseCompanyLogoButton.OnScreen(); break; case 5: managersNameInputField.OnScreen(); break; case 6: startupAsField.OnScreen(); break; case 7: startupAsDispensaryButton.OnScreen(); break; case 8: startupAsSupplierButton.OnScreen(); break; case 9: finishCreatingCompanyButton.OnScreen(); break; } yield return(new WaitForSeconds(.045f)); } ActivateCompanyNameInputField(); }
IEnumerator SetupBuildingUIGroupingDoComeOnScreen() { for (int i = 0; i < 9; i++) { switch (i) { case 0: createBuildingBG.OnScreen(); break; case 1: buildingLogoImage.OnScreen(); break; case 2: buildingNameInputField.OnScreen(); break; case 3: buildingLogoField.OnScreen(); break; case 4: chooseBuildingLogoButton.OnScreen(); break; case 5: startLocationScreenshotImage.OnScreen(); break; case 6: buildingLocationField.OnScreen(); break; case 7: chooseBuildingLocationButton.OnScreen(); break; case 8: finishCreatingBuildingButton.OnScreen(); break; } yield return(new WaitForSeconds(.045f)); } }
public void ChooseLogoButtonsPanelOnScreen(DisplayedLogo displayedLogo) { if (chooseLogoButtonsPanelOnScreen) { ChooseLogoButtonsPanelOffScreen(); } currentlySelectedDisplayedLogo = displayedLogo; defaultLogoSiblingIndex = currentlySelectedDisplayedLogo.animator.transform.GetSiblingIndex(); print("Default: " + defaultLogoSiblingIndex); int buttonsPanelSiblingIndex = defaultLogoSiblingIndex + 2; chooseLogoButtonsPanelOnScreen = true; if (displayedLogo.NeedsRightButtonsPanel()) { currentLogoWithDisabledRaycasting = right_chooseLogoButtonsPanelPrefab.transform.parent.GetChild(defaultLogoSiblingIndex + 1).GetComponent <UIObjectAnimator>(); currentLogoWithDisabledRaycasting.GetComponent <BoxCollider>().enabled = false; currentlyDisplayedButtonsPanel = Instantiate(right_chooseLogoButtonsPanelPrefab, right_chooseLogoButtonsPanelPrefab.transform.position, right_chooseLogoButtonsPanelPrefab.transform.rotation, mainChooseLogoContentPanel.transform); currentlyDisplayedButtonsPanel.gameObject.SetActive(true); currentlyDisplayedButtonsPanel.transform.SetSiblingIndex(buttonsPanelSiblingIndex); currentlySelectedDisplayedLogo.animator.transform.SetSiblingIndex(buttonsPanelSiblingIndex); print("new: " + currentlyDisplayedButtonsPanel.transform.GetSiblingIndex()); Vector2 prefabAnchorMin = right_chooseLogoButtonsPanelPrefab.GetComponent <RectTransform>().anchorMin; Vector2 prefabAnchorMax = right_chooseLogoButtonsPanelPrefab.GetComponent <RectTransform>().anchorMax; currentlyDisplayedButtonsPanel.GetComponent <RectTransform>().anchorMin = prefabAnchorMin + new Vector2(7.875f / 40 * displayedLogo.index.x, -7.875f / 21 * displayedLogo.index.y); currentlyDisplayedButtonsPanel.GetComponent <RectTransform>().anchorMax = prefabAnchorMax + new Vector2(7.875f / 40 * displayedLogo.index.x, -7.875f / 21 * displayedLogo.index.y); currentlyDisplayedButtonsPanel.OnScreen(); } else { currentLogoWithDisabledRaycasting = right_chooseLogoButtonsPanelPrefab.transform.parent.GetChild(defaultLogoSiblingIndex - 1).GetComponent <UIObjectAnimator>(); currentLogoWithDisabledRaycasting.GetComponent <BoxCollider>().enabled = false; currentlyDisplayedButtonsPanel = Instantiate(left_chooseLogoButtonsPanelPrefab, left_chooseLogoButtonsPanelPrefab.transform.position, left_chooseLogoButtonsPanelPrefab.transform.rotation, mainChooseLogoContentPanel.transform); currentlyDisplayedButtonsPanel.gameObject.SetActive(true); currentlyDisplayedButtonsPanel.transform.SetSiblingIndex(buttonsPanelSiblingIndex); currentlySelectedDisplayedLogo.animator.transform.SetSiblingIndex(buttonsPanelSiblingIndex); Vector2 prefabAnchorMin = left_chooseLogoButtonsPanelPrefab.GetComponent <RectTransform>().anchorMin; Vector2 prefabAnchorMax = left_chooseLogoButtonsPanelPrefab.GetComponent <RectTransform>().anchorMax; currentlyDisplayedButtonsPanel.GetComponent <RectTransform>().anchorMin = prefabAnchorMin + new Vector2(0, -7.875f / 21 * displayedLogo.index.y); currentlyDisplayedButtonsPanel.GetComponent <RectTransform>().anchorMax = prefabAnchorMax + new Vector2(0, -7.875f / 21 * displayedLogo.index.y); currentlyDisplayedButtonsPanel.OnScreen(); } }
IEnumerator SmokeScreenOnScreen() { float timeStarted = Time.time; float timeElapsed = 0.0f; float percentageComplete = 0.0f; // Figure out how often a smoke obj needs to be made float spawnDelay = smokeScreenOnScreenLerpTime / maxSmokeObjects; float lastSpawnedTime = 0.0f; while (percentageComplete < 1) { timeElapsed = Time.time - timeStarted; percentageComplete = timeElapsed / smokeScreenOnScreenLerpTime; if (timeElapsed >= lastSpawnedTime + spawnDelay) { UIObjectAnimator newSmokeObject = Instantiate(smokePrefab, transform); //newSmokeObject.InitializeAnimator(); RectTransform rectTransform = newSmokeObject.GetComponent <RectTransform>(); rectTransform.sizeDelta = new Vector2(Random.Range(300, maxSmokeWidth), Random.Range(300, maxSmokeHeight)); rectTransform.transform.eulerAngles = (Random.value >= .5f) ? Vector3.zero : new Vector3(0, 0, 90); rectTransform.localPosition = new Vector2(Random.Range(-Screen.width / 2, Screen.width / 2), Random.Range(-Screen.height / 2, Screen.height / 2)); newSmokeObject.OnScreen(); smokeObjects.Add(newSmokeObject); lastSpawnedTime = timeElapsed; } yield return(null); } List <SceneTransitionManager.SmokeObject> compatibleSmokeObjects = new List <SceneTransitionManager.SmokeObject>(); foreach (UIObjectAnimator obj in smokeObjects) { Image smokeImage = obj.GetComponent <Image>(); if (smokeImage != null) { compatibleSmokeObjects.Add(new SceneTransitionManager.SmokeObject(smokeImage)); } } manager.currentSmokeObjects = compatibleSmokeObjects; }
IEnumerator ChooseLogoUIDoComeOnScreen() { for (int i = 0; i < 3; i++) { switch (i) { case 0: chooseLogoBG.OnScreen(); break; case 1: chooseLogoLeftArrow.OnScreen(); break; case 2: chooseLogoRightArrow.OnScreen(); break; } yield return(new WaitForSeconds(0.055f)); } }
public void FinishSmokeScreenTransition() { SceneTransition_SmokeEffect boundingImage = Instantiate(smokeScreenScreenTransitionPrefab); boundingImage.transform.SetParent(GetCurrentCanvas().transform, false); // Recreate smoke cloud if (currentSmokeObjects.Count > 0) { foreach (SmokeObject smokeObject in currentSmokeObjects) { UIObjectAnimator newSmokeObject = Instantiate(boundingImage.smokePrefab, boundingImage.transform); RectTransform rectTransform = newSmokeObject.GetComponent <RectTransform>(); rectTransform.sizeDelta = smokeObject.size; rectTransform.localPosition = smokeObject.position; rectTransform.eulerAngles = smokeObject.eulers; newSmokeObject.OnScreen(); newSmokeObjects.Add(newSmokeObject); } } // Clear smoke cloud if (newSmokeObjects.Count > 0) { foreach (UIObjectAnimator smokeObject in newSmokeObjects) { BoxCollider2D boundingBox = boundingImage.GetComponent <BoxCollider2D>(); if (boundingBox != null) { Vector3 thisPos = smokeObject.transform.position; Vector3 targetPos = boundingBox.bounds.ClosestPoint(thisPos); smokeObject.OffScreenToTargetPos(targetPos, 0.75f); } } //ClearSmokeObjects(); } }
IEnumerator LoadDifferentBuildingUIDoComeOnScreen() { float timeToUse = 0.055f; for (int i = 0; i < 3; i++) { switch (i) { case 0: loadDifferentBuilding_dispensariesTitleImage.OnScreen(); break; case 1: loadDifferentBuilding_suppliersTitleImage.OnScreen(); break; case 2: CreateDispensaryList(); CreateSupplierList(); break; } yield return(new WaitForSeconds(timeToUse)); } }