void OnGUI() { GUILayout.BeginArea(_area); GUILayout.BeginVertical(); GUILayout.BeginHorizontal(); GUILayout.Label(GKToyMaker._GetLocalization("Save data")); GUILayout.FlexibleSpace(); GUILayout.Label("Shift + Alt + S"); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label(GKToyMaker._GetLocalization("Duplicate nodes")); GUILayout.FlexibleSpace(); GUILayout.Label("Shift + Alt + D"); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label(GKToyMaker._GetLocalization("Delete Node")); GUILayout.FlexibleSpace(); GUILayout.Label("Shift + Alt + T"); GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUILayout.EndArea(); }
/// <summary> /// 保存prefab /// </summary> /// <param name="destPath"></param> public void SavePrefab(string destPath) { if (!Directory.Exists(destPath)) { do { destPath = EditorUtility.OpenFolderPanel(GKToyMaker._GetLocalization("Save path"), internalData.name, GKToyMaker._GetLocalization("Select save path.")); } while (!Directory.Exists(destPath)); destPath = destPath.Substring(destPath.IndexOf("Assets/")); toyMakerBase._defaultOverlordPath = destPath; } string prefabPath = string.Format("{0}/{1}.prefab", destPath, internalData.name); GameObject prefab; if (!File.Exists(prefabPath)) { prefab = PrefabUtility.CreatePrefab(prefabPath, gameObject); } else { prefab = AssetDatabase.LoadAssetAtPath <GameObject>(prefabPath); prefab = PrefabUtility.ReplacePrefab(gameObject, prefab); } Selection.activeGameObject = prefab; DestroyImmediate(gameObject); }
void OnEnable() { if (null == instance) { instance = GetWindow <GKToyMakerTextInput>(GKToyMaker._GetLocalization("Text input"), true); wantsMouseMove = true; minSize = new Vector2(300, 250); maxSize = new Vector2(300, 250); } }
public static void PopupTaskWindow() { instance = GetWindow <GKToyMakerTextInput>(GKToyMaker._GetLocalization("Text input"), true); }