private static void EditorUpdateCallback()
        {
            // Unregister from callback
            EditorApplication.update	-= EditorUpdateCallback;

            // Create instance if required
            if (AssetStoreProduct == null)
            {
                AssetStoreProduct		= new AssetStoreProduct(Constants.kProductName, Constants.kProductVersion, kLogoPath);
            }
        }
Beispiel #2
0
        public override void OnInspectorGUI()
        {
            AssetStoreProduct _product = (target as IAssetStoreProduct).AssetStoreProduct;

            if (_product == null || _product.LogoTexture == null)
            {
                return;
            }

            // GUI style
            m_guiStyle          = new GUIStyle("label");
            m_guiStyle.richText = true;

            GUILayout.BeginHorizontal();
            {
                GUILayout.BeginVertical();
                {
                    GUILayout.Space(10f);

                    // Logo
                    GUILayout.Label(_product.LogoTexture);
                }
                GUILayout.EndVertical();

                // Product details and copyrights
                GUILayout.BeginVertical();
                {
                    // Product name
                    m_guiStyle.fontSize = 32;
                    GUILayout.Label(_product.ProductName, m_guiStyle, GUILayout.Height(40f));

                    // Product version info
                    string _pVersion = "Version " + _product.ProductVersion;
                    m_guiStyle.fontSize = 10;
                    GUILayout.Label(_pVersion, m_guiStyle);

                    // Copyrights info
                    m_guiStyle.fontSize = 10;
                    GUILayout.Label(m_copyrightsText, m_guiStyle);
                }
                GUILayout.EndVertical();

                // To keep above GUI elements left aligned
                GUILayout.FlexibleSpace();
            }
            GUILayout.EndHorizontal();

            // Extra spacing
            GUILayout.Space(10f);
        }
        protected override void OnGUIWindow()
        {
            AssetStoreProduct _product = (target as IAssetStoreProduct).AssetStoreProduct;

            if (_product == null || _product.LogoTexture == null)
            {
                return;
            }

            // GUI style
            GUIStyle _guiStyle = new GUIStyle("label");

            _guiStyle.richText = true;
            _guiStyle.wordWrap = true;

            GUILayout.BeginHorizontal();
            {
                // Logo
                GUILayout.BeginVertical();
                {
                    GUILayout.Space(10f);
                    GUILayout.Label(_product.LogoTexture);
                }
                GUILayout.EndVertical();

                // Product details and copyrights
                GUILayout.BeginVertical();
                {
                    string _pName       = "<size=30>" + _product.ProductName + "</size>";
                    string _pVersion    = "<size=12>Version " + _product.ProductVersion + "</size>";
                    string _pCopyRights = "<i><size=10>" + Constants.kCopyrights + "</size></i>";

                    GUILayout.Label(_pName, _guiStyle, GUILayout.Height(38f));
                    GUILayout.Label(_pVersion, _guiStyle);
                    GUILayout.Label(_pCopyRights, _guiStyle);
                }
                GUILayout.EndVertical();
                GUILayout.FlexibleSpace();
            }
            GUILayout.EndHorizontal();
        }