public void AddAudioEffectSetup(AudioEffectSetup audio_setup)
        {
            if (m_audio_effects == null)
            {
                m_audio_effects = new List <AudioEffectSetup>();
            }

            m_audio_effects.Add(audio_setup);
        }
        public AudioEffectSetup AddAudioEffectSetup()
        {
            if (m_audio_effects == null)
            {
                m_audio_effects = new List <AudioEffectSetup>();
            }

            AudioEffectSetup new_audio_effect = new AudioEffectSetup();

            m_audio_effects.Add(new_audio_effect);

            return(new_audio_effect);
        }
        public void ImportData(JSONObject json_data)
        {
            m_action_type           = (ACTION_TYPE)(int)json_data["m_action_type"].Number;
            m_ease_type             = (EasingEquation)(int)json_data["m_ease_type"].Number;
            m_use_gradient_start    = json_data["m_use_gradient_start"].Boolean;
            m_use_gradient_end      = json_data["m_use_gradient_end"].Boolean;
            m_force_same_start_time = json_data["m_force_same_start_time"].Boolean;
            m_letter_anchor_start   = (int)json_data["m_letter_anchor_start"].Number;
            m_letter_anchor_end     = (int)json_data["m_letter_anchor_end"].Number;
            m_letter_anchor_2_way   = json_data["m_letter_anchor_2_way"].Boolean;
            m_offset_from_last      = json_data["m_offset_from_last"].Boolean;
            m_position_axis_ease_data.ImportData(json_data["m_position_axis_ease_data"].Obj);
            m_rotation_axis_ease_data.ImportData(json_data["m_rotation_axis_ease_data"].Obj);
            m_scale_axis_ease_data.ImportData(json_data["m_scale_axis_ease_data"].Obj);

            if (m_use_gradient_start)
            {
                m_start_vertex_colour.ImportData(json_data["m_start_vertex_colour"].Obj);
            }
            else
            {
                m_start_colour.ImportData(json_data["m_start_colour"].Obj);
            }
            if (m_use_gradient_end)
            {
                m_end_vertex_colour.ImportData(json_data["m_end_vertex_colour"].Obj);
            }
            else
            {
                m_end_colour.ImportData(json_data["m_end_colour"].Obj);
            }

            m_start_euler_rotation.ImportData(json_data["m_start_euler_rotation"].Obj);
            m_end_euler_rotation.ImportData(json_data["m_end_euler_rotation"].Obj);
            m_start_pos.ImportData(json_data["m_start_pos"].Obj);
            m_end_pos.ImportData(json_data["m_end_pos"].Obj);
            m_start_scale.ImportData(json_data["m_start_scale"].Obj);
            m_end_scale.ImportData(json_data["m_end_scale"].Obj);
            m_delay_progression.ImportData(json_data["m_delay_progression"].Obj);
            m_duration_progression.ImportData(json_data["m_duration_progression"].Obj);


            m_audio_effects = new List <AudioEffectSetup>();
            AudioEffectSetup audio_effect;

            foreach (JSONValue audio_data in json_data["AUDIO_EFFECTS_DATA"].Array)
            {
                audio_effect = new AudioEffectSetup();
                audio_effect.ImportData(audio_data.Obj);
                m_audio_effects.Add(audio_effect);
            }

            m_particle_effects = new List <ParticleEffectSetup>();
            ParticleEffectSetup particle_effect;

            foreach (JSONValue particle_data in json_data["PARTICLE_EFFECTS_DATA"].Array)
            {
                particle_effect = new ParticleEffectSetup();
                particle_effect.ImportData(particle_data.Obj);
                m_particle_effects.Add(particle_effect);
            }
        }
Пример #4
0
		public void ImportData(JSONObject json_data)
		{	
			m_action_type = (ACTION_TYPE) (int) json_data["m_action_type"].Number;
			m_ease_type = (EasingEquation) (int) json_data["m_ease_type"].Number;
			m_use_gradient_start = json_data["m_use_gradient_start"].Boolean;
			m_use_gradient_end = json_data["m_use_gradient_end"].Boolean;
			m_force_same_start_time = json_data["m_force_same_start_time"].Boolean;
			m_letter_anchor_start = (int) json_data["m_letter_anchor_start"].Number;
			m_letter_anchor_end = (int) json_data["m_letter_anchor_end"].Number;
			m_letter_anchor_2_way = json_data["m_letter_anchor_2_way"].Boolean;
			m_offset_from_last = json_data["m_offset_from_last"].Boolean;
			m_position_axis_ease_data.ImportData(json_data["m_position_axis_ease_data"].Obj);
			m_rotation_axis_ease_data.ImportData(json_data["m_rotation_axis_ease_data"].Obj);
			m_scale_axis_ease_data.ImportData(json_data["m_scale_axis_ease_data"].Obj);
			
			if(m_use_gradient_start)
				m_start_vertex_colour.ImportData(json_data["m_start_vertex_colour"].Obj);
			else
				m_start_colour.ImportData(json_data["m_start_colour"].Obj);
			if(m_use_gradient_end)
				m_end_vertex_colour.ImportData(json_data["m_end_vertex_colour"].Obj);
			else
				m_end_colour.ImportData(json_data["m_end_colour"].Obj);
			
			m_start_euler_rotation.ImportData(json_data["m_start_euler_rotation"].Obj);
			m_end_euler_rotation.ImportData(json_data["m_end_euler_rotation"].Obj);
			m_start_pos.ImportData(json_data["m_start_pos"].Obj);
			m_end_pos.ImportData(json_data["m_end_pos"].Obj);
			m_start_scale.ImportData(json_data["m_start_scale"].Obj);
			m_end_scale.ImportData(json_data["m_end_scale"].Obj);
			m_delay_progression.ImportData(json_data["m_delay_progression"].Obj);
			m_duration_progression.ImportData(json_data["m_duration_progression"].Obj);
			
			
			m_audio_effects = new List<AudioEffectSetup>();
			AudioEffectSetup audio_effect;
			foreach(JSONValue audio_data in json_data["AUDIO_EFFECTS_DATA"].Array)
			{
				audio_effect = new AudioEffectSetup();
				audio_effect.ImportData(audio_data.Obj);
				m_audio_effects.Add(audio_effect);
			}
			
			m_particle_effects = new List<ParticleEffectSetup>();
			ParticleEffectSetup particle_effect;
			foreach(JSONValue particle_data in json_data["PARTICLE_EFFECTS_DATA"].Array)
			{
				particle_effect = new ParticleEffectSetup();
				particle_effect.ImportData(particle_data.Obj);
				m_particle_effects.Add(particle_effect);
			}
		}
Пример #5
0
		public void AddAudioEffectSetup(AudioEffectSetup audio_setup)
		{
			if(m_audio_effects == null)
				m_audio_effects = new List<AudioEffectSetup>();
			
			m_audio_effects.Add(audio_setup);
		}
Пример #6
0
		public AudioEffectSetup AddAudioEffectSetup()
		{
			if(m_audio_effects == null)
				m_audio_effects = new List<AudioEffectSetup>();
			
			AudioEffectSetup new_audio_effect = new AudioEffectSetup();
			m_audio_effects.Add(new_audio_effect);
			
			return new_audio_effect;
		}
		public static int ImportLegacyData (this LetterAction letter_action, List<object> data_list, int index_offset = 0)
		{
			KeyValuePair<string, string> value_pair;
			string key, value;
			int idx;
			
			letter_action.ClearAudioEffectSetups();
			letter_action.ClearParticleEffectSetups();
			
			AudioEffectSetup audio_setup = null;
			ParticleEffectSetup effect_setup = null;
			
			for(idx = index_offset; idx < data_list.Count; idx++)
			{
				value_pair = (KeyValuePair<string, string>) data_list[idx];
				key = value_pair.Key;
				value = value_pair.Value;
				
				if(key.Equals("ACTION_DATA_END"))
				{
					// reached end of this Actions import data
					break;
				}

				switch(key)
				{
					case "m_action_type":
						letter_action.m_action_type = (ACTION_TYPE) int.Parse(value); break;
					case "m_ease_type":
						letter_action.m_ease_type = (EasingEquation) int.Parse(value); break;
					case "m_use_gradient_start":
						letter_action.m_use_gradient_start = bool.Parse(value); break;
					case "m_use_gradient_end":
						letter_action.m_use_gradient_end = bool.Parse(value); break;
					case "m_force_same_start_time":
						letter_action.m_force_same_start_time = bool.Parse(value); break;
					// Legacy letter anchor import support
					case "m_letter_anchor":
						letter_action.m_letter_anchor_start = int.Parse(value);
						letter_action.m_letter_anchor_2_way = false;	
						break;
					
					// New letter anchor import support
					case "m_letter_anchor_start":
						letter_action.m_letter_anchor_start = int.Parse(value);break;
					case "m_letter_anchor_end":
						letter_action.m_letter_anchor_end = int.Parse(value);break;
					case "m_letter_anchor_2_way":
						letter_action.m_letter_anchor_2_way = bool.Parse(value); break;
					
					
					case "m_offset_from_last":
						letter_action.m_offset_from_last = bool.Parse(value); break;
					case "m_position_axis_ease_data":
						letter_action.m_position_axis_ease_data.ImportLegacyData(value); break;
					case "m_rotation_axis_ease_data":
						letter_action.m_rotation_axis_ease_data.ImportLegacyData(value); break;
					case "m_scale_axis_ease_data":
						letter_action.m_scale_axis_ease_data.ImportLegacyData(value); break;


					case "m_start_colour":
						letter_action.m_start_colour.ImportLegacyData(value); break;
					case "m_end_colour":
						letter_action.m_end_colour.ImportLegacyData(value); break;
					case "m_start_vertex_colour":
						letter_action.m_start_vertex_colour.ImportLegacyData(value); break;
					case "m_end_vertex_colour":
						letter_action.m_end_vertex_colour.ImportLegacyData(value); break;
					case "m_start_euler_rotation":
						letter_action.m_start_euler_rotation.ImportLegacyData(value); break;
					case "m_end_euler_rotation":
						letter_action.m_end_euler_rotation.ImportLegacyData(value); break;
					case "m_start_pos":
						letter_action.m_start_pos.ImportLegacyData(value); break;
					case "m_end_pos":
						letter_action.m_end_pos.ImportLegacyData(value); break;
					case "m_start_scale":
						letter_action.m_start_scale.ImportLegacyData(value); break;
					case "m_end_scale":
						letter_action.m_end_scale.ImportLegacyData(value); break;
					case "m_delay_progression":
						letter_action.m_delay_progression.ImportLegacyData(value); break;
					case "m_duration_progression":
						letter_action.m_duration_progression.ImportLegacyData(value); break;
						
					
					case "m_audio_on_start":
						if(value.PathToAudioClip() != null)
						{
							audio_setup = new AudioEffectSetup() { m_audio_clip = value.PathToAudioClip(), m_play_when = PLAY_ITEM_EVENTS.ON_START, m_effect_assignment = PLAY_ITEM_ASSIGNMENT.PER_LETTER, m_loop_play_once = false };
						}
						break;
					case "m_audio_on_start_delay":
						if(audio_setup != null)
							audio_setup.m_delay.ImportLegacyData(value); break;
					case "m_audio_on_start_offset":
						if(audio_setup != null)
							audio_setup.m_offset_time.ImportLegacyData(value); break;
					case "m_audio_on_start_pitch":
						if(audio_setup != null)
							audio_setup.m_pitch.ImportLegacyData(value); break;
					case "m_audio_on_start_volume":
						if(audio_setup != null)
						{
							audio_setup.m_volume.ImportLegacyData(value);
							letter_action.AddAudioEffectSetup(audio_setup);
							audio_setup = null;
						}
						break;
					
					case "m_audio_on_finish":
						if(value.PathToAudioClip() != null)
						{
							audio_setup = new AudioEffectSetup() { m_audio_clip = value.PathToAudioClip(), m_play_when = PLAY_ITEM_EVENTS.ON_FINISH, m_effect_assignment = PLAY_ITEM_ASSIGNMENT.PER_LETTER, m_loop_play_once = false };
						}
						break;
					case "m_audio_on_finish_delay":
						if(audio_setup != null)
							audio_setup.m_delay.ImportLegacyData(value);
						break;
					case "m_audio_on_finish_offset":
						if(audio_setup != null)
							audio_setup.m_offset_time.ImportLegacyData(value);
						break;
					case "m_audio_on_finish_pitch":
						if(audio_setup != null)
							audio_setup.m_pitch.ImportLegacyData(value);
						break;
					case "m_audio_on_finish_volume":
						if(audio_setup != null)
						{
							audio_setup.m_volume.ImportLegacyData(value);
							letter_action.AddAudioEffectSetup(audio_setup);
							audio_setup = null;
						}
						break;
					
					
					// BACKWARDS COMPATIBILITY PARTICLE IMPORT
					case "m_emitter_on_start":
						if(value.PathToParticleEmitter() != null)
						{
							effect_setup = new ParticleEffectSetup()
							{
								m_legacy_particle_effect = value.PathToParticleEmitter(),
								m_play_when = PLAY_ITEM_EVENTS.ON_START,
								m_loop_play_once = false,
								m_rotation_offset = new ActionVector3Progression(new Vector3(0,180,0)),
								m_rotate_relative_to_letter = true,
								m_effect_type = PARTICLE_EFFECT_TYPE.LEGACY
							};
						}
						break;
					case "m_emitter_on_start_delay":
						if(effect_setup != null)
							effect_setup.m_delay.ImportLegacyData(value);
						break;
					case "m_emitter_on_start_duration":
						if(effect_setup != null)
							effect_setup.m_duration.ImportLegacyData(value);
						break;
					case "m_emitter_on_start_follow_mesh":
						if(effect_setup != null)
							effect_setup.m_follow_mesh = bool.Parse(value);
						break;
					case "m_emitter_on_start_offset":
						if(effect_setup != null)
							effect_setup.m_position_offset.ImportLegacyData(value);
						break;
					case "m_emitter_on_start_per_letter":
						if(effect_setup != null)
						{
							effect_setup.m_effect_assignment = bool.Parse(value) ? PLAY_ITEM_ASSIGNMENT.PER_LETTER : PLAY_ITEM_ASSIGNMENT.CUSTOM;
							if(effect_setup.m_effect_assignment == PLAY_ITEM_ASSIGNMENT.CUSTOM)
								effect_setup.m_effect_assignment_custom_letters = new List<int>(){0};
						
							letter_action.AddParticleEffectSetup(effect_setup);
							effect_setup = null;
						}
						break;
					
					case "m_emitter_on_finish":
						if(value.PathToParticleEmitter() != null)
						{
							effect_setup = new ParticleEffectSetup()
							{
								m_legacy_particle_effect = value.PathToParticleEmitter(),
								m_play_when = PLAY_ITEM_EVENTS.ON_FINISH,
								m_loop_play_once = false,
								m_rotation_offset = new ActionVector3Progression(new Vector3(0,180,0)),
								m_rotate_relative_to_letter = true,
								m_effect_type = PARTICLE_EFFECT_TYPE.LEGACY
							};
						}
						break;
					case "m_emitter_on_finish_delay":
						if(effect_setup != null)
							effect_setup.m_delay.ImportLegacyData(value);
						break;
					case "m_emitter_on_finish_duration":
						if(effect_setup != null)
							effect_setup.m_duration.ImportLegacyData(value);
						break;
					case "m_emitter_on_finish_follow_mesh":
						if(effect_setup != null)
							effect_setup.m_follow_mesh = bool.Parse(value);
						break;
					case "m_emitter_on_finish_offset":
						if(effect_setup != null)
							effect_setup.m_position_offset.ImportLegacyData(value);
						break;
					case "m_emitter_on_finish_per_letter":
						if(effect_setup != null)
						{
							effect_setup.m_effect_assignment = bool.Parse(value) ? PLAY_ITEM_ASSIGNMENT.PER_LETTER : PLAY_ITEM_ASSIGNMENT.CUSTOM;
							if(effect_setup.m_effect_assignment == PLAY_ITEM_ASSIGNMENT.CUSTOM)
								effect_setup.m_effect_assignment_custom_letters = new List<int>(){0};
						
							letter_action.AddParticleEffectSetup(effect_setup);
							effect_setup = null;
						}
						break;
				}
			}

			return idx;
		}
Пример #8
0
        public static int ImportLegacyData(this LetterAction letter_action, List <object> data_list, int index_offset = 0)
        {
            KeyValuePair <string, string> value_pair;
            string key, value;
            int    idx;

            letter_action.ClearAudioEffectSetups();
            letter_action.ClearParticleEffectSetups();

            AudioEffectSetup    audio_setup  = null;
            ParticleEffectSetup effect_setup = null;

            for (idx = index_offset; idx < data_list.Count; idx++)
            {
                value_pair = (KeyValuePair <string, string>)data_list[idx];
                key        = value_pair.Key;
                value      = value_pair.Value;

                if (key.Equals("ACTION_DATA_END"))
                {
                    // reached end of this Actions import data
                    break;
                }

                switch (key)
                {
                case "m_action_type":
                    letter_action.m_action_type = (ACTION_TYPE)int.Parse(value); break;

                case "m_ease_type":
                    letter_action.m_ease_type = (EasingEquation)int.Parse(value); break;

                case "m_use_gradient_start":
                    letter_action.m_use_gradient_start = bool.Parse(value); break;

                case "m_use_gradient_end":
                    letter_action.m_use_gradient_end = bool.Parse(value); break;

                case "m_force_same_start_time":
                    letter_action.m_force_same_start_time = bool.Parse(value); break;

                // Legacy letter anchor import support
                case "m_letter_anchor":
                    letter_action.m_letter_anchor_start = int.Parse(value);
                    letter_action.m_letter_anchor_2_way = false;
                    break;

                // New letter anchor import support
                case "m_letter_anchor_start":
                    letter_action.m_letter_anchor_start = int.Parse(value); break;

                case "m_letter_anchor_end":
                    letter_action.m_letter_anchor_end = int.Parse(value); break;

                case "m_letter_anchor_2_way":
                    letter_action.m_letter_anchor_2_way = bool.Parse(value); break;


                case "m_offset_from_last":
                    letter_action.m_offset_from_last = bool.Parse(value); break;

                case "m_position_axis_ease_data":
                    letter_action.m_position_axis_ease_data.ImportLegacyData(value); break;

                case "m_rotation_axis_ease_data":
                    letter_action.m_rotation_axis_ease_data.ImportLegacyData(value); break;

                case "m_scale_axis_ease_data":
                    letter_action.m_scale_axis_ease_data.ImportLegacyData(value); break;


                case "m_start_colour":
                    letter_action.m_start_colour.ImportLegacyData(value); break;

                case "m_end_colour":
                    letter_action.m_end_colour.ImportLegacyData(value); break;

                case "m_start_vertex_colour":
                    letter_action.m_start_vertex_colour.ImportLegacyData(value); break;

                case "m_end_vertex_colour":
                    letter_action.m_end_vertex_colour.ImportLegacyData(value); break;

                case "m_start_euler_rotation":
                    letter_action.m_start_euler_rotation.ImportLegacyData(value); break;

                case "m_end_euler_rotation":
                    letter_action.m_end_euler_rotation.ImportLegacyData(value); break;

                case "m_start_pos":
                    letter_action.m_start_pos.ImportLegacyData(value); break;

                case "m_end_pos":
                    letter_action.m_end_pos.ImportLegacyData(value); break;

                case "m_start_scale":
                    letter_action.m_start_scale.ImportLegacyData(value); break;

                case "m_end_scale":
                    letter_action.m_end_scale.ImportLegacyData(value); break;

                case "m_delay_progression":
                    letter_action.m_delay_progression.ImportLegacyData(value); break;

                case "m_duration_progression":
                    letter_action.m_duration_progression.ImportLegacyData(value); break;


                case "m_audio_on_start":
                    if (value.PathToAudioClip() != null)
                    {
                        audio_setup = new AudioEffectSetup()
                        {
                            m_audio_clip = value.PathToAudioClip(), m_play_when = PLAY_ITEM_EVENTS.ON_START, m_effect_assignment = PLAY_ITEM_ASSIGNMENT.PER_LETTER, m_loop_play_once = false
                        };
                    }
                    break;

                case "m_audio_on_start_delay":
                    if (audio_setup != null)
                    {
                        audio_setup.m_delay.ImportLegacyData(value);
                    }
                    break;

                case "m_audio_on_start_offset":
                    if (audio_setup != null)
                    {
                        audio_setup.m_offset_time.ImportLegacyData(value);
                    }
                    break;

                case "m_audio_on_start_pitch":
                    if (audio_setup != null)
                    {
                        audio_setup.m_pitch.ImportLegacyData(value);
                    }
                    break;

                case "m_audio_on_start_volume":
                    if (audio_setup != null)
                    {
                        audio_setup.m_volume.ImportLegacyData(value);
                        letter_action.AddAudioEffectSetup(audio_setup);
                        audio_setup = null;
                    }
                    break;

                case "m_audio_on_finish":
                    if (value.PathToAudioClip() != null)
                    {
                        audio_setup = new AudioEffectSetup()
                        {
                            m_audio_clip = value.PathToAudioClip(), m_play_when = PLAY_ITEM_EVENTS.ON_FINISH, m_effect_assignment = PLAY_ITEM_ASSIGNMENT.PER_LETTER, m_loop_play_once = false
                        };
                    }
                    break;

                case "m_audio_on_finish_delay":
                    if (audio_setup != null)
                    {
                        audio_setup.m_delay.ImportLegacyData(value);
                    }
                    break;

                case "m_audio_on_finish_offset":
                    if (audio_setup != null)
                    {
                        audio_setup.m_offset_time.ImportLegacyData(value);
                    }
                    break;

                case "m_audio_on_finish_pitch":
                    if (audio_setup != null)
                    {
                        audio_setup.m_pitch.ImportLegacyData(value);
                    }
                    break;

                case "m_audio_on_finish_volume":
                    if (audio_setup != null)
                    {
                        audio_setup.m_volume.ImportLegacyData(value);
                        letter_action.AddAudioEffectSetup(audio_setup);
                        audio_setup = null;
                    }
                    break;


                // BACKWARDS COMPATIBILITY PARTICLE IMPORT
                case "m_emitter_on_start":
                    if (value.PathToParticleEmitter() != null)
                    {
                        effect_setup = new ParticleEffectSetup()
                        {
                            m_legacy_particle_effect = value.PathToParticleEmitter(),
                            m_play_when                 = PLAY_ITEM_EVENTS.ON_START,
                            m_loop_play_once            = false,
                            m_rotation_offset           = new ActionVector3Progression(new Vector3(0, 180, 0)),
                            m_rotate_relative_to_letter = true,
                            m_effect_type               = PARTICLE_EFFECT_TYPE.LEGACY
                        };
                    }
                    break;

                case "m_emitter_on_start_delay":
                    if (effect_setup != null)
                    {
                        effect_setup.m_delay.ImportLegacyData(value);
                    }
                    break;

                case "m_emitter_on_start_duration":
                    if (effect_setup != null)
                    {
                        effect_setup.m_duration.ImportLegacyData(value);
                    }
                    break;

                case "m_emitter_on_start_follow_mesh":
                    if (effect_setup != null)
                    {
                        effect_setup.m_follow_mesh = bool.Parse(value);
                    }
                    break;

                case "m_emitter_on_start_offset":
                    if (effect_setup != null)
                    {
                        effect_setup.m_position_offset.ImportLegacyData(value);
                    }
                    break;

                case "m_emitter_on_start_per_letter":
                    if (effect_setup != null)
                    {
                        effect_setup.m_effect_assignment = bool.Parse(value) ? PLAY_ITEM_ASSIGNMENT.PER_LETTER : PLAY_ITEM_ASSIGNMENT.CUSTOM;
                        if (effect_setup.m_effect_assignment == PLAY_ITEM_ASSIGNMENT.CUSTOM)
                        {
                            effect_setup.m_effect_assignment_custom_letters = new List <int>()
                            {
                                0
                            }
                        }
                        ;

                        letter_action.AddParticleEffectSetup(effect_setup);
                        effect_setup = null;
                    }
                    break;

                case "m_emitter_on_finish":
                    if (value.PathToParticleEmitter() != null)
                    {
                        effect_setup = new ParticleEffectSetup()
                        {
                            m_legacy_particle_effect = value.PathToParticleEmitter(),
                            m_play_when                 = PLAY_ITEM_EVENTS.ON_FINISH,
                            m_loop_play_once            = false,
                            m_rotation_offset           = new ActionVector3Progression(new Vector3(0, 180, 0)),
                            m_rotate_relative_to_letter = true,
                            m_effect_type               = PARTICLE_EFFECT_TYPE.LEGACY
                        };
                    }
                    break;

                case "m_emitter_on_finish_delay":
                    if (effect_setup != null)
                    {
                        effect_setup.m_delay.ImportLegacyData(value);
                    }
                    break;

                case "m_emitter_on_finish_duration":
                    if (effect_setup != null)
                    {
                        effect_setup.m_duration.ImportLegacyData(value);
                    }
                    break;

                case "m_emitter_on_finish_follow_mesh":
                    if (effect_setup != null)
                    {
                        effect_setup.m_follow_mesh = bool.Parse(value);
                    }
                    break;

                case "m_emitter_on_finish_offset":
                    if (effect_setup != null)
                    {
                        effect_setup.m_position_offset.ImportLegacyData(value);
                    }
                    break;

                case "m_emitter_on_finish_per_letter":
                    if (effect_setup != null)
                    {
                        effect_setup.m_effect_assignment = bool.Parse(value) ? PLAY_ITEM_ASSIGNMENT.PER_LETTER : PLAY_ITEM_ASSIGNMENT.CUSTOM;
                        if (effect_setup.m_effect_assignment == PLAY_ITEM_ASSIGNMENT.CUSTOM)
                        {
                            effect_setup.m_effect_assignment_custom_letters = new List <int>()
                            {
                                0
                            }
                        }
                        ;

                        letter_action.AddParticleEffectSetup(effect_setup);
                        effect_setup = null;
                    }
                    break;
                }
            }

            return(idx);
        }
Пример #9
0
		public void PlayAudioClip(AudioEffectSetup effect_setup, AnimationProgressionVariables progression_vars, AnimatePerOptions animate_per)
		{
			bool sound_played = false;
			AudioSource source = null;
			
			if(m_audio_sources != null)
			{
				foreach(AudioSource a_source in m_audio_sources)
				{
					if(!a_source.isPlaying)
					{
						// audio source free to play a sound
						source= a_source;
						
						sound_played = true;
						break;
					}
				}
				
				if(!sound_played)
				{
					source = AddNewAudioChild();
				}
			}
			else
			{
				source = AddNewAudioChild();
			}
			
			PlayClip(
				source,
				effect_setup.m_audio_clip,
				effect_setup.m_delay.GetValue(progression_vars, animate_per),
				effect_setup.m_offset_time.GetValue(progression_vars, animate_per),
				effect_setup.m_volume.GetValue(progression_vars, animate_per),
				effect_setup.m_pitch.GetValue(progression_vars, animate_per));
		}