Example #1
0
    private void OnEnable()
    {
        m_serializedObj             = new SerializedObject(target);
        m_audioClipListSeProp       = m_serializedObj.FindProperty("audioClipListSe");
        m_audioClipListBgmProp      = m_serializedObj.FindProperty("audioClipListBgm");
        m_editorIsFoldSeListProp    = m_serializedObj.FindProperty("m_editorIsFoldSeList");
        m_editorIsFoldBgmListProp   = m_serializedObj.FindProperty("m_editorIsFoldBgmList");
        m_soundEffectPlayersProp    = m_serializedObj.FindProperty("m_soundEffectPlayers");
        m_seAudioMixerGroupProp     = m_serializedObj.FindProperty("m_seAudioMixerGroup");
        m_bgmAudioMixerGroupProp    = m_serializedObj.FindProperty("m_bgmAudioMixerGroup");
        m_sePlayerNumProp           = m_serializedObj.FindProperty("m_sePlayerNum");
        m_volumeTotalProp           = m_serializedObj.FindProperty("m_volumeTotal");
        m_volumeSeProp              = m_serializedObj.FindProperty("m_volumeSe");
        m_volumeBgmProp             = m_serializedObj.FindProperty("m_volumeBgm");
        m_isChangeToSaveProp        = m_serializedObj.FindProperty("m_isChangeToSave");
        m_isChangeSceneToStopSeProp = m_serializedObj.FindProperty("m_isChangeSceneToStopSe");


        List <AudioClip> bgmClipList = new List <AudioClip>();
        List <AudioClip> seClipList  = new List <AudioClip>();

        bgmClipList = SimpleSoundManagerSetting.GetAudioClipListBgm();
        seClipList  = SimpleSoundManagerSetting.GetAudioClipListSe();

        m_audioClipListSeProp.arraySize  = seClipList.Count;
        m_audioClipListBgmProp.arraySize = bgmClipList.Count;


        foreach (SimpleSoundManager t in targets)
        {
            t.audioClipListSe.Clear();
            t.audioClipListBgm.Clear();
        }

        for (int i = 0; i < bgmClipList.Count; i++)
        {
            foreach (SimpleSoundManager t in targets)
            {
                t.audioClipListBgm.Add(bgmClipList[i]);
                serializedObject.ApplyModifiedProperties();
            }
        }

        for (int i = 0; i < seClipList.Count; i++)
        {
            foreach (SimpleSoundManager t in targets)
            {
                t.audioClipListSe.Add(seClipList[i]);
                serializedObject.ApplyModifiedProperties();
            }
        }

        m_serializedObj.Update();
        EditorUtility.SetDirty(target);
        serializedObject.ApplyModifiedProperties();
    }
Example #2
0
    private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
    {
        List <string[]> assetsList = new List <string[]>()
        {
            importedAssets, deletedAssets,
        };

        List <string> targetDirectoryNameList = new List <string>()
        {
            SimpleSoundManagerDefine.PathBgmSourceFolder,
            SimpleSoundManagerDefine.PathSeSourceFolder
        };

        if (ExistsDirectoryInAssets(assetsList, targetDirectoryNameList))
        {
            SimpleSoundManagerSetting.CreateSoundName();

            //該当するファイルがあった場合の処理
            Debug.Log("変更がありました");
        }
    }