Exemple #1
0
 // Update card slot colours for player colour
 public void ChangeSlotColours(bool redPlayer)
 {
     foreach (GameObject cardSlot in cardSlots)
     {
         SlotController slotScript = cardSlot.GetComponent <SlotController>();
         slotScript.SetMaterial(redPlayer);
         slotScript.ResetSlot();
         redPlayer = !redPlayer;
     }
 }
    public void LoadToTransfer(SlotController slot, RectTransform _image)
    {
        var slotData = slot.GetInventorySlot();

        item         = slotData.item;
        image        = _image;
        amount       = slotData.amount;
        itemOnCursor = true;
        slot.ResetSlot();
        image.transform.SetParent(transform);
        var imageCanvasGroup = image.gameObject.AddComponent <CanvasGroup>();

        imageCanvasGroup.blocksRaycasts = false;
        OnDragging += ImagePositionUpdate;
        input.OnClickInteractionLeft += DropItem;
        rectTransform = image;
    }