예제 #1
0
    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]";
        }
    }