private void CreateWindow()
        {
            switch (nodeType)
            {
            case NodeType.Sequence:
                window = new SequenceNodeWindow(this);
                break;

            case NodeType.Selector:
                window = new SelectorNodeWindow(this);
                break;

            case NodeType.Leaf:
                window   = new LeafNodeWindow(this);
                children = null;
                break;

            case NodeType.Inverter:
                window = new InverterNodeWindow(this);
                break;

            default:
                Debug.LogWarning("TODO: CreateWindow of type " + nodeType);
                break;
            }
        }
示例#2
0
        public ConnectionPoint(NodeWindow node, ConnectionPointType type, Action <ConnectionPoint> OnClickConnectionPoint)
        {
            var ohBehave = EditorWindow.GetWindow <OhBehaveEditorWindow>();

            blueprint       = ohBehave.treeBlueprint;
            this.nodeWindow = node;
            this.type       = type;
            if (type == ConnectionPointType.In)
            {
                unConnectedstyle = OhBehaveEditorWindow.InPointStyle;
            }
            else
            {
                unConnectedstyle = OhBehaveEditorWindow.OutPointStyle;
            }
            this.OnClickConnectionPoint = OnClickConnectionPoint;

            connectedStyle = new GUIStyle();
            connectedStyle.normal.background = unConnectedstyle.hover.background;

            rect = new Rect(0, 0, unConnectedstyle.normal.background.width, unConnectedstyle.normal.background.height);
        }
 public void CreateChildConnection(NodeWindow newChild)
 {
     newChild.SetParentWindow(this);
 }