void Launch() { GameObject projectileObject = Instantiate(projectilePrefab, rigidbody2d.position + Vector2.up * 0.5f, Quaternion.identity); CogProjectile projectile = projectileObject.GetComponent <CogProjectile>(); projectile.Launch(lookDirection, 300); animator.SetTrigger("Launch"); PlaySound(throwSound); }
private void Launch() { GameObject projectileObject = Instantiate( this.projectilePrefab, this.position + Vector2.up * 0.5f, Quaternion.identity); CogProjectile cogProjectile = projectileObject.GetComponent <CogProjectile>(); this.animator.SetTrigger("Launch"); cogProjectile.Launch(this.lookDirection, 300.0f, this.audioSource); return; }