本文整理汇总了C#中GameManager.Reset方法的典型用法代码示例。如果您正苦于以下问题:C# GameManager.Reset方法的具体用法?C# GameManager.Reset怎么用?C# GameManager.Reset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameManager
的用法示例。
在下文中一共展示了GameManager.Reset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
void Start()
{
gm = GameManager.GetInstance();
windowrect = new Rect(Screen.width / 2f - 150f, Screen.height / 2f - 160f, 300f, 375f);
gm.Reset();
}
示例2: Awake
void Awake()
{
startingPosition = transform.position;
daysRemaining = GameObject.Find("RemainingDays").GetComponent<DayCounterScript>();
eventSystem = GameObject.Find("EventSystem");
mplayer = GameObject.Find("PersistentDataObject").GetComponent<MusicPlayer>();
clock = GameObject.Find("Clock").GetComponent<ClockManager>();
pointer = GetComponent<SliderController>();
animator = GetComponent<Animator>();
gameManager = FindObjectOfType<GameManager>();
dialogController.gameObject.SetActive(true);
playerOrientation = PlayerOrientation.Down;
screenFader = GameObject.Find("Fader").GetComponent<ScreenFader>();
isForceSleeping = (PlayerPrefs.GetInt(Constants.Prefs.FORCE_SLEEPING, Constants.Prefs.Defaults.FORCE_SLEEPING) == 1);
bool hasSavedGame = (PlayerPrefs.GetFloat(Constants.Prefs.GAME_TIME, Constants.Prefs.Defaults.GAME_TIME) > 0);
if(hasSavedGame)
{
LoadPlayerData();
}
bool hasChangedFloor = PlayerPrefs.GetInt(Constants.Prefs.CHANGING_FLOOR, Constants.Prefs.Defaults.CHANGING_FLOOR) == 1;
if(isForceSleeping)
{
gameManager.Reset();
daysRemaining.ShowRemainingDays();
StartCoroutine(DisplayDailyMessage());
isForceSleeping = false;
PlayerPrefs.SetInt(Constants.Prefs.FORCE_SLEEPING, Constants.Prefs.Defaults.FORCE_SLEEPING);
SavePlayerData();
}
else if (hasChangedFloor)
{
mplayer.StopLoopedFootsteps();
transform.position = new Vector3(-0.86f, 3.88f, 0f);
playerOrientation = PlayerOrientation.Right;
PlayerPrefs.SetInt(Constants.Prefs.CHANGING_FLOOR, Constants.Prefs.Defaults.CHANGING_FLOOR);
SavePlayerData();
}
UpdatePlayerAnimation(playerOrientation, false);
}