本文整理汇总了C#中Puzzle.IsResetable方法的典型用法代码示例。如果您正苦于以下问题:C# Puzzle.IsResetable方法的具体用法?C# Puzzle.IsResetable怎么用?C# Puzzle.IsResetable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Puzzle
的用法示例。
在下文中一共展示了Puzzle.IsResetable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PuzzleCompleted
public void PuzzleCompleted(Puzzle puzzle)
{
if (isGameOver) {
Debug.Log("GAME OVER!!! Let the player know!!");
return;
}
var growthIncrement = puzzle.puzzleWeight / weightedIncrementTotal;
growthIncrement *= 2;
// Notify room of growth increment
wallMgr.Resize(wallMgr.transformRoom + growthIncrement);
KickOffSoundForPuzzle(puzzle);
if (puzzle.IsResetable() && puzzles.Contains(puzzle)) {
Debug.Log("Puzzle marked for reset");
puzzle.MarkForReset();
}
AdjustHighlightColor(puzzle);
// Remove the puzzle, but also allow it to remain in the list multiple times
puzzles.Remove(puzzle);
Debug.Log("Finished puzzle: "+puzzle+", "+puzzles.Count+" left, room growing to: "+(wallMgr.transformRoom + growthIncrement));
if (puzzles.Count == 1) {
Debug.Log("Final puzzle: "+puzzles[0]);
} else if (puzzles.Count == 0) {
isGameOver = true;
}
if (isGameOver) {
StopAllCoroutines(); // Turn off sounds
if (puzzleWinSound) {
puzzleWinSound.Stop();
}
isGameOver = true;
uiManager.SetInstructionsForTime("Well done, you've brought order to chaos!", 15f);
AudioSource finalSource = GetComponentInParent<AudioSource>();
if (finalSource) {
finalSource.Play();
}
}
}