コード例 #1
0
    // Use this for initialization
    void Start()
    {
        buttonImage = GameObject.Find("Canvas/StoryCanvas/Button/RawImage").GetComponent <RawImage> ();
        GameObject.Find("Canvas/RawImage").GetComponent <RawImage> ().texture = Resources.Load("targets/level" + Global.level) as Texture;
        GameObject temp1 = GameObject.Find("Box/FrontSurface");

        for (int i = 0; i < 16; i++)
        {
            point a = new point(i % 4, i / 4, 0);
            a.store_local(temp1.GetComponent <Add_point_line> ().Point [i].GetComponent <Click_On_Off> ().direct, temp1.GetComponent <Add_point_line> ().Point [i].GetComponent <Click_On_Off> ().index);
            table [0, i] = a;
        }
        GameObject temp2 = GameObject.Find("Box/LeftSurface");

        for (int i = 0; i < 16; i++)
        {
            point a = new point(0, i / 4, 3 - i % 4);
            a.store_local(temp2.GetComponent <Add_point_line> ().Point [i].GetComponent <Click_On_Off> ().direct, temp2.GetComponent <Add_point_line> ().Point [i].GetComponent <Click_On_Off> ().index);
            table [1, i] = a;
        }
        GameObject temp3 = GameObject.Find("Box/RightSurface");

        for (int i = 0; i < 16; i++)
        {
            point a = new point(3, i / 4, i % 4);
            a.store_local(temp3.GetComponent <Add_point_line> ().Point [i].GetComponent <Click_On_Off> ().direct, temp3.GetComponent <Add_point_line> ().Point [i].GetComponent <Click_On_Off> ().index);
            table [2, i] = a;
        }
        GameObject temp4 = GameObject.Find("Box/BackSurface");

        for (int i = 0; i < 16; i++)
        {
            point a = new point(3 - i % 4, i / 4, 3);
            a.store_local(temp4.GetComponent <Add_point_line> ().Point [i].GetComponent <Click_On_Off> ().direct, temp4.GetComponent <Add_point_line> ().Point [i].GetComponent <Click_On_Off> ().index);
            table [3, i] = a;
        }
        GameObject temp5 = GameObject.Find("Box/TopSurface");

        for (int i = 0; i < 16; i++)
        {
            point a = new point(i % 4, 0, 3 - i / 4);
            a.store_local(temp5.GetComponent <Add_point_line> ().Point [i].GetComponent <Click_On_Off> ().direct, temp5.GetComponent <Add_point_line> ().Point [i].GetComponent <Click_On_Off> ().index);
            table [4, i] = a;
        }


        for (int i = 0; i < 5; i++)
        {
            for (int j = 0; j < 16; j++)
            {
                for (int k = 0; k < 5; k++)
                {
                    for (int l = 0; l < 16; l++)
                    {
                        if ((i != k || j != l) && table [i, j].x == table [k, l].x && table [i, j].y == table [k, l].y && table [i, j].z == table [k, l].z)
                        {
                            table [i, j].store_local(k, l);
                        }
                    }
                }
            }
        }
        storyCanvas = GameObject.Find("Canvas/StoryCanvas");
        if (Global.level == 1)
        {
            storyCanvas.SetActive(true);
        }
        else
        {
            storyCanvas.SetActive(false);
        }
    }