当前位置: 首页>>代码示例>>C#>>正文


C# Puzzle.IsResetable方法代码示例

本文整理汇总了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();
			}
		}
	}
开发者ID:gadauto3,项目名称:OCDEscape,代码行数:45,代码来源:PuzzleMaster.cs


注:本文中的Puzzle.IsResetable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。