Beispiel #1
0
        public void SetUp(BaseNode node, BaseGraphView graphView)
        {
            Model = node;
            Owner = graphView;

            // 初始化
            base.SetPosition(new Rect(Model.Position == default ? Vector2.zero : Model.Position, GetPosition().size));
            title   = Model.Title;
            tooltip = Model.Tooltip;
            titleContainer.style.backgroundColor = Model.TitleColor;
            TitleLabel.style.color = Model.TitleColor.GetLuminance() > 0.5f && Model.TitleColor.a > 0.5f ? Color.black : Color.white * 0.9f;

            //创建节点内部值
            CreateDrawerValues();

            //刷新端口
            InitPorts();
            RefreshPorts();

            //绑定事件
            BindingProperties();
            //子类初始化
            OnInitialized();
        }
Beispiel #2
0
 public void SetUp(BaseConnection connection, BaseGraphView graphView)
 {
     Model = connection;
     Owner = graphView;
 }