Example #1
0
    static public GameObject AddParticleByName(string name, GameObject parent)
    {
        string     path   = "LiziEffects/Lizi/" + name;
        GameObject prefab = (GameObject)ResLoader.Load(path, typeof(GameObject));

        return(NGUITools.AddChildNotLoseScale(parent, prefab));
    }
Example #2
0
    /// <summary>
    /// Add Common Bag Without Close Btn And Background
    /// </summary>
    /// <param name="parent">bag transform parent</param>
    /// <param name="bagType">Bag Controller Component Often Inherit From EquipBaseBagController(You Need To Overrid Two Action Functions)</param>
    /// <returns></returns>
    public static GameObject AddHeroCommonBag(GameObject parent, System.Type bagType)
    {
        string     baseBagePrefabPath = "HeroCommon/CommonBag";
        GameObject BaseBagPrefab      = (GameObject)ResLoader.Load(UIPrefabDummy.GetUIPrefabPath(baseBagePrefabPath), typeof(GameObject));
        GameObject bag = NGUITools.AddChildNotLoseScale(parent, BaseBagPrefab);

        bag.AddComponent(bagType);
        return(bag);
    }
Example #3
0
    public static int AddChild(IntPtr l)
    {
        GameObject   parent = lua_.ToUserDataObject(1) as GameObject;
        string       path   = lua_.ToString(2);
        GameObject   prefab = (GameObject)ResLoader.Load(UIPrefabDummy.GetUIPrefabPath(path), typeof(GameObject));
        GameObject   obj    = NGUITools.AddChildNotLoseScale(parent, prefab);
        LuaBehaviour luaB   = obj.GetComponent <LuaBehaviour>();

        if (luaB == null)
        {
            Debug.Log("There is No LuaBehaviour on new GameObj." + prefab.name);
            return(0);
        }
        lua_.RawGetI(LuaAPI.LUA_REGISTRYINDEX, luaB.Object_ref);
        return(1);
    }
Example #4
0
    /// <summary>
    /// Add Common Bag With Close Btn And Background
    /// </summary>
    /// <param name="parent">bag transform parent</param>
    /// <param name="bagType">Bag Controller Component Often Inherit From EquipBaseBagController(You Need To Overrid Two Action Functions)</param>
    /// <returns></returns>
    public static GameObject MakeCommonBackBag(GameObject parent, Type bagType)
    {
        string     BaseBagePrefabPath = "HeroCommon/CommonBackCloseBag";
        GameObject BaseBagPrefab      = (GameObject)ResLoader.Load(UIPrefabDummy.GetUIPrefabPath(BaseBagePrefabPath), typeof(GameObject));
        GameObject bag = NGUITools.AddChildNotLoseScale(parent.transform.parent.gameObject, BaseBagPrefab);

        //BaseBagLoader.BagType = bagType;
        bag.transform.localPosition += new UnityEngine.Vector3(0, 0, -30);
        //bag.AddComponent<BaseBagLoader>();
        //RealCloseIfNotTouchThis rc = bag.GetComponent<RealCloseIfNotTouchThis>();
        //if (rc == null)
        //{
        //    bag.AddComponent<RealCloseIfNotTouchThis>();
        //}
        return(bag);
    }
Example #5
0
    static public GameObject AddChildByPath(string path, GameObject parent)
    {
        GameObject prefab = (GameObject)ResLoader.Load(UIPrefabDummy.GetUIPrefabPath(path), typeof(GameObject));

        return(NGUITools.AddChildNotLoseScale(parent, prefab));
    }
Example #6
0
    static public GameObject AddChildByResourcesPath(string path, GameObject parent)
    {
        GameObject prefab = (GameObject)ResLoader.Load(path, typeof(GameObject));

        return(NGUITools.AddChildNotLoseScale(parent, prefab));
    }