public TilePlaceObjectState(TileMap tileMap)
 {
     allPrefabs                   = System.Array.ConvertAll(FindAssets.FindAllAssets("prefab"), item => (GameObject)item);
     prefabSelection              = new ResizableSelectionWindow(64);
     prefabSelection.onSelection += PrefabSelection;
     this.tileMap                 = tileMap;
 }
Example #2
0
    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;
    }
Example #3
0
 public TileMaterialState()
 {
     allMaterials                   = System.Array.ConvertAll(FindAssets.FindAllAssets("material"), item => (Material)item);
     materialSelection              = new ResizableSelectionWindow(iconSize);
     materialSelection.onSelection += MaterialSelection;
 }