public parseCsdFile ( string filename ) : List |
||
filename | string | |
return | List |
public void DropAreaGUI() { Event evt = Event.current; Rect drop_area = GUILayoutUtility.GetRect(0.0f, 20.0f, GUILayout.ExpandWidth(true)); GUI.Box(drop_area, "Drag and Drop Csound file here"); switch (evt.type) { case EventType.DragUpdated: case EventType.DragPerform: if (!drop_area.Contains(evt.mousePosition)) { return; } DragAndDrop.visualMode = DragAndDropVisualMode.Copy; if (evt.type == EventType.DragPerform) { DragAndDrop.AcceptDrag(); foreach (string dragged_object in DragAndDrop.paths) { csoundUnity.csoundFile = Path.GetFileName(dragged_object); EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene()); if (csoundUnity.csoundFile.Length > 4) { channelControllers = csoundUnity.parseCsdFile(dragged_object); } } } break; } }
void OnEnable() { csoundUnity = (CsoundUnity)target; channelControllers = new List <CsoundChannelController>(); controllerValues = new List <float>(); //parse Csound files for CsoundUnity descriptor if (csoundUnity.csoundFile.Length > 4) { //deals with Csound files found the CsoundFiles folder string dir = Application.dataPath + "/Scripts/CsoundFiles"; if (Directory.Exists(dir)) { channelControllers = csoundUnity.parseCsdFile(dir + "/" + csoundUnity.csoundFile); } else { channelControllers = csoundUnity.parseCsdFile(Application.dataPath + "Scripts/" + csoundUnity.csoundFile); } } }