Exemplo n.º 1
0
        public static void make()
        {
            _uiElementDic.clear();
            _uiModelDic.clear();

            initElementNames();

            foreach (var v in _elementPrefabDic)
            {
                Transform tf = v.transform;

                UIObjectData element = new UIObjectData();
                element.name  = tf.gameObject.name;
                element.type  = UIElementType.Element;
                element.style = "";

                if (tf.gameObject.tag.Equals("G"))
                {
                    element.style = "G";
                }

                makeNode(element, tf);

                _uiElementDic.put(element.name, element);
            }

            //生成新预处理列表
            string[] files = FileUtils.getDeepFileList(ShineToolGlobal.uiModelsPath, "prefab");

            for (int i = 0; i < files.Length; i++)
            {
                string assetsPath = ToolFileUtils.getAssetsPath(files[i]);

                GameObject prefab = AssetDatabase.LoadAssetAtPath <GameObject>(assetsPath);

                Transform tf = prefab.transform;

                UIObjectData element = new UIObjectData();
                element.name  = tf.gameObject.name;
                element.type  = UIElementType.Model;
                element.style = "";

                if (tf.gameObject.tag.Equals("G"))
                {
                    element.style = "G";
                }

                makeNode(element, tf);

                _uiModelDic.put(element.name, element);
            }

            writeBytes();

            ToolFileUtils.executeServerTool("uiModel");

            Ctrl.print("OK");
        }
Exemplo n.º 2
0
        protected override void populateMenu(GenericMenu menu, SerializedProperty property, SElementAttribute attribute)
        {
            string[] files = FileUtils.getDeepFileList(ToolFileUtils.getAssetsPath(ShineToolGlobal.uiElementsPath), "prefab");
            for (int i = 0; i < files.Length; i++)
            {
                GameObject prefab = AssetDatabase.LoadAssetAtPath <GameObject>(files[i]);

                string name = prefab.name;
                menu.AddItem(new GUIContent(name), name == property.stringValue, onSelectItem, name);
            }
        }
Exemplo n.º 3
0
        private static void initElementNames()
        {
            _elementDic       = new SMap <string, string>();
            _elementPrefabDic = new SMap <string, GameObject>();

            string[] files = FileUtils.getDeepFileList(ShineToolGlobal.uiElementsPath, "prefab");
            for (int i = 0; i < files.Length; i++)
            {
                string assetsPath = ToolFileUtils.getAssetsPath(files[i]);

                GameObject prefab = AssetDatabase.LoadAssetAtPath <GameObject>(assetsPath);

                _elementDic.put(assetsPath, prefab.name);
                _elementPrefabDic.put(assetsPath, prefab);
            }
        }
Exemplo n.º 4
0
        static void addAllSceneToBuildSettings()
        {
            // string[] unityList=FileUtils.getDeepFileList(ShineToolGlobal.assetSourcePath + "/unity","unity");
            string[] sceneList = FileUtils.getDeepFileList(ShineToolGlobal.assetSourcePath + "/scene", "unity");

            EditorBuildSettingsScene[] newSettings = new EditorBuildSettingsScene[sceneList.Length + 2];

            int i = 0;

            newSettings[i++] = new EditorBuildSettingsScene(ShineGlobal.sourceHeadU + "unity/main.unity", true);
            newSettings[i++] = new EditorBuildSettingsScene(ShineGlobal.sourceHeadU + "unity/root.unity", true);

            foreach (string v in sceneList)
            {
                string sceneName = ToolFileUtils.getAssetsPath(v);
                newSettings[i++] = new EditorBuildSettingsScene(sceneName, true);
            }

            EditorBuildSettings.scenes = newSettings;
        }