public override void SetAnimation(ANIMATION anim) { if (currentAnimation == anim) return; currentAnimation = anim; StopAllCoroutines(); DOTween.Kill(this.GetInstanceID() + "s"); DOTween.Kill(this.GetInstanceID() + "r"); switch (anim) { case ANIMATION.NORMAL: body.GetComponent<MeshRenderer>().material.DOColor(new Color(0, 0, 0, 0), "_ColorEmissive", 1.0f); transform.position = originalPosition; break; case ANIMATION.TALKING: body.GetComponent<MeshRenderer>().material.DOColor(new Color(characterColor.r, characterColor.g, characterColor.b, 1.0f), "_ColorEmissive", 1.0f); StartCoroutine(StartShake()); break; } }
public void ChangeAnimation(ANIMATION anim, bool loop) { if (_anim != anim || _animLoop != loop) { _needSwitchAnim = true; _anim = anim; _animLoop = loop; } }
//private bool _isQueued = false; public void setAnimation(int run) { if (run == 0) { _currentAnimaiton = ANIMATION.idle; } else if (run == 1) { _currentAnimaiton = ANIMATION.run; } }
public void ChangeAnimationDuration(ANIMATION type, float duration) { Data d = GetAnimation(type); d.duration = duration; if (d == m_currentAnimation) { m_waitForSeconds = new WaitForSeconds(1.0f / m_currentAnimation.fps); } }
void PlayAnimation(ANIMATION anim, float duration) { playerSprite.GetComponent <SpriteRenderer>().sprite = sprites[(int)anim]; animTimer = duration; if (sprites[(int)anim] == null) { print("missing animation: " + anim); } print(anim); }
public override void SetAnimation(ANIMATION anim) { if (currentAnimation == anim) return; currentAnimation = anim; StopAllCoroutines(); DOTween.Kill(this.GetInstanceID() + "s"); DOTween.Kill(this.GetInstanceID() + "r"); switch (anim) { case ANIMATION.NORMAL: head.DOScale(originalScale, 1.0f); head.transform.localRotation = Quaternion.identity; head.GetComponent<MeshRenderer>().material.SetTexture("_MainTex", texFaceNeutral); transform.position = originalPosition; break; case ANIMATION.TALKING: Quaternion q = head.localRotation; q.eulerAngles = new Vector3(0, 0, -punchRotationScale.z / 2); head.transform.localRotation = q; head.DOPunchScale(punchScaleSize, punchScaleDuration, 1, 1).SetLoops(-1).SetId(this.GetInstanceID() + "s").SetEase(Ease.Linear); head.DOPunchRotation(punchRotationScale, punchRotationDuration, 1, 1).SetLoops(-1).SetId(this.GetInstanceID() + "r").SetEase(Ease.Linear); head.GetComponent<MeshRenderer>().material.SetTexture("_MainTex", texFaceNeutral); StartCoroutine(StartShake()); break; case ANIMATION.ANGRY: head.DOScale(originalScale, 1.0f); head.transform.localRotation = Quaternion.identity; transform.position = originalPosition; head.GetComponent<MeshRenderer>().material.SetTexture("_MainTex", texAngry); break; case ANIMATION.SURPRISED: head.DOScale(originalScale, 1.0f); head.transform.localRotation = Quaternion.identity; transform.position = originalPosition; head.GetComponent<MeshRenderer>().material.SetTexture("_MainTex", texSurprise); break; } }
public void SetAnimation(ANIMATION _a) { switch (_a) { case ANIMATION.PRAYING: _animator.SetBool("Praying", true); _animator.SetFloat("PrayType", Random.Range(1.0f, 1.0f)); break; case ANIMATION.WALKING: _animator.SetBool("Praying", false); _animator.SetBool("InConversation", false); break; } }
public void PlayAnimation(ANIMATION _animation) { switch (_animation) { case ANIMATION.HIT: mAnimator.SetTrigger("isSpecialEvent"); mAnimator.SetTrigger("isHit"); break; case ANIMATION.ATTACK: mAnimator.SetTrigger("isSpecialEvent"); mAnimator.SetTrigger("isAttacking"); break; default: Debug.LogWarning("animatie neimplementata"); break; } }
public void SetAnimation(ANIMATION animationSetting) { _currentAnimaiton = animationSetting; }
public bool isAttackPlaying() { bool b = ANIMATION.IsPlaying(attackClip.name); return(b); }
public bool isDiePlaying() { bool b = ANIMATION.IsPlaying(dieClip.name); return(b); }
public void playingDying() { ANIMATION.CrossFade(dieClip.name); }
public void playingAttack() { ANIMATION.Play(attackClip.name); }
public void playingIdle() { ANIMATION.CrossFade(idleClip.name); }
public void playingRun() { ANIMATION.CrossFade(runClip.name); }
private IEnumerator PlayDelayed(Action <ANIMATION> action, float time, ANIMATION type) { yield return(new WaitForSeconds(time)); action(type); }
public virtual void SetAnimation(ANIMATION anim) { }
public void Play(ANIMATION type) { Play(GetAnimation(type)); }
public void PlayDelayed(ANIMATION type, float delay) { StartCoroutine(PlayDelayed(Play, delay, type)); }
public Data GetAnimation(ANIMATION type) { return(m_animationData.animationsList.Find(a => a.type == type)); }