private void OnEnable()
        {
            tilemap = target as ATilemap;
            tilemap.OnValidate();

            layersList = new ReorderableList(tilemap.Layers, typeof(Tile), true, true, true, true);

            layersList.drawHeaderCallback  += DrawHeader;
            layersList.drawElementCallback += DrawElement;

            layersList.onAddCallback     += AddItem;
            layersList.onRemoveCallback  += RemoveItem;
            layersList.onReorderCallback += (index) => { tilemap.CalculateLayersOrder(); tilemap.RefreshAll(true); CalculateIndexes(); };
        }
Esempio n. 2
0
        static public int GetMouseGridY(this ATilemap tilemap, Camera camera)
        {
            var mousePos = camera.ScreenToWorldPoint(Input.mousePosition);

            return(GetGridY(tilemap.transform.InverseTransformPoint(mousePos)));
        }