- Home /
Error CS1525: Unexpected Symbol `int'
ModelImporter modelImporter = ModelImporter.GetAtPath(assetPath).
ModelImporter.generateAnimations = ModelImporter.GetAtPath(assetPath)
return void numAnimation = total
ModelImporterClipAnimation[] animations = new ModelImporterClipAnimation[numAnimation];
XmlNodeList list = doc.GetElementsByTagName("Data");
foreach (XmlNode node in list)
{
XmlAttributeCollection child = node.Attributes;
string name = "";
int sf = 0;
int ef = 0;
foreach (XmlNode nd in child)
{
if (nd.Name == "name")
name = nd.Value;
if (nd.Name == "startFrame")
sf = int.Parse(nd.Value.Replace("f", ""));
if (nd.Name == "endFrame")
ef = int.Parse(nd.Value.Replace("f", ""));
I don't understand your code. Do you have some lines finishing with something else that ";" ?
return void numAnimation = total
is a really weird code line. I don't understand what you are trying to do. $$anonymous$$aybe if you explain it, ins$$anonymous$$d of only dumping your code we could help you efficiently.
Trying to input/get an animation count, but something went wrong, do you need more of the code?
No, I don't even understand this fragment actually :)
There are some ";" missing, and I can't tell you exactly where because the code is too weird.
And the "return void numAnimation = total" has nothing to do here.
Here's some more of the C# Coding, since you're saying it's "weird", probably because you don't have all of the "info".
Debug.Log("Starting animation split process..."); string assetPath = AssetDatabase.GetAssetPath(DestinationAsset);
if (assetPath.Contains(objectName))
{
$$anonymous$$odelImporter modelImporter = $$anonymous$$odelImporter.GetAtPath(assetPath).
$$anonymous$$odelImporter.generateAnimations = $$anonymous$$odelImporter.GetAtPath(assetPath)
return void numAnimation = total
$$anonymous$$odelImporterClipAnimation[] animations = new $$anonymous$$odelImporterClipAnimation[numAnimation];
XmlNodeList list = doc.GetElementsByTagName("Data");
foreach (XmlNode node in list)
{
XmlAttributeCollection child = node.Attributes;
string name = "";
int sf = 0;
int ef = 0;
foreach (XmlNode nd in child)
{
if (nd.Name == "name")
name = nd.Value;
if (nd.Name == "startFrame")
sf = int.Parse(nd.Value.Replace("f", ""));
if (nd.Name == "endFrame")
ef = int.Parse(nd.Value.Replace("f", ""));
}
bool loop = false;
string nm = name.ToLower();
if (nm.Contains("idle") || nm.Contains("walk") || nm.Contains("sprint") || nm.Contains("run") || nm.Contains("strafe"))
loop = true;
animations[i] = SetClipAnimationNew(nm, sf, ef, loop);
i++;
}
modelImporter.clipAnimations = animations;
Object asset = AssetDatabase.LoadAssetAtPath(assetPath, typeof(GameObject));
EditorUtility.SetDirty(asset);
AssetDatabase.ImportAsset(assetPath, ImportAssetOptions.ForceUpdate);
Your answer
Follow this Question
Related Questions
Why does Unity crash with this code ? 2 Answers
Raycast error 1 Answer
Error unexpected symbol 'internal' What is wrong with this? 0 Answers
Error Message Coordinates 1 Answer
True False What am I doing wrong. 1 Answer