Example #1
0
 public void shooting()
 {
     if (Input.GetKey(KeyCode.Mouse0) && canShoot == true)
     {
         Shoot shoot = new Shoot(this, Resources.Load("Prefabs/playerBullet") as GameObject, gameObject.transform.position + new Vector3(0, 0, 0), transform.rotation * Quaternion.Euler(0, -90, 0));
         shoot.Execute();
         canShoot = false;
         StartCoroutine(bulletCooldown(0.2F));
     }
 }
Example #2
0
    void HandleInput()
    {
        if (Input.GetButtonDown("right_dash"))
        {
            dash.Execute(new DashObject(transform, Utils.Direction.RIGHT));
        }
        if (Input.GetButtonDown("left_dash"))
        {
            dash.Execute(new DashObject(transform, Utils.Direction.LEFT));
        }

        if (Input.GetButtonDown("shoot"))
        {
            shoot.Execute(new ShootObject(projectilePrefab, shootStart, shootEnd, type));
        }
    }