void PinUp(Player pl) { pl.AddAmmo(ammoAdd, AmmoType); GameObject gm = GameObject.Find("Base"); ConnectScript CS; if (gm) { CS = gm.GetComponent <ConnectScript>(); if (CS) { CS.DeSpawn(gameObject); } } }
void PinUp(Player pl) { GameObject gm = GameObject.Find("Base"); pl.addWeaponToSlot(wName); ConnectScript CS; if (gm) { CS = gm.GetComponent <ConnectScript>(); if (CS) { CS.DeSpawn(gameObject); } } }
// Use this for initialization void PinUp(Player pl) { if (pl.HP + healthAdd <= healthMax) { pl.Heal(healthAdd); } else { pl.Heal(healthMax - pl.HP); } GameObject gm = GameObject.Find("Base"); ConnectScript CS; if (gm) { CS = gm.GetComponent <ConnectScript>(); if (CS) { CS.DeSpawn(gameObject); } } }