// Init //------------------------------------------------------------------------ public void Init(apEditor editor, object loadKey, apModifiedMesh targetModMesh, FUNC_SELECT_PHYSICS_PRESET funcResult) { _editor = editor; _loadKey = loadKey; _funcResult = funcResult; _targetModMesh = targetModMesh; _strAddParamName = "No Name Preset"; _addParamIcon = apPhysicsPresetUnit.ICON.Cloth1; _selectedUnit = null; }
// Show Window / Close Dialog //------------------------------------------------------------------------ public static object ShowDialog(apEditor editor, apModifiedMesh targetModMesh, FUNC_SELECT_PHYSICS_PRESET funcResult) { CloseDialog(); if (editor == null || editor._portrait == null || editor._portrait._controller == null) { return(null); } EditorWindow curWindow = EditorWindow.GetWindow(typeof(apDialog_PhysicsPreset), true, "Physics Preset", true); apDialog_PhysicsPreset curTool = curWindow as apDialog_PhysicsPreset; object loadKey = new object(); if (curTool != null && curTool != s_window) { int width = 400; int height = 700; s_window = curTool; s_window.position = new Rect((editor.position.xMin + editor.position.xMax) / 2 - (width / 2), (editor.position.yMin + editor.position.yMax) / 2 - (height / 2), width, height); s_window.Init(editor, loadKey, targetModMesh, funcResult); return(loadKey); } else { return(null); } }