public static int MouseTile(bool snapToExpandableWorldObjects = false) { if (GenWorld.cachedFrame == Time.frameCount) { return(GenWorld.cachedTile); } GenWorld.cachedTile = GenWorld.TileAt(UI.MousePositionOnUI, snapToExpandableWorldObjects); GenWorld.cachedFrame = Time.frameCount; return(GenWorld.cachedTile); }
public static int MouseTile(bool snapToExpandableWorldObjects = false) { if (snapToExpandableWorldObjects) { if (GenWorld.cachedFrame_snap == Time.frameCount) { return(GenWorld.cachedTile_snap); } GenWorld.cachedTile_snap = GenWorld.TileAt(UI.MousePositionOnUI, true); GenWorld.cachedFrame_snap = Time.frameCount; return(GenWorld.cachedTile_snap); } else { if (GenWorld.cachedFrame_noSnap == Time.frameCount) { return(GenWorld.cachedTile_noSnap); } GenWorld.cachedTile_noSnap = GenWorld.TileAt(UI.MousePositionOnUI, false); GenWorld.cachedFrame_noSnap = Time.frameCount; return(GenWorld.cachedTile_noSnap); } }