/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
using System;
using UnityEngine;
namespace Live2D.Cubism.Framework.Json
{
///
/// Cubism exp3.json data.
///
[Serializable]
public sealed class CubismExp3Json
{
#region Load Methods
///
/// Loads a exp3.json asset.
///
/// exp3.json to deserialize.
/// Deserialized exp3.json on success; otherwise.
public static CubismExp3Json LoadFrom(string exp3Json)
{
return (string.IsNullOrEmpty(exp3Json))
? null
: JsonUtility.FromJson(exp3Json);
}
///
/// Loads a exp3.json asset.
///
/// exp3.json to deserialize.
/// Deserialized exp3.json on success; otherwise.
public static CubismExp3Json LoadFrom(TextAsset exp3JsonAsset)
{
return (exp3JsonAsset == null)
? null
: LoadFrom(exp3JsonAsset.text);
}
#endregion
#region Json Data
///
/// Expression Type
///
[SerializeField]
public string Type;
///
/// Expression FadeInTime
///
[SerializeField]
public float FadeInTime = 1.0f;
///
/// Expression FadeOutTime
///
[SerializeField]
public float FadeOutTime = 1.0f;
///
/// Expression Parameters
///
[SerializeField]
public SerializableExpressionParameter[] Parameters;
#endregion
#region Json Helpers
///
/// Expression Parameter
///
[Serializable]
public struct SerializableExpressionParameter
{
///
/// Expression Parameter Id
///
[SerializeField]
public string Id;
///
/// Expression Parameter Value
///
[SerializeField]
public float Value;
///
/// Expression Parameter Blend Mode
///
[SerializeField]
public string Blend;
}
#endregion
}
}