public void SetItemToolTip(ITEM.Item item)
 {
     if (item != null)
     {
         toolTipPanel.SetTooltipData(item);
     }
 }
Beispiel #2
0
    IEnumerator CreateShieldCour(int index)
    {
        ITEM.Item item = InventorySystem.instance.GetItemFromInventory(ItemType.TYPE_SHIELD, index - 1);


        Transform tr = (hasWeapon) ? player.leftHandBone.transform : player.backBone.transform;

        shield = Instantiate(Resources.Load("Prefabs/" + item.itemData.Name), tr) as GameObject;

        if (hasWeapon == false)     // 생성 위치 보정
        {
            shield.transform.parent        = player.backBone.transform;
            shield.transform.localPosition = posOffsetBack_Shield;
            shield.transform.localRotation = rotOffsetBack_Shield;
        }
        else
        {
            shield.transform.parent        = player.leftHandBone.transform;
            shield.transform.localPosition = posOffsetLeft;
            shield.transform.localRotation = rotOffsetLeft;
        }

        //Destroy(shield.GetComponent<Rigidbody>());
        shield.GetComponent <Rigidbody>().isKinematic = true;
        shield.GetComponent <ShieldComponent>().shieldItem.itemData = item.itemData;
        shield.GetComponent <ShieldComponent>().isUsing             = true;
        shield.GetComponent <BoxCollider>().isTrigger = true;

        shield.GetComponentInChildren <ParticleSystem>().Stop();

        yield return(null);
    }
Beispiel #3
0
    IEnumerator CreateWeaponCour(int index)
    {
        ITEM.Item item = InventorySystem.instance.GetItemFromInventory(ItemType.TYPE_WEAPON, index - 1);


        Transform tr = (hasWeapon) ? player.rightHandBone.transform : player.backBone.transform;

        weapon = Instantiate(Resources.Load("Prefabs/" + item.itemData.Name), tr) as GameObject;

        if (hasWeapon == false && isPick == false)
        {
            weapon.transform.parent        = player.backBone.transform;
            weapon.transform.localPosition = posOffsetBack;
            weapon.transform.localRotation = rotOffsetBack;
        }
        else
        {
            weapon.transform.parent        = player.rightHandBone.transform;
            weapon.transform.localPosition = posOffsetRight;
            weapon.transform.localRotation = rotOffsetRight;
        }

        //Destroy(weapon.GetComponent<Rigidbody>());
        weapon.GetComponent <Rigidbody>().isKinematic = true;
        weapon.GetComponent <BoxCollider>().isTrigger = true;
        weapon.GetComponent <BoxCollider>().enabled   = false;  // 무기는 휘두를때만 콜리더 킴
        weapon.GetComponent <WeaponComponent>().weaponItem.itemData = item.itemData;
        //weaponType = weapon.GetComponent<WeaponComponent>().weaponItem.weaponType;
        weapon.GetComponent <WeaponComponent>().isUsing = false;
        trail = weapon.GetComponent <MeleeWeaponTrail>();        // 현재 무기의 트레일 이펙트에 접근

        weapon.GetComponentInChildren <ParticleSystem>().Stop();

        yield return(null);
    }
Beispiel #4
0
    // 背包核心逻辑:交换
    public static void SwapItem(int gridID)
    {
        // 交换背包中的物品和拾取物品
        ITEM.Item temp = pickedItem;
        pickedItem         = ITEM.items[gridID];
        ITEM.items[gridID] = temp;

        // 刷新背包显示
    }
Beispiel #5
0
    public void SetItemData(ITEM.Item item = null)
    {
        _item = item;
        SpriteAtlas atlas = UIManager.instance.GetItemIconAtlas();

        if (item != null)
        {
            sprite = atlas.GetSprite(item.itemData.Name);
            item.count++;
        }
        else
        {
            sprite = atlas.GetSprite("Transparency");
        }
        itemIcon.overrideSprite = sprite;
    }
 public void SetTooltipData(ITEM.Item item)
 {
     //if(item != null)
     //{
     //    SetNameText(item.itemData.Name);
     //    SetInfoText(item.itemData.Info);
     //    SetDefenText(item.itemData.DefenseUp.ToString());
     //    SetDamegeText(item.itemData.Damage.ToString());
     //    SetHpUpText(item.itemData.HpUp.ToString());
     //}
     //else if (item == null)
     //{
     //    nameText.enabled = false;
     //}
     SetNameText(item.itemData.Name);
     SetInfoText(item.itemData.Info);
     SetDefenText(item.itemData.DefenseUp.ToString());
     SetDamegeText(item.itemData.Damage.ToString());
     SetHpUpText(item.itemData.HpUp.ToString());
 }
 public void AddItem(ITEM.Item item)
 {
     if (item.itemData.Type == (int)ItemType.TYPE_CONSUME)
     {
         var  consumeInven = itemLists[(int)ItemType.TYPE_CONSUME];
         bool isFind       = false;
         foreach (var c in consumeInven)
         {
             if (c.itemData.Name == item.itemData.Name)
             {
                 c.count++;
                 isFind = true;
             }
         }
         if (!isFind)
         {
             itemLists[item.itemData.Type].Add(item);
         }
     }
     else
     {
         itemLists[item.itemData.Type].Add(item);
     }
 }
 private void Awake()
 {
     consumeItem = new ITEM.Item(itemName);
 }
Beispiel #9
0
    public static ITEM.Item pickedItem;     // 当前拾取的物品

    void Start()
    {
        // 初始化当前拾取物品为空
        pickedItem = new ITEM.Item("", null);
    }
 private void Awake()
 {
     shieldItem = new ITEM.Item(itemName);
 }
Beispiel #11
0
 private void Awake()
 {
     weaponItem = new ITEM.Item(itemName);
 }