示例#1
0
        protected override IEnumerator ProcessPayload(VisualPayload payload)
        {
            Debug.LogWarning("[BOUND DEBUG] IsoGrid rendering to bound.", payload.VisualData.Bound);

            IsoGrid = VisualizerFactory.InstantiateIsoGrid();

            IsoGrid.Initialize(this, payload);
            //payload.VisualData.Bound.ChildVisualizer(this, IsoGrid);

            IsoGrid.DrawBackgrounds = ShowBackgrounds.GetLastKeyValue(payload.Data);

            IsoGrid.InitializeIsoGrid(payload.VisualData.Bound);

            IsoGrid.AllowSlicer = AllowSlicerField.GetLastKeyValue(payload.Data);

            AssignStates(IsoGrid);

            var entries = EntryField.GetFirstValue(payload.Data);

            if (entries == null)
            {
                throw new Exception("Illegal mutable field here!  " + EntryField.AbsoluteKey + " is not an enumerable of mutables!");
            }


            // Determine the full size of the entire isogrid
            int numCellsXAxis = 0;
            int numCellsZAxis = 0;

            if (entries.Any())
            {
                numCellsXAxis = XAxis.GetEntries(payload.Data).Max(e => XAxis.GetValue(e)) + 1;
                numCellsZAxis = ZAxis.GetEntries(payload.Data).Max(e => ZAxis.GetValue(e)) + 1;
            }

            IsoGrid.UpdateHorizontalScale(numCellsXAxis);
            IsoGrid.UpdateDepthScale(numCellsZAxis);

            AssignElements(entries);

            var iterator = IsoGrid.Apply();

            while (iterator.MoveNext( ))
            {
                yield return(null);
            }

            // PROCESS the label stuff, that was specified by the author:
            LabelSystem.Render(payload, IsoGrid.transform, IsoGrid.SelectionManager);
        }
示例#2
0
        protected override void OnProcessOutputSchema(MutableObject newSchema)
        {
            var elementList = EntryField.GetFirstValue(newSchema) as IEnumerable <MutableObject>;

            if (elementList == null)
            {
                Debug.LogError("This isn't a valid schema!  The entries field is empty!");
            }

            var singleSchema = elementList.First();
            var multiSchema  = new MutableObject();

            multiSchema.Add("Entries", elementList);

            NormalState.TransmitSchema(singleSchema);
            SelectedState.TransmitSchema(singleSchema);
            NoneSelectedState.TransmitSchema(singleSchema);

            NormalStateMulti.TransmitSchema(multiSchema);
            SelectedStateMulti.TransmitSchema(multiSchema);
            NoneSelectedStateMulti.TransmitSchema(multiSchema);
        }