Esempio n. 1
0
    private void OnPreprocessAtlas(string path)
    {
        if (!ArtAssetPath.CheckValidAssetPath(path))
        {
            return;
        }
        var atlas = context.mainObject as SpriteAtlas;

        if (atlas != null)
        {
            EditorToolSet.AtlasRenamePrefix(assetPath);

            if (atlas.name.Contains(Rank1TextureSubName))
            {
                spriteAtlasSetting.maxTextureSize = Rank1TextureMaxSize;
            }
            else if (atlas.name.Contains(Rank2TextureSubName))
            {
                spriteAtlasSetting.maxTextureSize = Rank2TextureMaxSize;
            }
            else if (atlas.name.Contains(Rank3TextureSubName))
            {
                spriteAtlasSetting.maxTextureSize = Rank3TextureMaxSize;
            }
            else
            {
                spriteAtlasSetting.maxTextureSize = Rank1TextureMaxSize;
            }

            atlas.SetPlatformSettings(spriteAtlasSetting);
        }
    }
Esempio n. 2
0
    private static void ProcessPrefab(string path)
    {
        var extension = Path.GetExtension(path);

        if (extension.Equals(".prefab"))
        {
            EditorToolSet.RemoveInvalidPrefix(path, invalidPrefix);
        }
    }
Esempio n. 3
0
 private void OnPostprocessTexture(Texture2D texture)
 {
     if (assetPath.Contains("Art/UISprites"))
     {
         EditorToolSet.SpriteRenamePrefix(assetPath);
     }
     else
     {
         EditorToolSet.TextureRenamePrefix(assetPath);
     }
 }
Esempio n. 4
0
    /// <summary>
    /// 导入模型后,修改已导入的Gameobject、mesh、animationclip
    /// </summary>
    /// <param name="g"></param>
    private void OnPostprocessModel(GameObject g)
    {
        //TODO:看之后补充的需求
        EditorToolSet.MeshRenamePrefix(assetPath);
        var modelImporter = assetImporter as ModelImporter;

        if (modelImporter == null)
        {
            return;
        }

        //SwitchModelPreProcess();//这一步已经在OnPreprocessModel判断了具体处理的流程
        DoModelPostProcess(modelImporter, g);
    }
Esempio n. 5
0
        private static void HandleAllDataTables()
        {
            EditorToolSet.LoadPackages();

            var packages = UIPackage.GetPackages();

            foreach (var package in packages)
            {
                var items = package.GetItems();
                foreach (var item in items)
                {
                    if (item.type == PackageItemType.Component && item.name.Contains("Panel") && !item.name.Contains("Frame"))
                    {
                        GenerateCode(package.name, item.name);
                    }
                }
            }
            Debug.Log("GenerateUICode Finish");
        }
Esempio n. 6
0
 private void OnPostprocessPrefab(GameObject obj)
 {
     EditorToolSet.ChangeLayerToEnemy(obj);
 }
Esempio n. 7
0
 private static void OnProcessAnimation(string path)
 {
     EditorToolSet.AnimationRenamePrefix(path);
 }
Esempio n. 8
0
 private void OnPreprocessAudio()
 {
     EditorToolSet.AudioRenamePrefix(assetPath);
 }
Esempio n. 9
0
 private static void OnProcessMaterial(string path)
 {
     EditorToolSet.MaterialRenamePrefix(path);
 }