public void PlaySmoothAnimationCharacterAction(CharacterAnimationType animationType, params CharacterStateControl[] characters) { foreach (CharacterStateControl characterStateControl in characters) { characterStateControl.CharacterParams.PlayAnimationSmooth(animationType, SkillType.Attack, 0, null, null); } }
public void SetAnimation(CharacterAnimationType type) { if (this.cpParams != null) { this.cpParams.PlayAnimationSmooth(type, SkillType.Attack, 0, null, null); } }
public void PlayDeadAnimationCharacterAction(Action deathEffectPlay, CharacterStateControl character) { HitEffectParams hitEffectParams; if (character.isEnemy) { bool flag = base.stateManager.IsLastBattleAndAllDeath(); if (flag) { hitEffectParams = (BattleEffectManager.Instance.GetEffect("EFF_COM_BOSSDEATH") as HitEffectParams); base.battleStateData.UseLastDeadEffect.Add(hitEffectParams); } else { hitEffectParams = (BattleEffectManager.Instance.GetEffect("EFF_COM_DEATH") as HitEffectParams); base.battleStateData.UseDeathEffect.Add(hitEffectParams); } } else { hitEffectParams = (BattleEffectManager.Instance.GetEffect("EFF_COM_DEATH") as HitEffectParams); base.battleStateData.UseDeathEffect.Add(hitEffectParams); } CharacterParams characterParams = character.CharacterParams; CharacterAnimationType type = CharacterAnimationType.dead; HitEffectParams hitEffectParams2 = hitEffectParams; characterParams.PlayAnimation(type, SkillType.Attack, 0, hitEffectParams2, deathEffectPlay); }
public void PlayAnimation(CharacterAnimationType type, SkillType attackType = SkillType.Attack, int motionIndex = 0, HitEffectParams hitEffectParams = null, Action callback = null) { if (!base.isActiveAndEnabled) { return; } this.PlayAnimationCorutine(type, attackType, motionIndex, hitEffectParams, callback, false); }
public void SetAnimation(CharacterAnimationType type) { foreach (CharacterParams characterParams in this.cpParamList) { if (characterParams != null) { characterParams.PlayAnimationSmooth(type, SkillType.Attack, 0, null, null); } } }
public bool isPlaying(CharacterAnimationType animationType) { string name = string.Empty; switch (animationType) { case CharacterAnimationType.idle: name = this._clips.idle.name; break; case CharacterAnimationType.hit: name = this._clips.hit.name; break; case CharacterAnimationType.dead: name = this._clips.down.name; break; case CharacterAnimationType.guard: name = this._clips.guard.name; break; case CharacterAnimationType.revival: name = this._clips.revival.name; break; case CharacterAnimationType.win: name = this._clips.win.name; break; case CharacterAnimationType.eat: name = this._clips.eat.name; break; case CharacterAnimationType.move: name = this._clips.move.name; break; case CharacterAnimationType.down: name = this._clips.down.name; break; case CharacterAnimationType.getup: name = this._clips.getup.name; break; case CharacterAnimationType.strongHit: name = this._clips.down.name; break; } return(this._characterAnimation.IsPlaying(name)); }
public string GetAnimationNameByType(CharacterAnimationType characterAnimationType) { var findAnims = anims.Where(o => o.Type == characterAnimationType); if (findAnims.Count() > 0) { return(findAnims.ElementAt(0).AnimationState.AnimationName); } else { return(null); } }
private void PlayIdleAnimationInternal(CharacterStateControl characterStateControl) { CharacterAnimationType characterAnimationType = CharacterAnimationType.idle; if (characterStateControl.currentSufferState.FindSufferState(SufferStateProperty.SufferType.Escape)) { characterAnimationType = CharacterAnimationType.move; } if (characterStateControl.CharacterParams.currentAnimationType == CharacterAnimationType.move && characterStateControl.CharacterParams.currentAnimationType != characterAnimationType) { characterStateControl.CharacterParams.StopAnimation(); } characterStateControl.CharacterParams.PlayAnimation(characterAnimationType, SkillType.Attack, 0, null, null); }
public void PlayAnimation(CharacterAnimationType animationType) { timer = 0; frameNumber = 0; currentAnimationType = animationType; switch (animationType) { case CharacterAnimationType.IdleUp: { currentFrames = idleUpFrames; break; } case CharacterAnimationType.IdleDown: { currentFrames = idleDownFrames; break; } case CharacterAnimationType.IdleLeft: { currentFrames = idleLeftFrames; break; } case CharacterAnimationType.IdleRight: { currentFrames = idleRightFrames; break; } case CharacterAnimationType.WalkUp: { currentFrames = walkUpFrames; break; } case CharacterAnimationType.WalkDown: { currentFrames = walkDownFrames; break; } case CharacterAnimationType.WalkLeft: { currentFrames = walkLeftFrames; break; } case CharacterAnimationType.WalkRight: { currentFrames = walkRightFrames; break; } } }
private IEnumerator PlayCharaAnimation(CharacterAnimationType AnimeType, bool IsForce = false) { if (this.isEating && !IsForce) { yield break; } this.isEating = true; this.charaParams.PlayAnimation(AnimeType, SkillType.Attack, 0, null, null); float animeClipLength = this.charaParams.AnimationClipLength; float playTime = 0f; while (playTime < animeClipLength) { playTime += Time.deltaTime; yield return(null); } this.isEating = false; yield break; }
public CharacterAnimation(string name, AnimationState animationState, CharacterAnimationType type) { this.name = name; this.animationState = animationState; this.type = type; }
public AnimationEventArgs( CharacterAnimationType type) { AnimState = type; }
void OnAnimationFinished(CharacterAnimationType state) { if(AnimationFinished != null) AnimationFinished(this, new AnimationEventArgs(state)); }
public void PlayAnimation(CharacterAnimationType type, bool loop = true, float crossfade = 0f) { // animation["AegirSwingRight"].speed = 0.5f; // animation["AegirSwingLeft"].speed = 0.5f; if(_CurrentAnimationType == type && _Loop)return; _Loop = loop; if(!_Initialized) { Initialize(); } _CurrentAnimationType = type; //Play the animation Animations data = _AnimDict[type]; _LastAnim = data.Start; _CurrentState = AnimState.Start; if(_LastAnim == "" ) { if(data.Loop.Length >0) { _LastAnim = data.Loop[0]; _CurrentState = AnimState.Loop; } } //Debug.Log("Playing Anim " + _LastAnim); if(crossfade == 0f) { animation.Play(_LastAnim); } else { animation.CrossFade(_LastAnim,crossfade); _CurrentState = AnimState.Loop; } }
private void PlayAnimationCorutine(CharacterAnimationType type, SkillType attackType = SkillType.Attack, int motionIndex = 0, HitEffectParams hitEffectParams = null, Action callback = null, bool isSmooth = false) { if (!this._characterAnimation) { return; } if (this._isBigBoss && type == CharacterAnimationType.strongHit) { type = CharacterAnimationType.hit; } this.isPlayingAnimation = true; AnimationClip clip = this._characterAnimation.clip; this.currentAnimationType = type; switch (type) { case CharacterAnimationType.idle: if (!this._clips.idle) { return; } this._clips.idle.wrapMode = WrapMode.Loop; this._characterAnimation.clip = this._clips.idle; goto IL_3CD; case CharacterAnimationType.hit: if (!this._clips.hit) { return; } this._clips.hit.wrapMode = WrapMode.Once; this._characterAnimation.clip = this._clips.hit; goto IL_3CD; case CharacterAnimationType.dead: if (!this._clips.down) { return; } this._clips.down.wrapMode = WrapMode.ClampForever; this._characterAnimation.clip = this._clips.down; goto IL_3CD; case CharacterAnimationType.guard: if (!this._clips.guard) { return; } this._clips.guard.wrapMode = WrapMode.Once; this._characterAnimation.clip = this._clips.guard; goto IL_3CD; case CharacterAnimationType.revival: if (!this._clips.revival) { return; } this._clips.revival.wrapMode = WrapMode.Once; this._characterAnimation.clip = this._clips.revival; goto IL_3CD; case CharacterAnimationType.win: if (!this._clips.win) { return; } this._clips.win.wrapMode = WrapMode.Once; this._characterAnimation.clip = this._clips.win; goto IL_3CD; case CharacterAnimationType.eat: if (!this._clips.eat) { return; } this._clips.eat.wrapMode = WrapMode.Once; this._characterAnimation.clip = this._clips.eat; goto IL_3CD; case CharacterAnimationType.move: if (!this._clips.move) { return; } if (this._isBigBoss) { this._clips.move.wrapMode = WrapMode.Once; } else { this._clips.move.wrapMode = WrapMode.Loop; } this._characterAnimation.clip = this._clips.move; goto IL_3CD; case CharacterAnimationType.down: if (!this._clips.down) { return; } this._clips.down.wrapMode = WrapMode.ClampForever; this._characterAnimation.clip = this._clips.down; goto IL_3CD; case CharacterAnimationType.getup: if (!this._clips.getup) { return; } this._clips.getup.wrapMode = WrapMode.Once; this._characterAnimation.clip = this._clips.getup; goto IL_3CD; case CharacterAnimationType.strongHit: if (!this._clips.down) { return; } this._clips.down.wrapMode = WrapMode.Once; this._characterAnimation.clip = this._clips.down; goto IL_3CD; } AnimationClip attackClip = this._clips.GetAttackClip(attackType, motionIndex); if (!attackClip) { return; } if (attackType == SkillType.Deathblow) { attackClip.wrapMode = WrapMode.ClampForever; } else { attackClip.wrapMode = WrapMode.Once; } this._characterAnimation.clip = attackClip; IL_3CD: if (BattleStateManager.current != null) { this.SetEscapeRotation(this.currentAnimationType == CharacterAnimationType.move); } if (type != CharacterAnimationType.strongHit) { if (this._characterAnimation.clip.wrapMode == WrapMode.Once || this._characterAnimation.clip.wrapMode == WrapMode.Default) { if (isSmooth) { this._characterAnimation.CrossFadeQueued(this._characterAnimation.clip.name, this.AnimationCrossFadeLength, QueueMode.PlayNow); } else { this._characterAnimation.PlayQueued(this._characterAnimation.clip.name, QueueMode.PlayNow); } if (this._clips.idle != null) { this._characterAnimation.CrossFadeQueued(this._clips.idle.name, this.AnimationCrossFadeLength, QueueMode.CompleteOthers); } } else if (this._characterAnimation.clip.wrapMode == WrapMode.Loop) { if (!this._characterAnimation.isPlaying) { if (isSmooth) { this._characterAnimation.CrossFadeQueued(this._characterAnimation.clip.name, this.AnimationCrossFadeLength, QueueMode.PlayNow); } else { this._characterAnimation.PlayQueued(this._characterAnimation.clip.name, QueueMode.PlayNow); } } else if (this._characterAnimation.clip != clip) { QueueMode queue = QueueMode.CompleteOthers; if (type != CharacterAnimationType.idle) { queue = QueueMode.PlayNow; } this._characterAnimation.CrossFadeQueued(this._characterAnimation.clip.name, this.AnimationCrossFadeLength, queue); } } else if (isSmooth) { this._characterAnimation.CrossFadeQueued(this._characterAnimation.clip.name, this.AnimationCrossFadeLength, QueueMode.PlayNow); } else { this._characterAnimation.PlayQueued(this._characterAnimation.clip.name, QueueMode.PlayNow); } } else { if (isSmooth) { this._characterAnimation.CrossFadeQueued(this._characterAnimation.clip.name, this.AnimationCrossFadeLength, QueueMode.PlayNow); } else { this._characterAnimation.PlayQueued(this._characterAnimation.clip.name, QueueMode.PlayNow); } IEnumerator enumerator = this._characterAnimation.GetEnumerator(); try { while (enumerator.MoveNext()) { object obj = enumerator.Current; AnimationState animationState = obj as AnimationState; if (animationState.name.Replace(" - Queued Clone", string.Empty).Equals(this._characterAnimation.clip.name)) { animationState.wrapMode = this._clips.getup.wrapMode; } } } finally { IDisposable disposable; if ((disposable = (enumerator as IDisposable)) != null) { disposable.Dispose(); } } if (this._clips.getup) { this._clips.getup.wrapMode = WrapMode.Once; this._characterAnimation.CrossFadeQueued(this._clips.getup.name, this.AnimationCrossFadeLength, QueueMode.CompleteOthers); } if (this._clips.idle != null) { this._characterAnimation.CrossFadeQueued(this._clips.idle.name, this.AnimationCrossFadeLength, QueueMode.CompleteOthers); } } this.SetActiveRenderers(true); if (type == CharacterAnimationType.dead) { Action callbackDeathEffect = delegate() { if (callback != null) { callback(); } this.SetActiveRenderers(false); this.StopAnimation(); }; this.characterDeadEffect.PlayAnimation(hitEffectParams, 1f, callbackDeathEffect); } }
private IEnumerator HitEffectFunction(SufferStateProperty.SufferType[] sufferTypes, CharacterAnimationType characterAnimationType) { List <CharacterStateControl> characters = new List <CharacterStateControl>(); foreach (SufferStateProperty.SufferType sufferType in sufferTypes) { List <CharacterStateControl> sufferCharacters = this.GetSufferCharacters(sufferType); foreach (CharacterStateControl characterStateControl in sufferCharacters) { SufferStateProperty sufferStateProperty = characterStateControl.currentSufferState.GetSufferStateProperty(sufferType); if (sufferStateProperty.isTurnRate && !characters.Contains(characterStateControl)) { characters.Add(characterStateControl); } } } if (characters.Count == 0) { yield break; } base.stateManager.uiControl.HideCharacterHUDFunction(); base.stateManager.SetBattleScreen(BattleScreen.PoisonHit); if (base.hierarchyData.batteWaves[base.battleStateData.currentWaveNumber].cameraType == 1) { base.stateManager.cameraControl.PlayCameraMotionAction("BigBoss/0002_command", base.battleStateData.stageSpawnPoint, true); } else { base.stateManager.cameraControl.PlayCameraMotionAction("0002_command", base.battleStateData.stageSpawnPoint, true); } HitEffectParams[] hitEffectParams = null; foreach (SufferStateProperty.SufferType sufferType2 in sufferTypes) { string key = sufferType2.ToString(); HitEffectParams[] @object = base.battleStateData.hitEffects.GetObject(key); if (@object != null) { hitEffectParams = @object; break; } } base.stateManager.soundPlayer.TryPlaySE(hitEffectParams[0]); for (int k = 0; k < characters.Count; k++) { base.stateManager.threeDAction.PlayAnimationCharacterAction(characterAnimationType, new CharacterStateControl[] { characters[k] }); base.stateManager.threeDAction.PlayHitEffectAction(hitEffectParams[k], characters[k]); } float waitSecond = base.stateManager.stateProperty.poisonHitEffectWaitSecond; IEnumerator wait = base.stateManager.time.WaitForCertainPeriodTimeAction(waitSecond, null, null); while (wait.MoveNext()) { yield return(null); } for (int l = 0; l < characters.Count; l++) { base.stateManager.threeDAction.StopHitEffectAction(new HitEffectParams[] { hitEffectParams[l] }); } base.stateManager.soundPlayer.TryStopSE(hitEffectParams[0]); base.stateManager.soundPlayer.StopHitEffectSE(); yield break; }