コード例 #1
0
    // Update is called once per frame
    void FixedUpdate()
    {
        if (count == 55 && isStart)
        {
            isStart = false;
            isEnd   = true;
            if (!endText.activeSelf)
            {
                endText.SetActive(true);
            }
            excWriter.CloseWriter();
        }
        if (exp && isStart)
        {
            if (strData[3] != null)
            {
                strData[3] = null;
            }
            setTextColor(0);
            if (crossObject.activeSelf)
            {
                crossObject.SetActive(false);
            }
            if (canInput)
            {
                canInput = false;
            }
            if (!objChanger.picsPlate[count].activeSelf)
            {
                objChanger.picsPlate[count].SetActive(true);
            }
            if (frameTimer >= expTime * 50)
            {
                exp       = !exp;
                timeReset = true;
            }
        }
        if (!exp && isStart)
        {
            if (!canInput)
            {
                canInput = true;
            }
            if (!crossObject.activeSelf)
            {
                crossObject.SetActive(true);
            }
            if (objChanger.picsPlate[count].activeSelf)
            {
                objChanger.picsPlate[count].SetActive(false);
            }
        }

        if (isStart)
        {
            frameTimer++;
        }
    }
コード例 #2
0
 void FixedUpdate()
 {
     if (isStart && !isEnd)
     {
         ////////////////////////////////////////////
         if ((timeCounter -= Time.deltaTime) <= 0)
         {
             isStart     = false;
             timeCounter = spanTimer;
             DestroyCharObject();
             ButtonParent.SetActive(false);
             //EndText.SetActive(true);
             exWriter.Writing(trueCount.ToString());
             exWriter.Writing(falseCount.ToString());
             exWriter.CloseWriter();
             isFirstTimeEnd = true;
             timesCount++;
             if (timesCount != testTimes)
             {
                 InitStats(timesCount);
                 CrossMark.SetActive(true);
             }
         }
     }
     if (timesCount == testTimes)
     {
         EndText.SetActive(true);
         isEnd = true;
     }
     if (!isStart && isFirstTimeEnd && !isEnd)
     {
         if ((timeCounter -= Time.deltaTime) <= 0)
         {
             for (int i = 0; i < outPutStr.Length; i++)
             {
                 outPutStr[i] = charStr[randNum[timesCount], i];
             }
             CrossMark.SetActive(false);
             exWriter.OpenWriter(timesCount, string.Join("_", outPutStr));
             timeCounter = defTimer;
             ButtonParent.SetActive(true);
             if (imgWriting)
             {
                 imgWriter.ScreenShot();
             }
             isStart = true;
         }
     }
 }
コード例 #3
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Return) && !isStart)
     {
         if (inputField.text != "")
         {
             isStart = true;
             inputFieldObject.SetActive(false);
             inputName.SetActive(false);
             excWriter.OpenWriter(cubePlacer.objectNum);
         }
     }
     if (Input.GetKeyDown(KeyCode.LeftArrow) && isSelecting)
     {
         testText.SetActive(false);
         if (colorChange)
         {
             outputStr = "1";
         }
         else
         {
             outputStr = "0";
         }
         string[] tmpData =
         {
             outputStr,
             outputBoolStr
         };
         writeData = string.Join(",", tmpData);
         if (!end)
         {
             excWriter.Writing(writeData);
         }
         if (expRand.trueCount == 20)
         {
             end = true;
             excWriter.CloseWriter();
             Application.LoadLevel(0);
         }
         frame       = 0;
         isSelecting = false;
     }
     if (Input.GetKeyDown(KeyCode.RightArrow) && isSelecting)
     {
         testText.SetActive(false);
         if (!colorChange)
         {
             outputStr = "1";
         }
         else
         {
             outputStr = "0";
         }
         string[] tmpData =
         {
             outputStr,
             outputBoolStr
         };
         writeData = string.Join(",", tmpData);
         if (!end)
         {
             excWriter.Writing(writeData);
         }
         if (expRand.trueCount == 20)
         {
             end = true;
             excWriter.CloseWriter();
             Application.LoadLevel(0);
         }
         frame       = 0;
         isSelecting = false;
     }
 }