示例#1
0
        void addRoomObj(Variant v)
        {
            if (roomItemCon == null)
            {
                roomItemCon      = new GameObject();
                roomItemCon.name = "roomObjs";
            }


            GameObject go = GameObject.CreatePrimitive(PrimitiveType.Cube);

            go.transform.SetParent(roomItemCon.transform);
            go.transform.position   = new Vector3(v["ux"], v["uy"], v["uz"]);
            go.transform.localScale = new Vector3(v["uw"], 1, v["uh"]);

            TransMapPoint room = go.AddComponent <TransMapPoint>();

            room.id    = v["id"];
            room.mapid = v["gto"]._uint;
            if (v.ContainsKey("faceto"))
            {
                room.faceto = v["faceto"];
            }
            room.init();
        }
示例#2
0
        private void addRoomObj(Variant v)
        {
            bool flag = this.roomItemCon == null;

            if (flag)
            {
                this.roomItemCon      = new GameObject();
                this.roomItemCon.name = "roomObjs";
            }
            GameObject gameObject = GameObject.CreatePrimitive(PrimitiveType.Cube);

            gameObject.transform.SetParent(this.roomItemCon.transform);
            gameObject.transform.position   = new Vector3(v["ux"], v["uy"], v["uz"]);
            gameObject.transform.localScale = new Vector3(v["uw"], 1f, v["uh"]);
            TransMapPoint transMapPoint = gameObject.AddComponent <TransMapPoint>();

            transMapPoint.id    = v["id"];
            transMapPoint.mapid = v["gto"]._uint;
            bool flag2 = v.ContainsKey("faceto");

            if (flag2)
            {
                transMapPoint.faceto = v["faceto"];
            }
            transMapPoint.init();
        }