/*! * Plays the named animation on the current avatar. * The animation will not be played if it has not already been loaded. * @param name name of animation to play * @param blend time in seconds to blend to this animation (0 = no blending) * * @see LoadAnimation PauseAnimation */ public virtual void PlayAnimation(String name, float blend) { SharedWorld world = SharedWorld.Get(); if (nowPlaying != null) { return; } try { Group g = scriptor.Find(name + '.', Group.FIND_START | Group.FIND_CHILD); world.SuspendScene(); if (g != null) { scriptor.End(); nowPlaying = g as Engine; scriptor.Begin(g.Name); } else { nowPlaying = null; } } catch (Exception ex) { SharedWorld.LogError("PlayAnimation EXCEPTION " + ex.Message); nowPlaying = null; } world.ResumeScene(); }
/*! * Pauses the currently playing animation. * * @see LoadAnimation PlayAnimation */ public void PauseAnimation(string name) { try { Viewer3D viewer = Viewer as Viewer3D; string skelname = ConnectSkeleton(); Scriptor scp = AnimScriptor; if (skelname != null) { if (name != null) { scp.End(name + skelname); } else { scp.End(_animName); } } } catch (Exception ex) { SharedWorld.LogError("PauseAnimation EXCEPTION " + ex.Message); } }