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


C# Token.getName方法代码示例

本文整理汇总了C#中Token.getName方法的典型用法代码示例。如果您正苦于以下问题:C# Token.getName方法的具体用法?C# Token.getName怎么用?C# Token.getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Token的用法示例。


在下文中一共展示了Token.getName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnGUI

    //And now the OnGUI.

    void OnGUI()
    {
        int buttonCount = 0;
        //Let's draw a meter to handle the Flow thingy! And I'm gonna put it in a block to limit the scope of the variables. At least I hope that's how it works.
        {
            //Variables to handle positioning and scaling for the back-bar and the front-bar.
            int barLeft = Screen.width / 4;
            int barTop = 20;
            int barWidth = (Screen.width / 2) - 20;
            int barHeight = Screen.height / 50;

            //GUI.Label(new Rect(barLeft, barTop, barWidth, barHeight), "THE END IS NEVER THE END IS NEVER THE END IS NEVER THE END IS NEVER THE END IS NEVER THE END IS NEVER THE END IS NEVER THE END IS NEVER ");
            //GUI.Label(new Rect(barLeft, barTop, barWidth, barHeight), "", backBarGUIStyle);

            GUI.color = Color.black;
            GUI.DrawTexture(new Rect(barLeft, barTop, barWidth, barHeight), blackPixelTex);
            GUI.color = Color.white;
            GUI.DrawTexture(new Rect(barLeft, barTop, barWidth * ((float)flow / maxflow), barHeight), orangePixelTex);
            GUI.color = Color.white;
        }
        
        /*if (GUI.Button(Rect(10,10,150,100), "I am a button"))
        {
            print ("You clicked the button!");
        }*/
        
        if (DEBUGGING)
        {
            if (null != recentTokenSelection)
            {
                GUI.Label(new Rect(500, 10, 100, 100), "DBGU: " + recentTokenSelection.ToString());
            }
        }
        
        {
            int barLeft = Screen.width / 4;
            int barTop = 50;
            int barWidth = (Screen.width / 2) - 20;
            int barHeight = Screen.height / 10;

            GUI.Label(new Rect(barLeft, barTop, barWidth, barHeight), "Turn Order: " + time.ToString() + " " + theTurnList.ToString());
        }
        //Draw the Flow meter. Or at least, it would be nice to make this a meter later.
        GUI.Label(new Rect(Screen.width - (Screen.width / 20), 20, 100, 30), flow + " / " + maxflow);
        
        
        
        //GUI.Label(new Rect (100, 100, 1000, 1000), theTurnList.turns[1].ToString());
        //GUI.Label(new Rect (100, 100, 100, 100), "My frothing demand for explosions increases.");

        //The remaining buttons are dependant on the state of the game.

        //----------------------{START OF GAME STATE: PLAYING}---------------------
        switch (gameState)
        {
            case GameStates.PLAYING:
                if (GUI.Button(new Rect(10, 10 + (Screen.height / 20) * buttonCount, (Screen.width / 10), (Screen.height / 20)), "Move"))
                {
                    if (DEBUGGING)
                    {
                        log("BUTTON RELEASED");
                        log(time.ToString() + ": Button Released.");
                    }
                    //Do stuff.
                    if (firstCellSelection != null)
                    {
                        playButtonSound();
                        nextTurnButtonResponse();
                        if (playerCharacter.currentCell)
                        {
                            playerCharacter.currentCell.giveTokenToDifferentCell(playerCharacter, firstCellSelection);
                        }
                        //playerCharacter.jumpToPosition(firstCellSelection.rigidbody.position);
                        string output = "The player moves."; //REMINDER: The first thing the player clicks will be OLD, and the second thing will be the most recent. We want the older thing to deal damage to the newer thing.
                        log(output);
                
                    }
                }

                buttonCount++; //Increment this to boost the offset. This is the first time we do this, so this should be 1. We're multiplying by the offset below.
                if (GUI.Button(new Rect(10, 10 + (Screen.height / 20) * buttonCount, (Screen.width / 10), (Screen.height / 20)), "Attack"))
                {
                //Rather than replace the references to previousTokenSelection with playerCharacter, it'll be enforced by replacing the value of previousTokenSelection with the player character.
                    previousTokenSelection = playerCharacter;
                    if (DEBUGGING)
                    {
                        log("BUTTON RELEASED");
                        log(time.ToString() + ": Button Released.");
                    }
                    //Do stuff.
                    if (recentTokenSelection != null && previousTokenSelection != null)
                    {
                        playButtonSound();

                        string damageString = recentTokenSelection.takeDamage(previousTokenSelection.potency); //REMINDER: The first thing the player clicks will be OLD, and the second thing will be the most recent. We want the older thing to deal damage to the newer thing.
                        log(previousTokenSelection.getName() + " attacks " + recentTokenSelection.getName() + " for " + damageString + " damage.");
                        nextTurnButtonResponse(); //This should be the last thing to happen after clicking the buttons.
                
//.........这里部分代码省略.........
开发者ID:Retl,项目名称:SuperBunnyBusterIITurboBounceCarrotEdition,代码行数:101,代码来源:GameControllerScript.cs


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