Hi . In my 2D game I create the animations for many characters from their atlases using this code in my script . But I can’t use UnityEditor in Build so I must find another way to do it . So far I haven’t found a way . Please help !
using UnityEditor;
void createRunAnim(){
EditorCurveBinding curveBinding = new EditorCurveBinding();
curveBinding.type = typeof(SpriteRenderer);
curveBinding.path = "";
curveBinding.propertyName = "m_Sprite";
ObjectReferenceKeyframe[] runFrames = new ObjectReferenceKeyframe[6];
for(int i=3 ; i<= 8; i++){
runFrames[i-3] = new ObjectReferenceKeyframe();
runFrames[i-3].value = animalArray*;*
-
runFrames[i-3].time = (i-3);* -
}* -
AnimationUtility.SetObjectReferenceCurve(run,curveBinding,runFrames);* -
}*
anyone? any ideas?
– mihnea2kxthis script along with others like this are creating the animation clips depending on which character is selected .
– mihnea2kx