コード例 #1
0
ファイル: MyEditor.cs プロジェクト: WilliamYYC/Demo
    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);
        }
    }
コード例 #2
0
ファイル: MyEditor.cs プロジェクト: WilliamYYC/Demo
    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);
        }
    }