void Update() { if (Ball_Controller.B_Lose) { I_EdgeFillAmount.fillAmount += F_speed * Time.deltaTime; //timer if (I_EdgeFillAmount.fillAmount >= 1) //player will die { SoundManagerGame.V_PlaySoundLose(); Ball_Controller.I_AdShow++; if (Advertisement.IsReady() && Ball_Controller.I_AdShow % 5 == 0) { Advertisement.Show(); } Ball_Controller.B_Lose = false; GameController.V_AdMoney(); print("test Bar"); StartCoroutine(LoseEffect.I_LoseEffect( C_FromColor: new Color32(0, 0, 0, 0), C_ToColor: new Color32(0, 0, 0, 113), F_OverTime: 1f)); StartCoroutine(GameButtons.I_RestartButtonCur( C_ToColor: 203, F_OverTime: 1)); StartCoroutine(AdTotalCoinText.I_AdCoinCur( C_ToColor: 203, F_OverTime: 1)); } } }
/// <summary> /// Continually loops through active buffs; and invokes a LoseEffect or GainEffect event each time a buff is determined as being lost or gained. /// </summary> public void WatchBuffs() { while (_buffs) { List <StatusEffect> _lostBuffs = _currentBuffs.Where(x => true).ToList(); List <StatusEffect> _newBuffs = new List <StatusEffect>(); // Loop through all status effects on me foreach (StatusEffect status in _fface.Player.StatusEffects) { if (status == StatusEffect.Unknown || status == StatusEffect.KO) { continue; } // If I still have a certain buff; remove it from the _lostBuffs list, because I didn't lose it. if (_currentBuffs.Contains(status)) { _lostBuffs.Remove(status); } // If my buff isn't in the _currentBuffs list, fire an event if the event is subscribed. if (!_currentBuffs.Contains(status)) { GainEffect?.Invoke(status); _newBuffs.Add(status); } Thread.Sleep(100); } // Loop through all the effects I've lost foreach (StatusEffect status in _lostBuffs) { _currentBuffs.Remove(status); LoseEffect?.Invoke(status); Thread.Sleep(100); } // Add new buffs to the _currentBuffs list var temp = _currentBuffs.Concat(_newBuffs).ToList(); _currentBuffs = temp; Thread.Sleep(100); } }
void Update() { transform.position = new Vector3(x: GameController.F_X, y: GameController.F_Y, z: transform.position.z); //Ball will be do bigger into the circle, near the Touch #region hold if (B_Lose) { if (Touch.S_Touch == "true" && !B_Second) { //Do ball bigger F_Speed += F_SpeedValue; transform.localScale = new Vector2(x: transform.localScale.y + F_Speed, y: transform.localScale.y + F_Speed); } //What happened (haw big ball when pleyer stop do it bigger) if (Touch.S_Touch == "false" && !B_First && !B_Second) //Middle { SoundManagerGame.V_PlaySoundLose(); I_AdShow++; if (Advertisement.IsReady() && I_AdShow % 5 == 0) { Advertisement.Show(); } print("test Middle"); Touch.S_Touch = "nope"; GameController.V_AdMoney(); StartCoroutine(LoseEffect.I_LoseEffect( C_FromColor: new Color32(0, 0, 0, 0), C_ToColor: new Color32(0, 0, 0, 113), F_OverTime: 1f)); StartCoroutine(GameButtons.I_RestartButtonCur( C_ToColor: 203, F_OverTime: 1)); StartCoroutine(AdTotalCoinText.I_AdCoinCur( C_ToColor: 203, F_OverTime: 1)); B_Lose = false; } if (Touch.S_Touch == "false" && B_First && !B_Second) //Win { SoundManagerGame.V_PlaySoundPassLevel(); LevelText.ChangeLevelText(); print("test Win"); Touch.S_Touch = "nope"; I_level++; LevelText.ChangeLevelText(); V_NewLevel(); if (I_level >= I_WhenMoveCircle) //If level >= level after what value u d'like to move circle { GameController.I_NewPos( width: Random.Range( //Random range X (Screen.width / 128.113f / 2 * -1) + (F_RandomScale * 3.25f), //From(smoller) (Screen.width / 128.113f / 2) - (F_RandomScale * 3.25f)), //To(bigger) height: Random.Range( //Random range Y (Screen.height / 128 / 2 * -1) + (F_RandomScale * 3.25f), //From(smoller) (Screen.height / 128 / 2) - (F_RandomScale * 3.25f))); //To(bigger) } if (I_level <= 100) { F_SpeedValue += 0.000003f; } ProgressBar.V_Win(); } if ((Touch.S_Touch == "false" && B_Second) || B_Second) //Lose { SoundManagerGame.V_PlaySoundLose(); I_AdShow++; if (Advertisement.IsReady() && I_AdShow % 5 == 0) { Advertisement.Show(); } print("test Lose"); Touch.S_Touch = "nope"; GameController.V_AdMoney(); StartCoroutine(LoseEffect.I_LoseEffect( C_FromColor: new Color32(0, 0, 0, 0), C_ToColor: new Color32(0, 0, 0, 113), F_OverTime: 1f)); StartCoroutine(GameButtons.I_RestartButtonCur( C_ToColor: 203, F_OverTime: 1)); StartCoroutine(AdTotalCoinText.I_AdCoinCur( C_ToColor: 203, F_OverTime: 1)); B_Lose = false; } if (Touch.S_Touch == "exit") //Exit { SoundManagerGame.V_PlaySoundLose(); I_AdShow++; if (Advertisement.IsReady() && I_AdShow % 5 == 0) { Advertisement.Show(); } print("test Exit"); Touch.S_Touch = "nope"; GameController.V_AdMoney(); StartCoroutine(LoseEffect.I_LoseEffect( C_FromColor: new Color32(0, 0, 0, 0), C_ToColor: new Color32(0, 0, 0, 113), F_OverTime: 1f)); StartCoroutine(GameButtons.I_RestartButtonCur( C_ToColor: 203, F_OverTime: 1)); StartCoroutine(AdTotalCoinText.I_AdCoinCur( C_ToColor: 203, F_OverTime: 1)); B_Lose = false; } } #endregion if (B_IsScale) { G_LevelCircle.transform.localScale = Vector3.Lerp( a: V_LocalScale, b: G_LevelCircle.transform.localScale = new Vector3(F_RandomScale, F_RandomScale, transform.localScale.z), t: Time.deltaTime * F_SpeedScale); V_LocalScale = new Vector3(G_LevelCircle.transform.localScale.x, G_LevelCircle.transform.localScale.x, G_LevelCircle.transform.localScale.x); } }