Пример #1
0
    private void SyncState(bool oldState, bool newState)
    {
        isActivated = newState;

        if (isActivated)
        {
            itemAttributes.SetSprites(GetItemSprites(color));
        }
        else
        {
            itemAttributes.SetSprites(Sprites.Off);
        }
    }
 /// <summary>
 /// Sets all the related sprites for items Currently supports only one item sprite
 /// </summary>
 public void SetSprites(ItemsSprites newSprites)
 {
     if (!Initialised)
     {
         Initialise();
     }
     itemAttributes.SetSprites(newSprites);
     pickupable.SetPlayerItemsSprites(newSprites);
     SetIcon(newSprites);
     pickupable.RefreshUISlotImage();
 }
Пример #3
0
    private void SetUpFromClothingData(EquippedData equippedData)
    {
        var SpriteSOData = new ItemsSprites();

        SpriteSOData.Palette             = new List <Color>(equippedData.Palette);
        SpriteSOData.SpriteLeftHand      = (equippedData.SpriteInHandsLeft);
        SpriteSOData.SpriteRightHand     = (equippedData.SpriteInHandsRight);
        SpriteSOData.SpriteInventoryIcon = (equippedData.SpriteItemIcon);
        SpriteSOData.IsPaletted          = equippedData.IsPaletted;

        myItem.SetSprites(SpriteSOData);
    }
Пример #4
0
    private void ClientUpdateSprite()
    {
        if (activated)
        {
            switch ((SwordColor)color)
            {
            case SwordColor.Blue:
                itemAttributes.SetSprites(Sprites.Blue);
                break;

            case SwordColor.Green:
                itemAttributes.SetSprites(Sprites.Green);
                break;

            case SwordColor.Purple:
                itemAttributes.SetSprites(Sprites.Purple);
                break;

            case SwordColor.Rainbow:
                itemAttributes.SetSprites(Sprites.Rainbow);
                break;

            case SwordColor.Red:
                itemAttributes.SetSprites(Sprites.Red);
                break;
            }

            spriteHandler?.ChangeSprite(color, false);
        }
        else
        {
            itemAttributes.SetSprites(Sprites.Off);
            spriteHandler?.ChangeSprite(0, false);
        }
    }