コード例 #1
0
ファイル: LetterAnimation.cs プロジェクト: zynigma/ddgame
        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);
            }
        }
コード例 #2
0
ファイル: LetterAnimation.cs プロジェクト: poup/ankagaja
        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);
        }
コード例 #3
0
ファイル: LetterAnimation.cs プロジェクト: poup/ankagaja
        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);
                    }
                }
            }
        }
コード例 #4
0
ファイル: LetterAnimation.cs プロジェクト: poup/ankagaja
        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));
        }
コード例 #5
0
 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;
 }
コード例 #6
0
 public static Vector2 JSONtoVector2(this tfxJSONObject json_data)
 {
     return(new Vector2()
     {
         x = (float)json_data["x"].Number, y = (float)json_data["y"].Number
     });
 }
コード例 #7
0
ファイル: LetterAnimation.cs プロジェクト: zynigma/ddgame
        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));
        }
コード例 #8
0
    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++;
            }
        }
    }
コード例 #9
0
ファイル: LetterAction.cs プロジェクト: zynigma/ddgame
 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();
 }
コード例 #10
0
ファイル: LetterAnimation.cs プロジェクト: zynigma/ddgame
 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;
 }
コード例 #11
0
ファイル: LetterAction.cs プロジェクト: zynigma/ddgame
        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);
        }
コード例 #12
0
        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));
        }
コード例 #13
0
        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));
        }
コード例 #14
0
ファイル: LetterAction.cs プロジェクト: zynigma/ddgame
        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;
        }
コード例 #15
0
 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()
     });
 }
コード例 #16
0
 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
     });
 }
コード例 #17
0
        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));
        }
コード例 #18
0
 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
     });
 }
コード例 #19
0
        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));
        }
コード例 #20
0
        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));
        }
コード例 #21
0
        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));
        }
コード例 #22
0
ファイル: LetterAnimation.cs プロジェクト: zynigma/ddgame
        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));
        }
コード例 #23
0
ファイル: PresetEffectSetting.cs プロジェクト: poup/ankagaja
        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));
        }
コード例 #24
0
ファイル: PresetEffectSetting.cs プロジェクト: poup/ankagaja
        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;
            }
        }
コード例 #25
0
ファイル: LetterAction.cs プロジェクト: zynigma/ddgame
        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));
        }
コード例 #26
0
        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));
        }
コード例 #27
0
        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()
            });
        }
コード例 #28
0
ファイル: LetterAnimation.cs プロジェクト: poup/ankagaja
 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;
 }
コード例 #29
0
ファイル: TextFxBezierCurve.cs プロジェクト: zynigma/ddgame
        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);
            }
        }
コード例 #30
0
ファイル: LetterAction.cs プロジェクト: zynigma/ddgame
        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);
        }