private void Awake() { Instante = this; //load some int InitCurrentTheme(PlayerPrefs.GetInt("theme")); //InitCurrentTheme(index); }
void Update() { if (Input.GetKeyDown(KeyCode.T)) { if (!manualControle) { TriggerThemeChange(); } else { manualControle = false; oldGameTheme = new GameTheme(new Color(mColorR, mColorG, mColorB), lightI); //currentGameTheme = oldGameTheme; TriggerThemeChange(); StartCoroutine(ChangeTheme()); } } if (Input.GetKeyDown(KeyCode.H)) { hideController = !hideController; } sunLight.intensity = lightI; for (int j = 0; j < musicShader.musicMaterials.Length; j++) { musicShader.musicMaterials[j].material.SetColor("_MColor", new Color(mColorR, mColorG, mColorB)); } }
void Start() { ssao = ssaoEffect.enabled; bloom = bloomEffect.enabled; depthOfField = depthOfFieldEffect.enabled; SunShafts = sunShaftoEffect.enabled; manualControle = false; currentGameTheme = new GameTheme(new Color(1, 1, 0), 0.03f); mColorR = currentGameTheme.color.r; mColorG = currentGameTheme.color.g; mColorB = currentGameTheme.color.b; lightI = currentGameTheme.lightPower; oldGameTheme = currentGameTheme; gameThemes = new GameTheme[5]; gameThemes[0] = currentGameTheme; gameThemes[1] = new GameTheme(new Color(1, 0, 1), 0.03f); gameThemes[2] = new GameTheme(new Color(1, 1, 1), 0.03f); gameThemes[3] = new GameTheme(new Color(1, 1, 0), 0.03f); gameThemes[4] = new GameTheme(new Color(0, 1, 1), 0.03f); gameThemes[4] = new GameTheme(new Color(0, 0.35f, 1), 0.03f); sunLight.intensity = lightI; StartCoroutine(ChangeTheme()); }
/// <summary> /// Switches the theme to that of the specified index /// </summary> /// <param name="index">The index of the theme in the themes list</param> public static void SwitchTheme(int index) { if (index >= Themes.Count || index < 0) { throw new ArgumentException("Index is out of range", nameof(index)); } CurrentTheme = Themes[index]; }
// Клик в зависимости от выбора темы private void ChooseThemes(GameTheme theme) { if (theme == GameTheme.All) // Не делаем ничего, потому что они уже все выбраны изначально { return; } else { _clicker.Click(780, 690); // Клик по кнопке Убрать все темы switch (theme) { case GameTheme.Art: _clicker.Click(463, 670); // Клик по кнопке Искусство break; case GameTheme.Media: _clicker.Click(522, 670); // Клик по кнопке СМИ break; case GameTheme.Geography: _clicker.Click(590, 670); // Клик по кнопке География break; case GameTheme.Wars: _clicker.Click(654, 670); // Клик по кнопке Войны break; case GameTheme.Books: _clicker.Click(715, 670); // Клик по кнопке Книги break; case GameTheme.Mathematics: _clicker.Click(463, 710); // Клик по кнопке Математика break; case GameTheme.Biology: _clicker.Click(522, 710); // Клик по кнопке Биология break; case GameTheme.Sport: _clicker.Click(590, 710); // Клик по кнопке Спорт break; case GameTheme.Theatre: _clicker.Click(654, 710); // Клик по кнопке Театр break; case GameTheme.Beauty: _clicker.Click(715, 710); // Клик по кнопке Красота break; default: break; } return; } }
/// <summary> /// Constructor /// </summary> static ApplicationTheme() { Themes = new List <GameTheme> { new DefaultGameTheme(), new KnightTheme(), new HalloweenTheme() }; // Add all game themes to the linked list CurrentTheme = Themes[DEFAULT_THEME_INDEX]; }
public bool checkSame(GameTheme check) { if (check.color == this.color && check.lightPower == this.lightPower) { return(true); } else { return(false); } }
/// <summary> /// Returns a hash code for this instance. /// </summary> /// <returns>A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.</returns> public override int GetHashCode() { unchecked { var hashCode = AuditDate.GetHashCode(); hashCode = (hashCode * 397) ^ CasinoName.GetHashCode(); hashCode = (hashCode * 397) ^ EgmSerialNumber.GetHashCode(); hashCode = (hashCode * 397) ^ EgmAssetNumber.GetHashCode(); hashCode = (hashCode * 397) ^ GameTheme.GetHashCode(); hashCode = (hashCode * 397) ^ Denomination.GetHashCode(); return(hashCode); } }
void TriggerThemeChange() { if (!manualControle) { if (oldGameTheme.checkSame(currentGameTheme)) { current++; if (current >= gameThemes.Length) { current = 0; } currentGameTheme = gameThemes[current]; changeTimer = 0; StartCoroutine(UpdateTheme()); } } }
IEnumerator UpdateTheme() { changeTimer += 0.015f; mColorR = Color.Lerp(oldGameTheme.color, currentGameTheme.color, changeTimer).r; mColorG = Color.Lerp(oldGameTheme.color, currentGameTheme.color, changeTimer).g; mColorB = Color.Lerp(oldGameTheme.color, currentGameTheme.color, changeTimer).b; for (int j = 0; j < musicShader.musicMaterials.Length; j++) { musicShader.musicMaterials[j].material.SetColor("_MColor", new Color(mColorR, mColorG, mColorB)); } lightI = Mathf.Lerp(oldGameTheme.lightPower, currentGameTheme.lightPower, changeTimer); yield return(new WaitForSeconds(0.025f)); if (changeTimer < 1) { yield return(StartCoroutine(UpdateTheme())); } else { oldGameTheme = currentGameTheme; } }
private ClickerFHD _clicker; // Кликер public ReopenerWithBots(int processId, GameTheme gameTheme = GameTheme.All) { _gameTheme = gameTheme; _clicker = new ClickerFHD(processId); }
void OnGUI() { if (!hideController) { showController = GUI.Toggle(new Rect(10, 10, 180, 30), showController, "Show Music Shader Controller"); if (GUI.Button(new Rect(260, 10, 80, 15), "Full Screen")) { CameraUtils.ToggleFullscreen(); } if (showController) { float checkLightI = lightI; float checkRed = mColorR; float checkGreen = mColorG; float checkBlue = mColorB; lightI = GUI.HorizontalSlider(new Rect(10, 60, 100, 10), lightI, 0.0f, 1.0f); mColorR = GUI.HorizontalSlider(new Rect(10, 80, 100, 10), mColorR, 0.0f, 1f); mColorG = GUI.HorizontalSlider(new Rect(10, 90, 100, 10), mColorG, 0.0f, 1f); mColorB = GUI.HorizontalSlider(new Rect(10, 100, 100, 10), mColorB, 0.0f, 1f); if (lightI != checkLightI || mColorR != checkRed || mColorG != checkGreen || mColorB != checkBlue) { manualControle = true; } if (manualControle) { if (GUI.Button(new Rect(120, 60, 180, 30), "Auto Color Change(Press T)")) { manualControle = false; oldGameTheme = new GameTheme(new Color(mColorR, mColorG, mColorB), lightI); currentGameTheme = oldGameTheme; StartCoroutine(ChangeTheme()); } } else { GUI.TextField(new Rect(120, 60, 130, 30), "<-Manual Controle"); } ssao = GUI.Toggle(new Rect(10, 140, 180, 30), ssao, "SSAO"); bloom = GUI.Toggle(new Rect(10, 170, 180, 30), bloom, "Bloom"); depthOfField = GUI.Toggle(new Rect(10, 200, 180, 30), depthOfField, "Depth Of Field"); SunShafts = GUI.Toggle(new Rect(10, 230, 180, 30), SunShafts, "Sun Shafts"); if (ssaoEffect.enabled != ssao) { ssaoEffect.enabled = ssao; } if (bloomEffect.enabled != bloom) { bloomEffect.enabled = bloom; } if (depthOfFieldEffect.enabled != depthOfField) { depthOfFieldEffect.enabled = depthOfField; } if (sunShaftoEffect.enabled != SunShafts) { sunShaftoEffect.enabled = SunShafts; } } } }