public void BloodSplat() { int randCount = DarkRef.RandomRange((int)splatCount.x, (int)splatCount.y); for (int i = 0; i < randCount; i++) { if (Physics.Raycast(tr.position, Random.onUnitSphere, out hit, Random.Range(splatDistance.x, splatDistance.y), splatLayers.value)) { DecalObject splat = (DecalObject)Instantiate(splatDecal, hit.point, Quaternion.LookRotation(-hit.normal)); splat.transform.parent = hit.transform; splat.transform.Rotate(Vector3.forward * Random.value * 360f, Space.Self); splat.targetObject = hit.collider.gameObject; splat.pushOffset = splatOffset; splat.layersToAffect = splatLayers; } } }
public void CheckText() { if (pe.hasEMP) { weaponName.text = empName; } else if (Time.time - lastScramble >= 0.025f) { weaponName.text = DarkRef.ScrambleString(curWepName, 5, scramble); lastScramble = Time.time; } if (pe.hasEMP) { if (Time.time - lastRandomizeTime >= 0.1f) { weaponSlot.text = DarkRef.RandomLetterCombination(DarkRef.RandomRange(7, 8)).ToUpper(); fireModeDisplay.text = "[" + DarkRef.RandomLetterCombination(DarkRef.RandomRange(4, 5)).ToUpper() + "]"; displayCurAmmo = DarkRef.RandomRange(0, 99); displayAmmoLeft = DarkRef.RandomRange(0, 999); curAmmoDisplay.text = displayCurAmmo.ToString(); ammoLeftDisplay.text = displayAmmoLeft.ToString(); empName = DarkRef.RandomLetterCombination(Random.Range(6, 9), true); lastRandomizeTime = Time.time; } return; } if (currentGC != null) { if (curWeaponNum == 0) { weaponSlot.text = "PRIMARY"; } else if (curWeaponNum == 1) { weaponSlot.text = "SECONDARY"; } if (currentGC.currentFireMode == GunController.FireMode.FullAuto) { fireModeDisplay.text = "[AUTO]"; } else if (currentGC.currentFireMode == GunController.FireMode.SemiAuto) { fireModeDisplay.text = "[SEMI]"; } else if (currentGC.currentFireMode == GunController.FireMode.BurstFire) { fireModeDisplay.text = "[BURST]"; } else { fireModeDisplay.text = "[SAFE]"; } } else if (curWeaponNum == 3) { weaponSlot.text = "GRENADE"; fireModeDisplay.text = "[NONE]"; } else if (curWeaponNum == 2) { weaponSlot.text = "MELEE"; fireModeDisplay.text = "[NONE]"; } else if (curWeaponNum <= -1) { weaponSlot.text = "NONE"; fireModeDisplay.text = "[NONE]"; } }