public void Start_Shot(Vector2 direction) { AllMessager.Stop_On_Shot(); if (rb == null) { init_references(); } Set_Velocity(direction.normalized * velocity_multiplier); }
void Handle_Freeze() { if (Input.GetKeyDown(KeyCode.F)) { if (!freezing) { AllMessager.Start_Freeze(); } else { AllMessager.Stop_Freeze(); } freezing = !freezing; freezeScreen.SetActive(freezing); } }
public IEnumerator Destroy() { if (current_path != null) { StopCoroutine(current_path); } AllMessager.Continue_After_Shot(); sr.enabled = false; preview_trajectory.enabled = false; trail.Stop(); this.GetComponentInChildren <Collider2D>().enabled = false; yield return(new WaitForSeconds( trail.main.startLifetime.constant )); Destroy(this.gameObject); }