本文整理汇总了C#中PlayMode.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# PlayMode.Equals方法的具体用法?C# PlayMode.Equals怎么用?C# PlayMode.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayMode
的用法示例。
在下文中一共展示了PlayMode.Equals方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Update
void Update()
{
if (settings != null)
{
if (!tagarela.isPlaying && playMode != PlayMode.stopped)
{
if (playMode != PlayMode.currentTime)
{
if (SelectedAudioclip != null)
{
if (tagarela.audio.clip == null) tagarela.audio.clip = SelectedAudioclip;
tagarela.audio.Stop();
tagarela.audio.Play();
}
tagarela.StartTimer();
}
tagarela.isPlaying = true;
updateTimeline = true;
}
switch (playMode)
{
case PlayMode.all:
if (tagarela.getTimer() >= tagarela.settings.animationTime - 0.01f)
{
tagarela.setTimer(0);
}
timeNormalized = tagarela.getTimer() / tagarela.settings.animationTime;
updateMorphValue = tagarela.getTimer();
disableGuiControls = true;
updateMorph = true;
if (SelectedAudioclip != null && !tagarela.audio.isPlaying)
{
tagarela.audio.Stop();
tagarela.audio.Play();
}
break;
case PlayMode.currentTime:
if (SelectedAudioclip != null) tagarela.audio.Play();
playMode = !guiTimeline.isDragging && !guiTimelineSegment.isDragging ? PlayMode.stopped : playMode;
if (tagarela.audio.clip != null && SelectedAudioclip != null)
{
tagarela.PreviewAudio(updateMorphValue);
}
else
{
tagarela.setTimer(updateMorphValue);
}
disableGuiControls = false;
break;
case PlayMode.segment:
float valueA = guiTimelineSegment.KeyframeSet[0].Value;
float valueB = guiTimelineSegment.KeyframeSet[1].Value;
if (tagarela.getTimer() < valueA)
{
timeNormalized = 0f;
tagarela.setTimer(valueA);
}
else if (tagarela.getTimer() > valueB)
{
timeNormalized = 0f;
tagarela.setTimer(valueA);
}
else
{
timeNormalized = (tagarela.getTimer() - valueA) / tagarela.settings.animationTime;
}
updateMorphValue = tagarela.getTimer();
updateMorph = true;
disableGuiControls = true;
break;
}
if (updateTimeline) UpdateTimeline();
if (updateMorph) UpdateMorph();
if (tagarela.isPlaying)
{
if (playMode.Equals(PlayMode.stopped))
{
tagarela.isPlaying = false;
tagarela.audio.Stop();
lastKeyframeSelected = -1;
timeNormalized = 0f;
updateMorphValue = 0f;
updateMorph = false;
disableGuiControls = false;
}
}
}
//.........这里部分代码省略.........