コード例 #1
0
        public void SerializeSingleVarConditionTest()
        {
            var serializedVarCondition = JsonUtility.ToJson(varCondition);

            Debug.Log(serializedVarCondition);
            var restoredVarCondition = JsonUtility.FromJson <VarCondition>(serializedVarCondition);

            Assert.NotNull(restoredVarCondition);
            Assert.AreEqual(varCondition.GetType(), restoredVarCondition.GetType());
            Assert.AreEqual(varCondition.getType(), restoredVarCondition.getType());
            Assert.AreEqual(varCondition.getState(), restoredVarCondition.getState());
            Assert.AreEqual(varCondition.getValue(), restoredVarCondition.getValue());
        }
コード例 #2
0
 public bool manages(Condition c)
 {
     return(c.GetType() == condition.GetType());
 }