private void DrawNewScene() { GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); GUI.color = Color.cyan; bool newScene = GUILayout.Button("新建场景", GUILayout.Width(120f)); GUI.color = Color.white; GUILayout.EndHorizontal(); if (newScene) { GameObject oldPrefab = prefab; Release(); ShowUtil.NewScene(); SetCharacter(oldPrefab); } }
public static void DrawNewScene(GameObject prefab, Action release, Action <GameObject> setPrefab) { GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); GUI.color = Color.cyan; bool newScene = GUILayout.Button("新建场景", GUILayout.Width(120f)); GUI.color = Color.white; GUILayout.EndHorizontal(); if (newScene) { GameObject oldPrefab = prefab; release(); ShowUtil.NewScene(); setPrefab(oldPrefab); } }