Подведи собственные итоги года совместно с YOUGAME и забери ценные призы! Перейти

Супер полезный сурс продвинутого прицела

Пользователь
Пользователь
Статус
Оффлайн
Регистрация
13 Янв 2018
Сообщения
198
Реакции
75
Мб кому-то пригодится.

Отрисовка BoxRect'а
C#:
Expand Collapse Copy
public static void BoxRect(Rect rect, Color color)
{
    if (color != Render.color_0)
    {
        Render.texture2D_0.SetPixel(0, 0, color);
        Render.texture2D_0.Apply();
        Render.color_0 = color;
    }
    GUI.DrawTexture(rect, Render.texture2D_0);
}
private static Texture2D texture2D_0 = new Texture2D(1, 1);
private static Color color_0;

Отрисовка crosshair'а
C#:
Expand Collapse Copy
public static bool Crosshair = false;
public static float CrosshairT = 1f;
public static float CrosshairL = 10f;
public static float CrosshairD = 10f;

public static byte CrosR = 255;
public static byte CrosG = 45;
public static byte CrosB = 45;
public static byte CrosA = 255;

public static void DrawCrosshair()
{
    Color CrosshairColor = new Color32(CrosR, CrosG, CrosB, CrosA);

    if (Crosshair == true)
    {
        Render.BoxRect(new Rect(Screen.width / 2f, Screen.height / 2f - CrosshairD + 1f, CrosshairT, -CrosshairL), CrosshairColor);
        Render.BoxRect(new Rect(Screen.width / 2f, Screen.height / 2f + CrosshairD - 1f, CrosshairT, CrosshairL), CrosshairColor);
        Render.BoxRect(new Rect(Screen.width / 2f, Screen.height / 2f - CrosshairD + 1f, -CrosshairT, -CrosshairL), CrosshairColor);
        Render.BoxRect(new Rect(Screen.width / 2f, Screen.height / 2f + CrosshairD - 1f, -CrosshairT, CrosshairL), CrosshairColor);
            
        Render.BoxRect(new Rect(Screen.width / 2f - CrosshairD + 1f, Screen.height / 2f, -CrosshairL, CrosshairT), CrosshairColor);
        Render.BoxRect(new Rect(Screen.width / 2f + CrosshairD - 1f, Screen.height / 2f, CrosshairL, CrosshairT), CrosshairColor);
        Render.BoxRect(new Rect(Screen.width / 2f - CrosshairD + 1f, Screen.height / 2f, -CrosshairL, -CrosshairT), CrosshairColor);
        Render.BoxRect(new Rect(Screen.width / 2f + CrosshairD - 1f, Screen.height / 2f, CrosshairL, -CrosshairT), CrosshairColor);
    }
}

Скрин прицела.
1556121494331.png
 
Последнее редактирование:
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Мб кому-то пригодится.

Отрисовка BoxRect'а
C#:
Expand Collapse Copy
public static void BoxRect(Rect rect, Color color)
{
    if (color != Render.color_0)
    { 
        Render.texture2D_0.SetPixel(0, 0, color);
        Render.texture2D_0.Apply();
        Render.color_0 = color;
    }
    GUI.DrawTexture(rect, Render.texture2D_0);
}

Отрисовка crosshair'а
C#:
Expand Collapse Copy
public static bool Crosshair = false;
public static float CrosshairT = 1f;
public static float CrosshairL = 10f;
public static float CrosshairD = 10f;

public static byte CrosR = 255;
public static byte CrosG = 45;
public static byte CrosB = 45;
public static byte CrosA = 255;

public static void DrawCrosshair()
{
    Color CrosshairColor = new Color32(CrosR, CrosG, CrosB, CrosA);

    if (Crosshair == true)
    {
        Render.BoxRect(new Rect(Screen.width / 2f, Screen.height / 2f - CrosshairD + 1f, CrosshairT, -CrosshairL), CrosshairColor);
        Render.BoxRect(new Rect(Screen.width / 2f, Screen.height / 2f + CrosshairD - 1f, CrosshairT, CrosshairL), CrosshairColor);
        Render.BoxRect(new Rect(Screen.width / 2f, Screen.height / 2f - CrosshairD + 1f, -CrosshairT, -CrosshairL), CrosshairColor);
        Render.BoxRect(new Rect(Screen.width / 2f, Screen.height / 2f + CrosshairD - 1f, -CrosshairT, CrosshairL), CrosshairColor);
             
        Render.BoxRect(new Rect(Screen.width / 2f - CrosshairD + 1f, Screen.height / 2f, -CrosshairL, CrosshairT), CrosshairColor);
        Render.BoxRect(new Rect(Screen.width / 2f + CrosshairD - 1f, Screen.height / 2f, CrosshairL, CrosshairT), CrosshairColor);
        Render.BoxRect(new Rect(Screen.width / 2f - CrosshairD + 1f, Screen.height / 2f, -CrosshairL, -CrosshairT), CrosshairColor);
        Render.BoxRect(new Rect(Screen.width / 2f + CrosshairD - 1f, Screen.height / 2f, CrosshairL, -CrosshairT), CrosshairColor);
    }
}
svaston shtole?
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
EAC По е*алу даст за это?
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
А какой вообще смысл делать интернал Прицел? Если еак ебло снесёт.
Можно драйвером защитить, но подписаный драйвер стоит баснословных денег (Если для такого прицела.)
 
  • Мне нравится
Реакции: DTRR
Назад
Сверху Снизу