Пример #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (textBox1.Text != "")
     {
         Launch?.Invoke(textBox1.Text);
     }
 }
Пример #2
0
 private void _launchButton_Click(object sender, EventArgs e)
 {
     if (Launch != null)
     {
         Cursor = Cursors.WaitCursor;
         Launch.Invoke(_addin, null);
         Cursor = Cursors.Default;
     }
 }
Пример #3
0
    private void LaunchBullet()
    {
        if (ammoCapacity == 0)
        {
            return;
        }
        ammoCapacity -= 1;
        var bulletActive = Instantiate(bullet, transform.position, transform.rotation);
        var rbBull       = bulletActive.GetComponent <Rigidbody2D>();

        rbBull.AddForce(transform.up * bulletForce, ForceMode2D.Impulse);
        shootSound.Play();
        Launch?.Invoke();
    }
Пример #4
0
 protected void OnLaunch()
 {
     Launch?.Invoke();
 }