本文整理汇总了C#中PlayerMovement.ResetPosition方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerMovement.ResetPosition方法的具体用法?C# PlayerMovement.ResetPosition怎么用?C# PlayerMovement.ResetPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerMovement
的用法示例。
在下文中一共展示了PlayerMovement.ResetPosition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnGUI
void OnGUI ()
{
if (displayClearLevel) {
Rect winScreenRect = new Rect ((Screen.width - Screen.width * 0.5f) / 2,
(Screen.height - Screen.height * 0.5f) / 2,
Screen.width * 0.5f, Screen.height * 0.5f);
GUI.Box (winScreenRect, "Level Accomplished", guiSkin.GetStyle ("box"));
if (newHighScoreFound) {
GUI.Label (new Rect (winScreenRect.x + winScreenRect.width * 0.5f - winScreenRect.width * 0.5f / 2,
winScreenRect.y + winScreenRect.height * 0.25f + 25,
winScreenRect.width * 0.5f,
100),
" New Record Reached! :)\n\n" + "Score: " + currentScore,
guiSkin.GetStyle ("label"));
} else {
GUI.Label (new Rect (winScreenRect.x + winScreenRect.width * 0.5f - winScreenRect.width * 0.5f / 2,
winScreenRect.y + winScreenRect.height * 0.25f + 25,
winScreenRect.width * 0.5f,
100),
"Score: " + currentScore,
guiSkin.GetStyle ("label"));
}
if (GUI.Button (new Rect (winScreenRect.x + winScreenRect.width * 0.25f - winScreenRect.width * 0.3f / 2,
winScreenRect.y + winScreenRect.height * 0.75f,
winScreenRect.width * 0.3f,
40),
"Back to Menu",
guiSkin.GetStyle ("button"))) {
gameManager.SetHighScore (currentScore);
fading.LoadSceneWrapperWrapper (0);
}
if (GUI.Button (new Rect (winScreenRect.x + winScreenRect.width * 0.25f - winScreenRect.width * 0.3f / 2 + winScreenRect.width * 0.5f,
winScreenRect.y + winScreenRect.height * 0.75f,
winScreenRect.width * 0.3f, 40),
"Next Level!",
guiSkin.GetStyle ("button"))) {
currentSpawnRockQuantity++;
if (mode == 2)
{
if (autoShootingDetectAngle >= 5.0f)
{
autoShootingDetectAngle -= autoShootingAngleDecreasingStep;
}
else
{
autoShootingModeOn = false;
currentSpawnRockQuantity = 1;
}
}
spawnRockQuantity = currentSpawnRockQuantity;
displayClearLevel = false;
Time.timeScale = 1;
playerMovement = GameObject.FindGameObjectWithTag ("Player").GetComponent<PlayerMovement> ();
playerMovement.ResetPosition ();
playerMovement.SetInvincible ();
}
}
}