public void AttackBy(MonsterAttackType type) { if (type == MonsterAttackType.DASH) { status.attackType = type; StartCoroutine(Delay(() => { status.attackType = MonsterAttackType.IDLE; }, cfg.dashAttackRange / cfg.dashAttackMoveSpeed)); } monsterAttack.Attack(type); }
public override void Start() { base.Start(); var baseMonster = (BaseMonster)baseObject; attackType = baseMonster.attackType; _gainedMeat = baseMonster.gainedMeat; if (nameText != null && !nameText.Equals(null)) { nameText.text = baseObject.name; } }
public void Attack(MonsterAttackType type) { switch (type) { case MonsterAttackType.IDLE: break; case MonsterAttackType.COMMON: CommonAttack(); break; case MonsterAttackType.DASH: break; case MonsterAttackType.RANGE: RangeAttack(); break; default: break; } }