Ejemplo n.º 1
0
 // Use this for initialization
 void Start()
 {
     haba = mapgenerator.GetComponent <setBlock>().ofsScale;
     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>();
     }
 }
Ejemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        //  mapgenerator = GameObject.Find("mapgenerator");//mapgeneratorからmapの配列をひくため、ただ、これ呼ばれる順番が怪しい
        map                = mapgenerator.GetComponent <automaticgenerator>().map; //これ、こっちの方が速く実行されていたらしぬので、そこを注意
        acc                = GetComponent <GetAcc>();                              //GetAccスクリプト
        startup            = ballup.transform.position;
        startdown          = balldown.transform.position;
        nowrotation        = 0;//最初のスマホの角度代入
        upvectormokuteki   = ballup.transform.position;
        downvectormokuteki = balldown.transform.position;
        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;

        //フォントさくせい

        /* 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));*/
    }
Ejemplo n.º 3
0
 public double CountDif(double a, double b, double y, double accuracy, UsedFunc Func)
 {
     if (a < y && b > y)
     {
         double xfirst;
         double xsecond;
         double eps;
         do
         {
             xfirst = (a + b) / 2;
             if (Func(xfirst) >= y)
             {
                 b = xfirst;
             }
             else
             {
                 a = xfirst;
             }
             xsecond = (a + b) / 2;
             eps     = Math.Abs(xfirst - xsecond);
             GetAcc?.Invoke(Math.Round(eps, 5));
         }while (eps > accuracy);
         return(xsecond);
     }
     else
     {
         throw new Exception("Incorrect params\ny is not betwin a - b.");
     }
 }
Ejemplo n.º 4
0
    // 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));*/
    }
Ejemplo n.º 5
0
    // Use this for initialization
    void Start()
    {
        //  mapgenerator = GameObject.Find("mapgenerator");//mapgeneratorからmapの配列をひくため、ただ、これ呼ばれる順番が怪しい
        map                = mapgenerator.GetComponent <automaticgenerator>().map; //これ、こっちの方が速く実行されていたらしぬので、そこを注意
        acc                = GetComponent <GetAcc>();                              //GetAccスクリプト
        nowrotation        = 0;                                                    //最初のスマホの角度代入
        upvectormokuteki   = ballup.transform.position;
        downvectormokuteki = balldown.transform.position;


        //フォントさくせい
        this.labelStyle                  = new GUIStyle();
        this.labelStyle.fontSize         = Screen.height / 20;
        this.labelStyle.normal.textColor = Color.black;
        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));
    }