void CreateAmbient(AkDragDropData DDData) { AkAmbient ambient = Undo.AddComponent <AkAmbient>(gameObject); if (ambient != null) { SetTypeValue(ref ambient.valueGuid, ref ambient.eventID, DDData); } }
void CreateBank(AkDragDropData DDData) { AkBank bank = Undo.AddComponent <AkBank>(gameObject); if (bank != null) { int valueID = 0; SetTypeValue(ref bank.valueGuid, ref valueID, DDData); bank.bankName = DDData.name; } }
void CreateAuxBus(AkDragDropData DDData) { if (HasSameEnvironment(DDData.guid)) { return; } AkEnvironment akEnvironment = Undo.AddComponent <AkEnvironment>(gameObject); if (akEnvironment != null) { SetTypeValue(ref akEnvironment.valueGuid, ref akEnvironment.m_auxBusID, DDData); } }
private void PrepareDragDrop(object sender, System.EventArgs args) { var item = (AK.Wwise.TreeView.TreeViewItem)sender; try { if (item == null || !item.IsDraggable) { return; } var objectReferences = new UnityEngine.Object[1]; var treeInfo = (AkTreeInfo)item.DataContext; AkDragDropData DDData = null; var objType = GetObjectType(treeInfo.ObjectType); if (objType == "State" || objType == "Switch") { var DDGroupData = new AkDragDropGroupData(); var ParentTreeInfo = (AkTreeInfo)item.Parent.DataContext; DDGroupData.groupGuid = new System.Guid(ParentTreeInfo.Guid); DDGroupData.groupID = ParentTreeInfo.ID; DDData = DDGroupData; } else { DDData = new AkDragDropData(); } DDData.name = item.Header; DDData.guid = new System.Guid(treeInfo.Guid); DDData.ID = treeInfo.ID; DDData.typeName = objType; objectReferences[0] = DragDropHelperMonoScript; UnityEngine.GUIUtility.hotControl = 0; UnityEditor.DragAndDrop.objectReferences = objectReferences; UnityEditor.DragAndDrop.SetGenericData(AkDragDropHelper.DragDropIdentifier, DDData); UnityEditor.DragAndDrop.StartDrag("Dragging an AkObject"); } catch (System.Exception e) { UnityEngine.Debug.Log(e.ToString()); } }
void PrepareDragDrop(object sender, System.EventArgs args) { TreeViewItem item = (TreeViewItem)sender; try { if (item == null || !item.IsDraggable) { return; } UnityEngine.Object[] objectReferences = new UnityEngine.Object[1]; AkTreeInfo treeInfo = (AkTreeInfo)item.DataContext; AkDragDropData DDData = null; string objType = GetObjectType(treeInfo.ObjectType); if (objType == "State" || objType == "Switch") { AkDragDropGroupData DDGroupData = new AkDragDropGroupData(); AkTreeInfo ParentTreeInfo = (AkTreeInfo)item.Parent.DataContext; DDGroupData.groupGuid = new Guid(ParentTreeInfo.Guid); DDGroupData.groupID = ParentTreeInfo.ID; DDData = DDGroupData; } else { DDData = new AkDragDropData(); } DDData.name = item.Header; DDData.guid = new Guid(treeInfo.Guid); DDData.ID = treeInfo.ID; DDData.typeName = objType; objectReferences[0] = DragDropHelperMonoScript; DragAndDrop.objectReferences = objectReferences; DragAndDrop.SetGenericData(AkDragDropHelper.DragDropIdentifier, DDData); DragAndDrop.StartDrag("Dragging an AkObject"); } catch (Exception e) { Debug.Log(e.ToString()); } }
private AkDragDropData GetAkDragDropData() { AkDragDropData DDData = DragAndDrop.GetGenericData(AkDragDropHelper.DragDropIdentifier) as AkDragDropData; return((DDData != null && DDData.typeName.Equals(m_typeName)) ? DDData : null); }
void SetTypeValue(ref byte[] valueGuid, ref int ID, AkDragDropData DDData) { DDData.guid.ToByteArray().CopyTo(valueGuid, 0); ID = DDData.ID; }