public T GetDebugObjectField <T>(DebugIdentifier fieldIdentifier) where T : struct, IDebugObject
        {
            DebugReference fieldReference = owner.GetDebugMemory().FindObjectReference(fieldIdentifier);

            Assert.IsTrue(fieldReference.IsValid);
            return(owner.GetDebugMemory().ReadObject <T>(fieldReference));
        }
Ejemplo n.º 2
0
 public GraphNodePort(Orientation orientation, Direction direction, Type type, DebugIdentifier identifier, bool selfNodeOnly)
     : base(orientation, direction, Capacity.Multi, type)
 {
     this.identifier   = identifier;
     this.selfNodeOnly = selfNodeOnly;
     UIElementsUtils.ApplyStyleSheet(styleSheet, this);
 }
        protected void AddOutputPort(DebugIdentifier identifier, string name, bool selfNodeOnly)
        {
            GraphNodePort port = GraphNodePort.Create(Direction.Output, typeof(DebugIdentifier), identifier, selfNodeOnly);

            outputPorts.Add(port);
            outputContainer.Add(port);

            port.Initialize(this, name);
        }
        GraphNodeGroup(GraphNodeView graphView, DebugIdentifier root)
        {
            owner     = graphView;
            this.root = root;

            UIElementsUtils.ApplyStyleSheet(styleSheet, this);

            RegisterCallback <GeometryChangedEvent>(GeometryChangededCallback);

            //inputPort = GraphNodePort.Create(
            //    Direction.Input, typeof(GraphNode), DebugIdentifier.Invalid/*, null*/);

            //inputPort.Initialize(this, string.Empty);

            // headerContainer.Add(inputPort);
        }
Ejemplo n.º 5
0
        public void UpdateSelection()
        {
            for (int i = 0; i < Debugger.frameDebugger.NumSelected; ++i)
            {
                SelectedFrameDebugProvider selected = Debugger.frameDebugger.GetSelected(i);

                IMotionSynthesizerProvider synthesizerProvider = selected.providerInfo.provider as IMotionSynthesizerProvider;
                if (synthesizerProvider == null || !synthesizerProvider.IsSynthesizerInitialized)
                {
                    continue;
                }

                ref MotionSynthesizer synthesizer = ref synthesizerProvider.Synthesizer.Ref;

                DebugMemory debugMemory = synthesizer.ReadDebugMemory;

                if (selected.metadata != null)
                {
                    DebugIdentifier identifier = (DebugIdentifier)selected.metadata;
                    if (debugMemory.FindObjectReference(identifier).IsValid)
                    {
                        break;
                    }
                    else
                    {
                        selected.metadata = null;
                    }
                }

                for (DebugReference reference = debugMemory.FirstOrDefault; reference.IsValid; reference = debugMemory.Next(reference))
                {
                    if (!DataTypes.IsValidType(reference.identifier.typeHashCode))
                    {
                        continue;
                    }

                    Type debugType = DataTypes.GetTypeFromHashCode(reference.identifier.typeHashCode).Item1;
                    if (typeof(IMotionMatchingQuery).IsAssignableFrom(debugType))
                    {
                        selected.metadata = reference.identifier;
                        break;
                    }
                }

                Debugger.frameDebugger.TrySelect(selected.providerInfo.provider, selected.metadata);
            }
Ejemplo n.º 6
0
        void DrawCostTimeline(FrameDebugProviderInfo providerInfo, IFrameAggregate aggregate, TimelineWidget.DrawInfo drawInfo)
        {
            Rect selectedRect = drawInfo.timeline.drawRect;
            int  width        = (int)selectedRect.width;
            int  height       = (int)selectedRect.height;

            if (width * height == 0)
            {
                return;
            }

            if (aggregate.IsEmpty)
            {
                return;
            }

            IMotionSynthesizerProvider synthesizerProvider = providerInfo.provider as IMotionSynthesizerProvider;

            if (synthesizerProvider == null || !synthesizerProvider.IsSynthesizerInitialized)
            {
                return;
            }

            DebugMemory debugMemory = synthesizerProvider.Synthesizer.Ref.ReadDebugMemory;

            foreach (SelectedFrameDebugProvider selected in Debugger.frameDebugger.Selection)
            {
                if (selected.providerInfo.uniqueIdentifier == providerInfo.uniqueIdentifier)
                {
                    CreateAndClearTexture(width, height);

                    if (selected.metadata != null)
                    {
                        DebugIdentifier selectedIdentifier = (DebugIdentifier)selected.metadata;
                        DebugReference  reference          = debugMemory.FindObjectReference(selectedIdentifier);

                        if (reference.IsValid)
                        {
                            object selectedObject = debugMemory.ReadObjectGeneric(reference);

                            if (selectedObject is IMotionMatchingQuery query)
                            {
                                DrawCostTimeline(query.DebugName.GetHashCode(), (DebugCostAggregate)aggregate, drawInfo);
                            }

                            if (selectedObject is IDisposable disposable)
                            {
                                disposable.Dispose();
                            }
                        }
                    }

                    m_CacheTexture.SetPixels(m_CachePixels);
                    m_CacheTexture.Apply();

                    GUI.DrawTexture(selectedRect, m_CacheTexture);

                    return;
                }
            }
        }
Ejemplo n.º 7
0
        public static GraphNodePort Create(Direction direction, Type type, DebugIdentifier identifier, bool selfNodeOnly)
        {
            var port = new GraphNodePort(Orientation.Horizontal, direction, type, identifier, selfNodeOnly);

            return(port);
        }
 public bool EqualsIndexAndVersion(DebugIdentifier identifier)
 {
     return(GlobalIndex == identifier.GlobalIndex && typeHashCode == identifier.typeHashCode);
 }
 public bool Equals(DebugIdentifier identifier)
 {
     return(index == identifier.index && typeHashCode == identifier.typeHashCode);
 }
 internal static GraphNodeGroup Create(GraphNodeView graphView, DebugIdentifier root)
 {
     return(new GraphNodeGroup(graphView, root));
 }