static public int get_material(IntPtr l) { try { LBoot.SpriteAsset self = (LBoot.SpriteAsset)checkSelf(l); pushValue(l, self.material); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int Unload(IntPtr l) { try { LBoot.SpriteAsset self = (LBoot.SpriteAsset)checkSelf(l); self.Unload(); return(0); } catch (Exception e) { return(error(l, e)); } }
static public int constructor(IntPtr l) { try { LBoot.SpriteAsset o; o = new LBoot.SpriteAsset(); pushValue(l, o); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int GetMaterial(IntPtr l) { try { LBoot.SpriteAsset self = (LBoot.SpriteAsset)checkSelf(l); var ret = self.GetMaterial(); pushValue(l, ret); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int set_material(IntPtr l) { try { LBoot.SpriteAsset self = (LBoot.SpriteAsset)checkSelf(l); UnityEngine.Material v; checkType(l, 2, out v); self.material = v; return(0); } catch (Exception e) { return(error(l, e)); } }
static public int GetSprite(IntPtr l) { try { LBoot.SpriteAsset self = (LBoot.SpriteAsset)checkSelf(l); System.String a1; checkType(l, 2, out a1); var ret = self.GetSprite(a1); pushValue(l, ret); return(1); } catch (Exception e) { return(error(l, e)); } }
public Sprite GetSprite(string spriteName) { string assetPath = null; sprites.TryGetValue(spriteName, out assetPath); if (assetPath == null) { return(null); } assetPath = "assets/" + assetPath + ".asset"; assetPath = assetPath.ToLower(); SpriteAsset spriteAsset = null; #if UNITY_EDITOR spriteAsset = UnityEditor.AssetDatabase.LoadAssetAtPath <SpriteAsset>(assetPath); #else string bundlePath = null; images.TryGetValue(assetPath, out bundlePath); if (bundlePath != null) { var assetBundle = BundleHelper.Load(bundlePath, -1); if (assetBundle != null) { spriteAsset = assetBundle.LoadAsset <SpriteAsset>(assetPath); } } #endif if (spriteAsset != null) { return(spriteAsset.GetSprite(spriteName)); } return(null); }