Unity-Technologies / 2d-extras

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

TerrainTile combined with WeightedRandom? #319

Open superfrantv opened 2 years ago

superfrantv commented 2 years ago

Hello,

i need some help in scripting. How can i optimized combine TerrainTile with WeightedRandom, i want a checkBox in the Inspector for the "Filled" Tile so add differend styles bassed on weightedrandom.

Thank you

ChuanXin-Unity commented 2 years ago

You could check out the link below for an implementation of a Terrain Tile with Weighted Random Sprites, and adjust the Inspector's UX to suit your needs:

https://github.com/Unity-Technologies/2d-extras/blob/weightedrandomterraintile/Runtime/Tiles/TerrainTile/WeightedRandomTerrainTile.cs

superfrantv commented 2 years ago

Thank you, but i added it and when i reload my project all sprites are deleted in the tile.

ChuanXin-Unity commented 2 years ago

I updated the branch with a fix for that!

On Thu, Nov 4, 2021 at 6:24 PM superfrantv @.***> wrote:

Thank you, but i added it and when i reload my project all sprites are deleted in the tile.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Unity-Technologies/2d-extras/issues/319#issuecomment-960626538, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHA3TER6FPCFZO2P3IKNHT3UKJNPPANCNFSM5HGQTGRQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.