Ejemplo n.º 1
0
        public override Texture2D RenderStaticPreview(string assetPath, Object[] subAssets, int width, int height)
        {
            AnimatedTile tile = AssetDatabase.LoadAssetAtPath <AnimatedTile>(assetPath);

            if (tile.m_AnimatedSprites[0] != null)
            {
                return(tile.m_AnimatedSprites[0].ToTexture2D(width, height));
            }

            return(null);
        }
Ejemplo n.º 2
0
        public static void CreateBrush()
        {
            string path = EditorUtility.SaveFilePanelInProject("Save Brush", "New Brush", "asset", "Save Brush", "Assets");

            if (path == "")
            {
                return;
            }

            AnimatedTile myTile = new AnimatedTile();

            myTile.m_AnimatedSprites = new Sprite[4];
            AssetDatabase.CreateAsset(myTile, path);

            AssetDatabase.SaveAssets();
            AssetDatabase.Refresh();
        }