Created
April 20, 2017 04:53
-
-
Save solkar/d91c8e1d4e053df52365a5413d154e71 to your computer and use it in GitHub Desktop.
Disable animation from AssetImporter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEditor; | |
public class DisableAnimations : AssetPostprocessor | |
{ | |
void OnPreprocessModel() | |
{ | |
var modelImporter = assetImporter as ModelImporter; | |
modelImporter.importAnimation = false; | |
modelImporter.generateAnimations = ModelImporterGenerateAnimations.None; | |
} | |
void OnPostprocessModel(GameObject g) | |
{ | |
var c = g.GetComponent<Animator>(); | |
if ( c != null ) | |
{ | |
GameObject.DestroyImmediate(c); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment