Saving new instances of class as Object

Updated on January 12, 2016 in [A] Unity Scripting
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
1 on January 12, 2016

I have created a class for skills which contains information with basic types and unity types(includes gameobject) .

Something like this –


public class Skillls {

public int points ;

public GameObject cloneObject ;

public Texture2D cloneTexture ;
//haves constructors

}

Now using Unity editor i create Instances of skills, like


Skills Fire = new Skills(data) ;

Skills Water = new Skills(data1) ;

Now i  want to save the Skills in my asset folder as object
I know we can achieve it by using serializing – Binary Formatter – save.
But i want to save as my own .skill extension .Say Fire.skills , Water.skills
So it can be directly used in inspector without deserializing it.
Any Help then please .

  • Liked by
Reply
0 on January 12, 2016

Found a way 🙂 too easy than i expected . Just now i can even customize inspector view 😛
Great tutorial Here

  • Liked by
Reply
Cancel