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); } }
// Start is called before the first frame update void Start() { redBullet = gameObject.AddComponent <RedBullet>(); blueBullet = gameObject.AddComponent <BlueBullet>(); gameManager = GameObject.Find("GameManager").GetComponent <GameManager>(); }