Esempio n. 1
0
    protected override IEnumerator Special()
    {
        NonPlayer casterActor
            = Target.GetComponent <NonPlayer>();

        casterActor.ThrowEvent(ConstValue.EventKey_SelectSkill,
                               eSkillTemplateType.TARGET_BLOCK);
        IS_SKILL = true;
        casterActor.RunSkill();
        IS_SKILL_COOLDOWN = true;
        Invoke("OffSkillCoolDown", 7f);

        yield return(new WaitForEndOfFrame());

        while (IS_SKILL)
        {
            if (OBJECT_STATE == eBaseObjectState.STATE_DIE)
            {
                break;
            }
            yield return(new WaitForEndOfFrame());
        }
        AddNextAI(eStateType.STATE_IDLE);

        yield return(StartCoroutine(base.Special()));
    }
    // 첫 번째와 마지막 프레임을 제외하고 각 업데이트 프레임에서 호출됩니다.
    public override void OnStateUpdate(
        Animator animator, AnimatorStateInfo animatorStateInfo, int layerIndex)
    {
        if (animatorStateInfo.normalizedTime >= 1.0f && TargetActor.AI.IS_ATTACK)
        {
            //BaseObject bo =
            //	animator.GetComponentInParent<BaseObject>();

            //bo.ThrowEvent("AttackEnd",eStateType.STATE_IDLE);
            if (TargetActor.AI.CURRENT_AI_STATE == eStateType.STATE_ATTACK)
            {
                TargetActor.AI.IS_ATTACK = false;
            }
        }

        if (bLookAt)
        {
            Vector3 Dir = ((TargetActor.GetData(ConstValue.ActorData_GetTarget) as BaseObject).SelfTransform.position
                           - TargetActor.SelfTransform.position).normalized;
            TargetActor.SelfTransform.forward = Dir;
        }

        if (bIsAttack == false &&
            animatorStateInfo.normalizedTime >= RunSkillTiming)
        {
            bLookAt   = false;
            bIsAttack = true;
            TargetActor.RunSkill();
        }

        // GiantEnemy 일 때 3타공격 발동. (하드코딩임.. 구조상 이게 제일 편함)
        if (bGiantEnemy && bFinalAttack == false &&
            animatorStateInfo.normalizedTime >= RunSkillTiming + 0.29f)
        {
            bFinalAttack = true;
            TargetActor.ThrowEvent(ConstValue.EventKey_SelectSkill, 1);
            TargetActor.RunSkill();
        }


        //if (animatorStateInfo.normalizedTime >= 1.0f
        //	&& TargetActor.AI.IS_ATTACK)
        //{
        //	//BaseObject bo =
        //	//	animator.GetComponentInParent<BaseObject>();

        //	//bo.ThrowEvent("AttackEnd",eStateType.STATE_IDLE);
        //	if (TargetActor.AI.CURRENT_AI_STATE == eStateType.STATE_ATTACK)
        //		TargetActor.AI.IS_ATTACK = false;
        //}

        //if (bIsAttack == false
        //	&& animatorStateInfo.normalizedTime >= 0.5f)
        //{
        //	bIsAttack = true;
        //	TargetActor.RunSkill();
        //}
    }
Esempio n. 3
0
    public override void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        CurTime += Time.deltaTime;
        //Vector3 targetPos = TargetObject.SelfTransform.position;
        SelfPos = TargetActor.SelfTransform.position;
        //Vector3 norPos = (targetPos- SelfPos).normalized;

        if (stateInfo.normalizedTime > 1.0f &&
            TargetActor.AI.IS_SKILL)
        {
            //1초동안 보스가 스킬을 활성화 했다면 끔.
            if (TargetActor.AI.CURRENT_AI_STATE == eStateType.STATE_SPECIAL)
            {
                TargetActor.AI.IS_SKILL = false;
            }
            FireBallCreate.SetActive(false);
        }

        if (bIsAttack == false &&
            stateInfo.normalizedTime > 0.5f)
        {
            bIsAttack = true;
            //보스는 0이 일반공격,1이 스킬
            if (TargetActor.AI.IS_SECOND_SKILL)
            {
                EggBallCreate = Instantiate(EggBallLoad, SelfPos, Quaternion.identity);
                TargetActor.AI.IS_SECOND_SKILL = false;
            }
            else
            {
                FireBallCreate.transform.position      = SelfPos;
                FireBallCreate.transform.localRotation = TargetActor.SelfTransform.rotation;
                TargetActor.ThrowEvent(ConstValue.EventKey_SelectSkill, 1);
                TargetActor.RunSkill();
                FireBallCreate.SetActive(true);
            }
        }
        //보스는 이동하지 않으므로 주석처리
        //TargetActor.SelfTransform.position =
        //    Vector3.Lerp(SelfPos, TargetPos, CurTime / 1.84f);

        //TargetActor.SelfTransform.localRotation = Quaternion.Lerp(TargetActor.SelfTransform.rotation, TargetObject.SelfTransform.rotation, CurTime / 1.84f);
    }
	public override void OnStateUpdate(Animator animator, AnimatorStateInfo animatorStateInfo, int layerIndex)
	{
		CurTime += Time.deltaTime;

        if (animatorStateInfo.normalizedTime >= 1.0f
            && TargetActor.AI.IS_SKILL)
        {
            if (TargetActor.AI.CURRENT_AI_STATE == eStateType.STATE_SPECIAL)
                TargetActor.AI.IS_SKILL = false;
        }

        if (bIsAttack == false
			&& animatorStateInfo.normalizedTime >= 0.5f)
		{
			bIsAttack = true;
			TargetActor.ThrowEvent(ConstValue.EventKey_SelectSkill, 2);
			TargetActor.RunSkill();
		}
		
		TargetActor.SelfTransform.position =
			Vector3.Lerp(SelfPos, TargetPos, CurTime / 1.84f);
	}