修了很多bug和增加功能,优化不少问题
This commit is contained in:
@@ -17,6 +17,9 @@ public class readyLetsGo : MonoBehaviour
|
||||
public float startScale = 1.25f;
|
||||
public float endScale = 0.8f;
|
||||
|
||||
[Header("Gameplay Track Intro")]
|
||||
public GameplayTrackStartIntroAnimator gameplayTrackStartIntroAnimator;
|
||||
|
||||
private Coroutine sequenceCoroutine;
|
||||
|
||||
// Prevent re-entry / accidental double-play
|
||||
@@ -58,6 +61,15 @@ public class readyLetsGo : MonoBehaviour
|
||||
isPlaying = false;
|
||||
lastPlayedTime = -10f;
|
||||
playedOnce = false; // allow one play when player initiates
|
||||
|
||||
if (gameplayTrackStartIntroAnimator == null)
|
||||
{
|
||||
gameplayTrackStartIntroAnimator = FindAnyObjectByType<GameplayTrackStartIntroAnimator>();
|
||||
if (gameplayTrackStartIntroAnimator == null)
|
||||
{
|
||||
gameplayTrackStartIntroAnimator = gameObject.AddComponent<GameplayTrackStartIntroAnimator>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -93,6 +105,12 @@ public class readyLetsGo : MonoBehaviour
|
||||
|
||||
isPlaying = true;
|
||||
lastPlayedTime = Time.unscaledTime;
|
||||
|
||||
if (gameplayTrackStartIntroAnimator != null)
|
||||
{
|
||||
gameplayTrackStartIntroAnimator.PlayIfNeeded();
|
||||
}
|
||||
|
||||
sequenceCoroutine = StartCoroutine(PlaySequenceCoroutine());
|
||||
}
|
||||
|
||||
@@ -251,5 +269,6 @@ public class readyLetsGo : MonoBehaviour
|
||||
try { StopCoroutine(sequenceCoroutine); } catch { }
|
||||
sequenceCoroutine = null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user