// UMA Auto genered code, DO NOT MODIFY!!!
// All changes to this file will be destroyed without warning or confirmation!
// Use double {{ to escape a single curly bracket
//
// template junk executed per dna Field , the accumulated content is available through the {{0:ID}} tag
//
//#TEMPLATE GetValues UmaDnaChild_GetIndex_Fragment.cs.txt
//#TEMPLATE SetValues UmaDnaChild_SetIndex_Fragment.cs.txt
//#TEMPLATE GetValue UmaDnaChild_GetValue_Fragment.cs.txt
//#TEMPLATE SetValue UmaDnaChild_SetValue_Fragment.cs.txt
//#TEMPLATE GetNames UmaDnaChild_GetNames_Fragment.cs.txt
//
// Byte Serialization Handling
// 
//#TEMPLATE Byte_Fields UmaDnaChild_Byte_Fields_Fragment.cs.txt
//#TEMPLATE Byte_ToDna UmaDnaChild_Byte_ToDna_Fragment.cs.txt
//#TEMPLATE Byte_FromDna UmaDnaChild_Byte_FromDna_Fragment.cs.txt
//

namespace UMA
{{
	public partial class {0:ClassName}
	{{
		public override int Count {{ get {{ return {0:DnaEntries}; }} }}
		public override float[] Values
		{{ 
			get 
			{{
				return new float[] 
				{{
	{0:GetValues}
				}};
			}}
			set
			{{
	{0:SetValues}
			}}
		}}
		public override float GetValue(int idx)
		{{
			switch(idx)
			{{
{0:GetValue}
			}}
			throw new System.ArgumentOutOfRangeException();
		}}
		public override void SetValue(int idx, float value)
		{{
			switch(idx)
			{{
{0:SetValue}
			}}
			throw new System.ArgumentOutOfRangeException();
		}}

		public static string[] GetNames()
		{{
			return new string[]
			{{
	{0:GetNames}
			}};
		}}
		public override string[] Names
		{{
			get
			{{
				return GetNames();
			}}
		}}
		public static {0:ClassName} LoadInstance(string data)
	    {{
	        return UnityEngine.JsonUtility.FromJson<{0:ClassName}_Byte>(data).ToDna();
	    }}
		public static string SaveInstance({0:ClassName} instance)
		{{
			return UnityEngine.JsonUtility.ToJson({0:ClassName}_Byte.FromDna(instance));
		}}
	}}

	[System.Serializable]
	public class {0:ClassName}_Byte
	{{
	{0:Byte_Fields}

		public {0:ClassName} ToDna()
		{{
			var res = new {0:ClassName}();
	{0:Byte_ToDna}
			return res;
		}}
		public static {0:ClassName}_Byte FromDna({0:ClassName} dna)
		{{
			var res = new {0:ClassName}_Byte();
	{0:Byte_FromDna}
			return res;
		}}
	}}
}}
