Ejemplo n.º 1
0
    private void StartQuestion() // 問題を出力します。
    {
        quizCount++;
        if (selectedItem == null)
        {
            selectedItem = piQuiz.GetItem();
        }

        if (PiQuizOpener.GameMode == PiQuizOpener.Mode.ScoreAttack)
        {
            if (quizCount > PiQuizOpener.QuestionSize)
            {
                FinishGame();
                return;
            }
        }

        if (!FileScaner.ChkFile(selectedItem.ImagePath))
        {
            if (tryNullCount < 10)
            {
                Debug.LogWarning("Error. No File." + selectedItem.ImagePath);
                selectedItem = piQuiz.GetItem();
                tryNullCount++;
            }
        }

        rawImage.color    = new Color(-0.2f, -0.2f, -0.2f);
        rawImage.texture  = FileUniTexture.PNGToUniTex(selectedItem.ImagePath);
        startQuestionTime = piQuiz.stopWatch.ElapsedMilliseconds;
        piQuiz.stopWatch.Start();

        acceptAnswer = true;
        if (IsMulti)
        {
            if (acceptAnswerPlayer == null)
            {
                acceptAnswerPlayer = new bool[PlayerNameOnMulti.Length];
            }
            for (int i = 0; i < acceptAnswerPlayer.Length; i++)
            {
                acceptAnswerPlayer[i] = true;
            }
        }

        updateAction += GameRunning;

        if (IsMulti)
        {
            if (PlayerNameOnMulti.Length >= 3)
            {
                SetRundomRotate(rawImage.rectTransform);
            }
        }
    }
Ejemplo n.º 2
0
    public static Texture GetTexture(From from, string path)
    {
        switch (from)
        {
        case From.Assets:
            return(Resources.Load(path) as Texture);

        case From.Path:
            return(FileUniTexture.PNGToUniTex(path));
        }
        return(null);
    }