private void Start() { m_cartoon = this.gameObject.GetComponentInChildren <CartoonTemplate>(); m_cartoon.Init(); m_cartoon.m_play_rect.GetWorldCorners(m_play_rect_4_corners); this.InitCartoonItemAnchorPosition(); this.InitCartoonItemPosition(); }
public static void SaveLevelJsonData(CartoonTemplate temp_) { CartoonItemJson item_json = new CartoonItemJson(); item_json.Item_id = temp_.m_template_id; item_json.M_cartoons = new List <CartoonVideoNamesJson>(); temp_.Init(); foreach (var item in temp_.m_cartoon_items) { CartoonVideoNamesJson names = new CartoonVideoNamesJson(); names.M_names = new List <string>(); foreach (var clip in item.m_videos) { names.M_names.Add(clip.name); } item_json.M_cartoons.Add(names); } string j_str = fastJSON.JSON.ToJSON(item_json); string _path = GAME_JSON_PATH; if (!_path.StartsWith("/")) { _path = _path.Insert(0, "/"); } if (!_path.EndsWith("/")) { _path = _path + "/"; } string temp_path = string.Format("{0}{1}{2}{3}", Application.dataPath, _path, item_json.Item_id, ".json"); ExportJigsawJson.CreateJson(temp_path, j_str); }