private void OnGUI()
        {
            EditorGUILayout.BeginVertical();

            if (Selection.activeGameObject != null)
            {
                selection = Selection.activeGameObject.GetComponent <ISILocalization>();
            }

            if (selection != null)
            {
                script           = script ?? Selection.activeGameObject.GetComponent <ISILocalization>();
                serializedObject = serializedObject ?? new SerializedObject(script);

                Initialize();
            }

            if (serializedObject != null && script != null)
            {
                serializedObject.Update();
                Draw();
                serializedObject.ApplyModifiedProperties();
            }

            EditorGUILayout.EndVertical();

            void Draw()
            {
                if (Event.current.type == EventType.MouseDown)
                {
                    GUIUtility.keyboardControl = 0;
                }

                if (splitPane == null)
                {
                    splitPane = SplitPane.Create(SplitPane.Orientations.Vertical, 5);
                    splitPane.DividerLocation = 0.4f;
                    splitPane.DividendLimit   = .9f;
                }

                splitPane.Location = new Rect(0, 0, position.width, position.height);

                splitPane.onDrawLeftComponent  = DrawLeftComponent;
                splitPane.onDrawRightComponent = DrawRightComponent;

                toolbarRect = GUILayoutUtility.GetRect(0, MENU_HEIGHT, GUILayout.Width(250));
                selectedTab = GUI.Toolbar(toolbarRect, selectedTab, toolbarItems, EditorStyles.toolbarButton);

                ControlShowingIndices();

                splitPane.Draw();
            }
        }
 /// <summary>
 /// Returns a formated version of this value
 /// </summary>
 /// <param name="arg">objects to insert into this string</param>
 /// <returns>fprmated version of this </returns>
 public string Format(params object[] arg)
 {
     return(ISILocalization.GetFormatedValueOf(key, arg));
 }
Beispiel #3
0
 protected override void InitManager()
 {
     ISILocalization.onLanguageChanged += OnLanguageChangedListener;
     ISILocalization.ChangeLanguage(Settings.Language);
     _popupShower.LocalizedLanguages = ISILocalization.Instance.LocalizedLanguages;
 }
 public void ChangeLanguage()
 {
     ISILocalization.ChangeLanguage(Language);
 }