Exemplo n.º 1
0
        public NodeGUI Duplicate(AssetBundleGraphController controller, float newX, float newY)
        {
            var data = m_data.Duplicate();

            data.X = newX;
            data.Y = newY;
            return(new NodeGUI(controller, data));
        }
Exemplo n.º 2
0
        public NodeGUI(AssetBundleGraphController controller, Model.NodeData data)
        {
            m_nodeWindowId = 0;
            m_graph        = controller.TargetGraph;
            m_data         = data;

            m_baseRect = new Rect(m_data.X, m_data.Y, Model.Settings.GUI.NODE_BASE_WIDTH, Model.Settings.GUI.NODE_BASE_HEIGHT);

            m_nodeSyle           = data.Operation.Object.InactiveStyle;
            Inspector.controller = controller;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Executes the graph.
        /// </summary>
        /// <returns>The graph.</returns>
        /// <param name="target">Target.</param>
        /// <param name="graph">Graph.</param>
        public static ExecuteGraphResult ExecuteGraph(BuildTarget target, Model.ConfigGraph graph)
        {
            string assetPath = AssetDatabase.GetAssetPath(graph);

            LogUtility.Logger.LogFormat(LogType.Log, "Executing graph:{0}", assetPath);

            AssetBundleGraphController c = new AssetBundleGraphController(graph);

            // perform setup. Fails if any exception raises.
            c.Perform(target, false, true, null);

            // if there is error reported, then run
            if(c.IsAnyIssueFound) {
                return new ExecuteGraphResult(graph, c.Issues);
            }

            Model.NodeData lastNodeData = null;
            float lastProgress = 0.0f;

            Action<Model.NodeData, string, float> updateHandler = (Model.NodeData node, string message, float progress) => {
                if(node != null && lastNodeData != node) {
                    lastNodeData = node;
                    lastProgress = progress;

                    LogUtility.Logger.LogFormat(LogType.Log, "Processing {0}", node.Name);
                }
                if(progress > lastProgress) {
                    if(progress <= 1.0f) {
                        LogUtility.Logger.LogFormat(LogType.Log, "{0} Complete.", node.Name);
                    } else if( (progress - lastProgress) > 0.2f ) {
                        LogUtility.Logger.LogFormat(LogType.Log, "{0}: {1} % : {2}", node.Name, (int)progress*100f, message);
                    }
                    lastProgress = progress;
                }
            };

            // run datas.
            c.Perform(target, true, true, updateHandler);

            AssetDatabase.Refresh();

            return new ExecuteGraphResult(graph, c.Issues);
        }
Exemplo n.º 4
0
 public void UpdateNode(AssetBundleGraphController c, NodeGUI node)
 {
     this.controller = c;
     this.node       = node;
 }