private void OnEnable() { Debug.Log("NodeEditorTWWindow enabled"); _editor = this; NodeEditor.checkInit(false); NodeEditorCallbacks.OnLoadCanvas -= OnLoadCanvas; NodeEditorCallbacks.OnLoadCanvas += OnLoadCanvas; NodeEditorInputControls.m_FinishedDupe -= _editor.RecalcAll; NodeEditorInputControls.m_FinishedDupe += _editor.RecalcAll; NodeEditor.ClientRepaints -= Repaint; NodeEditor.ClientRepaints += Repaint; EditorLoadingControl.justLeftPlayMode -= NormalReInit; EditorLoadingControl.justLeftPlayMode += NormalReInit; // Here, both justLeftPlayMode and justOpenedNewScene have to act because of timing EditorLoadingControl.justOpenedNewScene -= NormalReInit; EditorLoadingControl.justOpenedNewScene += NormalReInit; SceneView.onSceneGUIDelegate -= OnSceneGUI; SceneView.onSceneGUIDelegate += OnSceneGUI; string assetPath = AssetDatabase.GetAssetPath(MonoScript.FromScriptableObject(this)); if (assetPath.Length > 1) { // Debug.LogError("asset path " + assetPath); string path = Path.GetDirectoryName(assetPath); // Setup Cache canvasCache = new NodeEditorUserCache(path); } else { Debug.LogError("UNKNOWN asset path " + assetPath); canvasCache = new NodeEditorUserCache(); //path); } bool loadCache = true; if (!Shader.Find("Hidden/TextureOps")) { string shadername1 = "http://54.237.244.93/TextureOps" + NodeEditorTWWindow.m_Version + ".txt"; wwwShader1 = new WWW(shadername1); loadCache = false; } canvasCache.SetupCacheEvents(loadCache); m_NodeSelectionWindow = MultiColumnWindow.GetWindow(this); m_InspectorWindow = NodeInspectorWindow.Init(this); NodeEditor.ClientRepaints += m_InspectorWindow.Repaint; StartTextureWangPopup.Init(this); m_InspectorWindow.m_Source = this; NodeEditorCallbacks.OnAddNode -= NewNodeCallback; NodeEditorCallbacks.OnAddNode += NewNodeCallback; }
public static void Init(NodeEditorTWWindow _inst) { StartTextureWangPopup window = ScriptableObject.CreateInstance <StartTextureWangPopup>(); window.m_Parent = _inst; window.position = new Rect(_inst.canvasWindowRect.x + _inst.canvasWindowRect.width * 0.5f, _inst.canvasWindowRect.y + _inst.canvasWindowRect.height * 0.5f, 350, 250); window.titleContent = new GUIContent("Welcome To TextureWang"); window.www = new WWW("http://ec2-52-3-137-47.compute-1.amazonaws.com/demo/"); window.ShowUtility(); }
public static void Init(NodeEditorTWWindow _inst) { StartTextureWangPopup window = ScriptableObject.CreateInstance <StartTextureWangPopup>(); ms_StartPopup = window; window.m_Parent = _inst; window.position = new Rect(_inst.canvasWindowRect.x + _inst.canvasWindowRect.width * 0.5f, _inst.canvasWindowRect.y + _inst.canvasWindowRect.height * 0.5f, m_Width, m_Height); window.titleContent = new GUIContent("Welcome To TextureWang"); window.www = new WWW("http://54.237.244.93/"); window.ShowUtility(); }
private void OnEnable() { Debug.Log("NodeEditorTWWindow enabled"); _editor = this; NodeEditor.checkInit(false); NodeEditorCallbacks.OnLoadCanvas += OnLoadCanvas; NodeEditor.ClientRepaints -= Repaint; NodeEditor.ClientRepaints += Repaint; EditorLoadingControl.justLeftPlayMode -= NormalReInit; EditorLoadingControl.justLeftPlayMode += NormalReInit; // Here, both justLeftPlayMode and justOpenedNewScene have to act because of timing EditorLoadingControl.justOpenedNewScene -= NormalReInit; EditorLoadingControl.justOpenedNewScene += NormalReInit; SceneView.onSceneGUIDelegate -= OnSceneGUI; SceneView.onSceneGUIDelegate += OnSceneGUI; string assetPath = AssetDatabase.GetAssetPath(MonoScript.FromScriptableObject(this)); if (assetPath.Length > 1) { Debug.LogError("asset path " + assetPath); string path = Path.GetDirectoryName(assetPath); // Setup Cache canvasCache = new NodeEditorUserCache(path); } else { Debug.LogError("UNKNOWN asset path " + assetPath); canvasCache = new NodeEditorUserCache(); //path); } canvasCache.SetupCacheEvents(); m_NodeSelectionWindow = MultiColumnWindow.GetWindow(this); m_InspectorWindow = NodeInspectorWindow.Init(this); NodeEditor.ClientRepaints += m_InspectorWindow.Repaint; StartTextureWangPopup.Init(this); m_InspectorWindow.m_Source = this; }
private void OnDestroy() { ms_StartPopup = null; }