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


C# BetterList.RemoveAt方法代码示例

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


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

示例1: ParseSymbol

	/// <summary>
	/// Parse an embedded symbol, such as [FFAA00] (set color) or [-] (undo color change). Returns whether the index was adjusted.
	/// </summary>

	static public bool ParseSymbol (string text, ref int index, BetterList<Color> colors, bool premultiply)
	{
		if (colors == null) return ParseSymbol(text, ref index);

		int length = text.Length;

		if (index + 2 < length && text[index] == '[')
		{
			if (text[index + 1] == '-')
			{
				if (text[index + 2] == ']')
				{
					if (colors != null && colors.size > 1)
						colors.RemoveAt(colors.size - 1);
					index += 3;
					return true;
				}
			}
			else if (index + 7 < length)
			{
				if (text[index + 7] == ']')
				{
					if (colors != null)
					{
						Color c = ParseColor(text, index + 1);

						if (EncodeColor(c) != text.Substring(index + 1, 6).ToUpper())
							return false;

						c.a = colors[colors.size - 1].a;
						if (premultiply && c.a != 1f)
							c = Color.Lerp(mInvisible, c, c.a);

						colors.Add(c);
					}
					index += 8;
					return true;
				}
			}
		}
		return false;
	}
开发者ID:Jetblacktsunami,项目名称:TreasureCove,代码行数:46,代码来源:NGUIText.cs

示例2: ParseSymbol

	/// <summary>
	/// Parse the symbol, if possible. Returns 'true' if the 'index' was adjusted. Advanced symbol support contributed by Rudy Pangestu.
	/// </summary>

	static public bool ParseSymbol (string text, ref int index, BetterList<Color> colors, bool premultiply,
		ref int sub, ref bool bold, ref bool italic, ref bool underline, ref bool strike)
	{
		int length = text.Length;

		if (index + 3 > length || text[index] != '[') return false;

		if (text[index + 2] == ']')
		{
			if (text[index + 1] == '-')
			{
				if (colors != null && colors.size > 1)
					colors.RemoveAt(colors.size - 1);
				index += 3;
				return true;
			}

			string sub3 = text.Substring(index, 3);

			switch (sub3)
			{
				case "[b]":
				bold = true;
				index += 3;
				return true;

				case "[i]":
				italic = true;
				index += 3;
				return true;

				case "[u]":
				underline = true;
				index += 3;
				return true;

				case "[s]":
				strike = true;
				index += 3;
				return true;
			}
		}

		if (index + 4 > length) return false;

		if (text[index + 3] == ']')
		{
			string sub4 = text.Substring(index, 4);

			switch (sub4)
			{
				case "[/b]":
				bold = false;
				index += 4;
				return true;

				case "[/i]":
				italic = false;
				index += 4;
				return true;

				case "[/u]":
				underline = false;
				index += 4;
				return true;

				case "[/s]":
				strike = false;
				index += 4;
				return true;

				default:
				int a = (NGUIMath.HexToDecimal(text[index + 1]) << 4) | NGUIMath.HexToDecimal(text[index + 2]);
				mAlpha = a / 255f;
				index += 4;
				return true;
			}
		}

		if (index + 5 > length) return false;

		if (text[index + 4] == ']')
		{
			string sub5 = text.Substring(index, 5);

			switch (sub5)
			{
				case "[sub]":
				sub = 1;
				index += 5;
				return true;

				case "[sup]":
				sub = 2;
				index += 5;
				return true;
//.........这里部分代码省略.........
开发者ID:mr-kelly,项目名称:ProjectWeak,代码行数:101,代码来源:NGUIText.cs

示例3: ParseSymbol

	/// <summary>
	/// Parse the symbol, if possible. Returns 'true' if the 'index' was adjusted. Advanced symbol support contributed by Rudy Pangestu.
	/// </summary>

	static public bool ParseSymbol (string text, ref int index, BetterList<Color> colors, bool premultiply,
		ref int sub, ref bool bold, ref bool italic, ref bool underline, ref bool strike)
	{
		int length = text.Length;

		if (index + 3 > length || text[index] != '[') return false;

		if (text[index + 2] == ']')
		{
			if (text[index + 1] == '-')
			{
				if (colors != null && colors.size > 1)
					colors.RemoveAt(colors.size - 1);
				index += 3;
				return true;
			}

			string sub3 = text.Substring(index, 3);

			switch (sub3)
			{
				case "[b]":
				bold = true;
				index += 3;
				return true;

				case "[i]":
				italic = true;
				index += 3;
				return true;

				case "[u]":
				underline = true;
				index += 3;
				return true;

				case "[s]":
				strike = true;
				index += 3;
				return true;
			}
		}

		if (index + 4 > length) return false;

		if (text[index + 3] == ']')
		{
			string sub4 = text.Substring(index, 4);

			switch (sub4)
			{
				case "[/b]":
				bold = false;
				index += 4;
				return true;

				case "[/i]":
				italic = false;
				index += 4;
				return true;

				case "[/u]":
				underline = false;
				index += 4;
				return true;

				case "[/s]":
				strike = false;
				index += 4;
				return true;
			}
		}

		if (index + 5 > length) return false;

		if (text[index + 4] == ']')
		{
			string sub5 = text.Substring(index, 5);

			switch (sub5)
			{
				case "[sub]":
				sub = 1;
				index += 5;
				return true;

				case "[sup]":
				sub = 2;
				index += 5;
				return true;
			}
		}

		if (index + 6 > length) return false;

		if (text[index + 5] == ']')
//.........这里部分代码省略.........
开发者ID:hcutler,项目名称:24hoursofgood,代码行数:101,代码来源:NGUIText.cs

示例4: ParseSymbol

 public static bool ParseSymbol(string text, ref int index, BetterList<Color> colors, bool premultiply, ref int sub, ref bool bold, ref bool italic, ref bool underline, ref bool strike, ref bool ignoreColor)
 {
     int length = text.Length;
     if (index + 3 > length || text[index] != '[')
     {
         return false;
     }
     if (text[index + 2] == ']')
     {
         if (text[index + 1] == '-')
         {
             if (colors != null && colors.size > 1)
             {
                 colors.RemoveAt(colors.size - 1);
             }
             index += 3;
             return true;
         }
         string text2 = text.Substring(index, 3);
         string text3 = text2;
         switch (text3)
         {
         case "[b]":
             bold = true;
             index += 3;
             return true;
         case "[i]":
             italic = true;
             index += 3;
             return true;
         case "[u]":
             underline = true;
             index += 3;
             return true;
         case "[s]":
             strike = true;
             index += 3;
             return true;
         case "[c]":
             ignoreColor = true;
             index += 3;
             return true;
         }
     }
     if (index + 4 > length)
     {
         return false;
     }
     if (text[index + 3] == ']')
     {
         string text4 = text.Substring(index, 4);
         string text3 = text4;
         switch (text3)
         {
         case "[/b]":
             bold = false;
             index += 4;
             return true;
         case "[/i]":
             italic = false;
             index += 4;
             return true;
         case "[/u]":
             underline = false;
             index += 4;
             return true;
         case "[/s]":
             strike = false;
             index += 4;
             return true;
         case "[/c]":
             ignoreColor = false;
             index += 4;
             return true;
         }
         char ch = text[index + 1];
         char ch2 = text[index + 2];
         if (NGUIText.IsHex(ch) && NGUIText.IsHex(ch2))
         {
             int num2 = NGUIMath.HexToDecimal(ch) << 4 | NGUIMath.HexToDecimal(ch2);
             NGUIText.mAlpha = (float)num2 / 255f;
             index += 4;
             return true;
         }
     }
     if (index + 5 > length)
     {
         return false;
     }
     if (text[index + 4] == ']')
     {
         string text5 = text.Substring(index, 5);
         string text3 = text5;
         if (text3 != null)
         {
             if (NGUIText.<>f__switch$mapE == null)
             {
                 NGUIText.<>f__switch$mapE = new Dictionary<string, int>(2)
                 {
                     {
//.........这里部分代码省略.........
开发者ID:GameDiffs,项目名称:TheForest,代码行数:101,代码来源:NGUIText.cs


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