public static void OpenScene() { string path = EditorUtility.OpenFilePanel("Open level file", "", ""); if (path.Length != 0) { HKScene scene = new HKScene(path); } }
void OnGUI() { if (am == null || strings == null || gameDataPath == string.Empty) { return; } Rect scrollViewRect = new Rect(0, 0, position.width, position.height); Rect selectionGridRect = new Rect(0, 0, position.width - 20, strings.Length * 20); scrollPos = GUI.BeginScrollView(scrollViewRect, scrollPos, selectionGridRect); selected = GUI.SelectionGrid(selectionGridRect, selected, strings, 1); GUI.EndScrollView(); if (selected != -1) { string path = Path.Combine(gameDataPath, "level" + selected); HKScene scene = new HKScene(path, am); selected = -1; } }