Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by SFvdB · Mar 10, 2014 at 09:15 PM · prefabassetsserializationgenerating

Best approach to one-time generation: Assets, Serialization or manual labor?

What I want to achieve is this: A one-time generation of an X by Y field of gameobjects (tiles in a grid, basically). Afterwards I would like to be able to adjust the X or Y by using an editor window or inspector panel.

Making a script to generate a grid of items is easy. Now I want the tiles to stay in place after assembly reload. Or even when I reopen the project.

However I am lost to what is the best approach to this. Is it by using prefabs/resources and creating individual assets? Running the script only once?

Or perhaps through a serialized list of gameobjects which will use OnEnable to check if the required X and Y tiles are there?

I can manually place each item on each gridpoint (and adjust each item's name) but understandibly that should be a chore left unnecessary.

Which is the best avenue to go down? Thank you.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Owen-Reynolds · Mar 10, 2014 at 11:11 PM

I'm thinking a Unity "editor script" can make permanent changes to objects. In theory your current grid placement code would be translated into one of these. Might end up with a custom Inspector for a "gridScript" object, with a slider for size, etc... . Any cool packages with funny-looking Inspector panels were made that way.

They are a pain to figure out, lots of magic words, but I think the sort of thing that once you know how, you want to make one for everything.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image SFvdB · Mar 11, 2014 at 07:33 AM 0
Share

Thanks. It would seem so, wouldn't it? What I have been struggling with, though, is using prefabs in unapplied scripts. But perhaps the /resource folder might help with that.

Right now I think the best avenue is that of trying to instantiate real objects: IE, assets. Therefor I am investigating this package by $$anonymous$$ike "@runonthespot" http://forum.unity3d.com/threads/175168-Scriptable-Object-simplest-use

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

21 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Saving runtime created avatar 1 Answer

What does this mean exactly? "A script behaviour (script unknown or not yet loaded) has a different serialization layout when loading" 0 Answers

Serialization with custom editor, prefab not saving (again) 1 Answer

FormerlySerializedAs and Prefabs 0 Answers

How to Load/Unload assets in Editor? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges