public static void TestFloatField() { AgentData agent = new AgentData(); agent.StartNode = new NodeData(); FloatField floatField = new FloatField(); floatField.FieldName = "FloatField"; floatField.Value = 100.001f; agent.StartNode.Fields.Add(floatField); RepeatFloatField repeatFloatField = new RepeatFloatField(); repeatFloatField.FieldName = "RepeatIntField"; repeatFloatField.Value = new List <float>(); repeatFloatField.Value.Add(1.1f); repeatFloatField.Value.Add(100.11f); repeatFloatField.Value.Add(1000.11f); repeatFloatField.Value.Add(10000.1119f); agent.StartNode.Fields.Add(repeatFloatField); byte[] bytes = Serializer.Serialize(agent); AgentData deAgentData = Serializer.DeSerialize <AgentData>(bytes); }
public static void TestFloatField() { BehaviorTreeElement behaviorTree = new BehaviorTreeElement(); behaviorTree.StartNode = new NodeData(); FloatField floatField = new FloatField(); floatField.FieldName = "FloatField"; floatField.Value = 100.001f; behaviorTree.StartNode.Fields.Add(floatField); RepeatFloatField repeatFloatField = new RepeatFloatField(); repeatFloatField.FieldName = "RepeatIntField"; repeatFloatField.Value = new List <float>(); repeatFloatField.Value.Add(1.1f); repeatFloatField.Value.Add(100.11f); repeatFloatField.Value.Add(1000.11f); repeatFloatField.Value.Add(10000.1119f); behaviorTree.StartNode.Fields.Add(repeatFloatField); byte[] bytes = Serializer.Serialize(behaviorTree); BehaviorTreeElement deBehaviorTreeData = Serializer.DeSerialize <BehaviorTreeElement>(bytes); }