public override AtkMotion motion(Vector2 input) { AtkMotion m = new AtkMotion(); if (a.attacking) { m.use = true; m.motion = -transform.right * speed; } else { m.use = false; m.motion = Vector2.zero; } return(m); }
public override AtkMotion motion(Vector2 input) { if (a.attacking) { if (dir == false) { dir = true; Vector2 v2 = input; float angle = Mathf.Atan2(v2.y, v2.x) * Mathf.Rad2Deg; transform.rotation = Quaternion.Euler(0, 0, angle); } } AtkMotion m = new AtkMotion(); m.use = true; m.motion = Vector2.zero; return(m); }
public override AtkMotion motion(Vector2 input) { AtkMotion m = new AtkMotion(); m.use = true; if (a.attacking) { if (tackleDir == Vector2.zero) { tackleDir = input.normalized; if (input == Vector2.zero) { tackleDir = transform.right; } } m.motion = tackleDir * speed; return(m); } m.motion = Vector2.zero; return(m); }