void LateUpdate() { VTile t = tile.GetTile(); VLayer l = t.GetLayer(layerIndex); VAnimation a = t.GetAnimation(animationIndex); bool active = layerIndex == t.GetLayerIndex() && animationIndex == t.GetAnimationIndex() && frameIndex == t.GetFrameIndex(); cachedVChunk = t.GetChunk(layerIndex, animationIndex, frameIndex); if (GetChunk().IsDirty() || t.GetPalette().IsDirty() || l.IsDirty() || a.IsDirty()) { Refresh(); } bool visible = l.GetVisible() && animationIndex == t.GetAnimationIndex() && frameIndex == t.GetFrameIndex(); gameObject.layer = (visible && (active || (!l.GetOutline() && !l.GetTransparent()))) ? 10 : 0; if (Tool.editing && active) { visible = false; } if (mr) { mr.enabled = visible; } }
public void IsEmpty_PrefixTest() { var instance = new VLayer(new VNode()); instance.Prefix.Add(new VNode()); Assert.IsFalse(instance.IsEmpty); }
public void IsEmpty_ContentTest() { var instance = new VLayer(new VNode()); instance.Content.Add(new VNode()); Assert.IsFalse(instance.IsEmpty); }
public void HasChildren_Test() { var instance = new VNode(); var vLayer = new VLayer(instance); vLayer.Content.Add(new VNode()); instance.VLayers.Add(vLayer); Assert.IsTrue(instance.HasChildren); }
public void VLayer_CstrTest() { var owner = new VNode(); var instance = new VLayer(new VNode(), new VNode()); Assert.IsNotNull(instance.Prefix); Assert.IsNotNull(instance.Content); Assert.IsNotNull(instance.Suffix); Assert.AreEqual(2, instance.Content.Count); }
public void VLayer_Test() { var vnode = new VNode(); var instance = new VLayer(); Assert.IsNotNull(instance.Prefix); Assert.IsNotNull(instance.Content); Assert.IsNotNull(instance.Suffix); Assert.IsTrue(instance.IsEmpty); }
public int AddLayer(VLayer layer) { layers.Add(layer); for (int anim = 0; anim < GetAnimationCount(); anim++) { for (int frame = 0; frame < animations[anim].GetFrameCount(); frame++) { chunks.Add(new VTileChunk(layers.Count - 1, anim, frame, width, height, depth)); } } SetDirty(); return(layers.Count - 1); }
public bool ProcessElement(IElementProcessingState state, Paragraph p) { var layer = new VLayer(); foreach (Match m in regex.Matches(p.InnerText)) { var node = new VNode { Index = state.Index + m.Index, Length = m.Length, Tag = "span" }; node.AddClasses(CLASS_NAME); layer.Content.Add(node); } if (!layer.IsEmpty) { state.CurrentVNode.VLayers.Add(layer); } return(false); }
private void AssertLayerNodeRanges(VLayer vLayer, params (int, int)[] ranges)