public void PlayDetectionAnimation() { FloorMechanismAnimator animator = m_animator; if (!(null == animator) && animator.TryGetDetectionAnimationName(out string animName)) { PlayTimeline("detection", animName, restart: false); m_animationCallback.Setup(animName, restart: false); animator.SetAnimation(animName, animLoops: false); } }
public IEnumerator WaitForActivationEnd() { FloorMechanismAnimator animator = m_animator; if (!(null == animator)) { string activationAnimationName = animator.animationName; while (!CharacterObjectUtility.HasAnimationEnded(animator, activationAnimationName)) { yield return(null); } } }
public IEnumerator ActivatedByOpponent() { FloorMechanismAnimator animator = m_animator; if (!(null == animator) && animator.TryGetOpponentActivationAnimationName(out string activationAnimationName)) { PlayTimeline("opponent_activation", activationAnimationName, restart: false); m_animationCallback.Setup(activationAnimationName, restart: false); animator.SetAnimation(activationAnimationName, animLoops: false, async: false); do { yield return(null); }while (!CharacterObjectUtility.HasAnimationReachedLabel(animator, activationAnimationName, "shot")); } }
protected override IEnumerator SetAnimatorDefinition() { GameObject prefab = m_characterData.prefab; if (null == prefab) { Log.Error("AnimatedFloorMechanismData named '" + m_characterData.get_name() + " has no prefab set.", 169, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Maps\\Objects\\FloorMechanismObject.cs"); yield break; } m_instance = Object.Instantiate <GameObject>(prefab, this.get_transform().get_position(), m_direction.GetRotation(), this.get_transform()); m_animator = m_instance.GetComponent <FloorMechanismAnimator>(); if (null == m_animator) { Log.Error("Floor mechanism prefab named '" + prefab.get_name() + "' is missing a FloorMechanismAnimator component.", 178, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Maps\\Objects\\FloorMechanismObject.cs"); } InitializeAnimator(); }