public override void OnExit() { // Timer weaponItem.Basic_Dur.SetActive(false); weaponItem.Basic_Dur.Reset(); weaponItem.Basic_CD.SetActive(true); // Status Effect PlayerStatus.RemoveEffect(status_Slow); // Hit Check hitOverlapData.Clear(); for (int i = 0; i < hitCheck_Start.Length; i++) { hitCheck_Start[i] = false; hitCheck_End[i] = false; } // Animtaion data.Animator.ResetSpeed(); // Player GM.Player.Data.CanChangeDir = true; GM.Player.Data.CanDash = true; GM.Player.Data.CanKick = true; PlayerInventoryManager.weaponHotbar.LockSlots(this, false); }
public static void OverlapCheck(this OverlapCheckData data, List <Collider2D> overlaps) { if (overlaps.Count == 0) { data.Clear(); return; } // Check Exit for (int i = data.prevOverlaps.Count - 1; i >= 0; i--) { if (overlaps.Exists(col => col == data.prevOverlaps[i])) { continue; } data.prevOverlaps.RemoveAt(i); data.onExit?.Invoke(overlaps[i]); } // Check Enter for (int i = 0; i < overlaps.Count; i++) { if (data.prevOverlaps.Contains(overlaps[i])) { continue; } data.prevOverlaps.Add(overlaps[i]); data.onEnter?.Invoke(overlaps[i]); } }
protected override void InitEvents() { overlapCheckData = new OverlapCheckData( onEnter: overlap => { // Deal Damage PlayerStats.Inst.DealDamage(flameDashAttackData, overlap.gameObject); }); onDashing = this.NewPlayerActionEvent(() => { // Check Overlap overlapCheckData.OverlapCheckOnce(Physics2D.OverlapBoxAll(GM.PlayerPos, damageSize, 0f, damageLayer)); // Play Particle Effect flameParticle.Play(); }); onDashEnd = this.NewPlayerActionEvent(() => { // Clear Overlap Data overlapCheckData.Clear(); // Stop Particle Effect flameParticle.Stop(); }); }
public override void OnExit() { // Hit Check hitOverlapData.Clear(); hitCheck_Start = false; hitCheck_End = false; // Timer weaponItem.Heavy_Dur.SetActive(false); weaponItem.Heavy_Dur.Reset(); // Player GM.Player.Data.CanDash = true; GM.Player.Data.CanKick = true; GM.Player.Data.CanChangeDir = true; PlayerInventoryManager.weaponHotbar.LockSlots(this, false); }
public override void OnExit() { // Hit Check hitOverlapData.Clear(); hitCheck_Start = false; hitCheck_End = false; // Timer weaponItem.Slam_Dur.SetActive(false); weaponItem.Slam_Dur.Reset(); // Animation data.Animator.ResetSpeed(); // Player GM.Player.Data.PlayingOtherMotion = false; PlayerInventoryManager.weaponHotbar.LockSlots(this, false); }
public override void OnExit() { // Hit Check hitOverlapData.Clear(); hitCheck_0Start = false; hitCheck_0End = false; // Timer weaponItem.Basic_Dur.SetActive(false); weaponItem.Basic_Dur.Reset(); // Animtaion data.Animator.ResetSpeed(); // Player GM.Player.Data.CanDash = true; GM.Player.Data.CanKick = true; PlayerInventoryManager.weaponHotbar.LockSlots(this, false); }
public override void OnExit() { // Hit Check hitOverlapData.Clear(); }