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);
                    }
                }
            }
        }
Example #2
0
    public void SoftReset(LetterAction prev_action, AnimationProgressionVariables progression_variables, AnimatePerOptions animate_per, bool first_action = false)
    {
        if (m_use_gradient || 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.m_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.m_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.m_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.m_values : null);
            }
            if (m_start_scale.UniqueRandom)
            {
                m_start_scale.CalculateUniqueRandom(progression_variables, animate_per, prev_action != null ? prev_action.m_end_scale.m_values : null);
            }
        }

        // End State Unique Randoms
        if (m_use_gradient || m_use_gradient_end)
        {
            if (m_end_vertex_colour.UniqueRandom)
            {
                m_end_vertex_colour.CalculateUniqueRandom(progression_variables, animate_per, m_start_vertex_colour.m_values);
            }
        }
        else
        {
            if (m_end_colour.UniqueRandom)
            {
                m_end_colour.CalculateUniqueRandom(progression_variables, animate_per, m_start_colour.m_values);
            }
        }
        if (m_end_pos.UniqueRandom)
        {
            m_end_pos.CalculateUniqueRandom(progression_variables, animate_per, m_start_pos.m_values);
        }
        if (m_end_euler_rotation.UniqueRandom)
        {
            m_end_euler_rotation.CalculateUniqueRandom(progression_variables, animate_per, m_start_euler_rotation.m_values);
        }
        if (m_end_scale.UniqueRandom)
        {
            m_end_scale.CalculateUniqueRandom(progression_variables, animate_per, m_start_scale.m_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_on_start != null)
        {
            if (m_audio_on_start_volume.UniqueRandom)
            {
                m_audio_on_start_volume.CalculateUniqueRandom(progression_variables, animate_per);
            }
            if (m_audio_on_start_delay.UniqueRandom)
            {
                m_audio_on_start_delay.CalculateUniqueRandom(progression_variables, animate_per);
            }
            if (m_audio_on_start_offset.UniqueRandom)
            {
                m_audio_on_start_offset.CalculateUniqueRandom(progression_variables, animate_per);
            }
            if (m_audio_on_start_pitch.UniqueRandom)
            {
                m_audio_on_start_pitch.CalculateUniqueRandom(progression_variables, animate_per);
            }
        }
        if (m_audio_on_finish != null)
        {
            if (m_audio_on_finish_volume.UniqueRandom)
            {
                m_audio_on_finish_volume.CalculateUniqueRandom(progression_variables, animate_per);
            }
            if (m_audio_on_finish_delay.UniqueRandom)
            {
                m_audio_on_finish_delay.CalculateUniqueRandom(progression_variables, animate_per);
            }
            if (m_audio_on_finish_offset.UniqueRandom)
            {
                m_audio_on_finish_offset.CalculateUniqueRandom(progression_variables, animate_per);
            }
            if (m_audio_on_finish_pitch.UniqueRandom)
            {
                m_audio_on_finish_pitch.CalculateUniqueRandom(progression_variables, animate_per);
            }
        }

        if (m_emitter_on_start != null)
        {
            if (m_emitter_on_start_offset.UniqueRandom)
            {
                m_emitter_on_start_offset.CalculateUniqueRandom(progression_variables, animate_per, null);
            }
            if (m_emitter_on_start_delay.UniqueRandom)
            {
                m_emitter_on_start_delay.CalculateUniqueRandom(progression_variables, animate_per);
            }
            if (m_emitter_on_start_duration.UniqueRandom)
            {
                m_emitter_on_start_duration.CalculateUniqueRandom(progression_variables, animate_per);
            }
        }
        if (m_emitter_on_finish != null)
        {
            if (m_emitter_on_finish_offset.UniqueRandom)
            {
                m_emitter_on_finish_offset.CalculateUniqueRandom(progression_variables, animate_per, null);
            }
            if (m_emitter_on_finish_delay.UniqueRandom)
            {
                m_emitter_on_finish_delay.CalculateUniqueRandom(progression_variables, animate_per);
            }
            if (m_emitter_on_finish_duration.UniqueRandom)
            {
                m_emitter_on_finish_duration.CalculateUniqueRandom(progression_variables, animate_per);
            }
        }
    }