215 lines
7.1 KiB
C#
215 lines
7.1 KiB
C#
using UnityEngine;
|
|
|
|
namespace Vanguard.UI
|
|
{
|
|
/// <summary>
|
|
/// Иконки Lobby собраны из примитивов NeonUi: без атласа и без внешних
|
|
/// ассетов. Контейнер задаёт размер, иконка центрируется внутри.
|
|
/// </summary>
|
|
public static class LobbyIcon
|
|
{
|
|
public static readonly Color Default = new Color(0.64f, 0.84f, 1f, 0.92f);
|
|
|
|
public static void Swords(RectTransform parent, Color color)
|
|
{
|
|
Bar(parent, 46f, 5f, 45f, Vector2.zero, color);
|
|
Bar(parent, 46f, 5f, -45f, Vector2.zero, color);
|
|
Bar(parent, 14f, 4f, 45f, new Vector2(-13f, -13f), color);
|
|
Bar(parent, 14f, 4f, -45f, new Vector2(-13f, 13f), color);
|
|
}
|
|
|
|
public static void Deck(RectTransform parent, Color color)
|
|
{
|
|
Card(parent, new Vector2(-10f, 0f), -8f, color * 0.75f);
|
|
Card(parent, new Vector2(10f, 0f), 8f, color * 0.75f);
|
|
Card(parent, Vector2.zero, 0f, color);
|
|
}
|
|
|
|
public static void Shop(RectTransform parent, Color color)
|
|
{
|
|
NeonUi.AddImage(
|
|
parent,
|
|
"Basket",
|
|
NeonUi.Body(
|
|
32,
|
|
20,
|
|
4,
|
|
new Color(color.r, color.g, color.b, 0.18f),
|
|
color,
|
|
2),
|
|
new Vector2(32f, 20f),
|
|
new Vector2(0f, 2f));
|
|
Bar(parent, 14f, 4f, -28f, new Vector2(-18f, 12f), color);
|
|
NeonUi.AddImage(
|
|
parent, "WheelL", NeonUi.Circle(9, color), new Vector2(9f, 9f),
|
|
new Vector2(-9f, -14f));
|
|
NeonUi.AddImage(
|
|
parent, "WheelR", NeonUi.Circle(9, color), new Vector2(9f, 9f),
|
|
new Vector2(9f, -14f));
|
|
}
|
|
|
|
public static void Shield(RectTransform parent, Color color)
|
|
{
|
|
NeonUi.AddImage(
|
|
parent,
|
|
"Shield",
|
|
NeonUi.Body(
|
|
34,
|
|
40,
|
|
10,
|
|
new Color(color.r, color.g, color.b, 0.18f),
|
|
color,
|
|
2),
|
|
new Vector2(34f, 40f),
|
|
Vector2.zero);
|
|
Bar(parent, 18f, 4f, 0f, Vector2.zero, color);
|
|
Bar(parent, 4f, 14f, 0f, Vector2.zero, color);
|
|
}
|
|
|
|
public static void Chat(RectTransform parent, Color color)
|
|
{
|
|
NeonUi.AddImage(
|
|
parent,
|
|
"Bubble",
|
|
NeonUi.Body(
|
|
46,
|
|
32,
|
|
8,
|
|
new Color(color.r, color.g, color.b, 0.14f),
|
|
color,
|
|
2),
|
|
new Vector2(46f, 32f),
|
|
new Vector2(0f, 4f));
|
|
NeonUi.AddImage(
|
|
parent,
|
|
"Tail",
|
|
NeonUi.Body(12, 12, 2, new Color(color.r, color.g, color.b, 0.14f), color, 2),
|
|
new Vector2(12f, 12f),
|
|
new Vector2(-14f, -14f)).rectTransform.localRotation =
|
|
Quaternion.Euler(0f, 0f, 45f);
|
|
|
|
for (var i = -1; i <= 1; i++)
|
|
{
|
|
NeonUi.AddImage(
|
|
parent,
|
|
"Dot" + i,
|
|
NeonUi.Circle(4, color),
|
|
new Vector2(4f, 4f),
|
|
new Vector2(i * 9f, 4f));
|
|
}
|
|
}
|
|
|
|
public static void Friends(RectTransform parent, Color color)
|
|
{
|
|
NeonUi.AddImage(
|
|
parent, "Head", NeonUi.Circle(14, color), new Vector2(14f, 14f),
|
|
new Vector2(-9f, 10f));
|
|
NeonUi.AddImage(
|
|
parent,
|
|
"Body",
|
|
NeonUi.Body(
|
|
28,
|
|
14,
|
|
7,
|
|
new Color(color.r, color.g, color.b, 0.25f),
|
|
color,
|
|
2),
|
|
new Vector2(28f, 14f),
|
|
new Vector2(-9f, -8f));
|
|
NeonUi.AddImage(
|
|
parent,
|
|
"Head2",
|
|
NeonUi.Circle(11, color * 0.7f),
|
|
new Vector2(11f, 11f),
|
|
new Vector2(13f, 9f));
|
|
NeonUi.AddImage(
|
|
parent,
|
|
"Body2",
|
|
NeonUi.Body(
|
|
22,
|
|
12,
|
|
6,
|
|
new Color(color.r, color.g, color.b, 0.18f),
|
|
color * 0.7f,
|
|
2),
|
|
new Vector2(22f, 12f),
|
|
new Vector2(13f, -8f));
|
|
}
|
|
|
|
public static void Lock(RectTransform parent, Color color)
|
|
{
|
|
NeonUi.AddImage(
|
|
parent,
|
|
"Shackle",
|
|
NeonUi.Ring(34, 3f, color),
|
|
new Vector2(34f, 34f),
|
|
new Vector2(0f, 10f));
|
|
NeonUi.AddImage(
|
|
parent,
|
|
"Body",
|
|
NeonUi.Body(
|
|
40,
|
|
26,
|
|
6,
|
|
new Color(color.r, color.g, color.b, 0.2f),
|
|
color,
|
|
2),
|
|
new Vector2(40f, 26f),
|
|
new Vector2(0f, -8f));
|
|
NeonUi.AddImage(
|
|
parent,
|
|
"Keyhole",
|
|
NeonUi.Circle(6, color),
|
|
new Vector2(6f, 6f),
|
|
new Vector2(0f, -8f));
|
|
}
|
|
|
|
public static void Chevron(RectTransform parent, Color color)
|
|
{
|
|
Bar(parent, 13f, 3f, -45f, new Vector2(-4f, 4f), color);
|
|
Bar(parent, 13f, 3f, 45f, new Vector2(-4f, -4f), color);
|
|
}
|
|
|
|
public static void Chart(RectTransform parent, Color color)
|
|
{
|
|
Bar(parent, 12f, 6f, 90f, new Vector2(-10f, -6f), color);
|
|
Bar(parent, 20f, 6f, 90f, new Vector2(0f, 0f), color);
|
|
Bar(parent, 28f, 6f, 90f, new Vector2(10f, 4f), color);
|
|
}
|
|
|
|
private static void Card(RectTransform parent, Vector2 position, float angle, Color color)
|
|
{
|
|
var image = NeonUi.AddImage(
|
|
parent,
|
|
"Card",
|
|
NeonUi.Body(
|
|
28,
|
|
38,
|
|
5,
|
|
new Color(0.10f, 0.24f, 0.48f, 0.55f),
|
|
color,
|
|
2),
|
|
new Vector2(28f, 38f),
|
|
position);
|
|
image.rectTransform.localRotation = Quaternion.Euler(0f, 0f, angle);
|
|
}
|
|
|
|
private static void Bar(
|
|
RectTransform parent,
|
|
float width,
|
|
float height,
|
|
float angle,
|
|
Vector2 position,
|
|
Color color)
|
|
{
|
|
var image = NeonUi.AddImage(
|
|
parent,
|
|
"Bar",
|
|
NeonUi.HorizontalBar(Mathf.RoundToInt(width), Mathf.RoundToInt(height), color),
|
|
new Vector2(width, height),
|
|
position);
|
|
image.rectTransform.localRotation = Quaternion.Euler(0f, 0f, angle);
|
|
}
|
|
}
|
|
}
|