- Home /
Question by
raze incorporated · Nov 21, 2013 at 09:41 PM ·
errorcs1061
error cs1061
Assets/GameContent/Motiontracks/Editor/AnimationImporter.cs(60,68): error CS1061: Type `UnityEditor.ModelImporter' does not contain a definition for `clipanimations' and no extension method `clipanimations' of type `UnityEditor.ModelImporter' could be found (are you missing a using directive or an assembly reference?)
So I was trying to import more Animations, I tried using other "clipanimation" extensions/directives. That didn't work. I really need your help. This is due tomorrow. The error is in the first line, Here's the code:
ModelImporterClipAnimation = modelImporter.clipanimations;
Object asset = AssetDatabase.LoadAssetAtPath(assetPath, typeof(GameObject));
EditorUtility.SetDirty(asset);
AssetDatabase.ImportAsset(assetPath, ImportAssetOptions.ForceUpdate);
}
}
private ModelImporterClipAnimation SetClipAnimationNew(string name, int firstFrame, int lastFrame, bool loop)
{
ModelImporterClipAnimation mica = new ModelImporterClipAnimation();
mica.name = name;
mica.firstFrame = firstFrame;
mica.lastFrame = lastFrame;
mica.loop = loop;
if (loop)
mica.wrapMode = WrapMode.Loop;
else
mica.wrapMode = WrapMode.Once;
return mica;
}
}
Comment
Answer by ThePunisher · Nov 21, 2013 at 10:04 PM
You are trying to set a System.Type to a group of objects and you can't do that. You probably forgot to place a variable name in front. Like this:
ModelImporterClipAnimation[] clips = modelImporter.clipAnimations;
Also it should be an array and "clipAnimations" has an upper case 'A' in it.
Did you try it with what GameVortex mentioned? I updated the answer. Try it again.