public void ImportData(tfxJSONObject json_data) { m_letters_to_animate = json_data["m_letters_to_animate"].Array.JSONtoListInt(); m_letters_to_animate_custom_idx = (int)json_data["m_letters_to_animate_custom_idx"].Number; m_letters_to_animate_option = (LETTERS_TO_ANIMATE)(int)json_data["m_letters_to_animate_option"].Number; m_loop_cycles = new List <ActionLoopCycle>(); if (json_data.ContainsKey("LOOPS_DATA")) { ActionLoopCycle loop_cycle; foreach (tfxJSONValue loop_data in json_data["LOOPS_DATA"].Array) { loop_cycle = new ActionLoopCycle(); loop_cycle.ImportData(loop_data.Obj); m_loop_cycles.Add(loop_cycle); } } m_letter_actions = new List <LetterAction>(); LetterAction letter_action; foreach (tfxJSONValue action_data in json_data["ACTIONS_DATA"].Array) { letter_action = new LetterAction(); letter_action.ImportData(action_data.Obj); m_letter_actions.Add(letter_action); } }
public void ImportPresetSectionData(tfxJSONObject json_data, LetterSetup[] letters, string assetNameSuffix = "") { m_letter_actions = new List <LetterAction>(); m_loop_cycles = new List <ActionLoopCycle>(); ImportPresetSectionData(json_data, letters, 0, 0, assetNameSuffix); }
public void ImportData(tfxJSONObject json_data, string assetNameSuffix = "") { m_letters_to_animate = json_data["m_letters_to_animate"].Array.JSONtoListInt(); m_letters_to_animate_custom_idx = (int)json_data["m_letters_to_animate_custom_idx"].Number; m_letters_to_animate_option = (LETTERS_TO_ANIMATE)(int)json_data["m_letters_to_animate_option"].Number; m_letter_actions = new List <LetterAction>(); LetterAction letter_action; foreach (tfxJSONValue action_data in json_data["ACTIONS_DATA"].Array) { letter_action = new LetterAction(); letter_action.ImportData(action_data.Obj, assetNameSuffix); m_letter_actions.Add(letter_action); } m_loop_cycles = new List <ActionLoopCycle>(); if (json_data.ContainsKey("LOOPS_DATA")) { ActionLoopCycle loop_cycle; foreach (tfxJSONValue loop_data in json_data["LOOPS_DATA"].Array) { loop_cycle = new ActionLoopCycle(); loop_cycle.ImportData(loop_data.Obj); // Check for invalid loops if (loop_cycle.m_start_action_idx < m_letter_actions.Count && loop_cycle.m_end_action_idx < m_letter_actions.Count) { m_loop_cycles.Add(loop_cycle); } } } }
public tfxJSONValue ExportDataAsPresetSection(bool saveSampleTextData = true) { tfxJSONObject json_data = new tfxJSONObject(); if (m_loop_cycles.Count > 0) { tfxJSONArray loops_data = new tfxJSONArray(); foreach (ActionLoopCycle action_loop in m_loop_cycles) { loops_data.Add(action_loop.ExportData()); } json_data["LOOPS_DATA"] = loops_data; } tfxJSONArray actions_data = new tfxJSONArray(); foreach (LetterAction action in m_letter_actions) { actions_data.Add(action.ExportData()); } json_data["ACTIONS_DATA"] = actions_data; if (saveSampleTextData) { json_data["SAMPLE_NUM_LETTERS_ANIMATED"] = m_letters_to_animate.Count; } return(new tfxJSONValue(json_data)); }
public void ImportData(tfxJSONObject json_data) { m_override_default = json_data["m_override_default"].Boolean; m_x_ease = (EasingEquation)(int)json_data["m_x_ease"].Number; m_y_ease = (EasingEquation)(int)json_data["m_y_ease"].Number; m_z_ease = (EasingEquation)(int)json_data["m_z_ease"].Number; }
public static Vector2 JSONtoVector2(this tfxJSONObject json_data) { return(new Vector2() { x = (float)json_data["x"].Number, y = (float)json_data["y"].Number }); }
public tfxJSONValue ExportData() { tfxJSONObject json_data = new tfxJSONObject(); json_data["m_letters_to_animate"] = m_letters_to_animate.ExportData(); json_data["m_letters_to_animate_custom_idx"] = m_letters_to_animate_custom_idx; json_data["m_letters_to_animate_option"] = (int)m_letters_to_animate_option; if (m_loop_cycles.Count > 0) { tfxJSONArray loops_data = new tfxJSONArray(); foreach (ActionLoopCycle action_loop in m_loop_cycles) { loops_data.Add(action_loop.ExportData()); } json_data["LOOPS_DATA"] = loops_data; } tfxJSONArray actions_data = new tfxJSONArray(); foreach (LetterAction action in m_letter_actions) { actions_data.Add(action.ExportData()); } json_data["ACTIONS_DATA"] = actions_data; return(new tfxJSONValue(json_data)); }
public static void GetLatestEffectNameLists(bool force = false) { if (m_introAnimNames == null || force) { tfxJSONObject animNamesData = tfxJSONObject.Parse((Resources.Load <TextAsset>("textfxAnimNames")).text); m_introAnimNames = new string[animNamesData[INTRO_ANIM_FOLDER_NAME].Array.Length + 1]; m_introAnimNames[0] = "None"; int idx = 1; foreach (tfxJSONValue animVal in animNamesData[INTRO_ANIM_FOLDER_NAME].Array) { m_introAnimNames[idx] = animVal.Str; idx++; } m_mainAnimNames = new string[animNamesData[MAIN_ANIM_FOLDER_NAME].Array.Length + 1]; m_mainAnimNames[0] = "None"; idx = 1; foreach (tfxJSONValue animVal in animNamesData[MAIN_ANIM_FOLDER_NAME].Array) { m_mainAnimNames[idx] = animVal.Str; idx++; } m_outroAnimNames = new string[animNamesData[OUTRO_ANIM_FOLDER_NAME].Array.Length + 1]; m_outroAnimNames[0] = "None"; idx = 1; foreach (tfxJSONValue animVal in animNamesData[OUTRO_ANIM_FOLDER_NAME].Array) { m_outroAnimNames[idx] = animVal.Str; idx++; } } }
public void ExportBaseData(ref tfxJSONObject json_data) { json_data["m_play_when"] = (int)m_play_when; json_data["m_effect_assignment"] = (int)m_effect_assignment; json_data["m_loop_play_once"] = m_loop_play_once; json_data["m_effect_assignment_custom_letters"] = m_effect_assignment_custom_letters.ExportData(); json_data["m_delay"] = m_delay.ExportData(); }
public void ImportData(tfxJSONObject json_data) { m_delay_first_only = json_data["m_delay_first_only"].Boolean; m_end_action_idx = (int)json_data["m_end_action_idx"].Number; m_loop_type = (LOOP_TYPE)(int)json_data["m_loop_type"].Number; m_number_of_loops = (int)json_data["m_number_of_loops"].Number; m_start_action_idx = (int)json_data["m_start_action_idx"].Number; }
public void ImportData(tfxJSONObject json_data) { m_audio_clip = json_data["m_audio_clip"].Str.PathToAudioClip(); m_offset_time.ImportData(json_data["m_offset_time"].Obj); m_volume.ImportData(json_data["m_volume"].Obj); m_pitch.ImportData(json_data["m_pitch"].Obj); ImportBaseData(json_data); }
public static tfxJSONValue ExportData(this Vector3 vec) { tfxJSONObject json_data = new tfxJSONObject(); json_data["x"] = vec.x; json_data["y"] = vec.y; json_data["z"] = vec.z; return(new tfxJSONValue(json_data)); }
public static tfxJSONValue Vector2ToJSON(this Vector2 vec) { tfxJSONObject json_data = new tfxJSONObject(); json_data["x"] = vec.x; json_data["y"] = vec.y; return(new tfxJSONValue(json_data)); }
public void ImportBaseData(tfxJSONObject json_data) { m_play_when = (PLAY_ITEM_EVENTS)(int)json_data["m_play_when"].Number; m_effect_assignment = (PLAY_ITEM_ASSIGNMENT)(int)json_data["m_effect_assignment"].Number; m_loop_play_once = json_data["m_loop_play_once"].Boolean; m_delay.ImportData(json_data["m_delay"].Obj); m_effect_assignment_custom_letters = json_data["m_effect_assignment_custom_letters"].Array.JSONtoListInt(); m_loop_play_once = json_data["m_loop_play_once"].Boolean; }
public static VertexColour JSONtoVertexColour(this tfxJSONObject json_data) { return(new VertexColour() { bottom_left = json_data["bottom_left"].Obj.JSONtoColor(), bottom_right = json_data["bottom_right"].Obj.JSONtoColor(), top_left = json_data["top_left"].Obj.JSONtoColor(), top_right = json_data["top_right"].Obj.JSONtoColor() }); }
public static Color JSONtoColor(this tfxJSONObject json_data) { return(new Color() { r = (float)json_data["r"].Number, g = (float)json_data["g"].Number, b = (float)json_data["b"].Number, a = (float)json_data["a"].Number }); }
public tfxJSONValue ExportData() { tfxJSONObject json_data = new tfxJSONObject(); json_data["m_override_default"] = m_override_default; json_data["m_x_ease"] = (int)m_x_ease; json_data["m_y_ease"] = (int)m_y_ease; json_data["m_z_ease"] = (int)m_z_ease; return(new tfxJSONValue(json_data)); }
public static UnityEngine.Keyframe JSONtoKeyframe(this tfxJSONObject json_data) { return(new UnityEngine.Keyframe() { inTangent = (float)json_data["inTangent"].Number, outTangent = (float)json_data["outTangent"].Number, tangentMode = (int)json_data["tangentMode"].Number, time = (float)json_data["time"].Number, value = (float)json_data["value"].Number }); }
public static tfxJSONValue ExportData(this Color color) { tfxJSONObject json_data = new tfxJSONObject(); json_data["r"] = color.r; json_data["g"] = color.g; json_data["b"] = color.b; json_data["a"] = color.a; return(new tfxJSONValue(json_data)); }
public static tfxJSONValue ExportData(this UnityEngine.Keyframe frame) { tfxJSONObject json_data = new tfxJSONObject(); json_data["inTangent"] = frame.inTangent; json_data["outTangent"] = frame.outTangent; json_data["tangentMode"] = frame.tangentMode; json_data["time"] = frame.time; json_data["value"] = frame.value; return(new tfxJSONValue(json_data)); }
public static tfxJSONValue ExportData(this VertexColour vert_color) { tfxJSONObject json_data = new tfxJSONObject(); json_data["bottom_left"] = vert_color.bottom_left.ExportData(); json_data["bottom_right"] = vert_color.bottom_right.ExportData(); json_data["top_left"] = vert_color.top_left.ExportData(); json_data["top_right"] = vert_color.top_right.ExportData(); return(new tfxJSONValue(json_data)); }
public tfxJSONValue ExportData() { tfxJSONObject json_data = new tfxJSONObject(); json_data["m_delay_first_only"] = m_delay_first_only; json_data["m_end_action_idx"] = m_end_action_idx; json_data["m_loop_type"] = (int)m_loop_type; json_data["m_number_of_loops"] = m_number_of_loops; json_data["m_start_action_idx"] = m_start_action_idx; return(new tfxJSONValue(json_data)); }
public tfxJSONValue ExportData() { tfxJSONObject jsonData = new tfxJSONObject(); jsonData ["name"] = m_setting_name; jsonData ["data_type"] = (int)m_data_type; jsonData ["anim_idx"] = m_animation_idx; jsonData ["action_idx"] = m_action_idx; jsonData ["startState"] = m_startState; return(new tfxJSONValue(jsonData)); }
public void ImportData(tfxJSONObject jsonData) { m_setting_name = jsonData ["name"].Str; m_data_type = (ANIMATION_DATA_TYPE)((int)jsonData ["data_type"].Number); m_animation_idx = (int)jsonData ["anim_idx"].Number; m_action_idx = (int)jsonData ["action_idx"].Number; if (jsonData.ContainsKey("startState")) { m_startState = jsonData["startState"].Boolean; } }
public tfxJSONValue ExportData() { tfxJSONObject json_data = new tfxJSONObject(); ExportBaseData(ref json_data); json_data["m_audio_clip"] = m_audio_clip.ToPath(); json_data["m_offset_time"] = m_offset_time.ExportData(); json_data["m_volume"] = m_volume.ExportData(); json_data["m_pitch"] = m_pitch.ExportData(); return(new tfxJSONValue(json_data)); }
public static tfxJSONValue ExportData(this UnityEngine.Keyframe frame, AnimationCurve curve, int keyIndex) { tfxJSONObject json_data = new tfxJSONObject(); json_data["inTangent"] = frame.inTangent; json_data["outTangent"] = frame.outTangent; #if UNITY_2018_1_OR_NEWER && UNITY_EDITOR json_data["leftTangentMode"] = (int)AnimationUtility.GetKeyLeftTangentMode(curve, keyIndex); json_data["rightTangentMode"] = (int)AnimationUtility.GetKeyRightTangentMode(curve, keyIndex); #elif !UNITY_2018_1_OR_NEWER json_data["tangentMode"] = frame.tangentMode; #endif json_data["time"] = frame.time; json_data["value"] = frame.value; return(new tfxJSONValue(json_data)); }
public static VertexColour JSONtoVertexColour(this tfxJSONObject json_data) { if (json_data.ContainsKey("r")) { // Legacy export data return(new VertexColour(json_data.JSONtoColor())); } return(new VertexColour() { bottom_left = json_data["bottom_left"].Obj.JSONtoColor(), bottom_right = json_data["bottom_right"].Obj.JSONtoColor(), top_left = json_data["top_left"].Obj.JSONtoColor(), top_right = json_data["top_right"].Obj.JSONtoColor() }); }
public void ImportData(tfxJSONObject json_data) { if (json_data.ContainsKey("m_finish_at_end")) { m_finish_at_end = json_data["m_finish_at_end"].Boolean; } else { m_finish_at_end = false; } m_delay_first_only = json_data["m_delay_first_only"].Boolean; m_end_action_idx = (int)json_data["m_end_action_idx"].Number; m_loop_type = (LOOP_TYPE)(int)json_data["m_loop_type"].Number; m_number_of_loops = (int)json_data["m_number_of_loops"].Number; m_start_action_idx = (int)json_data["m_start_action_idx"].Number; }
public void ImportData(tfxJSONObject json_data) { m_anchor_points = new List <BezierCurvePoint>(); BezierCurvePoint curve_point; tfxJSONObject anchor_json; foreach (tfxJSONValue anchor_data in json_data["ANCHORS_DATA"].Array) { anchor_json = anchor_data.Obj; curve_point = new BezierCurvePoint(); curve_point.m_anchor_point = anchor_json["m_anchor_point"].Obj.JSONtoVector3(); curve_point.m_handle_point = anchor_json["m_handle_point"].Obj.JSONtoVector3(); m_anchor_points.Add(curve_point); } }
public void ImportData(tfxJSONObject json_data) { m_effect_type = (PARTICLE_EFFECT_TYPE)(int)json_data["m_effect_type"].Number; if (m_effect_type == PARTICLE_EFFECT_TYPE.LEGACY) { m_legacy_particle_effect = json_data["m_legacy_particle_effect"].Str.PathToParticleEmitter(); } else { m_shuriken_particle_effect = json_data["m_shuriken_particle_effect"].Str.PathToParticleSystem(); } m_duration.ImportData(json_data["m_duration"].Obj); m_follow_mesh = json_data["m_follow_mesh"].Boolean; m_position_offset.ImportData(json_data["m_position_offset"].Obj); m_rotation_offset.ImportData(json_data["m_rotation_offset"].Obj); m_rotate_relative_to_letter = json_data["m_rotate_relative_to_letter"].Boolean; ImportBaseData(json_data); }