示例#1
0
 public void InsertAction(int index, LetterAction action)
 {
     if (index >= 0 && index <= m_letter_actions.Count)
     {
         m_letter_actions.Insert(index, action);
     }
 }
示例#2
0
        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 SoftResetStarts(LetterAction prev_action, AnimationProgressionVariables progression_variables, AnimatePerOptions animate_per)
        {
            if (m_use_gradient_start)
            {
                if (!m_offset_from_last && m_start_vertex_colour.UniqueRandom)
                {
                    m_start_vertex_colour.CalculateUniqueRandom(progression_variables, animate_per, prev_action != null ? prev_action.m_end_vertex_colour.Values : null);
                }
            }
            else
            {
                if (!m_offset_from_last && m_start_colour.UniqueRandom)
                {
                    m_start_colour.CalculateUniqueRandom(progression_variables, animate_per, prev_action != null ? prev_action.m_end_colour.Values : null);
                }
            }

            if (!m_offset_from_last)
            {
                if (m_start_pos.UniqueRandom)
                {
                    m_start_pos.CalculateUniqueRandom(progression_variables, animate_per, prev_action != null ? prev_action.m_end_pos.Values : null);
                }
                if (m_start_euler_rotation.UniqueRandom)
                {
                    m_start_euler_rotation.CalculateUniqueRandom(progression_variables, animate_per, prev_action != null ? prev_action.m_end_euler_rotation.Values : null);
                }
                if (m_start_scale.UniqueRandom)
                {
                    m_start_scale.CalculateUniqueRandom(progression_variables, animate_per, prev_action != null ? prev_action.m_end_scale.Values : null);
                }
            }
        }
示例#4
0
        public void AddAction(LetterAction letter_action)
        {
            if (m_letter_actions == null)
            {
                m_letter_actions = new List <LetterAction>();
            }

            m_letter_actions.Add(letter_action);
        }
示例#5
0
        public void SetAnimationVars(LetterSetup master_letter)
        {
            m_anim_state_vars = master_letter.AnimStateVars.Clone();

            m_current_letter_action = null;

            // clone the list of active loop cycles, so that the list reference is not shared between two letters
            m_anim_state_vars.m_active_loop_cycles = new List <ActionLoopCycle>();
            foreach (ActionLoopCycle loop_cycle in master_letter.AnimStateVars.m_active_loop_cycles)
            {
                m_anim_state_vars.m_active_loop_cycles.Add(loop_cycle.Clone());
            }
        }
示例#6
0
        public void Recycle(string character, int letter_idx, Mesh mesh, Vector3 base_offset, ref CustomCharacterInfo char_info, int line_num, int word_idx, EffectManager effect_manager)
        {
            m_character             = character;
            m_mesh                  = mesh;
            m_base_offset           = base_offset;
            m_effect_manager_handle = effect_manager;

            m_progression_variables = new AnimationProgressionVariables(letter_idx, word_idx, line_num);

            SetupLetterMesh(ref char_info);

            if (m_flipped)
            {
                // flip UV coords in x axis.
                m_mesh.uv = new Vector2[] { mesh.uv[3], mesh.uv[2], mesh.uv[1], mesh.uv[0] };
            }

            m_current_letter_action = null;
        }
        public LetterAction ContinueActionFromThis()
        {
            LetterAction letter_action = new LetterAction();

            // Default to offset from previous and not be folded in editor
            letter_action.m_offset_from_last = true;
            letter_action.m_editor_folded    = true;

            letter_action.m_use_gradient_start = m_use_gradient_start;
            letter_action.m_use_gradient_end   = m_use_gradient_end;

            letter_action.m_position_axis_ease_data = m_position_axis_ease_data.Clone();
            letter_action.m_rotation_axis_ease_data = m_rotation_axis_ease_data.Clone();
            letter_action.m_scale_axis_ease_data    = m_scale_axis_ease_data.Clone();

            letter_action.m_start_colour        = m_end_colour.Clone();
            letter_action.m_end_colour          = m_end_colour.Clone();
            letter_action.m_start_vertex_colour = m_end_vertex_colour.Clone();
            letter_action.m_end_vertex_colour   = m_end_vertex_colour.Clone();

            letter_action.m_start_pos = m_end_pos.CloneThis();
            letter_action.m_end_pos   = m_end_pos.CloneThis();

            letter_action.m_start_euler_rotation = m_end_euler_rotation.Clone();
            letter_action.m_end_euler_rotation   = m_end_euler_rotation.Clone();

            letter_action.m_start_scale = m_end_scale.Clone();
            letter_action.m_end_scale   = m_end_scale.Clone();

            letter_action.m_delay_progression    = new ActionFloatProgression(0);
            letter_action.m_duration_progression = new ActionFloatProgression(1);

            letter_action.m_letter_anchor_start = m_letter_anchor_2_way ? m_letter_anchor_end : m_letter_anchor_start;

            letter_action.m_ease_type = m_ease_type;

            return(letter_action);
        }
示例#8
0
        void SetCurrentLetterAction(LetterAction letter_action, AnimatePerOptions animate_per)
        {
            m_current_letter_action = letter_action;

            if (letter_action.m_action_type == ACTION_TYPE.ANIM_SEQUENCE)
            {
                m_action_delay = Mathf.Max(m_current_letter_action.m_delay_progression.GetValue(m_progression_variables, m_last_animate_per), 0);
            }
            m_action_duration = Mathf.Max(m_current_letter_action.m_duration_progression.GetValue(m_progression_variables, m_last_animate_per), 0);

            // Check if action is in a loopreverse_onetime delay case. If so, set delay to 0.
            if (m_anim_state_vars.m_active_loop_cycles != null &&
                m_anim_state_vars.m_active_loop_cycles.Count > 0 &&
                m_anim_state_vars.m_active_loop_cycles[0].m_delay_first_only &&
                !m_anim_state_vars.m_active_loop_cycles[0].FirstPass &&
                m_current_letter_action.m_delay_progression.Progression != (int)ValueProgression.Constant)
            {
                if (m_anim_state_vars.m_reverse || !m_current_letter_action.m_force_same_start_time)
                {
                    m_action_delay = 0;
                }
            }
        }
        public void SoftReset(LetterAction prev_action, AnimationProgressionVariables progression_variables, AnimatePerOptions animate_per, bool first_action = false)
        {
            if (m_use_gradient_start)
            {
                if (!m_offset_from_last && m_start_vertex_colour.UniqueRandom && !first_action)
                {
                    m_start_vertex_colour.CalculateUniqueRandom(progression_variables, animate_per, prev_action != null ? prev_action.m_end_vertex_colour.Values : null);
                }
            }
            else
            {
                if (!m_offset_from_last && m_start_colour.UniqueRandom && !first_action)
                {
                    m_start_colour.CalculateUniqueRandom(progression_variables, animate_per, prev_action != null ? prev_action.m_end_colour.Values : null);
                }
            }

            if (!m_offset_from_last && !first_action)
            {
                if (m_start_pos.UniqueRandom)
                {
                    m_start_pos.CalculateUniqueRandom(progression_variables, animate_per, prev_action != null ? prev_action.m_end_pos.Values : null);
                }
                if (m_start_euler_rotation.UniqueRandom)
                {
                    m_start_euler_rotation.CalculateUniqueRandom(progression_variables, animate_per, prev_action != null ? prev_action.m_end_euler_rotation.Values : null);
                }
                if (m_start_scale.UniqueRandom)
                {
                    m_start_scale.CalculateUniqueRandom(progression_variables, animate_per, prev_action != null ? prev_action.m_end_scale.Values : null);
                }
            }

            // End State Unique Randoms
            if (m_use_gradient_end)
            {
                if (m_end_vertex_colour.UniqueRandom)
                {
                    m_end_vertex_colour.CalculateUniqueRandom(progression_variables, animate_per, m_start_vertex_colour.Values);
                }
            }
            else
            {
                if (m_end_colour.UniqueRandom)
                {
                    m_end_colour.CalculateUniqueRandom(progression_variables, animate_per, m_start_colour.Values);
                }
            }
            if (m_end_pos.UniqueRandom)
            {
                m_end_pos.CalculateUniqueRandom(progression_variables, animate_per, m_start_pos.Values);
            }
            if (m_end_euler_rotation.UniqueRandom)
            {
                m_end_euler_rotation.CalculateUniqueRandom(progression_variables, animate_per, m_start_euler_rotation.Values);
            }
            if (m_end_scale.UniqueRandom)
            {
                m_end_scale.CalculateUniqueRandom(progression_variables, animate_per, m_start_scale.Values);
            }


            // Timing unique randoms
            if (m_delay_progression.UniqueRandom)
            {
                m_delay_progression.CalculateUniqueRandom(progression_variables, animate_per);
            }
            if (m_duration_progression.UniqueRandom)
            {
                m_duration_progression.CalculateUniqueRandom(progression_variables, animate_per);
            }

            if (m_audio_effects != null)
            {
                foreach (AudioEffectSetup effect_setup in m_audio_effects)
                {
                    if (effect_setup.m_delay.UniqueRandom)
                    {
                        effect_setup.m_delay.CalculateUniqueRandom(progression_variables, animate_per);
                    }
                    if (effect_setup.m_offset_time.UniqueRandom)
                    {
                        effect_setup.m_offset_time.CalculateUniqueRandom(progression_variables, animate_per);
                    }
                    if (effect_setup.m_volume.UniqueRandom)
                    {
                        effect_setup.m_volume.CalculateUniqueRandom(progression_variables, animate_per);
                    }
                    if (effect_setup.m_pitch.UniqueRandom)
                    {
                        effect_setup.m_pitch.CalculateUniqueRandom(progression_variables, animate_per);
                    }
                }
            }

            if (m_particle_effects != null)
            {
                foreach (ParticleEffectSetup effect_setup in m_particle_effects)
                {
                    if (effect_setup.m_position_offset.UniqueRandom)
                    {
                        effect_setup.m_position_offset.CalculateUniqueRandom(progression_variables, animate_per, null);
                    }
                    if (effect_setup.m_rotation_offset.UniqueRandom)
                    {
                        effect_setup.m_rotation_offset.CalculateUniqueRandom(progression_variables, animate_per, null);
                    }
                    if (effect_setup.m_delay.UniqueRandom)
                    {
                        effect_setup.m_delay.CalculateUniqueRandom(progression_variables, animate_per);
                    }
                    if (effect_setup.m_duration.UniqueRandom)
                    {
                        effect_setup.m_duration.CalculateUniqueRandom(progression_variables, animate_per);
                    }
                }
            }
        }
示例#10
0
		public void PrepareData(ref LetterSetup[] letters, int num_letters, int num_words, int num_lines, LetterAction prev_action, AnimatePerOptions animate_per, bool prev_action_end_state = true)
		{
			m_duration_progression.CalculateProgressions(GetProgressionTotal(num_letters, num_words, num_lines, animate_per, m_duration_progression.AnimatePer, m_duration_progression.OverrideAnimatePerOption));
			
			
			if(m_audio_effects != null)
			{
				foreach(AudioEffectSetup effect_setup in m_audio_effects)
				{
					effect_setup.m_delay.CalculateProgressions(GetProgressionTotal(num_letters, num_words, num_lines, animate_per, effect_setup.m_delay.AnimatePer, effect_setup.m_delay.OverrideAnimatePerOption));
					effect_setup.m_offset_time.CalculateProgressions(GetProgressionTotal(num_letters, num_words, num_lines, animate_per, effect_setup.m_offset_time.AnimatePer, effect_setup.m_offset_time.OverrideAnimatePerOption));
					effect_setup.m_volume.CalculateProgressions(GetProgressionTotal(num_letters, num_words, num_lines, animate_per, effect_setup.m_volume.AnimatePer, effect_setup.m_volume.OverrideAnimatePerOption));
					effect_setup.m_pitch.CalculateProgressions(GetProgressionTotal(num_letters, num_words, num_lines, animate_per, effect_setup.m_pitch.AnimatePer, effect_setup.m_pitch.OverrideAnimatePerOption));
				}
			}

			if(m_particle_effects != null)
			{
				foreach(ParticleEffectSetup effect_setup in m_particle_effects)
				{
					effect_setup.m_position_offset.CalculateProgressions(GetProgressionTotal(num_letters, num_words, num_lines, animate_per, effect_setup.m_position_offset.AnimatePer, effect_setup.m_position_offset.OverrideAnimatePerOption), null);
					effect_setup.m_rotation_offset.CalculateProgressions(GetProgressionTotal(num_letters, num_words, num_lines, animate_per, effect_setup.m_rotation_offset.AnimatePer, effect_setup.m_rotation_offset.OverrideAnimatePerOption), null);
					effect_setup.m_delay.CalculateProgressions(GetProgressionTotal(num_letters, num_words, num_lines, animate_per, effect_setup.m_delay.AnimatePer, effect_setup.m_delay.OverrideAnimatePerOption));
					effect_setup.m_duration.CalculateProgressions(GetProgressionTotal(num_letters, num_words, num_lines, animate_per, effect_setup.m_duration.AnimatePer, effect_setup.m_duration.OverrideAnimatePerOption));
				}
			}
			
			if(m_action_type == ACTION_TYPE.BREAK)
			{
				return;
			}
			
			m_delay_progression.CalculateProgressions(GetProgressionTotal(num_letters, num_words, num_lines, animate_per, m_delay_progression.AnimatePer, m_delay_progression.OverrideAnimatePerOption));
			
			
			if(m_offset_from_last && prev_action != null)
			{
				m_use_gradient_start = prev_action.m_use_gradient_end;
				
				if(prev_action_end_state)
				{
					if(m_use_gradient_start)
					{
						m_start_vertex_colour.Values = prev_action.m_end_vertex_colour.Values;
					}
					else
					{
						m_start_colour.Values = prev_action.m_end_colour.Values;
					}
				}
				else
				{
					if(m_use_gradient_start)
					{
						m_start_vertex_colour.Values = prev_action.m_start_vertex_colour.Values;
					}
					else
					{
						m_start_colour.Values = prev_action.m_start_colour.Values;
					}
				}
			}
			else
			{
				if(m_use_gradient_start || (prev_action != null && (prev_action.m_use_gradient_end)))
				{
					if(!m_use_gradient_start)
					{
						// Need to convert flat colour into a vertex colour
						m_use_gradient_start = true;
						
						m_start_vertex_colour.ConvertFromFlatColourProg(m_start_colour);
					}
					
					// add this colour to previous state
					m_start_vertex_colour.CalculateProgressions(GetProgressionTotal(num_letters, num_words, num_lines, animate_per, m_start_vertex_colour.AnimatePer, m_start_vertex_colour.OverrideAnimatePerOption),
																prev_action != null && (prev_action.m_use_gradient_end) ? prev_action.m_end_vertex_colour.Values : null,
																prev_action != null && (!prev_action.m_use_gradient_end) ? prev_action.m_end_colour.Values : null);
				}
				else
				{
					m_start_colour.CalculateProgressions(GetProgressionTotal(num_letters, num_words, num_lines, animate_per, m_start_colour.AnimatePer, m_start_colour.OverrideAnimatePerOption), 
														prev_action != null ? prev_action.m_end_colour.Values : null);
				}
			}
			
			if(m_use_gradient_end || m_use_gradient_start)
			{
				if(!m_use_gradient_end)
				{
					// Need to convert flat colour into a vertex colour
					m_use_gradient_end = true;
					
					m_end_vertex_colour.ConvertFromFlatColourProg(m_end_colour);
				}
				
				m_end_vertex_colour.CalculateProgressions(GetProgressionTotal(num_letters, num_words, num_lines, animate_per, m_end_vertex_colour.AnimatePer, m_end_vertex_colour.OverrideAnimatePerOption),
															(m_use_gradient_start) ? m_start_vertex_colour.Values : null,
															(!m_use_gradient_start) ? m_start_colour.Values : null);
			}
			else
			{
				m_end_colour.CalculateProgressions(GetProgressionTotal(num_letters, num_words, num_lines, animate_per, m_end_colour.AnimatePer, m_end_colour.OverrideAnimatePerOption),
													m_start_colour.Values);
			}
			
			
			if(m_offset_from_last && prev_action != null)
			{
				m_start_pos.Values = prev_action_end_state ? prev_action.m_end_pos.Values : prev_action.m_start_pos.Values;
				m_start_euler_rotation.Values = prev_action_end_state ? prev_action.m_end_euler_rotation.Values : prev_action.m_start_euler_rotation.Values;
				m_start_scale.Values = prev_action_end_state ? prev_action.m_end_scale.Values : prev_action.m_start_scale.Values;
			}
			else
			{
				float[] start_pos_curve_letter_progressions = null;
				if(m_start_pos.Progression == ActionPositionVector3Progression.CURVE_OPTION_INDEX)
				{
					// Pre calculate letter progression values based on letter spacing
					start_pos_curve_letter_progressions = m_start_pos.BezierCurve.GetLetterProgressions(ref letters, m_letter_anchor_start);
				}
				
				m_start_pos.CalculatePositionProgressions(ref start_pos_curve_letter_progressions, GetProgressionTotal(num_letters, num_words, num_lines, animate_per, m_start_pos.AnimatePer, m_start_pos.OverrideAnimatePerOption),
													prev_action != null ? prev_action.m_end_pos.Values : new Vector3[]{Vector3.zero});
				m_start_euler_rotation.CalculateRotationProgressions(ref start_pos_curve_letter_progressions, GetProgressionTotal(num_letters, num_words, num_lines, animate_per, m_start_euler_rotation.AnimatePer, m_start_euler_rotation.OverrideAnimatePerOption),
													prev_action != null ? prev_action.m_end_euler_rotation.Values : new Vector3[]{Vector3.zero},
													m_start_pos.Progression == ActionPositionVector3Progression.CURVE_OPTION_INDEX ? m_start_pos.BezierCurve : null);
				m_start_scale.CalculateProgressions(GetProgressionTotal(num_letters, num_words, num_lines, animate_per, m_start_scale.AnimatePer, m_start_scale.OverrideAnimatePerOption),
													prev_action != null ? prev_action.m_end_scale.Values : new Vector3[]{Vector3.zero});
			}
			
			float[] end_pos_curve_letter_progressions = null;
			if(m_end_pos.Progression == ActionPositionVector3Progression.CURVE_OPTION_INDEX)
			{
				// Pre calculate letter progression values based on letter spacing
				end_pos_curve_letter_progressions = m_end_pos.BezierCurve.GetLetterProgressions(ref letters, m_letter_anchor_end);
			}
			
			m_end_pos.CalculatePositionProgressions(ref end_pos_curve_letter_progressions, GetProgressionTotal(num_letters, num_words, num_lines, animate_per, m_end_pos.AnimatePer, m_end_pos.OverrideAnimatePerOption), m_start_pos.Values);
			m_end_euler_rotation.CalculateRotationProgressions(ref end_pos_curve_letter_progressions, GetProgressionTotal(num_letters, num_words, num_lines, animate_per, m_end_euler_rotation.AnimatePer, m_end_euler_rotation.OverrideAnimatePerOption),
														m_start_euler_rotation.Values,
														m_end_pos.Progression == ActionPositionVector3Progression.CURVE_OPTION_INDEX ? m_end_pos.BezierCurve : null);
			m_end_scale.CalculateProgressions(GetProgressionTotal(num_letters, num_words, num_lines, animate_per, m_end_scale.AnimatePer, m_end_scale.OverrideAnimatePerOption), m_start_scale.Values);
			
			CalculateLetterAnchorOffset();
		}
示例#11
0
		public LetterAction ContinueActionFromThis()
		{
			LetterAction letter_action = new LetterAction();
			
			// Default to offset from previous and not be folded in editor
			letter_action.m_offset_from_last = true;
			letter_action.m_editor_folded = true;
			
			letter_action.m_use_gradient_start = m_use_gradient_start;
			letter_action.m_use_gradient_end = m_use_gradient_end;
			
			letter_action.m_position_axis_ease_data = m_position_axis_ease_data.Clone();
			letter_action.m_rotation_axis_ease_data = m_rotation_axis_ease_data.Clone();
			letter_action.m_scale_axis_ease_data = m_scale_axis_ease_data.Clone();
			
			letter_action.m_start_colour = m_end_colour.Clone();
			letter_action.m_end_colour = m_end_colour.Clone();
			letter_action.m_start_vertex_colour = m_end_vertex_colour.Clone();
			letter_action.m_end_vertex_colour = m_end_vertex_colour.Clone();
			
			letter_action.m_start_pos = m_end_pos.CloneThis();
			letter_action.m_end_pos = m_end_pos.CloneThis();
			
			letter_action.m_start_euler_rotation = m_end_euler_rotation.Clone();
			letter_action.m_end_euler_rotation = m_end_euler_rotation.Clone();
			
			letter_action.m_start_scale = m_end_scale.Clone();
			letter_action.m_end_scale = m_end_scale.Clone();
			
			letter_action.m_delay_progression = new ActionFloatProgression(0);
			letter_action.m_duration_progression = new ActionFloatProgression(1);
			
			letter_action.m_letter_anchor_start = m_letter_anchor_2_way ? m_letter_anchor_end : m_letter_anchor_start;
			
			letter_action.m_ease_type = m_ease_type;
			
			return letter_action;
		}
示例#12
0
		public void SoftResetStarts(LetterAction prev_action, AnimationProgressionVariables progression_variables, AnimatePerOptions animate_per)
		{
			if(m_use_gradient_start)
			{
				if(!m_offset_from_last && m_start_vertex_colour.UniqueRandom)
				{
					m_start_vertex_colour.CalculateUniqueRandom(progression_variables, animate_per, prev_action != null ? prev_action.m_end_vertex_colour.Values : null);
				}
			}
			else
			{
				if(!m_offset_from_last && m_start_colour.UniqueRandom)
				{
					m_start_colour.CalculateUniqueRandom(progression_variables, animate_per, prev_action != null ? prev_action.m_end_colour.Values : null);
				}
			}
			
			if(!m_offset_from_last)
			{
				if(m_start_pos.UniqueRandom)
				{
					m_start_pos.CalculateUniqueRandom(progression_variables, animate_per, prev_action != null ? prev_action.m_end_pos.Values : null);
				}
				if(m_start_euler_rotation.UniqueRandom)
				{
					m_start_euler_rotation.CalculateUniqueRandom(progression_variables, animate_per, prev_action != null ? prev_action.m_end_euler_rotation.Values : null);
				}
				if(m_start_scale.UniqueRandom)
				{
					m_start_scale.CalculateUniqueRandom(progression_variables, animate_per, prev_action != null ? prev_action.m_end_scale.Values : null);
				}
			}
		}
示例#13
0
		public void SoftReset(LetterAction prev_action, AnimationProgressionVariables progression_variables, AnimatePerOptions animate_per, bool first_action = false)
		{
			if(m_use_gradient_start)
			{
				if(!m_offset_from_last && m_start_vertex_colour.UniqueRandom && !first_action)
				{
					m_start_vertex_colour.CalculateUniqueRandom(progression_variables, animate_per, prev_action != null ? prev_action.m_end_vertex_colour.Values : null);
				}
			}
			else
			{
				if(!m_offset_from_last && m_start_colour.UniqueRandom && !first_action)
				{
					m_start_colour.CalculateUniqueRandom(progression_variables, animate_per, prev_action != null ? prev_action.m_end_colour.Values : null);
				}
			}
			
			if(!m_offset_from_last && !first_action)
			{
				if(m_start_pos.UniqueRandom)
				{
					m_start_pos.CalculateUniqueRandom(progression_variables, animate_per, prev_action != null ? prev_action.m_end_pos.Values : null);
				}
				if(m_start_euler_rotation.UniqueRandom)
				{
					m_start_euler_rotation.CalculateUniqueRandom(progression_variables, animate_per, prev_action != null ? prev_action.m_end_euler_rotation.Values : null);
				}
				if(m_start_scale.UniqueRandom)
				{
					m_start_scale.CalculateUniqueRandom(progression_variables, animate_per, prev_action != null ? prev_action.m_end_scale.Values : null);
				}
			}
			
			// End State Unique Randoms
			if(m_use_gradient_end)
			{
				if(m_end_vertex_colour.UniqueRandom)
				{
					m_end_vertex_colour.CalculateUniqueRandom(progression_variables, animate_per, m_start_vertex_colour.Values);
				}
			}
			else
			{
				if(m_end_colour.UniqueRandom)
				{
					m_end_colour.CalculateUniqueRandom(progression_variables, animate_per, m_start_colour.Values);
				}
			}
			if(m_end_pos.UniqueRandom)
			{
				m_end_pos.CalculateUniqueRandom(progression_variables, animate_per, m_start_pos.Values);
			}
			if(m_end_euler_rotation.UniqueRandom)
			{
				m_end_euler_rotation.CalculateUniqueRandom(progression_variables, animate_per, m_start_euler_rotation.Values);
			}
			if(m_end_scale.UniqueRandom)
			{
				m_end_scale.CalculateUniqueRandom(progression_variables, animate_per, m_start_scale.Values);
			}
			
			
			// Timing unique randoms
			if(m_delay_progression.UniqueRandom)
			{
				m_delay_progression.CalculateUniqueRandom(progression_variables, animate_per);
			}
			if(m_duration_progression.UniqueRandom)
			{
				m_duration_progression.CalculateUniqueRandom(progression_variables, animate_per);
			}
			
			if(m_audio_effects != null)
			{
				foreach(AudioEffectSetup effect_setup in m_audio_effects)
				{
					if(effect_setup.m_delay.UniqueRandom)
						effect_setup.m_delay.CalculateUniqueRandom(progression_variables, animate_per);
					if(effect_setup.m_offset_time.UniqueRandom)
						effect_setup.m_offset_time.CalculateUniqueRandom(progression_variables, animate_per);
					if(effect_setup.m_volume.UniqueRandom)
						effect_setup.m_volume.CalculateUniqueRandom(progression_variables, animate_per);
					if(effect_setup.m_pitch.UniqueRandom)
						effect_setup.m_pitch.CalculateUniqueRandom(progression_variables, animate_per);
				}
			}
			
			if(m_particle_effects != null)
			{
				foreach(ParticleEffectSetup effect_setup in m_particle_effects)
				{
					if(effect_setup.m_position_offset.UniqueRandom)
						effect_setup.m_position_offset.CalculateUniqueRandom(progression_variables, animate_per, null);
					if(effect_setup.m_rotation_offset.UniqueRandom)
						effect_setup.m_rotation_offset.CalculateUniqueRandom(progression_variables, animate_per, null);
					if(effect_setup.m_delay.UniqueRandom)
						effect_setup.m_delay.CalculateUniqueRandom(progression_variables, animate_per);
					if(effect_setup.m_duration.UniqueRandom)
						effect_setup.m_duration.CalculateUniqueRandom(progression_variables, animate_per);
				}
			}
		}
示例#14
0
		void SetupMesh(LetterAction letter_action, LetterAction prev_action, float action_progress, AnimationProgressionVariables progression_variables, AnimatePerOptions animate_per, float linear_progress, EffectManager effect_manager)
		{	
			// construct current anchor offset vector
			m_anchor_offset = letter_action.AnchorOffsetStart;
			m_anchor_offset = new Vector3(	m_anchor_offset.x * m_width, 
											letter_action.m_letter_anchor_start == (int) TextfxTextAnchor.BaselineLeft || letter_action.m_letter_anchor_start == (int) TextfxTextAnchor.BaselineCenter || letter_action.m_letter_anchor_start == (int) TextfxTextAnchor.BaselineRight 
												? 0		// zero because letters are based around the baseline already.
												: (effect_manager.IsFontBaseLineSet 
														? (effect_manager.FontBaseLine + m_y_offset) - (m_anchor_offset.y * -m_height)
														: (m_anchor_offset.y * m_height)),	// Legacy effect support when baseline isn't already set.
											0);
			
			if(letter_action.m_letter_anchor_2_way)
			{
				m_anchor_offset = letter_action.AnchorOffsetEnd;
				m_anchor_offset = Vector3.Lerp(	m_anchor_offset,
												new Vector3(
													m_anchor_offset.x * m_width,
													letter_action.m_letter_anchor_end == (int) TextfxTextAnchor.BaselineLeft || letter_action.m_letter_anchor_end == (int) TextfxTextAnchor.BaselineCenter || letter_action.m_letter_anchor_end == (int) TextfxTextAnchor.BaselineRight
														? 0		// zero because letters are based around the baseline already.
														: (effect_manager.IsFontBaseLineSet
																? (effect_manager.FontBaseLine + m_y_offset) - (m_anchor_offset.y * -m_height)
																: (m_anchor_offset.y * m_height)),	// Legacy effect support when baseline isn't already set.
													0),
												action_progress);
			}
			
			
			// Calculate Scale Vector
			from_vec = letter_action.m_start_scale.GetValue(progression_variables, animate_per);
			to_vec = letter_action.m_end_scale.GetValue(progression_variables, animate_per);
			
			if(letter_action.m_scale_axis_ease_data.m_override_default)
			{
				m_letter_scale = new Vector3(	EffectManager.FloatLerp(from_vec.x, to_vec.x, EasingManager.GetEaseProgress(letter_action.m_scale_axis_ease_data.m_x_ease, linear_progress)),
												EffectManager.FloatLerp(from_vec.y, to_vec.y, EasingManager.GetEaseProgress(letter_action.m_scale_axis_ease_data.m_y_ease, linear_progress)),
												EffectManager.FloatLerp(from_vec.z, to_vec.z, EasingManager.GetEaseProgress(letter_action.m_scale_axis_ease_data.m_z_ease, linear_progress)));
			}
			else
			{
				m_letter_scale = EffectManager.Vector3Lerp(
												from_vec,
												to_vec,
												action_progress);
			}
			
			// Calculate Rotation
			from_vec = letter_action.m_start_euler_rotation.GetValue(progression_variables, animate_per);
			to_vec = letter_action.m_end_euler_rotation.GetValue(progression_variables, animate_per);
			
			if(letter_action.m_rotation_axis_ease_data.m_override_default)
			{
				m_letter_rotation =	Quaternion.Euler
									(
										EffectManager.FloatLerp(from_vec.x, to_vec.x, EasingManager.GetEaseProgress(letter_action.m_rotation_axis_ease_data.m_x_ease, linear_progress)),
										EffectManager.FloatLerp(from_vec.y, to_vec.y, EasingManager.GetEaseProgress(letter_action.m_rotation_axis_ease_data.m_y_ease, linear_progress)),
										EffectManager.FloatLerp(from_vec.z, to_vec.z, EasingManager.GetEaseProgress(letter_action.m_rotation_axis_ease_data.m_z_ease, linear_progress))
									);
			}
			else
			{
				m_letter_rotation = Quaternion.Euler(
											EffectManager.Vector3Lerp(
												from_vec,
												to_vec,
												action_progress)
											);
			}
			
			
			// Calculate Position
			if(letter_action.m_start_pos.Progression == ActionPositionVector3Progression.CURVE_OPTION_INDEX || (letter_action.m_offset_from_last && prev_action != null && prev_action.m_end_pos.Progression == ActionPositionVector3Progression.CURVE_OPTION_INDEX))
				from_vec = new Vector3(-m_anchor_offset.x,m_base_offset.y,0);
			else if(letter_action.m_start_pos.ForcePositionOverride)
				from_vec = new Vector3(-m_anchor_offset.x,0,0);
			else
				from_vec = BaseOffset;
			
			from_vec += letter_action.m_start_pos.GetValue(progression_variables, animate_per);
			
			if(letter_action.m_end_pos.Progression == ActionPositionVector3Progression.CURVE_OPTION_INDEX || (letter_action.m_end_pos.IsOffsetFromLast && letter_action.m_start_pos.Progression == ActionPositionVector3Progression.CURVE_OPTION_INDEX))
				to_vec = new Vector3(-m_anchor_offset.x,m_base_offset.y,0);
			else if(letter_action.m_end_pos.ForcePositionOverride)
				to_vec = new Vector3(-m_anchor_offset.x,0,0);
			else
				to_vec = BaseOffset;
			
			to_vec += letter_action.m_end_pos.GetValue(progression_variables, animate_per);
			
			if(letter_action.m_position_axis_ease_data.m_override_default)
			{
				m_letter_position = new Vector3(	EffectManager.FloatLerp(from_vec.x, to_vec.x, EasingManager.GetEaseProgress(letter_action.m_position_axis_ease_data.m_x_ease, linear_progress)),
													EffectManager.FloatLerp(from_vec.y, to_vec.y, EasingManager.GetEaseProgress(letter_action.m_position_axis_ease_data.m_y_ease, linear_progress)),
													EffectManager.FloatLerp(from_vec.z, to_vec.z, EasingManager.GetEaseProgress(letter_action.m_position_axis_ease_data.m_z_ease, linear_progress)));
			}
			else
			{
				m_letter_position = EffectManager.Vector3Lerp(
					from_vec, 
					to_vec,
					action_progress);
			}
			
			// Calculate letter center position
			m_letter_center = new Vector3(m_width / 2, m_height/2, 0);
			m_letter_center -= m_anchor_offset;
			m_letter_center = Vector3.Scale(m_letter_center, m_letter_scale);
			m_letter_center = m_letter_rotation	* m_letter_center;
			m_letter_center += m_anchor_offset + m_letter_position;
			
			
			if(mesh_verts == null || mesh_verts.Length == 0)
				mesh_verts = new Vector3[4];
			for(int idx=0; idx < 4; idx++)
			{
				mesh_verts[idx] = m_base_vertices[idx];
				
				// normalise vert position to the anchor point before scaling and rotating.
				mesh_verts[idx] -= m_anchor_offset;
				
				// Scale verts
				mesh_verts[idx] = Vector3.Scale(mesh_verts[idx], m_letter_scale);
				
				// Rotate vert
				mesh_verts[idx] = m_letter_rotation	* mesh_verts[idx];
				
				mesh_verts[idx] += m_anchor_offset;
				
				// translate vert
				mesh_verts[idx] += m_letter_position;
			}
			m_mesh.vertices = mesh_verts;
			
			
			
			// Sort out letters colour
			if(letter_action.m_use_gradient_start)
			{
				start_colour = letter_action.m_start_vertex_colour.GetValue(progression_variables, animate_per);
			}
			else
			{
				start_colour = new VertexColour(letter_action.m_start_colour.GetValue(progression_variables, animate_per));
			}
			
			if(letter_action.m_use_gradient_end)
			{
				end_colour = letter_action.m_end_vertex_colour.GetValue(progression_variables, animate_per);
			}
			else
			{
				end_colour = new VertexColour(letter_action.m_end_colour.GetValue(progression_variables, animate_per));
			}
			
			if(!m_flipped)
			{
				m_mesh.colors = new Color[]{ 
					Color.Lerp(start_colour.top_right, end_colour.top_right, action_progress), 
					Color.Lerp(start_colour.top_left, end_colour.top_left, action_progress), 
					Color.Lerp(start_colour.bottom_left, end_colour.bottom_left, action_progress), 
					Color.Lerp(start_colour.bottom_right, end_colour.bottom_right, action_progress)};
			}
			else
			{
				m_mesh.colors = new Color[]{
					Color.Lerp(start_colour.top_left, end_colour.top_left, action_progress),
					Color.Lerp(start_colour.bottom_left, end_colour.bottom_left, action_progress),
					Color.Lerp(start_colour.bottom_right, end_colour.bottom_right, action_progress),
					Color.Lerp(start_colour.top_right, end_colour.top_right, action_progress)
				};
			}
		}
示例#15
0
        public void PrepareData(LetterSetup[] letters, int num_words, int num_lines, AnimatePerOptions animate_per)
        {
            if (letters == null || letters.Length == 0)
            {
                return;
            }

            int num_letters = letters.Length;

            // Populate list of letters to animate by index, and set Letter indexes accordingly
            if (m_letters_to_animate_option == LETTERS_TO_ANIMATE.ALL_LETTERS)
            {
                m_letters_to_animate = new List <int>();
                for (int letter_idx = 0; letter_idx < num_letters; letter_idx++)
                {
                    m_letters_to_animate.Add(letter_idx);

                    letters[letter_idx].m_progression_variables.m_letter_value = letter_idx;
                }
            }
            else if (m_letters_to_animate_option == LETTERS_TO_ANIMATE.FIRST_LETTER || m_letters_to_animate_option == LETTERS_TO_ANIMATE.LAST_LETTER)
            {
                m_letters_to_animate = new List <int>();
                m_letters_to_animate.Add(m_letters_to_animate_option == LETTERS_TO_ANIMATE.FIRST_LETTER ? 0 : letters.Length - 1);

                letters[m_letters_to_animate_option == LETTERS_TO_ANIMATE.FIRST_LETTER ? 0 : letters.Length - 1].m_progression_variables.m_letter_value = 0;
            }
            else if (m_letters_to_animate_option != LETTERS_TO_ANIMATE.CUSTOM)
            {
                m_letters_to_animate = new List <int>();

                int line_idx   = m_letters_to_animate_option == LETTERS_TO_ANIMATE.LAST_LETTER_LINES ? 0 : -1;
                int word_idx   = m_letters_to_animate_option == LETTERS_TO_ANIMATE.LAST_LETTER_WORDS ? 0 : -1;
                int target_idx = 0;

                if (m_letters_to_animate_option == LETTERS_TO_ANIMATE.LAST_WORD)
                {
                    target_idx = letters[letters.Length - 1].m_progression_variables.m_word_value;
                }
                else if (m_letters_to_animate_option == LETTERS_TO_ANIMATE.LAST_LINE)
                {
                    target_idx = letters[letters.Length - 1].m_progression_variables.m_line_value;
                }
                else if (m_letters_to_animate_option == LETTERS_TO_ANIMATE.NTH_WORD || m_letters_to_animate_option == LETTERS_TO_ANIMATE.NTH_LINE)
                {
                    target_idx = m_letters_to_animate_custom_idx - 1;
                }

                int letter_idx      = 0;
                int progression_idx = 0;
                foreach (LetterSetup letter in letters)
                {
                    if (m_letters_to_animate_option == LETTERS_TO_ANIMATE.FIRST_LINE || m_letters_to_animate_option == LETTERS_TO_ANIMATE.LAST_LINE || m_letters_to_animate_option == LETTERS_TO_ANIMATE.NTH_LINE)
                    {
                        if (letter.m_progression_variables.m_line_value == target_idx)
                        {
                            letter.m_progression_variables.m_letter_value = progression_idx;
                            m_letters_to_animate.Add(letter_idx);
                            progression_idx++;
                        }
                    }
                    else if (letter.m_progression_variables.m_line_value > line_idx)
                    {
                        if (m_letters_to_animate_option == LETTERS_TO_ANIMATE.FIRST_LETTER_LINES)
                        {
                            letter.m_progression_variables.m_letter_value = progression_idx;
                            m_letters_to_animate.Add(letter_idx);
                            progression_idx++;
                        }
                        else if (m_letters_to_animate_option == LETTERS_TO_ANIMATE.LAST_LETTER_LINES)
                        {
                            letter.m_progression_variables.m_letter_value = progression_idx - 1;
                            m_letters_to_animate.Add(letter_idx - 1);
                            progression_idx++;
                        }
                        line_idx = letter.m_progression_variables.m_line_value;
                    }

                    if (m_letters_to_animate_option == LETTERS_TO_ANIMATE.FIRST_WORD || m_letters_to_animate_option == LETTERS_TO_ANIMATE.LAST_WORD || m_letters_to_animate_option == LETTERS_TO_ANIMATE.NTH_WORD)
                    {
                        if (letter.m_progression_variables.m_word_value == target_idx)
                        {
                            letter.m_progression_variables.m_letter_value = progression_idx;
                            m_letters_to_animate.Add(letter_idx);
                            progression_idx++;
                        }
                    }
                    else if (letter.m_progression_variables.m_word_value > word_idx)
                    {
                        if (m_letters_to_animate_option == LETTERS_TO_ANIMATE.FIRST_LETTER_WORDS)
                        {
                            letter.m_progression_variables.m_letter_value = progression_idx;
                            m_letters_to_animate.Add(letter_idx);
                            progression_idx++;
                        }
                        else if (m_letters_to_animate_option == LETTERS_TO_ANIMATE.LAST_LETTER_WORDS)
                        {
                            letter.m_progression_variables.m_letter_value = progression_idx;
                            m_letters_to_animate.Add(letter_idx - 1);
                            progression_idx++;
                        }
                        word_idx = letter.m_progression_variables.m_word_value;
                    }

                    letter_idx++;
                }

                if (m_letters_to_animate_option == LETTERS_TO_ANIMATE.LAST_LETTER_WORDS || m_letters_to_animate_option == LETTERS_TO_ANIMATE.LAST_LETTER_LINES)
                {
                    letters[num_letters - 1].m_progression_variables.m_letter_value = letter_idx - 1;
                    m_letters_to_animate.Add(letter_idx - 1);
                }
            }
            else
            {
                int progression_idx = 0;
                for (int letter_idx = 0; letter_idx < num_letters; letter_idx++)
                {
                    if (m_letters_to_animate.Contains(letter_idx))
                    {
                        letters[letter_idx].m_progression_variables.m_letter_value = progression_idx;

                        progression_idx++;
                    }
                }
            }

            // Prepare data progression data in all actions
            LetterAction letter_action;
            LetterAction prev_action           = null;
            bool         prev_action_end_state = true;

            for (int action_idx = 0; action_idx < m_letter_actions.Count; action_idx++)
            {
                letter_action = m_letter_actions[action_idx];

                letter_action.PrepareData(ref letters, m_letters_to_animate.Count, num_words, num_lines, prev_action, animate_per, prev_action_end_state);


                if (letter_action.m_action_type == ACTION_TYPE.ANIM_SEQUENCE)
                {
                    // Set default previous action settings
                    prev_action_end_state = true;
                    prev_action           = letter_action;
                }

                // Check for reverse loops, and how the animation should progress from there
                foreach (ActionLoopCycle loop_cycle in m_loop_cycles)
                {
                    if (loop_cycle.m_end_action_idx == action_idx && loop_cycle.m_loop_type == LOOP_TYPE.LOOP_REVERSE)
                    {
                        prev_action           = m_letter_actions[loop_cycle.m_start_action_idx];
                        prev_action_end_state = false;
                    }
                }
            }
        }
示例#16
0
		public void Recycle(string character, int letter_idx, Mesh mesh, Vector3 base_offset, ref CustomCharacterInfo char_info, int line_num, int word_idx, EffectManager effect_manager)
		{
			m_character = character;
			m_mesh = mesh;
			m_base_offset = base_offset;
			m_effect_manager_handle = effect_manager;
			
			m_progression_variables = new AnimationProgressionVariables(letter_idx, word_idx, line_num);
			
			SetupLetterMesh(ref char_info);
			
			if(m_flipped)
			{
				// flip UV coords in x axis.
				m_mesh.uv = new Vector2[] {mesh.uv[3], mesh.uv[2], mesh.uv[1], mesh.uv[0]};
			}
			
			m_current_letter_action = null;
		}
示例#17
0
		public void SetAnimationVars(LetterSetup master_letter)
		{
			m_anim_state_vars = master_letter.AnimStateVars.Clone();
			
			m_current_letter_action = null;
			
			// clone the list of active loop cycles, so that the list reference is not shared between two letters
			m_anim_state_vars.m_active_loop_cycles = new List<ActionLoopCycle>();
			foreach(ActionLoopCycle loop_cycle in master_letter.AnimStateVars.m_active_loop_cycles)
			{
				m_anim_state_vars.m_active_loop_cycles.Add(loop_cycle.Clone());
			}
		}
示例#18
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);
        }
		public void ImportData(JSONObject 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(JSONValue 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(JSONValue 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 InsertAction(int index, LetterAction action)
		{
			if(index >= 0 && index <= m_letter_actions.Count)
				m_letter_actions.Insert(index, action);
		}
		public void AddAction(LetterAction letter_action)
		{
			if(m_letter_actions == null)
				m_letter_actions = new List<LetterAction>();
			
			m_letter_actions.Add(letter_action);
		}
示例#22
0
        void SetupMesh(LetterAction letter_action, LetterAction prev_action, float action_progress, AnimationProgressionVariables progression_variables, AnimatePerOptions animate_per, float linear_progress, EffectManager effect_manager)
        {
            // construct current anchor offset vector
            m_anchor_offset = letter_action.AnchorOffsetStart;
            m_anchor_offset = new Vector3(m_anchor_offset.x * m_width,
                                          letter_action.m_letter_anchor_start == (int)TextfxTextAnchor.BaselineLeft || letter_action.m_letter_anchor_start == (int)TextfxTextAnchor.BaselineCenter || letter_action.m_letter_anchor_start == (int)TextfxTextAnchor.BaselineRight
                                                                                                ? 0             // zero because letters are based around the baseline already.
                                                                                                : (effect_manager.IsFontBaseLineSet
                                                                                                                ? (effect_manager.FontBaseLine + m_y_offset) - (m_anchor_offset.y * -m_height)
                                                                                                                : (m_anchor_offset.y * m_height)),      // Legacy effect support when baseline isn't already set.
                                          0);

            if (letter_action.m_letter_anchor_2_way)
            {
                m_anchor_offset = letter_action.AnchorOffsetEnd;
                m_anchor_offset = Vector3.Lerp(m_anchor_offset,
                                               new Vector3(
                                                   m_anchor_offset.x * m_width,
                                                   letter_action.m_letter_anchor_end == (int)TextfxTextAnchor.BaselineLeft || letter_action.m_letter_anchor_end == (int)TextfxTextAnchor.BaselineCenter || letter_action.m_letter_anchor_end == (int)TextfxTextAnchor.BaselineRight
                                                                                                                ? 0             // zero because letters are based around the baseline already.
                                                                                                                : (effect_manager.IsFontBaseLineSet
                                                                                                                                ? (effect_manager.FontBaseLine + m_y_offset) - (m_anchor_offset.y * -m_height)
                                                                                                                                : (m_anchor_offset.y * m_height)),      // Legacy effect support when baseline isn't already set.
                                                   0),
                                               action_progress);
            }


            // Calculate Scale Vector
            from_vec = letter_action.m_start_scale.GetValue(progression_variables, animate_per);
            to_vec   = letter_action.m_end_scale.GetValue(progression_variables, animate_per);

            if (letter_action.m_scale_axis_ease_data.m_override_default)
            {
                m_letter_scale = new Vector3(EffectManager.FloatLerp(from_vec.x, to_vec.x, EasingManager.GetEaseProgress(letter_action.m_scale_axis_ease_data.m_x_ease, linear_progress)),
                                             EffectManager.FloatLerp(from_vec.y, to_vec.y, EasingManager.GetEaseProgress(letter_action.m_scale_axis_ease_data.m_y_ease, linear_progress)),
                                             EffectManager.FloatLerp(from_vec.z, to_vec.z, EasingManager.GetEaseProgress(letter_action.m_scale_axis_ease_data.m_z_ease, linear_progress)));
            }
            else
            {
                m_letter_scale = EffectManager.Vector3Lerp(
                    from_vec,
                    to_vec,
                    action_progress);
            }

            // Calculate Rotation
            from_vec = letter_action.m_start_euler_rotation.GetValue(progression_variables, animate_per);
            to_vec   = letter_action.m_end_euler_rotation.GetValue(progression_variables, animate_per);

            if (letter_action.m_rotation_axis_ease_data.m_override_default)
            {
                m_letter_rotation = Quaternion.Euler
                                    (
                    EffectManager.FloatLerp(from_vec.x, to_vec.x, EasingManager.GetEaseProgress(letter_action.m_rotation_axis_ease_data.m_x_ease, linear_progress)),
                    EffectManager.FloatLerp(from_vec.y, to_vec.y, EasingManager.GetEaseProgress(letter_action.m_rotation_axis_ease_data.m_y_ease, linear_progress)),
                    EffectManager.FloatLerp(from_vec.z, to_vec.z, EasingManager.GetEaseProgress(letter_action.m_rotation_axis_ease_data.m_z_ease, linear_progress))
                                    );
            }
            else
            {
                m_letter_rotation = Quaternion.Euler(
                    EffectManager.Vector3Lerp(
                        from_vec,
                        to_vec,
                        action_progress)
                    );
            }


            // Calculate Position
            if (letter_action.m_start_pos.Progression == ActionPositionVector3Progression.CURVE_OPTION_INDEX || (letter_action.m_offset_from_last && prev_action != null && prev_action.m_end_pos.Progression == ActionPositionVector3Progression.CURVE_OPTION_INDEX))
            {
                from_vec = new Vector3(-m_anchor_offset.x, m_base_offset.y, 0);
            }
            else if (letter_action.m_start_pos.ForcePositionOverride)
            {
                from_vec = new Vector3(-m_anchor_offset.x, 0, 0);
            }
            else
            {
                from_vec = BaseOffset;
            }

            from_vec += letter_action.m_start_pos.GetValue(progression_variables, animate_per);

            if (letter_action.m_end_pos.Progression == ActionPositionVector3Progression.CURVE_OPTION_INDEX || (letter_action.m_end_pos.IsOffsetFromLast && letter_action.m_start_pos.Progression == ActionPositionVector3Progression.CURVE_OPTION_INDEX))
            {
                to_vec = new Vector3(-m_anchor_offset.x, m_base_offset.y, 0);
            }
            else if (letter_action.m_end_pos.ForcePositionOverride)
            {
                to_vec = new Vector3(-m_anchor_offset.x, 0, 0);
            }
            else
            {
                to_vec = BaseOffset;
            }

            to_vec += letter_action.m_end_pos.GetValue(progression_variables, animate_per);

            if (letter_action.m_position_axis_ease_data.m_override_default)
            {
                m_letter_position = new Vector3(EffectManager.FloatLerp(from_vec.x, to_vec.x, EasingManager.GetEaseProgress(letter_action.m_position_axis_ease_data.m_x_ease, linear_progress)),
                                                EffectManager.FloatLerp(from_vec.y, to_vec.y, EasingManager.GetEaseProgress(letter_action.m_position_axis_ease_data.m_y_ease, linear_progress)),
                                                EffectManager.FloatLerp(from_vec.z, to_vec.z, EasingManager.GetEaseProgress(letter_action.m_position_axis_ease_data.m_z_ease, linear_progress)));
            }
            else
            {
                m_letter_position = EffectManager.Vector3Lerp(
                    from_vec,
                    to_vec,
                    action_progress);
            }

            // Calculate letter center position
            m_letter_center  = new Vector3(m_width / 2, m_height / 2, 0);
            m_letter_center -= m_anchor_offset;
            m_letter_center  = Vector3.Scale(m_letter_center, m_letter_scale);
            m_letter_center  = m_letter_rotation * m_letter_center;
            m_letter_center += m_anchor_offset + m_letter_position;


            if (mesh_verts == null || mesh_verts.Length == 0)
            {
                mesh_verts = new Vector3[4];
            }
            for (int idx = 0; idx < 4; idx++)
            {
                mesh_verts[idx] = m_base_vertices[idx];

                // normalise vert position to the anchor point before scaling and rotating.
                mesh_verts[idx] -= m_anchor_offset;

                // Scale verts
                mesh_verts[idx] = Vector3.Scale(mesh_verts[idx], m_letter_scale);

                // Rotate vert
                mesh_verts[idx] = m_letter_rotation * mesh_verts[idx];

                mesh_verts[idx] += m_anchor_offset;

                // translate vert
                mesh_verts[idx] += m_letter_position;
            }
            m_mesh.vertices = mesh_verts;



            // Sort out letters colour
            if (letter_action.m_use_gradient_start)
            {
                start_colour = letter_action.m_start_vertex_colour.GetValue(progression_variables, animate_per);
            }
            else
            {
                start_colour = new VertexColour(letter_action.m_start_colour.GetValue(progression_variables, animate_per));
            }

            if (letter_action.m_use_gradient_end)
            {
                end_colour = letter_action.m_end_vertex_colour.GetValue(progression_variables, animate_per);
            }
            else
            {
                end_colour = new VertexColour(letter_action.m_end_colour.GetValue(progression_variables, animate_per));
            }

            if (!m_flipped)
            {
                m_mesh.colors = new Color[] {
                    Color.Lerp(start_colour.top_right, end_colour.top_right, action_progress),
                    Color.Lerp(start_colour.top_left, end_colour.top_left, action_progress),
                    Color.Lerp(start_colour.bottom_left, end_colour.bottom_left, action_progress),
                    Color.Lerp(start_colour.bottom_right, end_colour.bottom_right, action_progress)
                };
            }
            else
            {
                m_mesh.colors = new Color[] {
                    Color.Lerp(start_colour.top_left, end_colour.top_left, action_progress),
                    Color.Lerp(start_colour.bottom_left, end_colour.bottom_left, action_progress),
                    Color.Lerp(start_colour.bottom_right, end_colour.bottom_right, action_progress),
                    Color.Lerp(start_colour.top_right, end_colour.top_right, action_progress)
                };
            }
        }
        public void PrepareData(ref LetterSetup[] letters, int num_letters, int num_words, int num_lines, LetterAction prev_action, AnimatePerOptions animate_per, bool prev_action_end_state = true)
        {
            m_duration_progression.CalculateProgressions(GetProgressionTotal(num_letters, num_words, num_lines, animate_per, m_duration_progression.AnimatePer, m_duration_progression.OverrideAnimatePerOption));


            if (m_audio_effects != null)
            {
                foreach (AudioEffectSetup effect_setup in m_audio_effects)
                {
                    effect_setup.m_delay.CalculateProgressions(GetProgressionTotal(num_letters, num_words, num_lines, animate_per, effect_setup.m_delay.AnimatePer, effect_setup.m_delay.OverrideAnimatePerOption));
                    effect_setup.m_offset_time.CalculateProgressions(GetProgressionTotal(num_letters, num_words, num_lines, animate_per, effect_setup.m_offset_time.AnimatePer, effect_setup.m_offset_time.OverrideAnimatePerOption));
                    effect_setup.m_volume.CalculateProgressions(GetProgressionTotal(num_letters, num_words, num_lines, animate_per, effect_setup.m_volume.AnimatePer, effect_setup.m_volume.OverrideAnimatePerOption));
                    effect_setup.m_pitch.CalculateProgressions(GetProgressionTotal(num_letters, num_words, num_lines, animate_per, effect_setup.m_pitch.AnimatePer, effect_setup.m_pitch.OverrideAnimatePerOption));
                }
            }

            if (m_particle_effects != null)
            {
                foreach (ParticleEffectSetup effect_setup in m_particle_effects)
                {
                    effect_setup.m_position_offset.CalculateProgressions(GetProgressionTotal(num_letters, num_words, num_lines, animate_per, effect_setup.m_position_offset.AnimatePer, effect_setup.m_position_offset.OverrideAnimatePerOption), null);
                    effect_setup.m_rotation_offset.CalculateProgressions(GetProgressionTotal(num_letters, num_words, num_lines, animate_per, effect_setup.m_rotation_offset.AnimatePer, effect_setup.m_rotation_offset.OverrideAnimatePerOption), null);
                    effect_setup.m_delay.CalculateProgressions(GetProgressionTotal(num_letters, num_words, num_lines, animate_per, effect_setup.m_delay.AnimatePer, effect_setup.m_delay.OverrideAnimatePerOption));
                    effect_setup.m_duration.CalculateProgressions(GetProgressionTotal(num_letters, num_words, num_lines, animate_per, effect_setup.m_duration.AnimatePer, effect_setup.m_duration.OverrideAnimatePerOption));
                }
            }

            if (m_action_type == ACTION_TYPE.BREAK)
            {
                return;
            }

            m_delay_progression.CalculateProgressions(GetProgressionTotal(num_letters, num_words, num_lines, animate_per, m_delay_progression.AnimatePer, m_delay_progression.OverrideAnimatePerOption));


            if (m_offset_from_last && prev_action != null)
            {
                m_use_gradient_start = prev_action.m_use_gradient_end;

                if (prev_action_end_state)
                {
                    if (m_use_gradient_start)
                    {
                        m_start_vertex_colour.Values = prev_action.m_end_vertex_colour.Values;
                    }
                    else
                    {
                        m_start_colour.Values = prev_action.m_end_colour.Values;
                    }
                }
                else
                {
                    if (m_use_gradient_start)
                    {
                        m_start_vertex_colour.Values = prev_action.m_start_vertex_colour.Values;
                    }
                    else
                    {
                        m_start_colour.Values = prev_action.m_start_colour.Values;
                    }
                }
            }
            else
            {
                if (m_use_gradient_start || (prev_action != null && (prev_action.m_use_gradient_end)))
                {
                    if (!m_use_gradient_start)
                    {
                        // Need to convert flat colour into a vertex colour
                        m_use_gradient_start = true;

                        m_start_vertex_colour.ConvertFromFlatColourProg(m_start_colour);
                    }

                    // add this colour to previous state
                    m_start_vertex_colour.CalculateProgressions(GetProgressionTotal(num_letters, num_words, num_lines, animate_per, m_start_vertex_colour.AnimatePer, m_start_vertex_colour.OverrideAnimatePerOption),
                                                                prev_action != null && (prev_action.m_use_gradient_end) ? prev_action.m_end_vertex_colour.Values : null,
                                                                prev_action != null && (!prev_action.m_use_gradient_end) ? prev_action.m_end_colour.Values : null);
                }
                else
                {
                    m_start_colour.CalculateProgressions(GetProgressionTotal(num_letters, num_words, num_lines, animate_per, m_start_colour.AnimatePer, m_start_colour.OverrideAnimatePerOption),
                                                         prev_action != null ? prev_action.m_end_colour.Values : null);
                }
            }

            if (m_use_gradient_end || m_use_gradient_start)
            {
                if (!m_use_gradient_end)
                {
                    // Need to convert flat colour into a vertex colour
                    m_use_gradient_end = true;

                    m_end_vertex_colour.ConvertFromFlatColourProg(m_end_colour);
                }

                m_end_vertex_colour.CalculateProgressions(GetProgressionTotal(num_letters, num_words, num_lines, animate_per, m_end_vertex_colour.AnimatePer, m_end_vertex_colour.OverrideAnimatePerOption),
                                                          (m_use_gradient_start) ? m_start_vertex_colour.Values : null,
                                                          (!m_use_gradient_start) ? m_start_colour.Values : null);
            }
            else
            {
                m_end_colour.CalculateProgressions(GetProgressionTotal(num_letters, num_words, num_lines, animate_per, m_end_colour.AnimatePer, m_end_colour.OverrideAnimatePerOption),
                                                   m_start_colour.Values);
            }


            if (m_offset_from_last && prev_action != null)
            {
                m_start_pos.Values            = prev_action_end_state ? prev_action.m_end_pos.Values : prev_action.m_start_pos.Values;
                m_start_euler_rotation.Values = prev_action_end_state ? prev_action.m_end_euler_rotation.Values : prev_action.m_start_euler_rotation.Values;
                m_start_scale.Values          = prev_action_end_state ? prev_action.m_end_scale.Values : prev_action.m_start_scale.Values;
            }
            else
            {
                float[] start_pos_curve_letter_progressions = null;
                if (m_start_pos.Progression == ActionPositionVector3Progression.CURVE_OPTION_INDEX)
                {
                    // Pre calculate letter progression values based on letter spacing
                    start_pos_curve_letter_progressions = m_start_pos.BezierCurve.GetLetterProgressions(ref letters, m_letter_anchor_start);
                }

                m_start_pos.CalculatePositionProgressions(ref start_pos_curve_letter_progressions, GetProgressionTotal(num_letters, num_words, num_lines, animate_per, m_start_pos.AnimatePer, m_start_pos.OverrideAnimatePerOption),
                                                          prev_action != null ? prev_action.m_end_pos.Values : new Vector3[] { Vector3.zero });
                m_start_euler_rotation.CalculateRotationProgressions(ref start_pos_curve_letter_progressions, GetProgressionTotal(num_letters, num_words, num_lines, animate_per, m_start_euler_rotation.AnimatePer, m_start_euler_rotation.OverrideAnimatePerOption),
                                                                     prev_action != null ? prev_action.m_end_euler_rotation.Values : new Vector3[] { Vector3.zero },
                                                                     m_start_pos.Progression == ActionPositionVector3Progression.CURVE_OPTION_INDEX ? m_start_pos.BezierCurve : null);
                m_start_scale.CalculateProgressions(GetProgressionTotal(num_letters, num_words, num_lines, animate_per, m_start_scale.AnimatePer, m_start_scale.OverrideAnimatePerOption),
                                                    prev_action != null ? prev_action.m_end_scale.Values : new Vector3[] { Vector3.zero });
            }

            float[] end_pos_curve_letter_progressions = null;
            if (m_end_pos.Progression == ActionPositionVector3Progression.CURVE_OPTION_INDEX)
            {
                // Pre calculate letter progression values based on letter spacing
                end_pos_curve_letter_progressions = m_end_pos.BezierCurve.GetLetterProgressions(ref letters, m_letter_anchor_end);
            }

            m_end_pos.CalculatePositionProgressions(ref end_pos_curve_letter_progressions, GetProgressionTotal(num_letters, num_words, num_lines, animate_per, m_end_pos.AnimatePer, m_end_pos.OverrideAnimatePerOption), m_start_pos.Values);
            m_end_euler_rotation.CalculateRotationProgressions(ref end_pos_curve_letter_progressions, GetProgressionTotal(num_letters, num_words, num_lines, animate_per, m_end_euler_rotation.AnimatePer, m_end_euler_rotation.OverrideAnimatePerOption),
                                                               m_start_euler_rotation.Values,
                                                               m_end_pos.Progression == ActionPositionVector3Progression.CURVE_OPTION_INDEX ? m_end_pos.BezierCurve : null);
            m_end_scale.CalculateProgressions(GetProgressionTotal(num_letters, num_words, num_lines, animate_per, m_end_scale.AnimatePer, m_end_scale.OverrideAnimatePerOption), m_start_scale.Values);

            CalculateLetterAnchorOffset();
        }
示例#24
0
		void SetCurrentLetterAction(LetterAction letter_action, AnimatePerOptions animate_per)
		{	
			m_current_letter_action = letter_action;

			if(letter_action.m_action_type == ACTION_TYPE.ANIM_SEQUENCE)
			{
				m_action_delay = Mathf.Max(m_current_letter_action.m_delay_progression.GetValue(m_progression_variables, m_last_animate_per), 0);
			}
			m_action_duration = Mathf.Max(m_current_letter_action.m_duration_progression.GetValue(m_progression_variables, m_last_animate_per), 0);
			
			// Check if action is in a loopreverse_onetime delay case. If so, set delay to 0.
			if(	m_anim_state_vars.m_active_loop_cycles != null &&
				m_anim_state_vars.m_active_loop_cycles.Count > 0 &&
				m_anim_state_vars.m_active_loop_cycles[0].m_delay_first_only &&
				!m_anim_state_vars.m_active_loop_cycles[0].FirstPass &&
				m_current_letter_action.m_delay_progression.Progression != (int) ValueProgression.Constant)
			{
				if(m_anim_state_vars.m_reverse || !m_current_letter_action.m_force_same_start_time)
				{
					m_action_delay = 0;
				}
			}
		}