Example #1
0
    private void Attack(int type)
    {
        if (characterState == CharacterState.Attack || characterState == CharacterState.Skill)
        {
            return;
        }

        switch (type)
        {
        case 1:
            animator.SetTrigger(AttackTrigger);
            break;

        case 2:
            animator.SetTrigger("Attack2");
            break;

        case 3:
            animator.SetTrigger("Attack3");
            break;
        }


        characterState = CharacterState.Attack;
        DelayRun.Execute(delegate { characterState = CharacterState.Idle; }, 0.5f, gameObject);
    }
Example #2
0
 private void Skill()
 {
     if (charactersState == CharactersState.Attack || charactersState == CharactersState.Skill)
     {
         return;
     }
     charactersState = CharactersState.Skill;
     animator.SetTrigger("Skill");
     DelayRun.Execute(delegate { charactersState = CharactersState.Idle; Camera.main.GetComponent <Animator>().SetTrigger("Shake"); }, 1f, gameObject);
 }
Example #3
0
 private void Attack()
 {
     if (charactersState == CharactersState.Attack || charactersState == CharactersState.Skill)
     {
         return;
     }
     charactersState = CharactersState.Attack;
     animator.SetTrigger("Attack");
     DelayRun.Execute(delegate { charactersState = CharactersState.Idle; }, 0.5f, gameObject);
 }
Example #4
0
    public void AttackEvent()
    {
        var obj = Instantiate(ballPrefab, firePoint.transform.position, Quaternion.identity);
        var rig = obj.GetComponent <Rigidbody>();

        if (rig)
        {
            rig.AddForce(transform.forward * 15f, ForceMode.Impulse);
        }

        DelayRun.Execute(delegate { Destroy(obj); }, 1f, obj);
    }
Example #5
0
    private void Skill()
    {
        if (characterState == CharacterState.Attack || characterState == CharacterState.Skill)
        {
            return;
        }

        collDown.GetComponent <Cooldown>().Run();

        SkillEffect.SetActive(true);
        animator.SetTrigger(SkillTrigger);
        characterState = CharacterState.Skill;
        DelayRun.Execute(delegate { characterState = CharacterState.Idle; }, 1.29f, gameObject);
    }
Example #6
0
    public void SkillEvent()
    {
        float step = (skillAngleBount * 2f) * (skillBountes - 1);

        for (int i = 0; i < skillBountes; i++)
        {
            var y        = skillAngleBount - i * step;
            var rotation = Quaternion.Euler(10f, y, 0f);
            var obj      = Instantiate(ballPrefab, firePoint.transform.position, rotation);
            obj.transform.Translate(obj.transform.forward * 0.7f);
            Rigidbody rig = obj.GetComponent <Rigidbody>();
            if (rig)
            {
                rig.AddForce(transform.forward * 15f, ForceMode.Impulse);
            }
            DelayRun.Execute(delegate { Destroy(obj); }, 1f, obj);
        }
    }