How to serialize and save a GameObject in Unity

前端 未结 3 667
再見小時候
再見小時候 2020-11-27 20:49

I have a game where the player picks up a weapon and it is then placed as the GameObject variable to my player called \"MainHandWeapon\" and I am trying to save that weapon

3条回答
  •  天涯浪人
    2020-11-27 21:28

    Ideally you should have an object which hold the weapon data (attack, durability, etc ...) and serialize this object, it makes your save games much smaller, and is more OOP, as you can inherit from that class.

提交回复
热议问题