// Init //------------------------------------------------------------------------ public void Init(apEditor editor, object loadKey, apControlParam targetControlParam, FUNC_SELECT_CONTROLPARAM_PRESET funcResult) { _editor = editor; _loadKey = loadKey; _funcResult = funcResult; _targetControlParam = targetControlParam; _strAddParamName = targetControlParam._keyName; _selectedUnit = null; switch (_targetControlParam._valueType) { case apControlParam.TYPE.Int: _strValueInfo = "Int : " + _targetControlParam._int_Min + " ~ " + _targetControlParam._int_Max; _strDefaultInfo = _targetControlParam._int_Def.ToString(); break; case apControlParam.TYPE.Float: _strValueInfo = "Float : " + _targetControlParam._float_Min + " ~ " + _targetControlParam._float_Max; _strDefaultInfo = _targetControlParam._float_Def.ToString(); break; case apControlParam.TYPE.Vector2: _strValueInfo = "Vector2 : " + "[ X " + _targetControlParam._vec2_Min.x + " ~ " + _targetControlParam._vec2_Max.x + " , " + "[ Y " + _targetControlParam._vec2_Min.y + " ~ " + _targetControlParam._vec2_Max.y + " ]"; _strDefaultInfo = _targetControlParam._vec2_Def.x + ", " + _targetControlParam._vec2_Def.y; break; } }
// Show Window / Close Dialog //------------------------------------------------------------------------ public static object ShowDialog(apEditor editor, apControlParam targetControlParam, FUNC_SELECT_CONTROLPARAM_PRESET funcResult) { CloseDialog(); if (editor == null || editor._portrait == null || editor._portrait._controller == null) { return(null); } EditorWindow curWindow = EditorWindow.GetWindow(typeof(apDialog_ControlParamPreset), true, "Control Parameter Preset", true); apDialog_ControlParamPreset curTool = curWindow as apDialog_ControlParamPreset; 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, targetControlParam, funcResult); return(loadKey); } else { return(null); } }