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


C# Team.ToString方法代码示例

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


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

示例1: LoadStyles

    /*void OnGUI()
    {
        LoadStyles();

        GUILayout.BeginArea(new Rect(Screen.width * 0.25f, Screen.height * 0.25f, Screen.width * 0.5f, Screen.height * 0.5f));
        {
            GUILayout.BeginHorizontal();
            {
                if (GUILayout.Button(GetButtonLabel(Team.Blue), m_PickButtonStyle, GUILayout.Width(Screen.width * 0.25f - 20), GUILayout.Height(Screen.height * 0.5f - 20)))
                {
                    ChooseTeam(Team.Blue);
                }

                GUILayout.FlexibleSpace();

                if (GUILayout.Button(GetButtonLabel(Team.Red), m_PickButtonStyle, GUILayout.Width(Screen.width * 0.25f - 20), GUILayout.Height(Screen.height * 0.5f - 20)))
                {
                    ChooseTeam(Team.Red);
                }
            }
            GUILayout.EndHorizontal();
        }
        GUILayout.EndArea();
    }*/
    string GetButtonLabel(Team team)
    {
        int playerCount = 0;
        string label = team.ToString() + " Team\n";
        label += playerCount.ToString();

        if (playerCount == 1)
        {
            label += " Player";
        }
        else
        {
            label += " Players";
        }

        return label;
    }
开发者ID:kartsofchaos,项目名称:game,代码行数:41,代码来源:PickTeamGUI.cs

示例2: RpcSetTeam

 public void RpcSetTeam(string teamName, uint playerId)
 {
     if (netId.Value != playerId)
         return;
     Team = (Team)Enum.Parse(typeof(Team), teamName);
     Debug.Log("Got team " + Team.ToString() + " Player Id: " + playerId);
     var weapon = GetComponent<PlayerWeapon>();
     if (weapon && Team == Team.Suicidials)
     {
         Destroy(weapon);
     }
     //SetSkin();
 }
开发者ID:TheWulo,项目名称:DontDoIt,代码行数:13,代码来源:PlayerBase.cs

示例3: C_Info_ModifyTeam

 //�޸ij�����Ϣ
 public static void C_Info_ModifyTeam(Team team)
 {
     StringBuilder stb = new StringBuilder(Constant.HEAD).Append(Constant.C_INFO);
     stb.Append(Constant.C_INFO_TEAM_MOD).Append(team.ToString()).Append(Constant.FOOT);
     dataSocket.Send(stb.ToString());
 }
开发者ID:suwadee2015,项目名称:GPS,代码行数:7,代码来源:FormMain.Socket.cs

示例4: C_Info_AddTeam

 //----------------------------------------------------------------------//
 //��ӳ���
 public static void C_Info_AddTeam(Team team)
 {
     team.TeamID = 0;
     StringBuilder stb = new StringBuilder(Constant.HEAD).Append(Constant.C_INFO);
     stb.Append(Constant.C_INFO_TEAM_ADD).Append(team.ToString()).Append(Constant.FOOT);
     dataSocket.Send(stb.ToString());
 }
开发者ID:suwadee2015,项目名称:GPS,代码行数:9,代码来源:FormMain.Socket.cs

示例5: SpawnPlayer

    public void SpawnPlayer(Team t_team)
    {
        if (!this.GetComponent<bl_RoomMenu>().SpectatorMode) {
            if (OurPlayer != null)
                PhotonNetwork.Destroy(OurPlayer);

            Hashtable PlayerTeam = new Hashtable();
            PlayerTeam.Add("Team", t_team.ToString());
            PhotonNetwork.player.SetCustomProperties(PlayerTeam);

            if (t_team == Team.Recon)
                OurPlayer = PhotonNetwork.Instantiate(Player_Team_1.name, GetSpawn(ReconSpawnPoint), Quaternion.identity, 0);
            else if (t_team == Team.Delta)
                OurPlayer = PhotonNetwork.Instantiate(Player_Team_2.name, GetSpawn(DeltaSpawnPoint), Quaternion.identity, 0);
            else
                OurPlayer = PhotonNetwork.Instantiate(Player_Team_1.name, GetSpawn(AllSpawnPoints), Quaternion.identity, 0);

            this.GetComponent<bl_ChatRoom>().AddLine("Spawn in " + t_team.ToString() + " Team");
            this.GetComponent<bl_ChatRoom>().Refresh();
            m_RoomCamera.gameObject.SetActive(false);
            StartCoroutine(bl_RoomMenu.FadeOut(1));
            bl_UtilityHelper.LockCursor(true);
        }
        else
            this.GetComponent<bl_RoomMenu>().WaitForSpectator = true;
    }
开发者ID:SaltPeter,项目名称:fps,代码行数:26,代码来源:bl_GameManager.cs

示例6: GetButtonLabel

	string GetButtonLabel( Team team )
	{
		GameObject[] shipObjects = GameObject.FindGameObjectsWithTag( "Ship" );
		int playerCount = 0;

		for( int i = 0; i < shipObjects.Length; ++i )
		{
			if( shipObjects[ i ].GetComponent<Ship>() != null && shipObjects[ i ].GetComponent<Ship>().Team == team )
			{
				playerCount++;
			}
		}

		string label = team.ToString() + " Team\n";
		label += playerCount.ToString();

		if( playerCount == 1 )
		{
			label += " Player";
		}
		else
		{
			label += " Players";
		}

		return label;
	}
开发者ID:EvilAbyss,项目名称:Wulfram,代码行数:27,代码来源:PickTeamGUI.cs

示例7: Main

        static void Main(string[] args)
        {
            int teamsize = 2;

            string peopleFile = "people.txt";

            List<string> argsList = args.ToList<string>();

            if (argsList.Contains("-c"))
            {
                int index = argsList.IndexOf("-c") + 1;

                bool parseSucc = Int32.TryParse(argsList[index], out teamsize);

                if (!parseSucc)
                    teamsize = 2;
            }
            if (argsList.Contains("-p"))
            {
                int index = argsList.IndexOf("-p") + 1;

                peopleFile = argsList[index];
            }

            try
            {
                using (FileStream fStream = new FileStream(peopleFile, FileMode.Open, FileAccess.Read))
                {
                    using (StreamReader reader = new StreamReader(fStream))
                    {
                        List<string> names = new List<string>();
                        List<Team> teams = new List<Team>();
                        Bracket bracket = new Bracket();
                        string line;
                        while ((line = reader.ReadLine()) != null)
                        {
                            names.Add(line);
                        }

                        names = Shuffle(names);

                        string teamsFile = string.Format("teams-{0}.txt", teamsize);

                        using (FileStream oFStream = new FileStream(teamsFile, FileMode.Create, FileAccess.ReadWrite))
                        {
                            using (StreamWriter writer = new StreamWriter(oFStream))
                            {
                                int lastIndex = 0;
                                for (int i = 0; i < names.Count - (teamsize - 1); i += teamsize)
                                {
                                    Team tempTeam = new Team();

                                    for (int j = i; j < i + teamsize; j++)
                                    {
                                        tempTeam.players.Add(names[j]);
                                    }

                                    tempTeam.teamName = string.Format("Team {0}", names[i]);
            #if DEBUG
                                    Console.WriteLine(tempTeam.ToString());
            #endif

                                    writer.WriteLine(tempTeam.ToString());

                                    lastIndex = i;

                                    teams.Add(tempTeam);
                                }

                                Team lastTeam = new Team();

                                for (int i = lastIndex + teamsize; i < names.Count; i++)
                                {

                                    lastTeam.players.Add(names[i]);

                                    lastTeam.teamName = string.Format("Team {0}", names[lastIndex + teamsize]);

                                }

                                if (lastTeam.players.Count > 0)
                                {
            #if DEBUG
                                    Console.WriteLine(lastTeam.ToString());
            #endif

                                    writer.WriteLine(lastTeam.ToString());

                                    teams.Add(lastTeam);
                                }

                                bracket.teams = bracket.FisherYatesShuffle(teams);

                                writer.WriteLine();
                                writer.WriteLine("Team Matchups: ");

            #if DEBUG
                                Console.WriteLine();
                                Console.WriteLine("Team Matchups: ");
            #endif
//.........这里部分代码省略.........
开发者ID:redsky17,项目名称:TeamGenerator,代码行数:101,代码来源:Program.cs


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