private void UIS_Click(object sender, EventArgs e) { if (UIS_C == false) { UIS.Text = "Uncheck all Items"; } else { UIS.Text = "Check all Items"; } UIS.Refresh(); for (int i = 0; i < surv_items.Items.Count; i++) { if (UIS_C == false) { surv_items.SetItemCheckState(i, CheckState.Checked); } if (UIS_C == true) { surv_items.SetItemCheckState(i, CheckState.Unchecked); } } UIS_C = !UIS_C; }
IEnumerator PowerUpTimer(float time, int powerUp) { timerOn = true; powerupTime = time; Debug.Log(powerUpDuration + "should be" + powerUp); UIS.SetActive(false); switch (powerUp) { case 0: doubleShot = true; UIDS.SetActive(true); break; case 1: shotgun = true; UISG.SetActive(true); break; case 2: fullDirectional = true; UIFD.SetActive(true); break; } yield return(new WaitForSeconds(time)); switch (powerUp) { case 0: doubleShot = false; UIDS.SetActive(false); break; case 1: shotgun = false; UISG.SetActive(false); break; case 2: fullDirectional = false; UIFD.SetActive(false); break; } hasPowerUp = false; UIS.SetActive(true); timerOn = false; }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { //Add methods to the size change Window.ClientSizeChanged += updateBoundsOnChange; //temporary, add the player. //players[thisPlayer] = Player.load("player.ghb") ?? new Player(new PlayerInputController(), Vector2.Zero); //Set window's title. Window.Title = "Yaritakunai"; //Set the bounds to the initial value. updateBoundsOnChange(null, null); //Assigned to a bool as it is the status of if there is a settings.json. //If there is not, we go to the language select screen and use the default cursor colour. (etc, etc) bool settingsLoaded = Settings.init(); //perfrom initialization Input.init(); Camera.init(); Player.init(); UIS.init(); Task.Run(() => IME.init()); BGMPlayer.init(); Item.init(); Projectile.init(); #if FORCE_RESET_SETTINGS settingsLoaded = false; Settings.defaults(); #endif if (settingsLoaded) { switchScreenTo(screens.title); } Settings.makeSureSettingsDirectoriesExist(); base.Initialize(); RenderTargetManager.init(GraphicsDevice); updateBoundsOnChange(null, null); }