protected override void updateResource(LanguageEnum lan)
    {
        base.updateResource(lan);

        if (_button == null)
        {
            return;
        }

        if (lan == LanguageEnum.UNKNOWN)
        {
            return;
        }

        if (_localizedTextures == null)
        {
            return;
        }

        ButtonSprites res = null;

        foreach (var r in _localizedTextures)
        {
            if (r.Language == lan)
            {
                res = r.Resource;
                break;
            }
        }

        if (res != null)
        {
            if (res.NormalSprite != null)
            {
                _button.image.sprite = res.NormalSprite;
            }

            SpriteState st = new SpriteState();

            if (res.PressedSprite != null)
            {
                st.pressedSprite = res.PressedSprite;
            }

            if (res.DisabledSprite != null)
            {
                st.disabledSprite = res.DisabledSprite;
            }
            _button.spriteState = st;
        }
    }
Ejemplo n.º 2
0
 private void Awake()
 {
     buttonSprites = (buttonSprites ?? (rounded ? Variables.instance.roundedButtonSprites : Variables.instance.defaultButtonSprites));
 }