Reproduced from: http://blog.csdn.net/qq617119142/article/details/49510173
Modify the recorded animation, or the animation properties in the model
The following is the Modify Looptime property
[csharp] View Plain copy [MenuItem ("Assets/loop=true")] static void looptrue () { object[] selectedasset = selection.getfiltered ( typeof (Object), selectionmode.deepassets); animationclip clip = selectedAsset[0] as AnimationClip; // Animationutility.getanimationclipsettings (clip). looptime = false;//cannot be directly assigned animationclipsettings clipsetting = animationutility.getanimationclipsettings (clip) ; clipSetting.loopTime = true; animationutility.setanimationclipsettings (clip, clipsetting); } [MenuItem ("Assets/loop=fasle")] Static void loopfalse () { oBject[] selectedasset = selection.getfiltered (typeof (Object), selectionmode.deepassets); AnimationClip clip = selectedAsset[0] as animationclip; //animationutility.getanimationclipsettings (clip). LoopTime = false;//cannot be directly assigned animationclipsettings clipsetting = animationutility.getanimationclipsettings (clip); clipsetting.looptime = false; animationutility.setanimationclipsettings (clip, clipsetting); }