Exemplo n.º 1
0
 public void GetData(CombatItemObject cio)
 {
     GetComponent <Image>().sprite = cio.icon; //Ändrar bilden till den som är vald i assets
     itemName    = cio.itemName;
     id          = cio.name;
     itemDescrip = cio.description;
 }
    public void GetItem(GameObject Character, GameObject pivotCharacter)
    {
        if (Character != null)
        {
            this.Character      = Character;
            this.pivotCharacter = pivotCharacter;
            combatItem          = Character.GetComponent <Abilities>().combatItem;

            if (combatItem != null)
            {
                toDraw.GetComponent <SpriteRenderer>().sprite = combatItem.rangeThingy;
                toDraw.transform.localScale   = new Vector3(combatItem.placeRange * 2, combatItem.placeRange * 2, 1);
                GetComponent <Image>().sprite = combatItem.sprite;
            }
            else
            {
                GetComponent <Image>().sprite = defultSprite;
            }
        }
        else
        {
            GetComponent <Image>().sprite = defultSprite;
        }
        isPlacing = false;
        drawItemTemp.SetActive(false);
    }
    private void GetEquipment()
    {
        weaponId = characterScript.rangedId;
        if (weaponId != "" || weaponId != null)
        {
            foreach (WeaponObject weapon in Assets.assets.weaponTemp)
            {
                if (weapon.name == weaponId)
                {
                    this.weapon = weapon;
                }
            }
        }
        else
        {
            weapon = null;
        }

        healingId = characterScript.healingId;
        if (healingId != "" || healingId != null)
        {
            foreach (HealingItemObject healingItem in Assets.assets.healingTemp)
            {
                if (healingItem.name == healingId)
                {
                    this.healingItem = healingItem;
                }
            }
        }
        else
        {
            healingItem = null;
        }

        combatId = characterScript.combatId;
        if (combatId != "" || combatId != null)
        {
            foreach (CombatItemObject combatItem in Assets.assets.combatTemp)
            {
                if (combatItem.name == combatId)
                {
                    this.combatItem = combatItem;
                }
            }
        }
        else
        {
            combatItem = null;
        }
    }