Example #1
0
    private void DrawAllSnippetFields()
    {
        List <AnimSnippet>  newAnimSnippets  = new List <AnimSnippet>();
        List <AudioSnippet> newAudioSnippets = new List <AudioSnippet>();

        if (story.animSnippets != null)
        {
            foreach (AnimSnippet animSnippet in story.animSnippets)
            {
                AnimSnippet newSnippet = null;
                Animator    anim       = animSnippet.anim;
                string      trigger    = animSnippet.trigger;
                float       time       = animSnippet.startTime;
                newSnippet = DrawAnimSnippetField(anim, trigger, time);

                if (newSnippet != null)
                {
                    newAnimSnippets.Add(newSnippet);
                }
            }
        }

        AnimSnippet newBlankAnimSnippet = DrawAnimSnippetField(null, null, 0);

        if (newBlankAnimSnippet != null)
        {
            newAnimSnippets.Add(newBlankAnimSnippet);
        }

        if (story.audioSnippets != null)
        {
            foreach (AudioSnippet audioSnippet in story.audioSnippets)
            {
                AudioSnippet newSnippet = null;
                AudioSource  audio      = audioSnippet.audio;
                float        time       = audioSnippet.startTime;
                newSnippet = DrawAudioSnippetField(audio, time);

                if (newSnippet != null)
                {
                    newAudioSnippets.Add(newSnippet);
                }
            }
        }

        AudioSnippet newBlankAudioSnippet = DrawAudioSnippetField(null, 0);

        if (newBlankAudioSnippet != null)
        {
            newAudioSnippets.Add(newBlankAudioSnippet);
        }

        story.UpdateAnimSnippets(newAnimSnippets);
        story.UpdateAudioSnippets(newAudioSnippets);
    }
Example #2
0
    public void AddAudioSnippet(AudioSource audio, float relativeStartTime)
    {
        AudioSnippet newSnippet = new AudioSnippet(audio, relativeStartTime);

        audioSnippets.Add(newSnippet);
    }