Unity-Technologies / 2d-extras

Fun 2D Stuff that we'd like to share!
Other
1.55k stars 343 forks source link

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

Open Phoenixrafael opened 2 years ago

Phoenixrafael commented 2 years ago

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)

ChuanXin-Unity commented 2 years ago

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 commented 2 years ago

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

Mita-kgwh commented 2 years ago

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

ChuanXin-Unity commented 2 years ago

@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!

Mita-kgwh commented 2 years ago

@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.

ChuanXin-Unity commented 2 years ago

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

Hope that helps!

Mita-kgwh commented 2 years ago

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

ChuanXin-Unity commented 2 years ago

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