GetItemAsset() public method

public GetItemAsset ( PackageItem item ) : object
item PackageItem
return object
コード例 #1
0
    static int GetItemAsset(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(FairyGUI.UIPackage), typeof(string)))
            {
                FairyGUI.UIPackage obj  = (FairyGUI.UIPackage)ToLua.ToObject(L, 1);
                string             arg0 = ToLua.ToString(L, 2);
                object             o    = obj.GetItemAsset(arg0);
                ToLua.Push(L, o);
                return(1);
            }
            else if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(string), typeof(string)))
            {
                string arg0 = ToLua.ToString(L, 1);
                string arg1 = ToLua.ToString(L, 2);
                object o    = FairyGUI.UIPackage.GetItemAsset(arg0, arg1);
                ToLua.Push(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: FairyGUI.UIPackage.GetItemAsset"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
コード例 #2
0
		/// <summary>
		/// Get a asset with a certain name.
		/// </summary>
		/// <param name="pkgName">Package name.</param>
		/// <param name="resName">Resource name.</param>
		/// <returns>If resource is atlas, returns NTexture; If resource is sound, returns AudioClip.</returns>
		public static object GetItemAsset(string pkgName, string resName)
		{
			UIPackage pkg = GetByName(pkgName);
			if (pkg != null)
				return pkg.GetItemAsset(resName);
			else
				return null;
		}
コード例 #3
0
        /// <summary>
        /// Get a asset with a certain name.
        /// </summary>
        /// <param name="pkgName">Package name.</param>
        /// <param name="resName">Resource name.</param>
        /// <returns>If resource is atlas, returns NTexture; If resource is sound, returns AudioClip.</returns>
        public static object GetItemAsset(string pkgName, string resName)
        {
            UIPackage pkg = GetByName(pkgName);

            if (pkg != null)
            {
                return(pkg.GetItemAsset(resName));
            }
            else
            {
                return(null);
            }
        }
コード例 #4
0
 static public int GetItemAsset(IntPtr l)
 {
     try {
         FairyGUI.UIPackage self = (FairyGUI.UIPackage)checkSelf(l);
         System.String      a1;
         checkType(l, 2, out a1);
         var ret = self.GetItemAsset(a1);
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #5
0
 public object Load()
 {
     return(owner.GetItemAsset(this));
 }