Esempio n. 1
0
    IEnumerator Start()
    {
        SelfPos      = ai.transform.position;
        TargetPos    = ai.Target.position;
        TargetPos.y  = SelfPos.y;
        FinalPos     = TargetPos + (TargetPos - SelfPos).normalized * 2;
        InitDistance = ai.DistanceSelfToTarget(FinalPos);


        NV.enabled = false;
        ai.SetComplete(false);
        Ani.SetTrigger(AniTriggerString);

        float LerpTime = 0;

        yield return(new WaitForSeconds(FirstTime));

        while (Vector3.Distance(ai.transform.position, FinalPos) > 0.2f)
        {
            LerpTime += Time.deltaTime;
            MidPos    = Vector3.Lerp(SelfPos, FinalPos, LerpTime / JumpTime);
            MidPos.y  = SelfPos.y + Height * Mathf.Sin(Mathf.Deg2Rad * (180 * (1 - ai.DistanceSelfToTarget(FinalPos) / InitDistance)));
            ai.transform.position = MidPos;
            Debug.Log((1 - ai.DistanceSelfToTarget(FinalPos) / InitDistance));
            yield return(null);
        }


        Debug.Log("释放技能1··············");
        yield return(new WaitForSeconds(SecondTime));

        NV.enabled = true;
        ai.SetComplete(true);
    }
Esempio n. 2
0
    IEnumerator Start()
    {
        NV.avoidancePriority = 1;
        NV.isStopped         = true;
        EndPos = ai.Target.transform.position;
        ai.SetComplete(false);
        Ani.SetTrigger(AniTriggerString[0]);
        Debug.Log("释放技能1··············@@@@@@@@@@@@@@@@@@@@@@@@@@");
        yield return(new WaitForSeconds(FirstTime));

        NV.isStopped         = false;
        InitSpeed            = NV.speed;
        NV.speed             = CFSpeed;
        NV.avoidancePriority = 1;
        NV.SetDestination(EndPos);
        yield return(new WaitUntil(() => ai.DistanceSelfToTarget(EndPos) < ai.AttackDistance));

        NV.isStopped = true;
        NV.velocity  = Vector3.zero;
        Ani.SetTrigger(AniTriggerString[1]);
        yield return(new WaitForSeconds(SecondTime));

        //GameDataManager.Ins.Player.GetComponentInChildren<HitByBulletBase>().BulletDeal(Damage, ai.TheType);
        yield return(new WaitForSeconds(ThirdTime));

        NV.speed = InitSpeed;
        ai.SetComplete(true);
    }
Esempio n. 3
0
    IEnumerator Start()
    {
        ai.SetComplete(false);
        NV.isStopped = false;
        NV.SetDestination(self.position + (self.position - ai.Target.position).normalized * 20);

        //Ani.SetTrigger(AniTriggerString);
        Debug.Log("后退中··············");
        yield return(new WaitUntil(() => ai.DistanceSelfToTarget(ai.Target) > ai.AttackDistance + 1f));

        ai.SetComplete(true);
    }