public TilePlaceObjectState(TileMap tileMap) { allPrefabs = System.Array.ConvertAll(FindAssets.FindAllAssets("prefab"), item => (GameObject)item); prefabSelection = new ResizableSelectionWindow(64); prefabSelection.onSelection += PrefabSelection; this.tileMap = tileMap; }
void OnEnable() { tileSelectionState = new TileSelectionState(target as TileMap); tilePainterState = new TilePainterState(); tileRaiserState = new TileRaiserState(target as TileMap); tileMaterialState = new TileMaterialState(); tileRotateState = new TileRotateState(); tilePlaceObjectState = new TilePlaceObjectState(target as TileMap); currentState = tileSelectionState; materialIcon = FindAssets.GetMaterialIcon(); selectIcon = Resources.Load("Icons/select_icon") as Texture; rotateIcon = Resources.Load("Icons/rotate_icon") as Texture; placeIcon = Resources.Load("Icons/place_icon") as Texture; raiseIcon = Resources.Load("Icons/raise_icon") as Texture; paintIcon = Resources.Load("Icons/paint_icon") as Texture; }
public TileMaterialState() { allMaterials = System.Array.ConvertAll(FindAssets.FindAllAssets("material"), item => (Material)item); materialSelection = new ResizableSelectionWindow(iconSize); materialSelection.onSelection += MaterialSelection; }