public override void OnInspectorGUI() {
			pureData.InitializeSettings();
			pureData.hierarchyManager.FreezeTransforms();
			
			generalSettings = pureData.generalSettings;
			generalSettingsSerialized = new SerializedObject(generalSettings);
			busManager = pureData.busManager;
			busManagerSerialized = new SerializedObject(busManager);
			spatializerManager = pureData.spatializerManager;
			spatializerManagerSerialized = new SerializedObject(spatializerManager);
			containerManager = pureData.containerManager;
			containerManagerSerialized = new SerializedObject(containerManager);
			sequenceManager = pureData.sequenceManager;
			sequenceManagerSerialized = new SerializedObject(sequenceManager);
				
			Begin();
			
			ShowGeneralSettings();
			Separator();
			ShowBuses();
			ShowSpatializers();
			ShowContainers();
			ShowSequences();
			Separator();
			
			End();
			
			generalSettingsSerialized.ApplyModifiedProperties();
			busManagerSerialized.ApplyModifiedProperties();
			spatializerManagerSerialized.ApplyModifiedProperties();
			containerManagerSerialized.ApplyModifiedProperties();
			sequenceManagerSerialized.ApplyModifiedProperties();
		}
示例#2
0
    public void InitializeSettings()
    {
        bool saveAssets = false;

        settingsPath = string.IsNullOrEmpty(settingsPath) || !File.Exists(settingsPath) ? HelperFunctions.GetAssetPath("PureDataSettings.asset") : settingsPath;
        settingsPath = string.IsNullOrEmpty(settingsPath) ? "Assets/PureDataSettings.asset" : settingsPath;

        if (references == null)
        {
            references = new PureDataReferences(Instance);
        }
        references.Initialize(Instance);

        if (generalSettings == null)
        {
            generalSettings = PureDataGeneralSettings.Create(settingsPath);
            saveAssets      = true;
        }
        generalSettings.Initialize(Instance);

        if (busManager == null)
        {
            busManager = PureDataBusManager.Create(settingsPath);
            busManager.UpdateMixer();
            saveAssets = true;
        }
        busManager.Initialize(Instance);

        if (spatializerManager == null)
        {
            spatializerManager = PureDataSpatializerManager.Create(settingsPath);
            saveAssets         = true;
        }
        spatializerManager.Initialize(Instance);

        if (containerManager == null)
        {
            containerManager = PureDataContainerManager.Create(settingsPath);
            saveAssets       = true;
        }
        containerManager.Initialize(Instance);

        if (sequenceManager == null)
        {
            sequenceManager = PureDataSequenceManager.Create(settingsPath);
            sequenceManager.UpdateSequenceContainer();
            saveAssets = true;
        }
        sequenceManager.Initialize(Instance);

        if (saveAssets)
        {
            HelperFunctions.SaveAssets();
        }
    }