Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma strict
- var Ammo : int = 7;
- var AssaultRifle = false;
- var Revolver = false;
- var GunScriptAssaultRifle : GameObject;
- var GunScriptRevolver : GameObject;
- function Start () {
- guiText.text = (Ammo.ToString);
- Revolver = true;
- if(AssaultRifle) {
- Ammo = 50;
- }
- if(Revolver) {
- Ammo = 7;
- }
- }
- function Update () {
- if(Ammo <= 0)
- Ammo = 0;
- }
- function BulletSystem () {
- if(AssaultRifle) {
- Ammo -= 1;
- }
- if(Revolver) {
- Ammo -= 1;
- }
- }
- function AssaultRifleYes () {
- AssaultRifle = true;
- Revolver = false;
- Ammo = 50;
- if(Ammo == 0)
- GunScriptAssaultRifle.gameObject.SetActive(false);
- else
- GunScriptAssaultRifle.gameObject.SetActive(true);
- }
- function RevolverYes () {
- Ammo = 7;
- Revolver = true;
- AssaultRifle = false;
- if(Ammo == 0) {
- GunScriptRevolver.gameObject.SetActive(false);
- Debug.Log("it is 0");
- }
- else
- GunScriptRevolver.gameObject.SetActive(true);
- }
Advertisement
Add Comment
Please, Sign In to add comment