예제 #1
0
파일: HUD.cs 프로젝트: zeropointx/KartClone
    public void updateWeaponTexture(InventoryScript.WEAPON currentWeapon)
    {
        int    index        = (int)currentWeapon;
        Sprite weaponSprite = weaponSprites[index];

        if (weaponSprite == null)
        {
            return;
        }
        if (currentWeapon == InventoryScript.WEAPON.noWeapon)
        {
            imageScript.changeColorAlpha(0.0f);
            imageScript.changeColorAlphaBackground(0.0f);
        }
        else
        {
            imageScript.changeColorAlpha(1.0f);
            imageScript.changeColorAlphaBackground(1.0f);
        }
        imageScript.updateSprite(weaponSprite);

        uiweapon = currentWeapon;
    }