Esempio n. 1
0
    /// <summary>
    /// Clean up all textures.
    /// </summary>

    void OnDisable()
    {
        instance = null;
        foreach (Item item in mItems)
        {
            DestroyTexture(item);
        }
        Save();
    }
Esempio n. 2
0
    /// <summary>
    /// Initialize everything.
    /// </summary>

    void OnEnable()
    {
        instance = this;

        Load();

        mContent                 = new GUIContent();
        mStyle                   = new GUIStyle();
        mStyle.alignment         = TextAnchor.MiddleCenter;
        mStyle.padding           = new RectOffset(2, 2, 2, 2);
        mStyle.clipping          = TextClipping.Clip;
        mStyle.wordWrap          = true;
        mStyle.stretchWidth      = false;
        mStyle.stretchHeight     = false;
        mStyle.normal.textColor  = UnityEditor.EditorGUIUtility.isProSkin ? new Color(1f, 1f, 1f, 0.5f) : new Color(0f, 0f, 0f, 0.5f);
        mStyle.normal.background = null;
    }