/// <summary>
 /// Customizes model importing.
 /// </summary>
 /// <param name="sender">Event source.</param>
 /// <param name="model">Imported model.</param>
 private static void OnModelImport(CubismModel3JsonImporter sender, CubismModel model)
 {
     // Lets pretend we want to change the vertex colors of all drawables to green...
     foreach (var renderer in model.Drawables.Select(d => d.GetComponent <CubismRenderer>()))
     {
         renderer.color = Color.green;
     }
 }
Example #2
0
        /// <summary>
        /// Create animator controller for MotionFade.
        /// </summary>
        /// <param name="importer">Event source.</param>
        /// <param name="model">Imported model.</param>
        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))
            {
                return;
            }

            CreateAnimatorController(assetPath);
            AssetDatabase.Refresh();
        }