コード例 #1
0
    public IEnumerator SkillRoutine()
    {
        yield return(new WaitForSeconds(0.5f));

        //Rise Up
        Sequence s = DOTween.Sequence();

        //Wind Up
        Vector3 rotate = new Vector3(windUp - actor.transform.rotation.x, 90, 0);

        s.Append(actor.transform.DORotate(rotate, windUpDuration));
        s.Append(actor.transform.DOPunchScale(new Vector3(2, 2, 2), windUpDuration, 5, 0.5f));
        yield return(new WaitForSeconds(windUpDuration));

        //Slam
        rotate = new Vector3(slam + actor.transform.rotation.x, 90, 0);
        s.Append(actor.transform.DORotate(rotate, slamDuration));

        yield return(new WaitForSeconds(slamDuration));

        if (audioManager)
        {
            audioManager.PlaySFX("Cast_Throw");
        }

        SingleTargetProjectile knife = Instantiate(KnifePref, actor.transform.position + Vector3.up * 2, KnifePref.transform.rotation);

        knife.BaseValue   = _Intensity.Levels[IntensityLevel - 1].IDatas.First();
        knife.destination = enemy.transform.position + Vector3.up;
        knife.target      = enemy;
        knife.OnHit.AddListener(SkillEffectEnd);

        s.Append(actor.transform.DORotate(new Vector3(0, 90, 0), 0.1f));
    }
コード例 #2
0
    public IEnumerator SkillRoutine()
    {
        yield return(new WaitForSeconds(0.5f));

        //Rise Up
        Sequence s = DOTween.Sequence();

        //Wind Up
        Vector3 rotate = new Vector3(windUp - actor.transform.rotation.x, -90, 0);

        s.Append(actor.transform.DORotate(rotate, windUpDuration));
        s.Append(actor.transform.DOPunchScale(new Vector3(2, 2, 2), windUpDuration, 5, 0.5f));
        yield return(new WaitForSeconds(windUpDuration));

        //Slam
        rotate = new Vector3(slam + actor.transform.rotation.x, -90, 0);
        s.Append(actor.transform.DORotate(rotate, slamDuration));
        yield return(new WaitForSeconds(slamDuration));

        int rng = Random.Range(0, enemies.Length);

        if (audioManager)
        {
            audioManager.PlaySFX("Cast_Throw");
        }
        SingleTargetProjectile projectileInstance = Instantiate(projectilePrefab, actor.transform.position + Vector3.up * 3, projectilePrefab.transform.rotation);

        projectileInstance.destination = enemies[rng].transform.position + Vector3.up * 1;
        projectileInstance.target      = enemies[rng];

        throwCount++;
        if (throwCount == numberOfAxeToThrow)
        {
            projectileInstance.OnHit.AddListener(SkillEffectEnd);
        }

        s.Append(actor.transform.DORotate(new Vector3(0, -90, 0), 0.1f));
        yield return(new WaitForSeconds(1f));

        if (throwCount != numberOfAxeToThrow)
        {
            StartCoroutine(SkillRoutine());
        }
    }