Esempio n. 1
0
    void _AniMenu(int id)
    {
        for (int i = 0; i < AniPlayList.Count; i++)
        {
            if (GUI.Button(new Rect(5, 20 + (i * 26), 150, 25), AniPlayList[i].ToString()))
            {
                //< 애니메이션 실행
                StopCoroutine("AttackCombo");
                MainUnit.transform.localPosition = center;
                if (MainUnit.PlayAnim(AniPlayList[i]))
                {
                    (MainUnit as Pc).rootMotion.Play(MainUnit.Animator.CurrentAnimState, true);
                    AniActive = true;

                    //< 이펙트도 실행
                    if (MainUnit.GetAniData(AniPlayList[i]) != null)
                    {
                        string StartEffect = MainUnit.GetAniData(AniPlayList[i]).effect;
                        MainUnit.SpawnSkillEffect(StartEffect, MainUnit.Animation[MainUnit.Animator.GetAnimName(AniPlayList[i])].speed, MainUnit.transform, MainUnit.GetAniData(AniPlayList[i]).childEffect == 0 ? null : MainUnit.transform, null);
                    }
                }
            }
        }

        if (GUI.Button(new Rect(5, 20 + ((AniPlayList.Count + 1) * 26), 150, 25), "어택 콤보"))
        {
            AniActive = true;
            StartCoroutine("AttackCombo");
        }
    }
Esempio n. 2
0
    void Update()
    {
        if (AuotoIdle && AniActive && !MainUnit.Animator.Animation.isPlaying)
        {
            AniActive = false;
            MainUnit.transform.localPosition = center;
            MainUnit.PlayAnim(eAnimName.Anim_idle);
        }

        if (Input.GetAxis("Mouse ScrollWheel") < 0)
        {
            if (MainUnit == null)
            {
                return;
            }

            Camera.main.transform.localPosition -= (MainUnit.transform.position - Camera.main.transform.position).normalized * 0.5f;
        }
        if (Input.GetAxis("Mouse ScrollWheel") > 0)
        {
            if (MainUnit == null)
            {
                return;
            }

            Camera.main.transform.localPosition += (MainUnit.transform.position - Camera.main.transform.position).normalized * 0.5f;
        }
    }