示例#1
0
        private void CreateUIPanelComponentsCode(string behaviourName, string uiUIPanelfilePath)
        {
            var dir = uiUIPanelfilePath.Replace(behaviourName + ".cs", "");
            var generateFilePath = dir + behaviourName + "Components.cs";

            UIPanelComponentsCodeTemplate.Generate(generateFilePath, behaviourName, GetProjectNamespace(), mPanelCodeData);

            foreach (var elementCodeData in mPanelCodeData.ElementCodeDatas)
            {
                var elementDir = (dir + behaviourName + "/").CreateDirIfNotExists();
                CreateUIElementCode(elementDir, elementCodeData);
            }
        }
        private void CreateUIPanelComponentsCode(string behaviourName, string uiUIPanelfilePath)
        {
            var dir = uiUIPanelfilePath.Replace(behaviourName + ".cs", "");
            var generateFilePath = dir + behaviourName + "Components.cs";

            UIPanelComponentsCodeTemplate.Generate(generateFilePath, behaviourName, GetProjectNamespace(), mPanelCodeData);

            foreach (var elementCodeData in mPanelCodeData.ElementCodeDatas)
            {
                var elementDir = string.Empty;
                elementDir = elementCodeData.MarkedObjInfo.MarkObj.GetUIMarkType() == UIMarkType.Element
                                        ? (dir + behaviourName + "/").CreateDirIfNotExists()
                                        : (Application.dataPath + "/" + GetScriptsPath() + "/Components/").CreateDirIfNotExists();
                CreateUIElementCode(elementDir, elementCodeData);
            }
        }