public void ApplyBonus(BonusName name, float duration) { if (!timers.ContainsKey(name)) { timers[name] = new BonusTimer(); } timers[name].timer = 0; if (timers[name].duration == 0.0f && onBonusOn.ContainsKey(name)) { onBonusOn[name](); } timers[name].duration = duration; }
private void Use() { if ((!m_Caster.Deleted && m_Caster.Alive)) { if (m_Caster.Mana >= m_ManaCost) { m_Caster.Mana -= m_ManaCost; BonusTimer m_TimerDuration = new BonusTimer(CalculDuree(), m_Caster); } else { m_Caster.SendMessage("Vous n'avez pas assez de mana pour utiliser cette technique !"); } } }
public void OnResetClick() { ScavengerHuntArea scavHunt = GameObject.Find("ScavengerHuntPanel").GetComponent <ScavengerHuntArea>(); Timer timer = GameObject.Find("Timer").GetComponent <Timer>(); if (timer.timeInSeconds > 10) { timer.timeInSeconds -= 10; } Bonus bonus = GameObject.Find("ScoreTimerEquationHistoryPanel").GetComponent <Bonus>(); if (GameObject.Find("bonusTimer") != null) { BonusTimer bt = GameObject.Find("bonusTimer").GetComponent <BonusTimer>(); bt.timeInSeconds = 0; bt.bonusOver = true; } bonus.pickRandomBonus(); scavHunt.populateScavHunt(40); }
//char[] _operators = new [] { '+', '-', 'x', '/', '√', '^' }; // Use this for initialization void Start() { bt = GameObject.Find("bonusTimer").GetComponent <BonusTimer>(); t = GameObject.Find("Timer").GetComponent <Timer>(); }
void Start() { _floor = MonobehaviorHandler.GetMonobeharior().GetObject <Floor>("Floor"); _timer = MonobehaviorHandler.GetMonobeharior().GetObject <BonusTimer>("bonusTimer"); }
void Start() { _floor = MonobehaviorHandler.GetMonobeharior().GetObject<Floor>("Floor"); _timer = MonobehaviorHandler.GetMonobeharior().GetObject<BonusTimer>("bonusTimer"); }
void Awake() { bonusInfo = GameObject.Find("BonusInfo").GetComponent <BonusInfo>(); bonusTimer = GameObject.Find("BonusTimer").GetComponent <BonusTimer>(); }
public void RefreshTimer( TimeSpan newDuration ) { m_DecayTimer.Stop(); m_DecayTimer = new BonusTimer( newDuration, this ); m_DecayTimer.Start(); }
public BonusTableEntry( double bonus, TimeSpan decay, Mobile mob, bool fightingstyle ) { m_Bonus = bonus; m_Mobile = mob; m_FightingStyle = fightingstyle; m_DecayTimer = new BonusTimer( decay, this ); m_DecayTimer.Start(); }
// Update is called once per frame void Update() { delay++; if (score < tempScore && delay % delayMod == 0) { score += 1; } else if (gameOver) { bestScore = PlayerPrefs.GetInt("HighScore"); if (score > bestScore) { bestScore = score; PlayerPrefs.SetInt("HighScore", bestScore); } Application.LoadLevel("GameOver"); } else if (equationSolved) { Transform tr = null; equationSolved = false; numEquationsSolved++; if (GameObject.Find("bonusTimer") != null) { BonusTimer bt = GameObject.Find("bonusTimer").GetComponent <BonusTimer>(); if (bt != null) { bt.timeInSeconds = 0; } } delay = 0; foreach (GameObject slot in slots) { UISprite mp = slot.gameObject.transform.parent.gameObject.GetComponent <UISprite>(); tr = slot.transform.GetComponentsInChildren <Transform>().FirstOrDefault(t => t.name.Contains("shElement") || t.name.Contains("symbol")); if (tr != null) { mp.color = new Color(0.0f, 1.0f, 0.0f, .1f); DragSymbol ds = tr.gameObject.GetComponent <DragSymbol>(); ds.enabled = false; } } messagePos = addToTimerMessage.transform.localPosition; NGUITools.SetActive(addToTimerMessage, true); AudioSource audio = addToTimerMessage.audio; if (audio.isPlaying) { audio.Stop(); } audio.Play(); runDisplayTimeMessage = true; addToTimerAndScore(); //ScoreLabel.text = score.ToString(); StartCoroutine("WaitToClear"); } ScoreLabel.text = score.ToString(); PlayerPrefs.SetInt("Score", score); if (runDisplayTimeMessage) { addToTimerMessage.transform.localPosition += Vector3.up * 4; StartCoroutine("ClearMessage"); } }