private void SetClip(AudioClip clip) { GameObject[] prefabs = EditorBase.GetSelectedPrefabs(); Debug.Log(prefabs.Length); foreach (GameObject obj in prefabs) { //string path = AssetDatabase.GetAssetPath(obj); GameObject prefab = obj as GameObject; EditorUtility.SetDirty(prefab); } }
private void SetFont(Object f) { Font font = f as Font; GameObject[] prefabs = EditorBase.GetSelectedPrefabs(); foreach (GameObject obj in prefabs) { //string path = AssetDatabase.GetAssetPath(obj); GameObject prefab = obj as GameObject; Text [] label = prefab.GetComponentsInChildren <Text>(true); for (int i = 0; i < label.Length; i++) { label[i].font = font; } EditorUtility.SetDirty(prefab); } }