예제 #1
0
    public void basic_generate()
    {
        //GameObject cabin;
        cabin = new GameObject("cabin");


        chosen_style = mystyle;
        if (width < 1200)
        {
            chosen_style = door_style.swing;
        }
        vectical_split(width);


        if (height <= 2400 && height >= 300)
        {
            bottom_closet = new GameObject("bottomcloset");

            gameObject.GetComponent <bottombox>().single_bottombox(width, each_width, depth, height, n, bottom_closet, move, closet);
        }
        else if (height > 2400)
        {
            float height_0 = 1920;
            bottom_closet = new GameObject("bottomcloset");
            gameObject.GetComponent <bottombox>().single_bottombox(width, each_width, depth, height_0, n, bottom_closet, move, closet);
            gameObject.GetComponent <singlebox>().single_box(width, each_width, depth, depth, height_0, height, n, move, cabin);
            cabin.transform.position += move;
        }
        chosen_style = mystyle;

        equal = new GameObject("split");
        bottom_closet.transform.parent = equal.transform;
        if (bottom_closet = null)
        {
            Destroy(bottom_closet);
        }
        if (cabin != null)
        {
            cabin.transform.parent = equal.transform;
            //cabin.transform.position += move;
            //cabin = null;
        }
        else
        {
            Destroy(cabin);
        }
        equal.transform.parent = onetime.transform;
        //equal = new GameObject();
        // Debug.Log(cabin);



        //onetime.transform.Rotate(new Vector3(0, rotate, 0));

        onetime.transform.parent = aroom.transform;
    }
    //专门用来外部调用生上面的单个的柜
    public void hanging_cabin(float its_left, float its_right, float its_depth, float its_bottom, float its_top)
    {
        if (its_right - its_left < 1200)
        {
            chosen_style = door_style.swing;
        }
        gameObject.GetComponent <singlebox>().single_box(width, each_width, depth, its_depth, its_bottom, its_top, n, move, cabin);
        cabin.transform.position += new Vector3(its_left, 0, 0);

        chosen_style = mystyle;

        //onetime.transform.Rotate(new Vector3(0, rotate, 0));
    }
예제 #3
0
 void Start()
 {
     Camera.main.transform.position = new Vector3(width / 2, height / 2, height + depth);
     chosen_style = mystyle;
     handle       = Resources.Load <GameObject>("handle");
 }