Hi to all.
In my project i have some dynamic array of animationclip for holding character animations.my script is such bellow:
public AnimationClip[] idleanimations;
public AnimationClip[] walkanimations;
public AnimationClip[] attackanimations;
public AnimationClip[] escapeanimations;
public AnimationClip[] alertanimations;
and in start function of my script i do some check to see are those arrays have any value or not,like this code:
if(idleanimations.Length==0)
{
_animation=null;
Debug.Log("No idle animations found. Turning off animations.");
}
.
.
.
if(walkanimations.Length==0)
{
_animation=null;
Debug.Log("No walk animations found. Turning off animations.");
}
and until this point there isn’t any error.But this is strange! this line of code does not cause any error:
temp=idleanimations.Length;
for(int i=0;i<temp;i++)
{
_animation.AddClip(idleanimations_,idleanimations*.name); *_
* }*
but bellow codes that are exactly the same method generate error:
temp=walkanimations.length; //this line generate error
* for(int i=0;i*