本文整理汇总了C#中Note.GetAngle方法的典型用法代码示例。如果您正苦于以下问题:C# Note.GetAngle方法的具体用法?C# Note.GetAngle怎么用?C# Note.GetAngle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Note
的用法示例。
在下文中一共展示了Note.GetAngle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Update
void Update()
{
if (restart && Notes.Count == 0) {
}
wait += Time.deltaTime;
if (wait < waitTime) {
return;
}
// hide notes
float currentAngle = GetCurrentAngle ();
float disappearLimitBegin = currentAngle - behindPoleBegin;
float disappearLimitEnd = currentAngle - behindPoleEnd;
if (disappearLimitBegin < 0.0f)
{
disappearLimitBegin += 360.0f;
}
if (disappearLimitEnd < 0.0f)
{
disappearLimitEnd += 360.0f;
}
for (int i = Notes.Count - 1; i >= 0; --i)
{
note = Notes [i];
if (note.Played)
{
float noteAngle = note.GetAngle ();
if ((disappearLimitEnd > disappearLimitBegin && disappearLimitEnd < noteAngle + 360.0f && noteAngle < disappearLimitBegin)
|| (disappearLimitEnd < disappearLimitBegin && disappearLimitEnd < noteAngle && noteAngle < disappearLimitBegin))
{
note.gameObject.SetActive (false);
Notes.RemoveAt (i);
AvailableNotes.Add (note);
}
}
}
// create notes
if (currentNote)
{
float lengthAngleDiff = currentNote.NoteSetting.Length * noteLength;
float currentNoteAngle = currentNote.GetAngle ();
if (currentNoteAngle > currentAngle)
{
currentNoteAngle -= 360.0f;
}
float currentLength = currentNoteAngle - currentAngle + creationAngle;
if (currentLength >= lengthAngleDiff)
{
currentNote = CreateNote (noteManager.GetNextNote (), currentNoteAngle - lengthAngleDiff);
}
}
else
{
currentNote = CreateNote (noteManager.GetNextNote (), currentAngle + creationAngle);
}
}