コード例 #1
0
ファイル: BonusManager.cs プロジェクト: ThomasV2/ColorWarrior
    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;
    }
コード例 #2
0
ファイル: AttackSpeed.cs プロジェクト: Zilmerx/Temrael2
 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 !");
         }
     }
 }
コード例 #3
0
ファイル: GameSceneUI.cs プロジェクト: adoc11/mathhunt
    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);
    }
コード例 #4
0
    //char[] _operators = new [] { '+', '-', 'x', '/', '√', '^' };

    // Use this for initialization
    void Start()
    {
        bt = GameObject.Find("bonusTimer").GetComponent <BonusTimer>();
        t  = GameObject.Find("Timer").GetComponent <Timer>();
    }
コード例 #5
0
ファイル: MegaBonusIcon.cs プロジェクト: Syjgin/zerotram
 void Start()
 {
     _floor = MonobehaviorHandler.GetMonobeharior().GetObject <Floor>("Floor");
     _timer = MonobehaviorHandler.GetMonobeharior().GetObject <BonusTimer>("bonusTimer");
 }
コード例 #6
0
ファイル: MegaBonusIcon.cs プロジェクト: Xakkar/zerotram
 void Start()
 {
     _floor = MonobehaviorHandler.GetMonobeharior().GetObject<Floor>("Floor");
     _timer = MonobehaviorHandler.GetMonobeharior().GetObject<BonusTimer>("bonusTimer");
 }
コード例 #7
0
ファイル: Bonus.cs プロジェクト: diablol1/gameoff2017
 void Awake()
 {
     bonusInfo  = GameObject.Find("BonusInfo").GetComponent <BonusInfo>();
     bonusTimer = GameObject.Find("BonusTimer").GetComponent <BonusTimer>();
 }
コード例 #8
0
 public void RefreshTimer( TimeSpan newDuration )
 {
     m_DecayTimer.Stop();
     m_DecayTimer = new BonusTimer( newDuration, this );
     m_DecayTimer.Start();
 }
コード例 #9
0
 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();
 }
コード例 #10
0
    // 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");
        }
    }