本文整理汇总了C#中Ui类的典型用法代码示例。如果您正苦于以下问题:C# Ui类的具体用法?C# Ui怎么用?C# Ui使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Ui类属于命名空间,在下文中一共展示了Ui类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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>();
}
示例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);
}
示例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);
}
}
}
//.........这里部分代码省略.........
示例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;
}
}
示例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();
}
}
示例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;
}
}
示例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;
}
}
示例8: SetUI
public void SetUI(Ui page)
{
this.mUi = page;
}
示例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;
}
});
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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();
}
}
示例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;
}
});
}
示例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;
}
});
}