示例#1
0
        private void updateParameters(AgentType agentType, string agentName, int frame)
        {
            if (string.IsNullOrEmpty(agentName)) {
                return;
            }

            string typeName = (agentType == null) ? agentName : agentType.ToString();
            string agentFullname = (agentType == null) ? agentName : agentType.ToString() + "#" + agentName;
            List<AgentDataPool.ValueMark> values = AgentDataPool.GetValidValues(agentType, agentFullname, frame);
            foreach(AgentDataPool.ValueMark value in values) {
                ParametersDock.SetProperty(typeName, agentName, value.Name, value.Value);
            }
        }
示例#2
0
        private void InspectObject(AgentType agentType, string agentName, string agentFullname)
        {
            Nodes.Node node = null;
            if (agentType == null && !string.IsNullOrEmpty(agentFullname))
            {
                int frame = AgentDataPool.CurrentFrame > -1 ? AgentDataPool.CurrentFrame : 0;
                string behaviorFilename = FrameStatePool.GetBehaviorFilename(agentFullname, frame);
                List<string> highlightNodeIds = FrameStatePool.GetHighlightNodeIds(agentFullname, frame, behaviorFilename);
                List<string> updatedNodeIds = FrameStatePool.GetUpdatedNodeIds(agentFullname, frame, behaviorFilename);
                Dictionary<string, FrameStatePool.NodeProfileInfos.ProfileInfo> profileInfos = FrameStatePool.GetProfileInfos(frame, behaviorFilename);

                BehaviorNode behavior = UIUtilities.ShowBehaviorTree(agentFullname, frame, highlightNodeIds, updatedNodeIds, HighlightBreakPoint.Instance, profileInfos);
                node = behavior as Nodes.Node;
            }

            _agentType = agentType;
            _agentName = agentName;

            Hide();

            setText(agentType, agentName);
            parametersPanel.InspectObject(agentType, agentFullname, node);

            if (AgentDataPool.CurrentFrame > -1 && !string.IsNullOrEmpty(agentName))
            {
                List<AgentDataPool.ValueMark> valueSet = AgentDataPool.GetValidValues(node, agentType, agentFullname, AgentDataPool.CurrentFrame);
                foreach (AgentDataPool.ValueMark value in valueSet)
                {
                    SetProperty(agentType != null ? agentType.ToString() : null, agentName, value.Name, value.Value);
                }
            }

            lostAnyFocus();
            Show();
        }
示例#3
0
        private void setText(AgentType agentType, string agentName) {
            // Par
            if (agentType == null) {
                Text = TabText = string.IsNullOrEmpty(agentName) ? Resources.Pars : string.Format(Resources.ParsOf, agentName);
            }

            // Global
            else if (Plugin.IsGlobalInstanceAgentType(agentType)) {
                Text = TabText = string.Format(Resources.PropertiesOf, agentType.ToString());
            }

            // Agent
            else {
                Text = TabText = string.Format(Resources.PropertiesOf + "::{1}", agentType.ToString(), agentName);
            }
        }
示例#4
0
        private void updateParameters(AgentType agentType, string agentName, int frame) {
            if (string.IsNullOrEmpty(agentName)) {
                return;
            }

            string typeName = (agentType == null) ? agentName : agentType.ToString();
            string agentFullname = (agentType == null) ? agentName : agentType.ToString() + "#" + agentName;
            string behaviorFilename = FrameStatePool.GetBehaviorFilename(agentFullname, frame);
            BehaviorNode behavior = null;

            if (agentFullname == Plugin.DebugAgentInstance)
            {
                behavior = UIUtilities.ShowBehavior(behaviorFilename);
            }

            List<AgentDataPool.ValueMark> values = AgentDataPool.GetValidValues(agentType, agentFullname, frame);
            foreach(AgentDataPool.ValueMark value in values) {
                ParametersDock.SetProperty(behavior, typeName, agentName, value.Name, value.Value);
            }
        }