Saving and loading cube data

I am trying to save all of the data of cubes as floats for x,y,z positioning and x,y,z rotation, and the name of the block as a string to save it for later. I am then loading all this data into a vector3 quaternion and a huge if statement line checking what type of block it is and loading it. It doesn’t save the x,y,z positioning, and x,y,z rotation right and keeps making a gigantic ball of crap. Any ideas of how I can save each of the variables individually? Btw I am trying to save those variables separately for serialization, not trying to be a noob and fail when I serialize my data into some type of file. Wouldn’t want that data exploited!

there are several ways to accomplish what you want, but it is best to use a library that will do it all for you. You can use the [PlayerPrefsX.cs][1] class written by community user [Eric Haines][2], or you can use the [script shown here][3] that has the necessary code taken from [PlayerPrefsX.cs][4] (660 lines vs 292 lines).

Here is an example class that easily saves positions and quaternions from a list of transforms that works with either versions of the extended PlayerPrefs code

using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class SaveLoad : MonoBehaviour
{
    public List<Transform> transforms = new List<Transform>();

    // this is just an example of saving a position and a quaternion using the PlayerPrefsExt class
    public void SaveTransformData(string positionKey, string quaternionKey)
    {
        if (transforms.count > 0)
        {
            for int i = 0; i < transforms.count; i++)
            {
                PlayerPrefsExt.SetVector3(positionKey + "_" + i.ToString(), transforms*.position);*

PlayerPrefsExt.SetQuaternion(quaternionKey + "" + i.ToString(), transforms*.rotation);
_
}*

}
}

// this is just an example of loading a position and a quaternion using the PlayerPrefsExt class
public void LoadTransformData(string positionKey, string quaternionKey)
{
if (transforms.count > 0)
{
for int i = 0; i < transforms.count; i++)
{
transforms*.position = PlayerPrefsExt.GetVector3(positionKey + “_” + i.ToString(), new Vector3(0, 0, 0));*

transforms*.rotation = PlayerPrefsExt.GetQuaternion(quaternionKey + "" + i.ToString(), Quaternion.Euler(0, 0, 0));*
}
}
}
}
[1]: http://wiki.unity3d.com/index.php/ArrayPrefs2#C.23_-_PlayerPrefsX.cs
[2]: http://wiki.unity3d.com/index.php/User:Eric5h5*_
_[3]: http://pastebin.com/VNsKKWsS*_

[4]: http://wiki.unity3d.com/index.php/ArrayPrefs2#C.23_-_PlayerPrefsX.cs

I want to avoid playerprefs at all costs, my experience with them was short and I would not like to use them again. They really lagged my first concept of my game making it stop for 3 second to save a three digit integer.