Assets/Live2D/Cubism/Framework/Expression/Editor/CubismExpression3JsonImporter.cs
/// <summary>
/// Load the .expressionList.
/// If it does not exist, create a new one.
/// </summary>
/// <param name="expressionListPath">The path of the .expressionList.asset relative to the project.</param>
/// <returns>.expressionList.asset</returns>
Load the .expressionList.
If it does not exist, create a new one.
Load the . expressionList . If it does not exist create a new one .
private static CubismExpressionList GetExpressionList(string expressionListPath)
        {
            var assetList = CubismCreatedAssetList.GetInstance();
            var assetListIndex = assetList.AssetPaths.Contains(expressionListPath)
                ? assetList.AssetPaths.IndexOf(expressionListPath)
                : -1;
            CubismExpressionList expressionList = null;
            if (assetListIndex < 0)
            {
                expressionList = AssetDatabase.LoadAssetAtPath<CubismExpressionList>(expressionListPath);
                if (expressionList == null)
                {
                    expressionList = ScriptableObject.CreateInstance<CubismExpressionList>();
                    expressionList.CubismExpressionObjects = new CubismExpressionData[0];
                    AssetDatabase.CreateAsset(expressionList, expressionListPath);
                }
                assetList.Assets.Add(expressionList);
                assetList.AssetPaths.Add(expressionListPath);
                assetList.IsImporterDirties.Add(true);
            }
            else
            {
                expressionList = (CubismExpressionList)assetList.Assets[assetListIndex];
            }
            return expressionList;
        }
private static CubismExpressionList GetExpressionList ( string expressionListPath ) { var assetList = CubismCreatedAssetList . GetInstance ( ) ; var assetListIndex = assetList . AssetPaths . Contains ( expressionListPath ) ? assetList . AssetPaths . IndexOf ( expressionListPath ) : - 1 ; CubismExpressionList expressionList = null ; if ( assetListIndex < 0 ) { expressionList = AssetDatabase . LoadAssetAtPath < CubismExpressionList > ( expressionListPath ) ; if ( expressionList == null ) { expressionList = ScriptableObject . CreateInstance < CubismExpressionList > ( ) ; expressionList . CubismExpressionObjects = new CubismExpressionData [ 0 ] ; AssetDatabase . CreateAsset ( expressionList , expressionListPath ) ; } assetList . Assets . Add ( expressionList ) ; assetList . AssetPaths . Add ( expressionListPath ) ; assetList . IsImporterDirties . Add ( true ) ; } else { expressionList = ( CubismExpressionList ) assetList . Assets [ assetListIndex ] ; } return expressionList ; }
Load the .expressionList.
Load the . expressionList .
None
expressionListPath
string
The path of the .expressionList.asset relative to the project.
The path of the . expressionList . asset relative to the project .