2d-extras icon indicating copy to clipboard operation
2d-extras copied to clipboard

'AssetDatabase' does not contain a definition for 'SaveAssetIfDirty'

Open Phoenixrafael opened this issue 3 years ago • 8 comments

I am using Unity version 2020.3.15f2, and I installed 2d-extras using git URL.

Following error occurred after adding the package : Library\PackageCache\com.unity.2d.tilemap.extras@d8f6f31800\Editor\Tiles\RuleOverrideTile\RuleOverrideTileEditor.cs(355,31): error CS0117: 'AssetDatabase' does not contain a definition for 'SaveAssetIfDirty'

(I installed branch 2020.3 by using link https://github.com/Unity-Technologies/2d-extras.git#2020.3)

Phoenixrafael avatar Apr 03 '22 01:04 Phoenixrafael

Hi, sorry about this! It looks like this was added in 2020.3.16. We will sort this out so that this will work in prior versions too.

ChuanXin-Unity avatar Apr 04 '22 01:04 ChuanXin-Unity

Hi, this has been updated to use the original AssetDatabase.SaveAssets, so that it will work with all versions of 2020.3!

ChuanXin-Unity avatar Apr 04 '22 02:04 ChuanXin-Unity

Hi, I use version 2021.1 and this happened to me too. Can you check that for me, thank you <3

Mita-kgwh avatar May 06 '22 15:05 Mita-kgwh

@Mita-kgwh Hi, could you share which version of the 2D Tilemap Extras package you are using and how you have added it to your project (eg. Unity Package Manager, Github, ...)? Thanks!

ChuanXin-Unity avatar May 09 '22 01:05 ChuanXin-Unity

@Mita-kgwh Hi, could you share which version of the 2D Tilemap Extras package you are using and how you have added it to your project (eg. Unity Package Manager, Github, ...)? Thanks!

Hii, I downloaded the package from branch package_2021.1 and place it in my Packages folder, and then i add "com.unity.2d.tilemap.extras": "https://github.com/Unity-Technologies/2d-extras.git#package_2021.1" to my Packages/manifest.json. But i see you fixed the package 2020.3 so i'm using it now.

Mita-kgwh avatar May 09 '22 02:05 Mita-kgwh

I added this changeset to help with this on 2021.1: https://github.com/Unity-Technologies/2d-extras/commit/b41b6d291a9968297948355814327cc2cd98dd47

Hope that helps!

ChuanXin-Unity avatar May 09 '22 08:05 ChuanXin-Unity

I added this changeset to help with this on 2021.1: b41b6d2

Hope that helps!

Hi, That fixed my SaveAssetIfDirty error. Thank you very much <3

Mita-kgwh avatar May 10 '22 06:05 Mita-kgwh

Thanks for confirming this! I will merge this into the main package_2021.1 branch.

ChuanXin-Unity avatar May 10 '22 06:05 ChuanXin-Unity