Ejemplo n.º 1
0
        public void JsonPersistentSaveTest()
        {
            var testClassB = new TestClassB()
            {
                intvalue    = 5,
                stringvalue = "testclassB",
            };

            var testClassA = new TestClassA()
            {
                intvalue    = 3,
                stringvalue = "testclassA",
                classB      = testClassB,
            };

            string line = "";

            PersistentData.SaveToJson(testClassA);
            var a    = PersistentData.LoadFromJson <TestClassA>();
            var test = JsonUtility.FromJson <TestClassA>(line);

            Assert.AreEqual(a.classB.stringvalue, "testclassB");
            PersistentData.Delete <TestClassA>();
        }