void Launch() { GameObject projectile = Instantiate(projectilePrefab, rigidbody2d.position + Vector2.up * 0.2f, Quaternion.identity); BoomerangProjectileController boomerangProjectile = projectile.GetComponent <BoomerangProjectileController>(); boomerangProjectile.Launch(lookDirection, projectileSpeed); }
void LaunchBoomerang() { if (inventory.hasRang && inventory.secActive == Inventory.Secondary.RANG) { GameObject boomerang = Instantiate(boomerangPrefab, rigidbody2d.position + Vector2.up * .2f, Quaternion.identity); BoomerangProjectileController boomerangProjectile = boomerang.GetComponent <BoomerangProjectileController>(); boomerangProjectile.Launch(lookDirection, projectileSpeed); PlaySound(arrowBoom); } }
void Launch() { launched = true; animator.SetFloat("Look X", 0); animator.SetFloat("Look Y", 1); GameObject projectile = Instantiate(projectilePrefab, rigidbody2d.position + Vector2.up * 0.2f, Quaternion.identity); BoomerangProjectileController boomerangProjectile = projectile.GetComponent <BoomerangProjectileController>(); boomerangProjectile.Launch(lookDirection, projectileSpeed); }