• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Ui类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Ui的典型用法代码示例。如果您正苦于以下问题:C# Ui类的具体用法?C# Ui怎么用?C# Ui使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Ui类属于命名空间,在下文中一共展示了Ui类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Start

 // Use this for initialization
 void Start()
 {
     _data_manager = GameObject.Find("DataManager").GetComponent<Datamanager>();
     _input_manager = GameObject.Find("InputManager").GetComponent<Inputmanager>();
     _input_manager.OnDoubleClickEvent += OnDoubleClick;
     _ui = GameObject.Find("UIManager").GetComponent<Ui>();
     _starblock = GetComponent<Starblock>();
 }
开发者ID:xiaoshichang,项目名称:destory_star,代码行数:9,代码来源:Scenemanager.cs


示例2: StartenKommandZeigtDieBefragenSeite

        public void StartenKommandZeigtDieBefragenSeite()
        {
            dynamic expandoObject = new ExpandoObject();
            expandoObject.cmd = "Starten";

            // Json functionality available after NuGet installation and deinstallation of Microsoft.AspNet.Web.Helpers.Mvc 2.0.20710
            // System.Web.helpers v1.0.20105.407 is now available in lib-dir - but also not needed as reference.
            var json = JsonExtensions.ToJson(expandoObject);
            Console.WriteLine(json);
            //jsonObject.ToJson();

            var ui = new Ui();
            ui.Process(json);
        }
开发者ID:ralfw,项目名称:madesign.appfragen,代码行数:14,代码来源:UiTest.cs


示例3: Update

        public void Update(Control control, Camera camera, Player player, NpcPackage npcs, Ui.FloatingTextCollection floatingText, ref Map map)
        {
            #region Initialize Weapons

            if (player.Inventory.Quickbar.UsingItem.Type == "useweapon")
            {
                ItemUse use = player.Inventory.Quickbar.UsingItem;
                Weapon weapon = GetWeaponById(int.Parse(use.Value));

                if (weapon.Type.Name == "Sword" && !player.Inventory.Quickbar.IsUsingItem)
                {
                    LiveWeapons.Add(new LiveSword(GetWeaponById(player.Inventory.Quickbar.UsingItem.IntValue),new Vector2(player.Movement.Area.Center.X, player.Movement.Area.Center.Y - 5), player.Movement.Direction));
                    player.Inventory.Quickbar.IsUsingItem = true;
                }

                if (weapon.Type.Name == "Arrow")
                {
                    if(control.currentMouse.LeftButton == ButtonState.Pressed){
                        if(!player.Inventory.Quickbar.IsUsingItem) {
                            player.Inventory.Quickbar.IsUsingItem = true;
                            use.Charge = 10f;
                        } else {
                            use.Charge += 0.1f;
                        }
                    } else {
                        LiveProjectile liveWeapon = new LiveProjectile(Weapons[2], new Vector2(player.Movement.Area.Center.X, player.Movement.Area.Center.Y), (float)use.Charge, control, camera);
                        use.Charge = 0;
                        LiveWeapons.Add(liveWeapon);
                        player.Inventory.Quickbar.IsUsingItem = false;
                        Player = player;
                    }
                }
            }

            #endregion

            #region Update weapons

            for ( int i = 0; i < LiveWeapons.Count; i++)
            {
                if (LiveWeapons[i].Weapon.Type.Name == "Sword")
                {
                    LiveSword weapon = LiveWeapons[i];
                    weapon.Rotation += LiveWeapons[i].Speed;
                    LiveWeapons[i].Location += player.Movement.Moved;
                    if ((LiveWeapons[i].SwingEnd > 0 && LiveWeapons[i].Rotation > LiveWeapons[i].SwingEnd) || (LiveWeapons[i].SwingEnd < 0 && LiveWeapons[i].Rotation < LiveWeapons[i].SwingEnd))
                    {
                        LiveWeapons.RemoveAt(i);
                        player.Inventory.Quickbar.IsUsingItem = false;
                    }
                } else if(LiveWeapons[i].Weapon.Type.Name == "Arrow")
                {
                    LiveProjectile weapon = LiveWeapons[i];
                    if (weapon.Movement.Velocity != Vector2.Zero)
                    {
                        weapon.Movement.Update(map);
                    }
                    else
                    {
                        weapon.TimeToLive -= 1;
                        if (weapon.TimeToLive <= 0) { LiveWeapons.RemoveAt(i); }
                    }
                }
            }

            #endregion

            #region Check for weapon collisions

            // Npc Collisions
            for (int w = 0; w < LiveWeapons.Count; w++)
            {

                var weapon = LiveWeapons[w];
                for (int i = 0; i < npcs.ActiveNpcs.Count; i++)
                {

                    if (weapon.Weapon.Type.Name == "Sword")
                    {
                        LiveSword sword = weapon;
                        if (weapon.currentLocation.Intersects(npcs.ActiveNpcs[i].Movement.Area))
                        {
                            if (npcs.Damage(npcs.ActiveNpcs[i], 10, weapon.Location))
                            {
                                floatingText.Add("10", weapon.Location);
                            }
                        }
                    }
                    else if(weapon.Weapon.Type.Name == "Arrow" && weapon.Movement.Velocity != Vector2.Zero)
                    {
                        LiveProjectile projectile = weapon;
                        if (projectile.Movement.Area.Intersects(npcs.ActiveNpcs[i].Movement.Area))
                        {
                            if (npcs.Damage(npcs.ActiveNpcs[i], 10, weapon.Location))
                            {
                                floatingText.Add("10", new Vector2(projectile.Movement.Area.Center.X, projectile.Movement.Area.Center.Y));
                                LiveWeapons.RemoveAt(w);
                            }
                        }
                    }
//.........这里部分代码省略.........
开发者ID:Shard,项目名称:Blueprint-Client,代码行数:101,代码来源:WeaponPackage.cs


示例4: ShowRtmpUi

    internal void ShowRtmpUi()
    {
        DrawTitle("REAL-TIME MULTIPLAYER");
        DrawStatus();

        if (GUI.Button(CalcGrid(0, 1), "Quick Game 2p"))
        {
            DoQuickGame(2);
        }
        else if (GUI.Button(CalcGrid(0, 2), "Create Game"))
        {
            DoCreateGame();
        }
        else if (GUI.Button(CalcGrid(0, 3), "From Inbox"))
        {
            DoAcceptFromInbox();
        }
        else if (GUI.Button(CalcGrid(1, 1), "Broadcast msg"))
        {
            DoBroadcastMessage();
        }
        else if (GUI.Button(CalcGrid(0, 4), "Send msg"))
        {
            DoSendMessage();
        }
        else if (GUI.Button(CalcGrid(1, 2), "Who Is Here"))
        {
            DoListParticipants();
        }
        else if (GUI.Button(CalcGrid(1, 3), "Accept incoming"))
        {
            DoAcceptIncoming();
        }
        else if (GUI.Button(CalcGrid(1, 4), "Decline incoming"))
        {
            DoDeclineIncoming();
        }
        else if (GUI.Button(CalcGrid(0, 5), "Leave Room"))
        {
            DoLeaveRoom();
        }
        else if (GUI.Button(CalcGrid(1, 5), "Back"))
        {
            mUi = Ui.Multiplayer;
        }
    }
开发者ID:rida1148,项目名称:play-games-plugin-for-unity,代码行数:46,代码来源:MainGui.cs


示例5: ShowRegularUi

    internal void ShowRegularUi()
    {
        this.DrawTitle(null);
        this.DrawStatus();

        if (GUI.Button(this.CalcGrid(0, 1), "Ach Reveal"))
        {
            this.DoAchievementReveal();
        }
        else if (GUI.Button(this.CalcGrid(0, 2), "Ach Unlock"))
        {
            this.DoAchievementUnlock();
        }
        else if (GUI.Button(this.CalcGrid(0, 3), "Ach Increment"))
        {
            this.DoAchievementIncrement();
        }
        else if (GUI.Button(this.CalcGrid(0, 4), "Ach Show UI"))
        {
            this.DoAchievementUI();
        }

        if (GUI.Button(this.CalcGrid(1, 1), "Post Score"))
        {
            this.DoPostScore();
        }
        else if (GUI.Button(this.CalcGrid(1, 2), "LB Show UI"))
        {
            this.DoLeaderboardUI();
        }
        else if (GUI.Button(this.CalcGrid(1, 3), "Cloud Save"))
        {
            this.DoCloudSave();
        }
        else if (GUI.Button(this.CalcGrid(1, 4), "Cloud Load"))
        {
            this.DoCloudLoad();
        }

        if (GUI.Button(this.CalcGrid(0, 5), "Multiplayer"))
        {
            this.mUi = Ui.Multiplayer;
        }

        if (GUI.Button(this.CalcGrid(1, 5), "Quests / Events"))
        {
            this.mUi = Ui.QuestsAndEvents;
        }

        if (GUI.Button(this.CalcGrid(0, 6), "Saved Game"))
        {
            this.mUi = Ui.SavedGame;
        }

        if (GUI.Button(this.CalcGrid(1, 6), "Nearby Connections"))
        {
            this.mUi = Ui.NearbyConnections;
        }

        if (GUI.Button(this.CalcGrid(0, 7), "Sign Out"))
        {
            this.DoSignOut();
        }
    }
开发者ID:rida1148,项目名称:play-games-plugin-for-unity,代码行数:64,代码来源:MainGui.cs


示例6: ShowNotAuthUi

    internal void ShowNotAuthUi()
    {
        this.DrawTitle(null);
        this.DrawStatus();
        if (GUI.Button(this.CalcGrid(0, 1), "Authenticate"))
        {
            this.DoAuthenticate();
        }

        if (GUI.Button(this.CalcGrid(1, 1), "Nearby Connections"))
        {
            this.mUi = Ui.NearbyConnections;
        }
    }
开发者ID:rida1148,项目名称:play-games-plugin-for-unity,代码行数:14,代码来源:MainGui.cs


示例7: ShowEditSavedGameName

    internal void ShowEditSavedGameName()
    {
        this.DrawTitle("EDIT SAVED GAME FILENAME");
        this.DrawStatus();

        this.mSavedGameFilename = GUI.TextArea(this.CalcGrid(0, 1), this.mSavedGameFilename);

        if (GUI.Button(this.CalcGrid(1, 7), "Back"))
        {
            this.mUi = Ui.SavedGame;
        }
    }
开发者ID:rida1148,项目名称:play-games-plugin-for-unity,代码行数:12,代码来源:MainGui.cs


示例8: SetUI

 public void SetUI(Ui page)
 {
     this.mUi = page;
 }
开发者ID:rida1148,项目名称:play-games-plugin-for-unity,代码行数:4,代码来源:MainGui.cs


示例9: DoTbmpAcceptFromInbox

 private void DoTbmpAcceptFromInbox()
 {
     SetStandBy("Accepting TBMP from inbox...");
     PlayGamesPlatform.Instance.TurnBased.AcceptFromInbox((bool success, TurnBasedMatch match) =>
         {
             ShowEffect(success);
             EndStandBy();
             mMatch = match;
             mStatus = success ? "Successfully accepted from inbox!" : "Failed to accept from inbox";
             if (success)
             {
                 mUi = Ui.TbmpMatch;
             }
         });
 }
开发者ID:rida1148,项目名称:play-games-plugin-for-unity,代码行数:15,代码来源:MainGui.cs


示例10: ShowWriteSavedGame

    internal void ShowWriteSavedGame()
    {
        DrawTitle("WRITE SAVED GAME");
        DrawStatus();

        mSavedGameFileContent = GUI.TextArea(CalcGrid(0, 1), mSavedGameFileContent);

        if (mCurrentSavedGame == null || !mCurrentSavedGame.IsOpen)
        {
            mStatus = "No opened saved game selected.";
            mUi = Ui.SavedGame;
            return;
        }

        var update = new SavedGameMetadataUpdate.Builder()
            .WithUpdatedDescription("Saved at " + DateTime.Now.ToString())
            .WithUpdatedPlayedTime(mCurrentSavedGame.TotalTimePlayed.Add(TimeSpan.FromHours(1)))
            .Build();

        if (GUI.Button(CalcGrid(0, 7), "Write"))
        {
            SetStandBy("Writing update");
            PlayGamesPlatform.Instance.SavedGame.CommitUpdate(
                mCurrentSavedGame,
                update,
                System.Text.ASCIIEncoding.Default.GetBytes(mSavedGameFileContent),
                (status, updated) =>
                {
                    mStatus = "Write status was: " + status;
                    mUi = Ui.SavedGame;
                    EndStandBy();
                });
            mCurrentSavedGame = null;
        }
        else if (GUI.Button(CalcGrid(1, 7), "Cancel"))
        {
            mUi = Ui.SavedGame;
        }
    }
开发者ID:rida1148,项目名称:play-games-plugin-for-unity,代码行数:39,代码来源:MainGui.cs


示例11: ShowTbmpUi

    internal void ShowTbmpUi()
    {
        DrawTitle("TURN-BASED MULTIPLAYER");
        DrawStatus();

        if (GUI.Button(CalcGrid(0, 1), "Quick Game 2p"))
        {
            DoTbmpQuickGame();
        }
        else if (GUI.Button(CalcGrid(0, 2), "Create Game"))
        {
            DoTbmpCreateGame();
        }
        else if (GUI.Button(CalcGrid(0, 3), "View all Matches"))
        {
            DoTbmpAcceptFromInbox();
        }
        else if (GUI.Button(CalcGrid(1, 1), "Accept incoming"))
        {
            DoTbmpAcceptIncoming();
        }
        else if (GUI.Button(CalcGrid(1, 2), "Decline incoming"))
        {
            DoTbmpDeclineIncoming();
        }
        else if (GUI.Button(CalcGrid(1, 3), "Match..."))
        {
            if (mMatch == null)
            {
                mStatus = "No match active.";
            }
            else
            {
                mUi = Ui.TbmpMatch;
            }
        }
        else if (GUI.Button(CalcGrid(1, 5), "Back"))
        {
            mUi = Ui.Multiplayer;
        }
    }
开发者ID:rida1148,项目名称:play-games-plugin-for-unity,代码行数:41,代码来源:MainGui.cs


示例12: ShowTbmpMatchUi

    internal void ShowTbmpMatchUi()
    {
        DrawTitle("TURN-BASED MULTIPLAYER MATCH\n" + GetMatchSummary());
        DrawStatus();

        if (GUI.Button(CalcGrid(0, 1), "Match Data"))
        {
            DoTbmpShowMatchData();
        }
        else if (GUI.Button(CalcGrid(0, 2), "Take Turn"))
        {
            DoTbmpTakeTurn();
        }
        else if (GUI.Button(CalcGrid(0, 3), "Finish"))
        {
            DoTbmpFinish();
        }
        else if (GUI.Button(CalcGrid(0, 4), "Ack Finish"))
        {
            DoTbmpAckFinish();
        }
        else if (GUI.Button(CalcGrid(0, 5), "Max Data Size"))
        {
            mStatus = PlayGamesPlatform.Instance.TurnBased.GetMaxMatchDataSize() + " bytes";
        }
        else if (GUI.Button(CalcGrid(1, 1), "Leave"))
        {
            DoTbmpLeave();
        }
        else if (GUI.Button(CalcGrid(1, 2), "Leave During Turn"))
        {
            DoTbmpLeaveDuringTurn();
        }
        else if (GUI.Button(CalcGrid(1, 3), "Cancel"))
        {
            DoTbmpCancel();
        }
        else if (GUI.Button(CalcGrid(1, 4), "Rematch"))
        {
            DoTbmpRematch();
        }
        else if (GUI.Button(CalcGrid(1, 5), "Back"))
        {
            mUi = Ui.Tbmp;
        }
    }
开发者ID:rida1148,项目名称:play-games-plugin-for-unity,代码行数:46,代码来源:MainGui.cs


示例13: ShowRegularUi

    void ShowRegularUi()
    {
        DrawTitle(null);
        DrawStatus();

        if (GUI.Button(CalcGrid(0,1), "Ach Reveal")) {
            DoAchievementReveal();
        } else if (GUI.Button(CalcGrid(0,2), "Ach Unlock")) {
            DoAchievementUnlock();
        } else if (GUI.Button(CalcGrid(0,3), "Ach Increment")) {
            DoAchievementIncrement();
        } else if (GUI.Button(CalcGrid(0,4), "Ach Show UI")) {
            DoAchievementUI();
        }

        if (GUI.Button(CalcGrid(1,1), "Post Score")) {
            DoPostScore();
        } else if (GUI.Button(CalcGrid(1,2), "LB Show UI")) {
            DoLeaderboardUI();
        } else if (GUI.Button(CalcGrid(1,3), "Cloud Save")) {
            DoCloudSave();
        } else if (GUI.Button(CalcGrid(1,4), "Cloud Load")) {
            DoCloudLoad();
        }

        if (GUI.Button(CalcGrid(0,5), "Multiplayer")) {
            mUi = Ui.Multiplayer;
        }

        if (GUI.Button(CalcGrid(1,5), "Sign Out")) {
            DoSignOut();
        }
    }
开发者ID:486boy,项目名称:play-games-plugin-for-unity,代码行数:33,代码来源:MainGui.cs


示例14: DoTbmpLeave

    void DoTbmpLeave()
    {
        if (mMatch == null) {
            mStatus = "No match is active.";
            return;
        }
        if (mMatch.TurnStatus == TurnBasedMatch.MatchTurnStatus.MyTurn) {
            mStatus = "It's my turn; use 'Leave During Turn'.";
            return;
        }

        SetStandBy("Leaving match...");
        PlayGamesPlatform.Instance.TurnBased.Leave(mMatch.MatchId, (bool success) => {
            EndStandBy();
            ShowEffect(success);
            mStatus = success ? "Successfully left match." : "Failed to leave match.";
            if (success) {
                mMatch = null;
                mUi = Ui.Tbmp;
            }
        });
    }
开发者ID:486boy,项目名称:play-games-plugin-for-unity,代码行数:22,代码来源:MainGui.cs


示例15: DoTbmpTakeTurn

    private void DoTbmpTakeTurn()
    {
        if (mMatch == null)
        {
            mStatus = "No match is active.";
            return;
        }

        if (mMatch.TurnStatus != TurnBasedMatch.MatchTurnStatus.MyTurn)
        {
            mStatus = "Not my turn.";
            return;
        }

        SetStandBy("Taking turn...");
        PlayGamesPlatform.Instance.TurnBased.TakeTurn(
            mMatch,
            System.Text.ASCIIEncoding.Default.GetBytes(GenString()),
            GetNextToPlay(mMatch),
            (bool success) =>
            {
                EndStandBy();
                ShowEffect(success);
                mStatus = success ? "Successfully took turn." : "Failed to take turn.";
                if (success)
                {
                    mMatch = null;
                    mUi = Ui.Tbmp;
                }
            });
    }
开发者ID:rida1148,项目名称:play-games-plugin-for-unity,代码行数:31,代码来源:MainGui.cs


示例16: OnMatchFromNotification

 private void OnMatchFromNotification(TurnBasedMatch match, bool fromNotification)
 {
     if (fromNotification)
     {
         mUi = Ui.TbmpMatch;
         mMatch = match;
         mStatus = "Got match from notification! " + match;
     }
     else
     {
         mStatus = "Got match a update not from notification.";
     }
 }
开发者ID:rida1148,项目名称:play-games-plugin-for-unity,代码行数:13,代码来源:MainGui.cs


示例17: DoTbmpAcceptIncoming

    private void DoTbmpAcceptIncoming()
    {
        if (mLastInvitationId == null)
        {
            mStatus = "No incoming invitation received from listener.";
            return;
        }

        SetStandBy("Accepting TBMP invitation...");
        PlayGamesPlatform.Instance.TurnBased.AcceptInvitation(
            mLastInvitationId,
            (bool success, TurnBasedMatch match) =>
            {
                ShowEffect(success);
                EndStandBy();
                mMatch = match;
                mStatus = success ? "Successfully accepted invitation!" :
                "Failed to accept invitation";
                if (success)
                {
                    mUi = Ui.TbmpMatch;
                }
            });
    }
开发者ID:rida1148,项目名称:play-games-plugin-for-unity,代码行数:24,代码来源:MainGui.cs


示例18: DoOpenManual

    internal void DoOpenManual()
    {
        SetStandBy("Manual opening file: " + mSavedGameFilename);
        PlayGamesPlatform.Instance.SavedGame.OpenWithManualConflictResolution(
            mSavedGameFilename,
            DataSource.ReadNetworkOnly,
            true,
            (resolver, original, originalData, unmerged, unmergedData) =>
            {
                Logger.d("Entering conflict callback");
                mConflictResolver = resolver;
                mConflictOriginal = original;
                mConflictOriginalData = System.Text.ASCIIEncoding.Default.GetString(originalData);
                mConflictUnmerged = unmerged;
                mConflictUnmergedData = System.Text.ASCIIEncoding.Default.GetString(unmergedData);
                mUi = Ui.ResolveSaveConflict;
                EndStandBy();
                Logger.d("Encountered manual open conflict.");
            },
            (status, openedFile) =>
            {
                mStatus = "Open status for file " + mSavedGameFilename + ": " + status + "\n";
                if (openedFile != null)
                {
                    mStatus += "Successfully opened file: " + openedFile.ToString();
                    Logger.d("Opened file: " + openedFile.ToString());
                    mCurrentSavedGame = openedFile;
                }

                EndStandBy();
            });
    }
开发者ID:rida1148,项目名称:play-games-plugin-for-unity,代码行数:32,代码来源:MainGui.cs


示例19: DoTbmpAckFinish

    private void DoTbmpAckFinish()
    {
        if (mMatch == null)
        {
            mStatus = "No match is active.";
            return;
        }

        if (mMatch.Status != TurnBasedMatch.MatchStatus.Complete)
        {
            mStatus = "Match is not complete";
            return;
        }

        SetStandBy("Ack'ing finished match");
        PlayGamesPlatform.Instance.TurnBased.AcknowledgeFinished(
            mMatch,
            (bool success) =>
            {
                EndStandBy();
                ShowEffect(success);
                mStatus = success ? "Successfully ack'ed finish." : "Failed to ack finish.";
                if (success)
                {
                    mMatch = null;
                    mUi = Ui.Tbmp;
                }
            });
    }
开发者ID:rida1148,项目名称:play-games-plugin-for-unity,代码行数:29,代码来源:MainGui.cs


示例20: ShowMultiplayerUi

    internal void ShowMultiplayerUi()
    {
        this.DrawTitle("MULTIPLAYER");
        this.DrawStatus();

        if (GUI.Button(this.CalcGrid(0, 1), "RTMP"))
        {
            this.mUi = Ui.Rtmp;
        }
        else if (GUI.Button(this.CalcGrid(1, 1), "TBMP"))
        {
            this.mUi = Ui.Tbmp;
        }
        else if (GUI.Button(this.CalcGrid(1, 5), "Back"))
        {
            this.mUi = Ui.Main;
        }
    }
开发者ID:rida1148,项目名称:play-games-plugin-for-unity,代码行数:18,代码来源:MainGui.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# UltimateModeType类代码示例发布时间:2022-05-24
下一篇:
C# UdpClient类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap