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


C# Tile.Remove方法代码示例

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

示例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");
    }
开发者ID:jt7777,项目名称:avmemo,代码行数:85,代码来源:Grid.cs


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