// Start is called before the first frame update void Start() { sgs = GameObject.Find("shotgun Variant").GetComponent <ShotgunScript>(); mgs = GameObject.Find("machinegun").GetComponent <machineGunScript>(); sns = GameObject.Find("sniper").GetComponent <SniperScript>(); ChooseGun(); }
void OnCollisionEnter(Collision collision) { if (collision.gameObject.name == "Player") { SniperScript sgs = collision.transform.Find("Head").transform.Find("sniper").GetComponent <SniperScript>(); sgs.totalAmmo += ammoAmmount; sgs.SendMessage("UpdateAmmo"); Destroy(gameObject); } }
protected override void ApplyTalent() { if (Tower.PlayerSelectedTower.TowerType != TowerType.Sniper) { return; } SniperScript sniper = Tower.PlayerSelectedTower as SniperScript; sniper.ApplyConcussion = true; }