static int GetIndex(VTile tile, int x, int y, int z) { for (int i = tile.GetLayerCount() - 1; i >= 0; i--) { indexTemp = tile.GetChunk(i, tile.GetAnimationIndex(), tile.GetFrameIndex()).GetPaletteIndexAt(x, y, z); if (indexTemp != 0) { return(indexTemp); } } return(0); }
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; } }