示例#1
0
    private void Init()
    {
        _isInitialized = true;

        _iconBroadcaster = SOTextureResourceManager.GetTexture(SOTextureResourceManager.Resource.IconBroadcaster);
        _iconListener    = SOTextureResourceManager.GetTexture(SOTextureResourceManager.Resource.IconListener);
    }
    protected void  DrawIcon(Rect position, SOTextureResourceManager.Resource resource, string tooltip = "", bool shouldDrawBackground = true)
    {
        if (shouldDrawBackground)
        {
            DrawIconBackground(position);
        }

        Texture icon = SOTextureResourceManager.GetTexture(resource);

        if (!string.IsNullOrEmpty(tooltip))
        {
            GUI.Box(position, new GUIContent(string.Empty, icon, tooltip));
        }
        else
        {
            GUI.DrawTexture(position, icon, ScaleMode.ScaleToFit, true, 1.0f);
        }
    }
 protected virtual void  Init()
 {
     _iconBackground = SOTextureResourceManager.GetTexture(SOTextureResourceManager.Resource.IconBackground);
     _iconConstant   = SOTextureResourceManager.GetTexture(SOTextureResourceManager.Resource.IconConstant);
     _iconRuntime    = SOTextureResourceManager.GetTexture(SOTextureResourceManager.Resource.IconRuntime);
 }