Beispiel #1
0
        void Start()
        {
            MapData data = new MapData();
            data.Deserialize(map);

            Json_MasterParam master = LitJson.JsonMapper.ToObject<Json_MasterParam>(json.text);
            Json_CalenderParam d = master.calender;
            CalenderParam cp = new CalenderParam();
            cp.Desrialize(d);
            int year = cp.Year;

            width = data.mMapData.Width;
            height = data.mMapData.Height;
            types = data.mMapData.MapData;
            for (int h = 0; h < height; ++h)
            {
                for (int w = 0; w < width; ++w)
                {
                    //Debug.Log(h * height + w);

                    if (types[h * height + w] == FloorType.Hatake)
                    {
                        GameObject obj = Instantiate<GameObject>(hatake);
                        obj.transform.position = new Vector3((float)w, 0.1f, (float)height - h);
                        obj.transform.rotation = new Quaternion();
                    }
                }
            }
        }
Beispiel #2
0
        void Start()
        {
            MapData data = new MapData();

            data.Deserialize(map);

            Json_MasterParam   master = LitJson.JsonMapper.ToObject <Json_MasterParam>(json.text);
            Json_CalenderParam d      = master.calender;
            CalenderParam      cp     = new CalenderParam();

            cp.Desrialize(d);
            int year = cp.Year;


            width  = data.mMapData.Width;
            height = data.mMapData.Height;
            types  = data.mMapData.MapData;
            for (int h = 0; h < height; ++h)
            {
                for (int w = 0; w < width; ++w)
                {
                    //Debug.Log(h * height + w);

                    if (types[h * height + w] == FloorType.Hatake)
                    {
                        GameObject obj = Instantiate <GameObject>(hatake);
                        obj.transform.position = new Vector3((float)w, 0.1f, (float)height - h);
                        obj.transform.rotation = new Quaternion();
                    }
                }
            }
        }