コード例 #1
0
        void PlayTimer_Tick(object sender, EventArgs e)
        {
            if (Timelines_Grid.ActualWidth - 5 > PlayLine.X1)
            {
                PlayLine.X1 += 1; PlayLine.X2 += 1; PlayLine.BringIntoView(new Rect(PlayLine.X1, PlayLine.Y1, 2, 100));
            }
            else
            {
                PlayerTimer.Stop(); ActiveTBblocks.Clear();
            }

            //scan EVERY timeline for active blocks.
            foreach (Timeline tline in timelines)
            {
                if (tline.ActiveBlock == null)
                {
                    continue;
                }

                double time = (PlayLine.X1) * (1.0 / TimeWidth);
                if (time >= tline.ActiveBlock.Value.StartTime && time <= tline.ActiveBlock.Value.EndTime && !ActiveTBblocks.Contains(tline.ActiveBlock.Value))                  //add
                {
                    ActiveTBblocks.Add(tline.ActiveBlock.Value); tline.SetActiveBlock(time);
                }
                else if (time > tline.ActiveBlock.Value.EndTime && ActiveTBblocks.Contains(tline.ActiveBlock.Value))                //remove
                {
                    ActiveTBblocks.Remove(tline.ActiveBlock.Value); tline.SetActiveBlock(time);
                }
            }
        }
コード例 #2
0
    private void UpdateEmotion(PlayLine line)
    {
        if (line == null)
        {
            return;
        }

        if (role == Role.Chorus || line.Speaker == role)
        {
            if (facesByEmotion.ContainsKey(line.Emote))
            {
                FaceRenderer.sprite = facesByEmotion[line.Emote];
            }
        }
        else
        {
            if (facesByEmotion.ContainsKey(Emotions.None))
            {
                FaceRenderer.sprite = facesByEmotion[Emotions.None];
            }
        }
        if (mark != null)
        {
            mark.gameObject.SetActive(false);
        }
    }
コード例 #3
0
 void UpdateText(PlayLine newLine)
 {
     if (newLine == null)
     {
         display.text = "";
     }
     else
     {
         string newText = string.Format("{0}:\n{1}\n{2}", newLine.Speaker, newLine.LineOneText, newLine.LineTwoText);
         display.text = newText;
     }
 }
コード例 #4
0
    private void UpdateMainActorStance(PlayLine line)
    {
        if (line == null)
        {
            return;
        }

        if (line.Speaker == role)
        {
            spotlight.SetActive(true);
        }
        else
        {
            spotlight.SetActive(false);
        }
    }