// 处理Sprite中的大图 private static void ExcuteBigImg(Image img, string imgPath) { SpriteBigLoader loader = GameObjectHelper.AddComponent <SpriteBigLoader>(img.gameObject); RemoveOtherCs(img.gameObject, TYPE_BIG_SPRITE); img.sprite = null; loader._isComplete = false; loader._resPath = imgPath; }
// 处理Sprite中的图集 private static void ExcuteAltas(Image img, string imgPath) { // 图集的处理方式 SpriteAtlasLoader loader = GameObjectHelper.AddComponent <SpriteAtlasLoader>(img.gameObject); RemoveOtherCs(img.gameObject, TYPE_SPRITE); img.sprite = null; loader._initComplete = false; loader._resPath = imgPath; loader._spriteTag = GetSpriteTag(imgPath); }
private static void ExcuteSelectableBig(Selectable selectable, string highlightedPath, string pressedPath, string disabledPath) { SpriteSelectableBigLoader loader = GameObjectHelper.AddComponent <SpriteSelectableBigLoader>(selectable.gameObject); RemoveOtherCs(selectable.gameObject, TYPE_SELECTABLE_BIT); SpriteState state = new SpriteState(); state.highlightedSprite = null; state.pressedSprite = null; state.disabledSprite = null; selectable.spriteState = state; loader._initComplete = false; loader._highlightedSpritePath = highlightedPath; loader._pressedSpritePath = pressedPath; loader._disabledSpritePath = disabledPath; }