예제 #1
0
        protected override void beforeAll()
        {
            tileset = linker.getOrCreateTileset(name);

            tileset.setNbTiles(nbTileX,nbTileY);
            tileset.imagePath = imageSourceAtRessourceLevel;
        }
예제 #2
0
        protected override void beforeAll()
        {
            tileset = linker.getOrCreateTileset(name);

            tileset.setNbTiles(nbTileX, nbTileY);
            tileset.imagePath = imageSourceAtRessourceLevel;
        }
예제 #3
0
 protected override void onLinkerLoaded()
 {
     if(linker.tilesets.Count > 0 && selectedTileset == null){
         selectedTileset = linker.tilesets[0];
     }
     if(selectedTileset != null){
         loadTilesetImage(selectedTileset);
     }
 }
 public TiledTilesetData getOrCreateTileset(string name)
 {
     TiledTilesetData tileset = getTileset(name);
     if(tileset == null){
         tileset = new TiledTilesetData(name);
         tilesets.Add(tileset);
     }
     return tileset;
 }
예제 #5
0
 protected override void OnEnable()
 {
     base.OnEnable();
     if(linker != null && linker.tilesets.Count > 0 && selectedTileset == null){
         selectedTileset = linker.tilesets[0];
     }
     if(selectedTileset != null){
         loadTilesetImage(selectedTileset);
     }
 }
예제 #6
0
        /*protected void OnEnable(){
         *      if(linker.tilesets.Count > 0 && selectedTileset == null){
         *              selectedTileset = linker.tilesets[0];
         *      }
         *      if(selectedTileset != null){
         *              loadTilesetImage(selectedTileset);
         *      }
         * }*/


        protected override void onLinkerLoaded()
        {
            if (linker.tilesets.Count > 0 && selectedTileset == null)
            {
                selectedTileset = linker.tilesets[0];
            }
            if (selectedTileset != null)
            {
                loadTilesetImage(selectedTileset);
            }
        }
예제 #7
0
        public TiledTilesetData getOrCreateTileset(string name)
        {
            TiledTilesetData tileset = getTileset(name);

            if (tileset == null)
            {
                tileset = new TiledTilesetData(name);
                tilesets.Add(tileset);
            }
            return(tileset);
        }
예제 #8
0
 protected override void OnEnable()
 {
     base.OnEnable();
     if (linker != null && linker.tilesets.Count > 0 && selectedTileset == null)
     {
         selectedTileset = linker.tilesets[0];
     }
     if (selectedTileset != null)
     {
         loadTilesetImage(selectedTileset);
     }
 }
예제 #9
0
 void showTilesetSelector()
 {
     tilsetChoicesText = new string[linker.tilesets.Count];
     for (int index = 0; index < linker.tilesets.Count; index++)
     {
         tilsetChoicesText[index] = linker.tilesets[index].name;
     }
     GUI.changed          = false;
     selectedTilesetIndex = RickEditorGUI.Popup("Editing Tileset", selectedTilesetIndex, tilsetChoicesText);
     if (GUI.changed)
     {
         selectedTileset = linker.tilesets[selectedTilesetIndex];
         loadTilesetImage(selectedTileset);
     }
 }
예제 #10
0
        void loadTilesetImage(TiledTilesetData tileset)
        {
            buttonsIcons = new List <Texture2D>();
            Sprite[] sprites = Resources.LoadAll <Sprite>(tileset.imagePath);

            killAllTexturesFrom(buttonsIcons);
            killAllTexturesFrom(buttonsIconsGray);
            killAllTexturesFrom(buttonsIconsInverted);
            foreach (var sprite in sprites)
            {
                buttonsIcons.Add(TextureUtils.textureFromSprite(sprite));
                buttonsIconsGray.Add(TextureUtils.textureFromSpriteGrayed(sprite));
                buttonsIconsInverted.Add(TextureUtils.textureFromSpriteInverted(sprite));
            }
        }
예제 #11
0
 void switchShownTile(int index)
 {
     selectedTileset = linker.tilesets[index];
     loadTilesetImage(selectedTileset);
 }
예제 #12
0
        void loadTilesetImage(TiledTilesetData tileset)
        {
            buttonsIcons = new List<Texture2D>();
            Sprite[] sprites = Resources.LoadAll<Sprite>(tileset.imagePath);

            killAllTexturesFrom(buttonsIcons);
            killAllTexturesFrom(buttonsIconsGray);
            killAllTexturesFrom(buttonsIconsInverted);
            foreach (var sprite in sprites) {
                buttonsIcons.Add( TextureUtils.textureFromSprite(sprite) );
                buttonsIconsGray.Add( TextureUtils.textureFromSpriteGrayed(sprite) );
                buttonsIconsInverted.Add( TextureUtils.textureFromSpriteInverted(sprite) );
            }
        }
예제 #13
0
 void switchShownTile(int index)
 {
     selectedTileset = linker.tilesets[index];
     loadTilesetImage(selectedTileset);
 }