Beispiel #1
0
    public void updateCaller()
    {
        if (!gameObject.activeSelf)
        {
            callTimer += Time.deltaTime;
            if (lastCallTime + callTimer >= nextCallTime)
            {
                callTimer = 0;
                gameObject.SetActive(true);
                lastCallTime = Time.time;
                timeUntilEnd = lastCallTime + endTime;
                nextCallTime = Random.Range(minTimer, maxTimer);
            }
        }

        if (gameObject.activeSelf)
        {
            endTimer += Time.deltaTime;
            if (lastCallTime + endTimer >= timeUntilEnd)
            {
                endTimer     = 0;
                lastCallTime = Time.time;
                GameFlow gameFlow = (GameFlow)FlowManager.Instance.currentFlow;
                gameFlow.EndGame();
            }
        }
    }
Beispiel #2
0
    /// <summary>
    /// スキルの番号を選択する。
    /// </summary>
    void SelectingSkill()
    {
        if (!playerUseSkill.CanSelectSkill())
        {
            return;//スキルがつかえないなら早期リターン
        }
        if (usedSkill.Where(i => (i == false)).Count() == 0)
        {
            gameFlow.EndGame();//すべての技を使い切ったらゲーム終了
        }

        for (int i = 0; i < 26; i++)
        {
            //97がA、122がZでその間は順番。だから、97から122までチェックして行く。
            if (Input.GetKeyDown((KeyCode)(i + 97)))
            {
                if (currentSkillNum == i && !usedSkill[i]) //前回と同じスキルを選択した場合
                {
                    TryToUseSkill();                       //スキルの使用を試みる(条件があるので)
                }

                //直前がちゃんとした番号の場合は、直前のやつをもとに戻す
                if (currentSkillNum >= 0 && currentSkillNum < 26)
                {
                    BackAlphabetInfomations(currentSkillNum);
                }

                currentSkillNum = i;                                                //選択中スキル番号の更新

                SetAlphabetInfomations(i);                                          //新しい情報を入力する

                currentChar.text = (System.Convert.ToChar(i + 97 - 32).ToString()); //大文字のASCIIに変換
            }
        }

        //エンターキーなどを押したときに発動を試みる
        if (Input.GetKeyDown(KeyCode.Space) || Input.GetKeyDown(KeyCode.Return))
        {
            if (currentSkillNum >= 0 && currentSkillNum < 26) //範囲内かどうかの判定
            {
                if (!usedSkill[currentSkillNum])              //使えるかどうかの判定
                {
                    TryToUseSkill();                          //スキルの使用を試みる(条件があるので)
                    BackAlphabetInfomations(currentSkillNum);
                    SetAlphabetInfomations(currentSkillNum);
                }
            }
        }
    }
Beispiel #3
0
    public void UpToDate()
    {
        if (oxygene <= 0)
        {
            GameFlow gameFlow = (GameFlow)FlowManager.Instance.currentFlow;
            gameFlow.EndGame();
        }

        if (mySpaceShip.Count > 0)
        {
            if (Time.time > nextTime)
            {
                int random = Random.Range(0, mySpaceShip.Count);
                mySpaceShip[random].destroyRoom();
                modifier = Random.Range(minTime, maxTime);
                nextTime = Time.time + modifier;
            }
        }

        if (Input.GetKeyDown(KeyCode.Space))
        {
            int random = Random.Range(0, mySpaceShip.Count);
            mySpaceShip[random].destroyRoom();
            modifier = Random.Range(minTime, maxTime);
            nextTime = Time.time + modifier;
        }


        Debug.Log("Oxygene: " + oxygene);
        Debug.Log("OxygeneLostSecondes: " + oxygeneLostPerSeconds);

        if (Time.time > oxygeneTime && oxygeneLostPerSeconds > 0)
        {
            oxygene -= oxygeneLostPerSeconds;

            oxygeneTime = Time.time + oxygeneSeconds;

            UIManager.Instance.Oxygene(oxygene);
        }
    }