/// <summary> /// EDITOR: Initialize the required components of a new AudioEvent when it is first created /// </summary> /// <param name="outputPos">The position of the Output node in the canvas</param> public void InitializeEvent(Vector2 outputPos) { AudioOutput tempNode = ScriptableObject.CreateInstance <AudioOutput>(); AssetDatabase.AddObjectToAsset(tempNode, this); tempNode.InitializeNode(outputPos); this.output = tempNode; this.nodes.Add(tempNode); EditorUtility.SetDirty(this); }
private void SetBatchProperties(AudioEvent batchEvent) { AudioOutput op = batchEvent.Output; if (this.batchSetBus) { op.mixerGroup = this.batchBus; } if (this.batchSetMinVol) { op.MinVolume = this.batchMinVol; } if (this.batchSetMaxVol) { op.MaxVolume = this.batchMaxVol; } if (this.batchSetMinPitch) { op.MinPitch = this.batchMinPitch; } if (this.batchSetMaxPitch) { op.MaxPitch = this.batchMaxPitch; } if (this.batchSetLoop) { op.loop = this.batchLoop; } if (this.batchSetSpatialBlend) { op.spatialBlend = this.batchSpatialBlend; } if (this.batchSetHRTF) { op.HRTF = this.batchHRTF; } if (this.batchSetMaxDistance) { op.MaxDistance = this.batchMaxDistance; } if (this.batchSetAttenuation) { op.attenuationCurve = this.batchAttenuation; } if (this.batchSetDoppler) { op.dopplerLevel = this.batchDoppler; } }