Exemplo n.º 1
0
    public void Start_Shot(Vector2 direction)
    {
        AllMessager.Stop_On_Shot();

        if (rb == null)
        {
            init_references();
        }

        Set_Velocity(direction.normalized * velocity_multiplier);
    }
Exemplo n.º 2
0
 void Handle_Freeze()
 {
     if (Input.GetKeyDown(KeyCode.F))
     {
         if (!freezing)
         {
             AllMessager.Start_Freeze();
         }
         else
         {
             AllMessager.Stop_Freeze();
         }
         freezing = !freezing;
         freezeScreen.SetActive(freezing);
     }
 }
Exemplo n.º 3
0
    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);
    }