Assets/Live2D/Cubism/Framework/MotionFade/Editor/CubismFadeMotionImporter.cs
/// <summary>
/// Create animator controller for MotionFade.
/// </summary>
/// <param name="importer">Event source.</param>
/// <param name="model">Imported model.</param>
Create animator controller for MotionFade.
Create animator controller for MotionFade .
private static void OnModelImport(CubismModel3JsonImporter importer, CubismModel model)
        {
            var dataPath = Directory.GetParent(Application.dataPath).FullName + "/";
            var assetPath = importer.AssetPath.Replace(".model3.json", ".controller");
            if (!File.Exists(dataPath + assetPath))
            {
                CreateAnimatorController(assetPath);
            }
            var fadeController = model.GetComponent<CubismFadeController>();
            if (importer.Model3Json.FileReferences.Motions.Motions == null || fadeController == null)
            {
                return;
            }
            var modelDir = Path.GetDirectoryName(importer.AssetPath).Replace("\\", "/");
            var modelName = Path.GetFileName(modelDir);
            var fadeMotionListPath = modelDir + "/" + modelName + ".fadeMotionList.asset";
            var fadeMotions = GetFadeMotionList(fadeMotionListPath);
            if (fadeMotions == null)
            {
                return;
            }
            fadeController.CubismFadeMotionList = fadeMotions;
        }
private static void OnModelImport ( CubismModel3JsonImporter importer , CubismModel model ) { var dataPath = Directory . GetParent ( Application . dataPath ) . FullName + " " ; var assetPath = importer . AssetPath . Replace ( " " , " " ) ; if ( ! File . Exists ( dataPath + assetPath ) ) { CreateAnimatorController ( assetPath ) ; } var fadeController = model . GetComponent < CubismFadeController > ( ) ; if ( importer . Model3Json . FileReferences . Motions . Motions == null || fadeController == null ) { return ; } var modelDir = Path . GetDirectoryName ( importer . AssetPath ) . Replace ( " \\ " , " " ) ; var modelName = Path . GetFileName ( modelDir ) ; var fadeMotionListPath = modelDir + " " + modelName + " " ; var fadeMotions = GetFadeMotionList ( fadeMotionListPath ) ; if ( fadeMotions == null ) { return ; } fadeController . CubismFadeMotionList = fadeMotions ; }
Create animator controller for MotionFade.
Create animator controller for MotionFade .
importer
CubismModel3JsonImporter
None
model
CubismModel
None