コード例 #1
0
        void OnEnable()
        {
            GUIScaleUtility.CheckInit();
            TextureLib.LoadStandardTextures();

            actions  = new ActionManager(this);
            editor   = new NodeEditor(this);
            triggers = new ActionTriggerSystem(actions);
            state    = new NodeEditorState();

            _saveManager = new SaveManager(this);

            editor.graph = graph;

            // Make sure that changes from the undo system are immediately
            // updated in the window. If not, the undo changes will be
            // visually delayed.
            actions.OnUndo += Repaint;
            actions.OnRedo += Repaint;

            // Always start in edit mode.
            // The only way it can be in view mode is if the window is
            // already opened and the user selects a some graph.
            _mode = Mode.Edit;

            editor.HomeView();
        }
コード例 #2
0
        public NodeEditor(NodeEditorWindow w)
        {
            backColor = ColorExtensions.From255(59, 62, 74);
            knobColor = ColorExtensions.From255(126, 186, 255);

            guideColor   = Color.gray;
            guideColor.a = 0.3f;

            _gridTex   = TextureLib.GetTexture("Grid");
            _backTex   = TextureLib.GetTexture("Square");
            _circleTex = TextureLib.GetTexture("Circle");

            _window = w;
        }
コード例 #3
0
 // TODO: Call after exiting playmode.
 private void updateTextures()
 {
     _knobTex   = TextureLib.GetTintTex("Circle", knobColor);
     _headerTex = TextureLib.GetTintTex("Square", ColorExtensions.From255(79, 82, 94));
 }