testing
This commit is contained in:
reedgamingstudio
2014-12-16 00:23:12 -06:00
parent c0c0755cc6
commit 5b8ebb7a35
1697 changed files with 1115979 additions and 0 deletions
@@ -0,0 +1,32 @@
//This script is used for next cases:
//For example you pick RPG and shoot till last rocket
//what this script do is deactivate rocked mesh, so it create and illusion
//of having no ammo
//Same for grenade and grenade launcher
import System.Collections.Generic;
#pragma strict
//Mesh that need to be deactivate while player have no ammo
//For ex. Rocker, Grenade etc.
var objectsToDeactivate : List.<GameObject>;
//This need to be attached to the same object as WeaponScript
private var weapScript : WeaponScript;
function Start () {
weapScript = gameObject.GetComponent.<WeaponScript>();
}
function Update () {
//We make it work only with grenade launcher gun types
if(weapScript.GunType == weapScript.gunType.GRENADE_LAUNCHER){
for(var i = 0; i < objectsToDeactivate.Count; i++){
if(weapScript.grenadeLauncher.ammoCount == 0){
objectsToDeactivate[i].SetActiveRecursively(false);
}else{
objectsToDeactivate[i].SetActiveRecursively(true);
}
}
}
}