// Populate a particular anim_palettes_set protected static void populate_one_set(anim_palettes_set APS, IOrderedEnumerable <Object> spritesheets) { APS.palettes = new List <spritesheet>(); Debug.Log("Populating your anim_palettes_set with all spritesheets found containing substring: " + APS.name); foreach (spritesheet sheet in spritesheets) { if (sheet.name.Contains(APS.name)) { APS.palettes.Add(sheet); } } EditorUtility.SetDirty(APS); }
public override void refresh_sprite() { if (0 <= animation_index && animation_index < anim_Palettes_Bundle.sets.Count) { anim_palettes_set set = anim_Palettes_Bundle.sets[animation_index]; if (0 <= palette_index && palette_index < set.palettes.Count) { spritesheet sheet = set.palettes[palette_index]; if (0 <= sprite_index && sprite_index < sheet.sprites.Count) { image.sprite = sheet.sprites[sprite_index]; } } } }
public virtual void refresh_sprite() { if (sprite_renderer == null) { return; } if (0 <= palette_index && palette_index < anim_Palettes_Bundle.sets.Count) { anim_palettes_set set = anim_Palettes_Bundle.sets[palette_index]; if (0 <= animation_index && animation_index < set.palettes.Count) { spritesheet sheet = set.palettes[animation_index]; if (0 <= sprite_index && sprite_index < sheet.sprites.Count) { sprite_renderer.sprite = sheet.sprites[sprite_index]; } } } }