本文整理汇总了C#中Tile.Remove方法的典型用法代码示例。如果您正苦于以下问题:C# Tile.Remove方法的具体用法?C# Tile.Remove怎么用?C# Tile.Remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tile
的用法示例。
在下文中一共展示了Tile.Remove方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FoundMatch
IEnumerator FoundMatch(Tile a, Tile b)
{
yield return new WaitForSeconds(0.5f);
// remove them,
a.Remove ();
b.Remove ();
// play video
yield return StartCoroutine(videoPlayer.Play(a.data.movie));
}
示例2: GameLogic
IEnumerator GameLogic()
{
var foundList = new List<TileData>();
int usedTries = 0;
var startTime = Time.time;
if(autoMode)
{
yield return new WaitForSeconds(0.5f);
var tmp = ConvertToList(tiles);
while(remainingPairs > 0) {
first = tmp.First (x => !x.solved);
second = tmp.FindLast(x => TileData.Matches (first.data, x.data));
first.Show ();
yield return new WaitForSeconds(0.5f);
second.Show ();
yield return new WaitForSeconds(0.5f);
first.Remove ();
second.Remove ();
foundList.Add (first.data);
remainingPairs--;
// hack to not destroy the highscore
usedTries += 10;
startTime -= 10;
}
}
else
while(remainingPairs > 0)
{
// wait for first tile
while(clickedTile == null) yield return null;
first = clickedTile; clickedTile = null;
if(second != null) second.FadeOut();
first.Show ();
// wait for second
while(clickedTile == null || clickedTile == first) yield return null;
second = clickedTile; clickedTile = null;
if(first != null) first.FadeOut();
var tilesMatch = TileData.Matches(first.data, second.data);
// play audio of second tile only if they don't match
// - otherwise sound is played with the video
second.Show (!tilesMatch);
// compare their content
if(tilesMatch) {
foundList.Add (first.data);
yield return StartCoroutine(FoundMatch(first, second));
// add score
remainingPairs--;
}
else {
yield return StartCoroutine(NoMatch(first, second));
}
usedTries++;
}
var usedTime = Time.time - startTime;
yield return new WaitForSeconds(0.5f);
// playing single video list
// yield return StartCoroutine(videoPlayer.PlayList(foundList.Select (x => x.movie).ToArray()));
// playing composition
yield return StartCoroutine(videoPlayer.Play(foundList.Select (x => x.movie).ToArray()));
// game is over - do some cool stuff
print ("game over! thanks for playing!");
// show usedTime and usedTries
print ("used time: " + usedTime + ", " + "usedTries: " + usedTries);
highscoreHandler.ShowResult(usedTime, usedTries);
// Application.LoadLevel ("menu");
}