Exemplo n.º 1
0
        void AddNode(NodeBase node,Vector2 pos)
        {
            node.name = getNewName(node.name);
            NodeContainer c = ScriptableObject.CreateInstance<NodeContainer>();
            c.SetNode(node);
            c.winID = getNewWinID();
            c.rect = new Rect(pos + scrollPosition - new Vector2(workspaceWidth/2,workspaceHeight/2), new Vector2(128, 128 + 16));
            c.rect.x = (int)c.rect.x;
            c.rect.y = (int)c.rect.y;
            c.container = target;
            nodeContainers.Add(c);

            target.Sort();
            EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene());
        }
Exemplo n.º 2
0
 public void OnEnable()
 {
     terrainTool = target as TerrainTool;
     terrainTool.Sort();
 }