示例#1
0
        public static int CloseView(IntPtr L)
        {
            int result = 1;
            int count  = LuaDLL.lua_gettop(L);

            if (count == 2 &&
                LuaStatic.CheckType(L, typeof(EnumUIName), 2))
            {
                UIManager  obj  = LuaStatic.GetObj(L, 1) as UIManager;
                EnumUIName arg1 = (EnumUIName)(double)(LuaStatic.GetObj(L, 2));
                obj.CloseView(arg1);

                return(result);
            }
            if (count == 3 &&
                LuaStatic.CheckType(L, typeof(EnumUIName), 2) &&
                LuaStatic.CheckType(L, typeof(Boolean), 3))
            {
                UIManager  obj  = LuaStatic.GetObj(L, 1) as UIManager;
                EnumUIName arg1 = (EnumUIName)(double)(LuaStatic.GetObj(L, 2));
                Boolean    arg2 = (Boolean)LuaStatic.GetObj(L, 3);
                obj.CloseView(arg1, arg2);

                return(result);
            }
            LuaStatic.traceback(L, "count not enough");
            LuaDLL.lua_error(L);
            return(result);
        }
示例#2
0
    private void FreeView(EnumUIName uiName)
    {
        UIBase uiBase = mCachedUIDict[uiName];

        mCachedUINameList.Remove(uiName);
        mCachedUIDict.Remove(uiName);
        GameObject.Destroy(uiBase.gameObject);
    }
示例#3
0
	public void OpenView(EnumUIName uiName, object args, bool closeOtherUI) {
		
		if (closeOtherUI) {
			CloseAllExitView();
		}

		bool isUIOpen = CheckExitView(uiName);
		UIBase uiBase = isUIOpen ? mCachedUIDict[uiName] : LoadUISource(uiName, args);

		if (isUIOpen && uiBase.isActive) { 
			return; 
		}
		uiBase.OnOpenUI(args);
	}
示例#4
0
    public void OpenView(EnumUIName uiName, object args, bool closeOtherUI)
    {
        if (closeOtherUI)
        {
            CloseAllExitView();
        }

        bool   isUIOpen = CheckExitView(uiName);
        UIBase uiBase   = isUIOpen ? mCachedUIDict[uiName] : LoadUISource(uiName, args);

        if (isUIOpen && uiBase.isActive)
        {
            return;
        }
        uiBase.OnOpenUI(args);
    }
示例#5
0
    public void CloseView(EnumUIName uiName, bool needFree)
    {
        if (!CheckExitView(uiName))
        {
            return;
        }
        UIBase uiBase = mCachedUIDict[uiName];

        if (!uiBase.isActive)
        {
            uiBase.OnCloseUI();
        }
        if (needFree)
        {
            FreeView(uiName);
        }
    }
示例#6
0
    private UIBase LoadUISource(EnumUIName uiName, object args)
    {
        string     name = uiName.ToString();
        GameObject ui   = Resources.Load <GameObject>(GameConst.ResourceUrl.UI_URL + name);

        ui = GameObject.Instantiate(ui);
        ui.transform.parent        = mUIRoot;
        ui.transform.localScale    = Vector3.one;
        ui.transform.localPosition = Vector3.zero;
        ui.name = name;

        UIBase uiBase = ui.GetComponent <UIBase>();

        if (uiBase == null)
        {
            uiBase = ui.AddComponent(LuaStatic.GetType(name)) as UIBase;
        }
        mCachedUINameList.Add(uiName);
        mCachedUIDict[uiName] = uiBase;
        uiBase.OnLoadedUI(true, args);
        return(uiBase);
    }
示例#7
0
	public void CloseView(EnumUIName uiName, bool needFree) {
		if (!CheckExitView(uiName)) {
			return;
		}
		UIBase uiBase = mCachedUIDict[uiName];
		if (!uiBase.isActive) {
			uiBase.OnCloseUI();
		}
		if (needFree) {
			FreeView(uiName);
		}
	}
示例#8
0
 public void OpenView(EnumUIName uiName, object args)
 {
     OpenView(uiName, args, true);
 }
示例#9
0
 public void OpenView(EnumUIName uiName)
 {
     OpenView(uiName, null, true);
 }
示例#10
0
 private bool CheckExitView(EnumUIName name)
 {
     return(mCachedUINameList.Contains(name));
 }
示例#11
0
	private void FreeView(EnumUIName uiName) {
		UIBase uiBase = mCachedUIDict[uiName];
		mCachedUINameList.Remove(uiName);
		mCachedUIDict.Remove(uiName);
		GameObject.Destroy(uiBase.gameObject);
	}
示例#12
0
 public void CloseView(EnumUIName uiName)
 {
     CloseView(uiName, false);
 }
示例#13
0
	private UIBase LoadUISource(EnumUIName uiName, object args) {
		string name = uiName.ToString();
		GameObject ui = Resources.Load<GameObject>(GameConst.ResourceUrl.UI_URL + name);
		ui = GameObject.Instantiate(ui);
		ui.transform.parent = mUIRoot;
		ui.transform.localScale = Vector3.one;
		ui.transform.localPosition = Vector3.zero;
		ui.name = name;

		UIBase uiBase = ui.GetComponent<UIBase>();
		if (uiBase == null) {
			uiBase = ui.AddComponent(LuaStatic.GetType(name)) as UIBase;
		}
		mCachedUINameList.Add(uiName);
		mCachedUIDict[uiName] = uiBase;
		uiBase.OnLoadedUI(true, args);
		return uiBase;
	}
示例#14
0
	public void CloseView(EnumUIName uiName) {
		CloseView(uiName, false);
	}
示例#15
0
	private bool CheckExitView(EnumUIName name) {
		return mCachedUINameList.Contains(name);
	}
示例#16
0
	public void OpenView(EnumUIName uiName, object args) {
		OpenView(uiName, args, true);
	}
示例#17
0
	public void OpenView(EnumUIName uiName) {
		OpenView(uiName, null, true);
	}