Skip to content

Instantly share code, notes, and snippets.

@solkar
Created April 20, 2017 04:53
Show Gist options
  • Save solkar/d91c8e1d4e053df52365a5413d154e71 to your computer and use it in GitHub Desktop.
Save solkar/d91c8e1d4e053df52365a5413d154e71 to your computer and use it in GitHub Desktop.
Disable animation from AssetImporter
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