Exemplo n.º 1
0
    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;
        }
    }
Exemplo n.º 2
0
 public void ChangeAnimation(ANIMATION anim, bool loop)
 {
     if (_anim != anim || _animLoop != loop)
     {
         _needSwitchAnim = true;
         _anim           = anim;
         _animLoop       = loop;
     }
 }
Exemplo n.º 3
0
    //private bool _isQueued = false;

    public void setAnimation(int run)
    {
        if (run == 0)
        {
            _currentAnimaiton = ANIMATION.idle;
        }
        else if (run == 1)
        {
            _currentAnimaiton = ANIMATION.run;
        }
    }
Exemplo n.º 4
0
            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);
                }
            }
Exemplo n.º 5
0
    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);
    }
Exemplo n.º 6
0
    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;
        }
    }
Exemplo n.º 8
0
    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;
        }
    }
Exemplo n.º 9
0
 public void SetAnimation(ANIMATION animationSetting)
 {
     _currentAnimaiton = animationSetting;
 }
Exemplo n.º 10
0
        public bool isAttackPlaying()
        {
            bool b = ANIMATION.IsPlaying(attackClip.name);

            return(b);
        }
Exemplo n.º 11
0
        public bool isDiePlaying()
        {
            bool b = ANIMATION.IsPlaying(dieClip.name);

            return(b);
        }
Exemplo n.º 12
0
 public void playingDying()
 {
     ANIMATION.CrossFade(dieClip.name);
 }
Exemplo n.º 13
0
 public void playingAttack()
 {
     ANIMATION.Play(attackClip.name);
 }
Exemplo n.º 14
0
 public void playingIdle()
 {
     ANIMATION.CrossFade(idleClip.name);
 }
Exemplo n.º 15
0
 public void playingRun()
 {
     ANIMATION.CrossFade(runClip.name);
 }
Exemplo n.º 16
0
            private IEnumerator PlayDelayed(Action <ANIMATION> action, float time, ANIMATION type)
            {
                yield return(new WaitForSeconds(time));

                action(type);
            }
Exemplo n.º 17
0
 public virtual void SetAnimation(ANIMATION anim)
 {
     
 }
Exemplo n.º 18
0
 public void Play(ANIMATION type)
 {
     Play(GetAnimation(type));
 }
Exemplo n.º 19
0
 public void PlayDelayed(ANIMATION type, float delay)
 {
     StartCoroutine(PlayDelayed(Play, delay, type));
 }
Exemplo n.º 20
0
 public Data GetAnimation(ANIMATION type)
 {
     return(m_animationData.animationsList.Find(a => a.type == type));
 }