Exemplo n.º 1
0
    string autoClearUI(MonoLuaItem[] pArr)
    {
        string tResult = "function " + "this" + ":autoClearUI()\r\n";

        string tDisPoseStr = "";

        for (int tIndex = 0, tLen = pArr.Length; tIndex < tLen; tIndex++)
        {
            MonoLuaItem        tMonoLuaItem = pArr[tIndex];
            MonoLuaUIOutData[] tOutDatas    = tMonoLuaItem.outDatas;
            for (int tIndexOut = 0, tLenOut = tOutDatas.Length; tIndexOut < tLenOut; tIndexOut++)
            {
                MonoLuaUIOutData tOutData = tOutDatas[tIndexOut];
                if (tOutData.uiGameObj == null && tOutData.uiComponent == null)
                {
                    continue;
                }
                if (tOutData.uiComponent == null)
                {
                    tResult += "\t this.ui_" + tOutData.exportName + "= nil" + SybolNewLine;
                }
                else
                {
                    string tType = getUIType(tOutData.uiComponent);
                    tResult += "\t this.ui_" + tOutData.exportName + "=nil" + SybolNewLine;
                }
            }
        }
        tResult += "end ";
        return(tResult);
    }
Exemplo n.º 2
0
    string checkRepeat(MonoLuaItem[] pArr)
    {
        Dictionary <string, bool> tKey = new Dictionary <string, bool>();

        for (int tIndex = 0, tLen = pArr.Length; tIndex < tLen; tIndex++)
        {
            MonoLuaItem tMonoLuaItem = pArr[tIndex];

            MonoLuaUIOutData[] tOutDatas = tMonoLuaItem.outDatas;
            for (int tIndexOut = 0, tLenOut = tOutDatas.Length; tIndexOut < tLenOut; tIndexOut++)
            {
                MonoLuaUIOutData tOutData = tOutDatas[tIndexOut];
                if (tOutData.uiGameObj == null && tOutData.uiComponent == null)
                {
                    continue;
                }

                if (tKey.ContainsKey(tOutData.exportName))
                {
                    return(getGameObjectPath(tMonoLuaItem.gameObject) + " repeated " + tOutData.exportName);
                }
                tKey.Add(tOutData.exportName, true);
            }
        }
        return("");
    }
Exemplo n.º 3
0
    string autoSetUI(MonoLuaItem[] pArr)
    {
        string tResult = "function " + "this" + ":autoGetUI()\r\n";

        string tDisPoseStr = "";

        for (int tIndex = 0, tLen = pArr.Length; tIndex < tLen; tIndex++)
        {
            MonoLuaItem tMonoLuaItem = pArr[tIndex];

            MonoLuaUIOutData[] tOutDatas = tMonoLuaItem.outDatas;
            for (int tIndexOut = 0, tLenOut = tOutDatas.Length; tIndexOut < tLenOut; tIndexOut++)
            {
                MonoLuaUIOutData tOutData = tOutDatas[tIndexOut];
                if (tOutData.uiGameObj == null && tOutData.uiComponent == null)
                {
                    continue;
                }
                if (tOutData.uiGameObj != null)
                {
                    if (tOutData.uiGameObj == gameObject)
                    {
                        tResult += "\t this.ui_" + tOutData.exportName + "=this.gameObject" + SybolNewLine;
                    }
                    else
                    {
                        tResult += "\t this.ui_" + tOutData.exportName + "=this.transform:FindChild(\"" + getGameObjectPath(tOutData.uiGameObj) + "\").gameObject" + SybolNewLine;
                    }
                }
                else
                {
                    string tType = getUIType(tOutData.uiComponent);
                    if (tOutData.uiComponent.gameObject == gameObject)
                    {
                        tResult += "\t this.ui_" + tOutData.exportName + "=this.gameObject:GetComponent(\"" + tType + "\")" + SybolNewLine;
                    }
                    else
                    {
                        tResult += "\t this.ui_" + tOutData.exportName + "=this.transform:FindChild(\"" + getGameObjectPath(tOutData.uiComponent.gameObject) + "\").gameObject:GetComponent(\"" + tType + "\")" + SybolNewLine;
                    }
                }
            }
        }
        tResult += "end ";
        return(tResult);
    }