コード例 #1
0
 public override void OnInspectorGUI()
 {
     base.DrawDefaultInspector();
     if (database)
     {
         EditorGUILayout.BeginVertical("Box");
         GUILayout.Label("Languajes in DataBase: " + database.LanguajesCount);
         if (database.LanguajesCount > 0)
         {
             EditorGUILayout.BeginHorizontal("Box");
             GUILayout.Label("Search: ");
             searchString = GUILayout.TextField(searchString);
             EditorGUILayout.EndHorizontal();
         }
         if (GUILayout.Button("Add new Idioma"))
         {
             AddLanguajeWindows.ShowWindow(database);
         }
         if (GUILayout.Button("Add new Content"))
         {
             AddContentWindows.ShowWindow(database);
         }
         EditorGUILayout.EndVertical();
         shouldSearch = !string.IsNullOrEmpty(searchString);
         foreach (var item in database.GetLanguajes())
         {
             if (shouldSearch)
             {
                 if (item == searchString || item.Contains(searchString))
                 {
                     DisplayIdioma(database.GetLanguaje(item));
                 }
             }
             else
             {
                 DisplayIdioma(database.GetLanguaje(item));
             }
         }
         //if(deleteItem != null)
         //    database.items.Remove(deleteItem);
     }
 }
コード例 #2
0
 public static void ShowWindow(ScriptableLanguaje db, int _id)
 {
     database            = db;
     idElement           = _id;
     window              = GetWindow <ContentModifiWindows>();
     window.titleContent = new GUIContent("Edit Content For Languajes");
     window.minSize      = new Vector2(300, 380);
     contents            = new List <string>();
     foreach (var idioma in db.GetLanguajes())
     {
         contents.Add(database.GetLanguajeContent(idioma, idElement).content);
     }
 }
コード例 #3
0
    void Start()
    {
        languajeSelect.onValueChanged.AddListener((index) => {
            languajeSelected = dbLanguaje.GetLanguaje(index).Name;
            SetTextsLanguajes();
        });
        var langs = dbLanguaje.GetLanguajes();

        languajeSelect.AddOptions(langs);
        for (int i = 0; i < langs.Count; i++)
        {
            if (langs[i] == languajeSelected)
            {
                languajeSelect.value = i;
            }
        }
        SetTextsLanguajes();
    }