Exemple #1
0
    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);
        }
    }
Exemple #2
0
    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);
        }
    }