コード例 #1
0
    public void OnPointerClickLevelButton(BaseEventData eventData)
    {
        string s = eventData.selectedObject.name;

        if (counter == int.Parse(s))
        {
            var pos  = camera.ScreenToWorldPoint(Input.mousePosition + camera.transform.forward * 10);
            var part = Instantiate(particle, pos, Quaternion.identity);
            //particle.Simulate(0.0f, true, true);
            //particle.transform.position = pos;
            //particle.Emit(1);
            //particle.Play();
            part.transform.position = pos;
            part.Emit(1);
            part.Play();

            eventData.selectedObject.SetActive(false);
            scDataStore.speed_ReactionTimes[counter - 1] = Time.realtimeSinceStartup - preClickTime;
            preClickTime = Time.realtimeSinceStartup;
            //audClick.Play();
            HandheldUtil.Vibrate(100);
            counter++;
        }

        if (counter > 30)
        {
            scDataStore.saveToFile_SPEED();

            //- Upload log
            string[] resultStr = scDataStore.resultToString_SPEED();

            WebAPI.TrainingResultPostObject obj = new WebAPI.TrainingResultPostObject();
            obj.xb01id      = resultStr[0]; //scDataStore.userID;
            obj.training_id = resultStr[1];
            obj.time        = 0;
            obj.score       = 0;
            WebAPI.Instance.TrainingResultPost(obj);


            SceneManager.LoadScene("5score");
            Handheld.Vibrate();
            //HandheldUtil.Destruct();//- for vibration
            cvs.enabled = false;
        }
        //Debug.Log(s + "が、選択されました!");
    }
コード例 #2
0
ファイル: sc2D3D.cs プロジェクト: gbtapps/NT
    private void updateDataStore(int inputNum)
    {
        scDataStore.reactionDuration[scDataStore.answerCount] = Time.realtimeSinceStartup - preClickTime;
        scDataStore.reactionEval[scDataStore.answerCount]     = inputNum == ansNum;
        scDataStore.answerCount++;
        if (inputNum == ansNum)
        {
            scDataStore.correctCount++;
            HandheldUtil.Vibrate(20);
        }
        else
        {
            HandheldUtil.Vibrate(1000);
        }

        preClickTime = Time.realtimeSinceStartup;
        Debug.Log(scDataStore.reactionDuration[scDataStore.answerCount - 1].ToString() +
                  "/" + scDataStore.reactionEval[scDataStore.answerCount - 1].ToString() + "/" + ansNum.ToString());
        answerCounterText.text = scDataStore.correctCount.ToString() + "/" + scDataStore.answerCount.ToString();
    }
コード例 #3
0
 public void onClick_MarkButton()
 {
     scDataStore.saveToFile_Mark();
     HandheldUtil.Vibrate(100);
 }