public void DestroyBullet() { GreenBullet greenBullet = GetComponent <GreenBullet>(); BlueBullet blueBullet = GetComponent <BlueBullet>(); SwitchBullet switchBullet = GetComponent <SwitchBullet>(); GameController.instance.songController.beat -= Move; if (greenBullet != null) { GameController.instance.songController.beat -= greenBullet.FollowPlayer; } if (blueBullet != null) { GameController.instance.songController.beat -= blueBullet.CheckSplit; } if (switchBullet != null) { GameController.instance.songController.beat -= switchBullet.CheckSwitch; } if (tag != "Laser") { Destroy(gameObject); } }
void LaunchProjectile() { m_currentspawnedprojectile.Launch(30f); m_currentspawnedprojectile = null; m_currentammocount--; m_ammobar.EjectCurrentAmmo(); CameraShake(); GameAudioManager.m_Instance.StopSound("GreenMuzzleCharge"); GameAudioManager.m_Instance.PlaySound("GreenMuzzleLaunch", false, 1.0f, m_muzzlevolume); m_projectileready = false; }
void SpawnProjectile() { Vector2 t_firedirection = Vector3.up; m_currentspawnedprojectile = Instantiate(m_currentBullet).GetComponent <GreenBullet>(); m_currentspawnedprojectile.m_GreenMuzzle = this; Vector2 t_startPosition = (Vector2)transform.position + (t_firedirection * (m_currentspawnedprojectile.GetComponent <SpriteRenderer>().bounds.size.magnitude / 2)); m_currentspawnedprojectile.transform.position = t_startPosition; //m_currentspawnedprojectile.transform.rotation = Quaternion.FromToRotation(m_currentspawnedprojectile.transform.right, t_firedirection); GameAudioManager.m_Instance.PlaySound("GreenMuzzleCharge", true, 1.0f, m_muzzlevolume); }