public void PlayAnimation(string animationName, Action onComplete = null, bool loop = false, bool restart = true, bool async = false) { TimelineAsset value; bool flag = ((Dictionary <string, TimelineAsset>)m_timelineAssetDictionary).TryGetValue(animationName, out value); if (flag && null != value) { m_playableDirector.set_extrapolationMode(0); if (value != m_playableDirector.get_playableAsset()) { m_playableDirector.Play(value); } else { if (restart || !m_animator2D.get_animationName().Equals(animationName)) { m_playableDirector.set_time(0.0); } m_playableDirector.Resume(); } m_hasTimeline = true; } else { if (flag) { Log.Warning("Boss named '" + this.get_gameObject().get_name() + "' has a timeline setup for key '" + animationName + "' but the actual asset is null.", 202, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Maps\\Objects\\BossObject.cs"); } m_playableDirector.set_time(0.0); m_playableDirector.Pause(); m_hasTimeline = false; } m_animationCallback.Setup(animationName, restart, onComplete); m_animator2D.SetAnimation(animationName, loop, async, restart); }
protected override void OnEnable() { base.OnEnable(); InitializeAnimator(); m_playableDirector.set_playableAsset(null); m_playableDirector.set_extrapolationMode(0); TimelineContextUtility.SetContextProvider(m_playableDirector, this); CameraHandler.AddMapRotationListener(OnMapRotationChanged); }
protected unsafe void OnEnable() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown m_animator2D.add_AnimationLooped(new AnimationLoopedEventHandler((object)this, (IntPtr)(void *) /*OpCode not supported: LdFtn*/)); m_animationCallback = new CharacterAnimationCallback(m_animator2D); m_context = new MapCharacterObjectContext(this); m_context.Initialize(); m_playableDirector.set_extrapolationMode(0); }