FairyGUI.UIPackage.CreateObject C# (CSharp) Method

CreateObject() public method

public CreateObject ( string resName ) : GObject
resName string
return GObject
        public GObject CreateObject(string resName)
        {
            PackageItem pi;
            if (!_itemsByName.TryGetValue(resName, out pi))
            {
                Debug.LogError("FairyGUI: resource not found - " + resName + " in " + this.name);
                return null;
            }

            return CreateObject(pi, null);
        }

Same methods

UIPackage::CreateObject ( PackageItem item, System userClass ) : GObject
UIPackage::CreateObject ( string resName, System userClass ) : GObject
UIPackage::CreateObject ( string pkgName, string resName ) : GObject
UIPackage::CreateObject ( string pkgName, string resName, System userClass ) : GObject

Usage Example

Example #1
0
 static public int CreateObject(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 2)
         {
             FairyGUI.UIPackage self = (FairyGUI.UIPackage)checkSelf(l);
             System.String      a1;
             checkType(l, 2, out a1);
             var ret = self.CreateObject(a1);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         else if (argc == 3)
         {
             FairyGUI.UIPackage self = (FairyGUI.UIPackage)checkSelf(l);
             System.String      a1;
             checkType(l, 2, out a1);
             System.Type a2;
             checkType(l, 3, out a2);
             var ret = self.CreateObject(a1, a2);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function to call");
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
All Usage Examples Of FairyGUI.UIPackage::CreateObject