Beispiel #1
0
 // Use this for initialization
 void Start()
 {
     HandheldUtil.Initialize();
     slidebool = Config.ctrlCfg;
     if (automaticmode)
     {
         map = mapgenerator.GetComponent <automaticgenerator>().map;//これ、こっちの方が速く実行されていたらしぬので、そこを注意
     }
     else
     {
         map = mapgenerator.GetComponent <codevisualizer>().Lockoff();
     }
     acc                = GetComponent <GetAcc>();//GetAccスクリプト
     startup            = ballup.transform.position;
     startdown          = balldown.transform.position;
     nowrotation        = 0;//最初のスマホの角度代入
     upvectormokuteki   = ballup.transform.position;
     downvectormokuteki = balldown.transform.position;
     if (automaticmode)//もしおーとまちっくじゃないならもともといれておいて、startは変数nannidoをつかって条件分岐
     {
         goaldownx     = mapgenerator.GetComponent <automaticgenerator>().downx;
         goaldowny     = mapgenerator.GetComponent <automaticgenerator>().downy;
         goalupx       = mapgenerator.GetComponent <automaticgenerator>().nowx;
         goalupy       = mapgenerator.GetComponent <automaticgenerator>().nowy;
         startupintx   = mapgenerator.GetComponent <automaticgenerator>().startupx;
         startupinty   = mapgenerator.GetComponent <automaticgenerator>().startupy;
         startdownintx = mapgenerator.GetComponent <automaticgenerator>().startdownx;
         startdowninty = mapgenerator.GetComponent <automaticgenerator>().startdowny;
     }
     else
     {
         codevisualizer cv = mapgenerator.GetComponent <codevisualizer>();
     }
 }
Beispiel #2
0
    // Use this for initialization
    void Start()
    {
        if (!scDataStore.debug_Start)
        {
            scDataStore.Start();                          //- for debug. Scene-1 should do this.
        }
        scDataStore.startTime = System.DateTime.Now;
        scDataStore.taskType  = "SPEED TASK";
        startTime             = Time.realtimeSinceStartup;
        preClickTime          = startTime;
        GameObject[] Obj = new GameObject[30];
        float        x = cvs.transform.GetComponent <RectTransform>().sizeDelta.x;
        float        y = cvs.transform.GetComponent <RectTransform>().sizeDelta.y;
        int          sx = 6, sy = 5;

        bool[,] f = new bool[sx, sy];
        int p, q;

        for (int i = 0; i < sx * sy; i++)
        {
            p = Random.Range(0, sx); q = Random.Range(0, sy);
            while (f[p, q])
            {
                p = Random.Range(0, sx); q = Random.Range(0, sy);
            }
            f[p, q] = true;
            Obj[i]  = Instantiate(Resources.Load("Button"),
                                  new Vector3(-x / 2 + (p + 1) * x / (sx + 1), -y / 2 + (q + 1) * y / (sy + 1), -1),
                                  Quaternion.identity) as GameObject;
            Obj[i].transform.SetParent(cvs.transform, false);
            Obj[i].transform.Find("Text").GetComponent <Text>().text = (i + 1).ToString();
            //Obj[i].GetComponent<Button>().onClick.AddListener(button_click);
            //Obj[i].tag = i.ToString();
            Obj[i].name = (i + 1).ToString();
            var trigger = Obj[i].AddComponent <EventTrigger>();
            trigger.triggers = new List <EventTrigger.Entry>();

            // PointerEnter(マウスオーバー)時のイベントを設定してみる
            var entry = new EventTrigger.Entry();
            entry.eventID = EventTriggerType.PointerDown; // 他のイベントを設定したい場合はここを変える
            entry.callback.AddListener(OnPointerClickLevelButton);
            trigger.triggers.Add(entry);
        }

        HandheldUtil.Initialize();//- for vibration

        //Input.backButtonLeavesApp = true;//- for back button

        particle.Simulate(0.0f, true, true);
        //particle.Play();
    }
Beispiel #3
0
    // Use this for initialization
    void Start()
    {
        Debug.Log("Application Version : " + Application.version);

        AppVersion.text = "NT-" + Application.version;

        //if (checkExpired())
        //{
        //txtMessage.text = "アプリの利用期限が切れました。";
        //}

        cvsMe = cvsMe.GetComponent <Canvas>();
        //cvsNext = cvsNext.GetComponent<Canvas>();
        audStart = audStart.GetComponent <AudioSource>();
        btnStart = btnStart.GetComponent <Button>();
        txtTotal = txtTotal.GetComponent <Text>();


        switch (scDataStore.nback_mode)
        {
        case scDataStore.enumNbackMode.calc:
        case scDataStore.enumNbackMode.number:
            PlayerPrefs.SetInt("NB_back_number", scDataStore.back_number);
            break;

        case scDataStore.enumNbackMode.challenge:
            PlayerPrefs.SetInt("challenge_back_number", scDataStore.back_number);
            break;
        }


        scDataStore.back_number = PlayerPrefs.GetInt("NB_back_number", 1);
        input_N.text            = scDataStore.back_number.ToString();
        slider_Speed.value      = scDataStore.speed;

        scDataStore.challenge_back_number = PlayerPrefs.GetInt("challenge_back_number", 1);
        input_Challenge_Nbk.text          = scDataStore.challenge_back_number.ToString();

        scDataStore.rotationBlockSize = PlayerPrefs.GetInt("rotation_block_size", 3);
        input_RotationBlockSize.text  = scDataStore.rotationBlockSize.ToString();

        scDataStore.userID = PlayerPrefs.GetString("user_id", "default");
        userID.text        = scDataStore.userID;

        //- debug
        //str_back.text = scDataStore.SD_card_pathname();

        setupStart();

        HandheldUtil.Initialize();//- for vibration
    }
    // Use this for initialization
    void Start()
    {
        HandheldUtil.Initialize();
        slidebool = Config.ctrlCfg;
        //  mapgenerator = GameObject.Find("mapgenerator");//mapgeneratorからmapの配列をひくため、ただ、これ呼ばれる順番が怪しい
        if (automaticmode)
        {
            map = mapgenerator.GetComponent <automaticgenerator>().map;//これ、こっちの方が速く実行されていたらしぬので、そこを注意
        }
        else
        {
            map = mapgenerator.GetComponent <codevisualizer>().Lockoff();
        }
        acc                = GetComponent <GetAcc>();//GetAccスクリプト
        startup            = ballup.transform.position;
        startdown          = balldown.transform.position;
        nowrotation        = 0;//最初のスマホの角度代入
        upvectormokuteki   = ballup.transform.position;
        downvectormokuteki = balldown.transform.position;
        if (automaticmode)//もしおーとまちっくじゃないならもともといれておいて、startは変数nannidoをつかって条件分岐
        {
            goaldownx     = mapgenerator.GetComponent <automaticgenerator>().downx;
            goaldowny     = mapgenerator.GetComponent <automaticgenerator>().downy;
            goalupx       = mapgenerator.GetComponent <automaticgenerator>().nowx;
            goalupy       = mapgenerator.GetComponent <automaticgenerator>().nowy;
            startupintx   = mapgenerator.GetComponent <automaticgenerator>().startupx;
            startupinty   = mapgenerator.GetComponent <automaticgenerator>().startupy;
            startdownintx = mapgenerator.GetComponent <automaticgenerator>().startdownx;
            startdowninty = mapgenerator.GetComponent <automaticgenerator>().startdowny;
        }
        else
        {
            codevisualizer cv = mapgenerator.GetComponent <codevisualizer>();
        }

        //フォントさくせい

        /* Debug.Log("up");
         * Debug.Log(Selectrange(0, -1, nowdownx, nowdowny));
         * Debug.Log("down");
         * Debug.Log(Selectrange(0, 1, nowdownx, nowdowny));
         * Debug.Log("left");
         * Debug.Log(Selectrange(-1, 0, nowdownx, nowdowny));
         * Debug.Log("right");
         * Debug.Log(Selectrange(1, 0, nowdownx, nowdowny));*/
    }
Beispiel #5
0
    // Use this for initialization
    void Start()
    {
        scDataStore.Start();//- for debug. Scene-1 should do this.
        scDataStore.startTime       = System.DateTime.Now;
        scDataStore.unityTime       = Time.realtimeSinceStartup;
        scDataStore.NBACK_StartTime = Time.realtimeSinceStartup;
        scDataStore.taskType        = "2D3D TASK";

        PlayerPrefs.SetInt("rotation_block_size", scDataStore.rotationBlockSize);
        sx = scDataStore.rotationBlockSize;
        sy = sx; sz = sx;

        startTime    = Time.realtimeSinceStartup;
        preClickTime = startTime;

        ansF      = new bool[sx, sy, sz];
        f         = new bool[sx, sy, sz];
        objBlocks = new GameObject[7, sx *sy *sz];

        float x = sx;
        float y = sy;
        float z = sz;

        float scu = 0.6f;

        for (int i = 0; i < 4; i++)
        {
            prepareBlocks(scu, parentObj[i], blockPrefab, i);
        }
        for (int i = 0; i < 3; i++)
        {
            prepareBlocks(scu, ansObj[i], blockPrefabAns, i + 4);
        }

        prepareGame(f, ansF);

        timerSprite_DefaultScale = timerSprite.transform.localScale;
        HandheldUtil.Initialize();//- for vibration
    }