//################################################################################ #region Private Members private void InitializePanels() { LayoutPanel = new LayoutPanel(this); TitlePanel = new TitlePanel(this); EurTryStockPanel = new StockPanel(this, StockServiceFactory.CreateService("Yahoo", "EURTRY")); UsdTryStockPanel = new StockPanel(this, StockServiceFactory.CreateService("Yahoo", "USDTRY")); EurUsdStockPanel = new StockPanel(this, StockServiceFactory.CreateService("Yahoo", "EURUSD"), 5000); SiemensStockPanel = new StockPanel(this, StockServiceFactory.CreateService("Yahoo", "SIEMENS"), 10000); HourPanel = new TimerPanel(); LayoutPanel.Add(TitlePanel); LayoutPanel.Add(EurTryStockPanel); LayoutPanel.Add(UsdTryStockPanel); LayoutPanel.Add(EurUsdStockPanel); LayoutPanel.Add(SiemensStockPanel); LayoutPanel.Add(HourPanel); Controls.Add(LayoutPanel); TitlePanel.CustomContextMenu = CustomContextMenu.Instance; }
public void ReturnToMainMenu() { TimerPanel.SetPause(false); TimerPanel.UnsubscribeDelegates(); FMODPlayer.StopAllSounds(); SceneManager.LoadScene(0); }
public QuizTimer(float duration, TimerPanel template, bool paused, TimerThreshold[] thresholds) { Duration = duration; Template = template; Thresholds = thresholds; Paused = paused; }
public void Pause() { canvasGroup.DOFade(1, fadeTime); canvasGroup.interactable = true; canvasGroup.blocksRaycasts = true; TimerPanel.SetPause(true); pauseButton.sprite = pausedImage; }
public void BackToMenu() { FMODPlayer.StopAllSounds(); StopCoroutine(BackToMenuButtonAnimation()); TimerPanel.UnsubscribeDelegates(); TimerPanel.SetPause(false); SceneManager.LoadScene(0); }
private void FinishTutorial() { HideAllScreens(); if (thisIsTheGameScene) { TimerPanel.SetPause(false); } sectionManager.SelectSection(1); }
private void Prompt() { currentScreen = 0; if (thisIsTheGameScene) { TimerPanel.SetPause(true); } StartCoroutine(ShowScreen(currentScreen)); }
public void Resume() { canvasGroup.DOFade(0, fadeTime); canvasGroup.interactable = false; canvasGroup.blocksRaycasts = false; if (!SoldierPanel.isEditButtonsEnable) { TimerPanel.SetPause(false); } pauseButton.sprite = unpausedImage; }
private IEnumerator GameFinishedCoroutine() { gameOverPanel.DOFade(1, panelFadeTime); gameOverPanel.interactable = true; gameOverPanel.blocksRaycasts = true; TimerPanel.SetPause(true); yield return(new WaitForSeconds(buttonAppearTime)); yield return(BackToMenuButtonAnimation()); }
public void StartTutorial() { sectionManager.SelectSection(1); currentScreen = 1; if (thisIsTheGameScene) { TimerPanel.SetPause(true); } StartCoroutine(ShowScreen(currentScreen)); }
public override void Tick() { base.Tick(); if (Game.Instance.Round == null) { return; } RoundLabel.UpdateTranslation(new TranslationData($"ROUND.STATE.{Game.Instance.Round.RoundName.ToUpper().Replace(' ', '_')}")); TimerPanel.SetClass("disabled", Game.Instance.Round is Rounds.WaitingRound); TimerLabel.Text = Game.Instance.Round.TimeLeftFormatted; }
private IEnumerator BattleRoutine() { TimerPanel.SetPause(true); numberOfBattlesLostByThePlayerLastTurn = 0; numberOfBattlesWonByThePlayerLastTurn = 0; for (int i = 0; i < propertiesInBattle.Count; i++) { yield return(IndividualBattle(propertiesInBattle[i], battleInformations[i])); OnIndividualBattleEnded(); } OnBattlesEnd(); TimerPanel.SetPause(false); ResetBattleList(); }
//Timer para mostrar el panel 3 segundos private void TimerPanel_Tick(object sender, EventArgs e) { int Num = Convert.ToInt32(lblSeg.Text); lblSeg.Text = Convert.ToString(Num - 1); if (lblSeg.Text == "0") { TimerPanel.Stop(); panel1.Visible = false; TimerPanel.Enabled = false; TimerVideo.Enabled = true; TimerVideo.Start(); } }
private void OpenPanel(int pSegundos) { //Panel Informativo del Video lblDesafio.Text = "Nuevo Desafio"; lblComienza.Text = "Comienza en"; lblTitulo.Text = Video.Nombre.ToString(); int Min = pSegundos / 60; int Seg = pSegundos % 60; lblTiempo.Text = Min.ToString() + ":" + Seg.ToString(); panel1.Visible = true; // MessageBox.Show(TotalSeg.ToString()); TimerPanel.Enabled = true; TimerPanel.Start(); }
private async Task SetTimerToZeroAsync() { int delay = 500; var anim = new Animation(); anim.Add(0, 1.0, new Animation(t => { TimerPanel.WidthRequest = t; }, TimerPanel.WidthRequest, 0, Easing.SinIn)); anim.Commit(this, "TimerAnimation", 16, (uint)delay); await TimerPanel.ColorTo(Color.LightGreen, Color.Yellow, c => TimerPanel.BackgroundColor = c, 150); await TimerPanel.ColorTo(Color.Yellow, Color.Red, c => TimerPanel.BackgroundColor = c, 150); await TimerPanel.ColorTo(Color.Red, Color.DarkRed, c => TimerPanel.BackgroundColor = c, 200); await Task.Delay(delay); }
public void ToggleEditButtons() { isEditButtonsEnable = !isEditButtonsEnable; if (isEditButtonsEnable) { FMODPlayer.Instance.Play("enter battle mode"); } TimerPanel.SetPause(isEditButtonsEnable); toggle.color = isEditButtonsEnable ? editEnabledColor : editDisabledColor; float target = isEditButtonsEnable ? 1 : 0; editButtonsGroup.interactable = isEditButtonsEnable; editButtonsGroup.blocksRaycasts = isEditButtonsEnable; editButtonsGroup.DOFade(target, editButtonsFadeTime); if (!isEditButtonsEnable && SendTroopsBox.Instance.IsActivated) { SendTroopsBox.Instance.CancelOperation(); } }
public async Task StartTimerAsync() { if (this.AnimationIsRunning("TimerAnimation")) { return; } TimerPanel.BackgroundColor = Color.LightGreen; uint total_time = 10000; var anim = new Animation(); anim.Add(0, 1.0, new Animation(t => { TimerPanel.WidthRequest = t; }, MaxTimerWidth, 0, Easing.SinInOut)); anim.Commit(this, "TimerAnimation", 16, total_time, null, (v, c) => RaiseEventTimerExpired()); await TimerPanel.ColorTo(Color.LightGreen, Color.Yellow, c => TimerPanel.BackgroundColor = c, 3000); await TimerPanel.ColorTo(Color.Yellow, Color.Red, c => TimerPanel.BackgroundColor = c, 2000); await TimerPanel.ColorTo(Color.Red, Color.DarkRed, c => TimerPanel.BackgroundColor = c, 5000); }
void Awake() { _battleRaging = false; _party1 = PlayerPanel.GetComponent <PartyGroup>(); //_party1SuccessSprite = PlayerPanel.GetComponentInChildren<SuccessSprite>(true); //_party1FailSprite = PlayerPanel.GetComponentInChildren<FailSprite>(true); _party2 = BossPanel.GetComponent <PartyGroup>(); //_party2SuccessSprite = BossPanel.GetComponentInChildren<SuccessSprite>(true); //_party2FailSprite = BossPanel.GetComponentInChildren<FailSprite>(true); _timerPanel = TimerPanel.GetComponent <TimerPanel>(); _resolutionPanel = GetComponentInChildren <ResolutionPanel>(true); _theBigButton = GetComponentInChildren <TheBigButton>(true); _buttonNamePanel = GetComponentInChildren <ButtonNamePanel>(true); _getReadyPanel = GetComponentInChildren <AttackGetReadyPanel>(true); _cannon = GetComponentInChildren <ProjectileCannon>(true); _audioSource = GetComponent <AudioSource>(); }
//Timer para mostrar el panel del desafio Completado(3 Seg) private void TimerVideo_Tick(object sender, EventArgs e) { TotalSeg--; if (TotalSeg == 4) { if (ControlUser.VideoVisto(Video)) { lblSeg.Text = "3"; lblDesafio.Text = "Desafio Completado"; lblComienza.Text = "Finaliza en"; panel1.Visible = true; TimerPanel.Enabled = true; TimerPanel.Start(); } } if (TotalSeg == 0) { TimerVideo.Stop(); TimerVideo.Enabled = false; this.Close(); } }
private IEnumerator LoadGameCoroutine() { // Waits for the PropertyManager to finish setting up TimerPanel.SetPause(true); while (!PropertyManager.Instance.HasFinishedSettingUp) { yield return(null); } // Loads game SaveData saveData = SaveSystem.LoadGame(); // Overwrites saved game state over current game state Population = saveData.population; Happiness = saveData.happiness; Gold = saveData.gold; Food = saveData.food; Building = saveData.building; FindObjectOfType <TimerPanel>().SetCurrentDay(saveData.day); StartingKingdomController.Instance.PlayerKingdom = saveData.playerKingdom; Camera.main.transform.position = new Vector3(saveData.cameraX, saveData.cameraY, Camera.main.transform.position.z); foreach (PropertySaveData pSaveData in saveData.properties) { PropertyManager.Instance.Propriedades[pSaveData.index].SetDominated(pSaveData.dominated, false); PropertyManager.Instance.Propriedades[pSaveData.index].SetSoldiers(SoldierType.InProperty, pSaveData.soldiers); PropertyManager.Instance.Propriedades[pSaveData.index].Level = pSaveData.level; PropertyManager.Instance.Propriedades[pSaveData.index].UpdateSoldierInfo(); PropertyManager.Instance.Propriedades[pSaveData.index].kingdom = pSaveData.kingdom; PropertyManager.Instance.Propriedades[pSaveData.index].UpdateSprite(PropertyManager.Instance.Propriedades[pSaveData.index]); } if (saveData.activeEvents != null) { KEventManager.Instance.ClearActiveEvents(); foreach (EventSaveData eSaveData in saveData.activeEvents) { KEvent kevt = ScriptableObject.CreateInstance <KEvent>(); kevt.PortugueseExhibitionName = eSaveData.PortugueseExhibitionName; kevt.EnglishExhibitionName = eSaveData.EnglishExhibitionName; kevt.InternalName = eSaveData.InternalName; kevt.PortugueseDescription = eSaveData.PortugueseDescription; kevt.EnglishDescription = eSaveData.EnglishDescription; kevt.Duration = eSaveData.Duration; kevt.LeftDuration = eSaveData.LeftDuration; kevt.ActiveIntensity = eSaveData.ActiveIntensity; kevt.mode = eSaveData.mode; kevt.battle = eSaveData.battle; kevt.chance = eSaveData.chance; kevt.PercentGoldLight = eSaveData.PercentGoldLight; kevt.PercentFoodLight = eSaveData.PercentFoodLight; kevt.PercentBuildingLight = eSaveData.PercentBuildingLight; kevt.PercentPeopleLight = eSaveData.PercentPeopleLight; kevt.PercentHappinessLight = eSaveData.PercentHappinessLight; kevt.PercentGoldMedium = eSaveData.PercentGoldMedium; kevt.PercentFoodMedium = eSaveData.PercentFoodMedium; kevt.PercentBuildingMedium = eSaveData.PercentBuildingMedium; kevt.PercentPeopleMedium = eSaveData.PercentPeopleMedium; kevt.PercentHappinessMedium = eSaveData.PercentHappinessMedium; kevt.PercentGoldHeavy = eSaveData.PercentGoldHeavy; kevt.PercentFoodHeavy = eSaveData.PercentFoodHeavy; kevt.PercentBuildingHeavy = eSaveData.PercentBuildingHeavy; kevt.PercentPeopleHeavy = eSaveData.PercentPeopleHeavy; kevt.PercentHappinessHeavy = eSaveData.PercentHappinessHeavy; kevt.AbsoluteGoldLight = eSaveData.AbsoluteGoldLight; kevt.AbsoluteFoodLight = eSaveData.AbsoluteFoodLight; kevt.AbsoluteBuildingLight = eSaveData.AbsoluteBuildingLight; kevt.AbsoluteGoldMedium = eSaveData.AbsoluteGoldMedium; kevt.AbsoluteFoodMedium = eSaveData.AbsoluteFoodMedium; kevt.AbsoluteBuildingMedium = eSaveData.AbsoluteBuildingMedium; kevt.AbsoluteGoldHeavy = eSaveData.AbsoluteGoldHeavy; kevt.AbsoluteFoodHeavy = eSaveData.AbsoluteFoodHeavy; kevt.AbsoluteBuildingHeavy = eSaveData.AbsoluteBuildingHeavy; kevt.showInInspector = eSaveData.showInInspector; KEventManager.Instance.AddActiveEvent(kevt); } } hud.UpdateHUD(); TimerPanel.SetPause(false); }
public SaveData(GameManager gameManager, TimerPanel timer, PropertyManager propertyManager, KEventManager eventManager, StartingKingdomController startingKingdomController, Transform camera) { population = gameManager.Population; happiness = gameManager.Happiness; gold = gameManager.Gold; food = gameManager.Food; building = gameManager.Building; day = timer.GetCurrentDay(); playerKingdom = startingKingdomController.PlayerKingdom; cameraX = camera.position.x; cameraY = camera.position.y; properties = new PropertySaveData[propertyManager.Propriedades.Count]; foreach (Property p in propertyManager.Propriedades) { properties[p.index] = new PropertySaveData(p.index, p.dominated, p.GetSoldiers(SoldierType.InProperty), p.Level, p.kingdom); } if (eventManager.GetAllActiveEvents().Count > 0) { List <KEvent> list = eventManager.GetAllActiveEvents(); activeEvents = new EventSaveData[list.Count]; for (int i = 0; i < list.Count; i++) { activeEvents[i] = new EventSaveData( list[i].PortugueseExhibitionName, list[i].EnglishExhibitionName, list[i].InternalName, list[i].PortugueseDescription, list[i].EnglishDescription, list[i].Duration, list[i].LeftDuration, list[i].ActiveIntensity, list[i].mode, list[i].battle, list[i].chance, list[i].PercentGoldLight, list[i].PercentFoodLight, list[i].PercentBuildingLight, list[i].PercentPeopleLight, list[i].PercentHappinessLight, list[i].PercentGoldMedium, list[i].PercentFoodMedium, list[i].PercentBuildingMedium, list[i].PercentPeopleMedium, list[i].PercentHappinessMedium, list[i].PercentGoldHeavy, list[i].PercentFoodHeavy, list[i].PercentBuildingHeavy, list[i].PercentPeopleHeavy, list[i].PercentHappinessHeavy, list[i].AbsoluteGoldLight, list[i].AbsoluteFoodLight, list[i].AbsoluteBuildingLight, list[i].AbsoluteGoldMedium, list[i].AbsoluteFoodMedium, list[i].AbsoluteBuildingMedium, list[i].AbsoluteGoldHeavy, list[i].AbsoluteFoodHeavy, list[i].AbsoluteBuildingHeavy, list[i].showInInspector); } } else { activeEvents = null; } }
public void OnIndividualBattleEnded() { //Chamado quando cada batalha individual termina TimerPanel.OnIndividualBattleEnd(); }
public void DestroyWindow() { Destroy(this.gameObject); TimerPanel.SetPause(false); }
private void Start() { TimerPanel.SetPause(true); }
public void OnBattlesEnd() { //Chamado quando terminam todas as batalhas TimerPanel.OnBattleEnd(); }