Ejemplo n.º 1
0
        private void OnEnable()
        {
            nodeIdPool    = new IdentityPool();
            nodes         = new List <Node>();
            connections   = new List <Connection>();
            SelectedNodes = new HashSet <Node>();

            // initialize node style
            nodeStyle = CommonStyle.BlueNode;

            // initialize selected node style
            selectedNodeStyle = CommonStyle.SelectedBlueNode;

            // initialize input point style
            inPointStyle = new GUIStyle();
            inPointStyle.normal.background = EditorGUIUtility.Load("builtin skins/darkskin/images/btn left.png") as Texture2D;
            inPointStyle.active.background = EditorGUIUtility.Load("builtin skins/darkskin/images/btn left on.png") as Texture2D;
            inPointStyle.border            = new RectOffset(4, 4, 12, 12);

            // initialize output point style
            outPointStyle = new GUIStyle();
            outPointStyle.normal.background = EditorGUIUtility.Load("builtin skins/darkskin/images/btn right.png") as Texture2D;
            outPointStyle.active.background = EditorGUIUtility.Load("builtin skins/darkskin/images/btn right on.png") as Texture2D;
            outPointStyle.border            = new RectOffset(4, 4, 12, 12);

            // zoom
            Zoom     = 1;
            ZoomRate = 0.01f;
            MaxZoom  = 1f;
            MinZoom  = 1f;

            // initialize subwindow
            SubwindowRect = new Rect(0, ToolBarHeight, LeftColWidth, position.height - ToolBarHeight);

            OnInitialized();
        }