private void OnClickSwapNodes(Vector2 mousePosition) { Rect rect = new Rect(GUIUtility.GUIToScreenPoint(mousePosition), new Vector2(200, 155)); SO_SwapNodePopUpWindow.OpenEditorWindow(AssetToUpdate, rect); InContexMenu = false; }
public static void OpenEditorWindow(SO_Node Asset, Rect pos) { SO_SwapNodePopUpWindow window = ScriptableObject.CreateInstance <SO_SwapNodePopUpWindow>(); Texture icon = AssetDatabase.LoadAssetAtPath <Texture>("Assets/AndreLibrary/Editor/BT_Icon.png"); GUIContent titleContent = new GUIContent("Add Node" + Asset.name, icon); AssetToUpdate = Asset; window.titleContent = titleContent; window.position = pos; tex = AssetDatabase.LoadAssetAtPath <Texture>("Assets/AndreLibrary/Editor/BT_Lighter_Grey_Blue.jpg"); window.PopulateNodeOptions(); window.ShowModalUtility(); }