// Init //------------------------------------------------------------------ public void Init(apEditor editor, apTextureData targetTextureData, object loadKey, FUNC_SELECT_TEXTUREASSET_RESULT funcResult) { _editor = editor; _loadKey = loadKey; _targetTextureData = targetTextureData; _funcResult = funcResult; _curSelectedTexture2D = null; _isSearched = false; _strSearchKeyword = ""; RefreshTextureAssets(); }
// Show Window //------------------------------------------------------------------ public static object ShowDialog(apEditor editor, apTextureData targetTextureData, FUNC_SELECT_TEXTUREASSET_RESULT funcResult) { CloseDialog(); if (editor == null || editor._portrait == null || editor._portrait._controller == null) { return(null); } EditorWindow curWindow = EditorWindow.GetWindow(typeof(apDialog_SelectTextureAsset), true, "Select Texture2D", true); apDialog_SelectTextureAsset curTool = curWindow as apDialog_SelectTextureAsset; object loadKey = new object(); if (curTool != null && curTool != s_window) { int width = 500; int height = 600; 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, targetTextureData, loadKey, funcResult); return(loadKey); } else { return(null); } }