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); }
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); }
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); }
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); }
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); }
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); } }