Drawing.Initialize C# (CSharp) Метод

Initialize() приватный статический Метод

private static Initialize ( ) : void
Результат void
    private static void Initialize()
    {
        if (lineTex == null)
        {
            lineTex = new Texture2D(1, 1, TextureFormat.ARGB32, false);
            lineTex.SetPixel(0, 1, Color.white);
            lineTex.Apply();
        }
        if (aaLineTex == null)
        {
            // TODO: better anti-aliasing of wide lines with a larger texture? or use Graphics.DrawTexture with border settings
            aaLineTex = new Texture2D(1, 3, TextureFormat.ARGB32, false);
            aaLineTex.SetPixel(0, 0, new Color(1, 1, 1, 0));
            aaLineTex.SetPixel(0, 1, Color.white);
            aaLineTex.SetPixel(0, 2, new Color(1, 1, 1, 0));
            aaLineTex.Apply();
        }

        // GUI.blitMaterial and GUI.blendMaterial are used internally by GUI.DrawTexture,
        // depending on the alphaBlend parameter. Use reflection to "borrow" these references.
        blitMaterial = (Material)typeof(GUI).GetMethod("get_blitMaterial", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, null);
        blendMaterial = (Material)typeof(GUI).GetMethod("get_blendMaterial", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, null);
    }

Usage Example

Пример #1
0
        static Config()
        {
            Menu = new MenuWrapper(MENU_NAME);

            // Combo
            Combo.Initialize();

            // Harass
            Harass.Initialize();

            // WaveClear
            WaveClear.Initialize();

            // JungleClear
            JungleClear.Initialize();

            // Flee
            Flee.Initialize();

            // Keys
            Keys.Initialize();

            // Misc
            Misc.Initialize();

            // Items
            Items.Initialize();

            // Drawing
            Drawing.Initialize();
        }
All Usage Examples Of Drawing::Initialize