public static CubismExpressionData CreateInstance(CubismExp3Json json) { var expressionData = CreateInstance <CubismExpressionData>(); expressionData.Type = json.Type; expressionData.FadeInTime = json.FadeInTime; expressionData.FadeOutTime = json.FadeOutTime; expressionData.Parameters = new SerializableExpressionParameter[json.Parameters.Length]; for (var i = 0; i < json.Parameters.Length; ++i) { expressionData.Parameters[i].Id = json.Parameters[i].Id; expressionData.Parameters[i].Value = json.Parameters[i].Value; expressionData.Parameters[i].Blend = json.Parameters[i].Blend; } return(expressionData); }
public static CubismExpressionData CreateInstance(CubismExpressionData expressionData, CubismExp3Json json) { expressionData.Type = json.Type; expressionData.FadeInTime = json.FadeInTime; expressionData.FadeOutTime = json.FadeOutTime; expressionData.Parameters = new SerializableExpressionParameter[json.Parameters.Length]; for (var i = 0; i < json.Parameters.Length; ++i) { expressionData.Parameters[i].Id = json.Parameters[i].Id; expressionData.Parameters[i].Value = json.Parameters[i].Value; switch (json.Parameters[i].Blend) { case "Add": expressionData.Parameters[i].Blend = CubismParameterBlendMode.Additive; break; case "Multiply": expressionData.Parameters[i].Blend = CubismParameterBlendMode.Multiply; break; case "Overwrite": expressionData.Parameters[i].Blend = CubismParameterBlendMode.Override; break; default: expressionData.Parameters[i].Blend = CubismParameterBlendMode.Additive; break; } } return(expressionData); }
public static CubismExpressionData CreateInstance(CubismExp3Json json) { var expressionData = CreateInstance <CubismExpressionData>(); return(CreateInstance(expressionData, json)); }