Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 Showoffz · Apr 25, 2016 at 12:11 PM · gameobjectruntimesaveloadserialize

Serialize GameObject

Hello

I have looked through numerous serialize threads and all of them want a way to serialize complex structures / whole scene states or something similar. But all I am looking is a way to same a GameObject created with OBJLoader created by AARO04130. Is there a simple way to save that GameObject into a new file so that the old .obj file is not needed anymore and later load it?

Basically I have some default prefab models that can be used by the user. But I want to add a way that a user can load new models. Right now when user creates a room with different models all the models are saved into strings

  ("Original name:{0};" +"name:{1};position:{2};rotation:{3};color:{4};scale:{5};TAG:{6}",)

And later loaded with

 (tempObj = (GameObject)Resources.Load (pathResource + orgName);)

But is there a way to get that GameObject that was loaded from a OBJ and make it so that i can save it's info the same way I do with prefabs? Or do I have to create a new save and load script for them?

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 LordDarkon76 · Apr 25, 2016 at 02:38 PM

You can use JsonUtility to get the reference from the json.

http://docs.unity3d.com/ScriptReference/JsonUtility.html

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 Showoffz · Apr 25, 2016 at 02:47 PM 0
Share

Can u provide a simple example? Will this allow me do : GameObject -> JSON rep. -> GameObject

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

How to save/load references to components and prefabs 1 Answer

Android download and save "Resources.assets" 0 Answers

How can I serialize the Particles of a Particle Emitter 1 Answer

How do I save/restore a procedurally generated mesh in runtime in Unity 5? 2 Answers

Is it possible to save loaded textures and reuse after close app? 1 Answer


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