Пример #1
0
 public void DestroyWeapon()
 {
     pickWeapon.gameObject.SetActive(false);
     pickWeapon.SetInFree();
     ishold                 = false;
     holdWeapon             = CItemDataBase.items[0];
     playerWeaponImg.sprite = weaponSprite[0];
 }
Пример #2
0
 public void DestroyWeapon()
 {
     pickWeapon.gameObject.SetActive(false);
     pickWeapon.SetInFree();
     ishold = false;
     weapon = null;
     playerWeaponImg.sprite = weaponSprite[0];
 }
Пример #3
0
    void PickItem()
    {
        if (!can_pick || picking_item == null)
        {
            return;
        }
        if (useController)
        {
            if (Input.GetButtonDown(whichPlayer + "LB"))
            {
                if (!LBFixed)
                {
                    return;
                }
                LBFixed = false;
                if (CItemDataBase.items[picking_item.id].elementID < -20)
                {
                    TeamHp.ChangeHp(true, 0.15f);
                    healEffect.SetHealEffectAni();
                    picking_item.GetComponent <COutLine>().SetOutLine(false);
                    picking_item.SetInFree();
                    ChangeSlot(true, -1);
                    if (test)
                    {
                        tutorialRequest.DonePickUp(true);
                    }
                }
                else
                {
                    handle.enabled = true;
                    if (!b_handling)
                    {
                        b_handling    = true;
                        craftA        = items[picking_item.id];
                        handling_item = picking_item.gameObject;
                        handling_item.transform.parent   = transform.GetChild(0);
                        handling_item.transform.position = this.transform.position;
                        handling_item.GetComponent <COutLine>().SetOutLine(false);
                        handling_item.SetActive(false);
                        handle.sprite = CItemDataBase.spriteList[craftA.id];
                        handling_item.GetComponent <CPickItem>().SetLifeTime(0.0f);
                        ChangeSlot(true, 0);
                        ArrowEnable(true);
                        if (test)
                        {
                            tutorialRequest.DonePickUp(true);
                        }
                    }
                    else
                    {
                        OnCrafting();
                    }
                }
                can_pick     = false;
                picking_item = null;

                //if (picking_item == null) return;
                //crafterAnimator.SetBool("is_gather", true);
                ////Debug.Log("設動畫");
            }
        }
        else
        {
            if (Input.GetKeyDown(KeyCode.E))
            {
                //if (picking_item == null) return;
                //crafterAnimator.SetBool("is_gather", true);

                if (CItemDataBase.items[picking_item.id].elementID < -20)
                {
                    TeamHp.ChangeHp(true, 0.15f);
                    healEffect.SetHealEffectAni();
                    picking_item.GetComponent <COutLine>().SetOutLine(false);
                    picking_item.SetInFree();
                    ChangeSlot(true, -1);
                    if (test)
                    {
                        tutorialRequest.DonePickUp(true);
                    }
                }
                else
                {
                    handle.enabled = true;
                    if (!b_handling)
                    {
                        b_handling    = true;
                        craftA        = items[picking_item.id];
                        handling_item = picking_item.gameObject;
                        handling_item.transform.parent   = transform.GetChild(0);
                        handling_item.transform.position = this.transform.position;
                        handling_item.GetComponent <COutLine>().SetOutLine(false);
                        handling_item.SetActive(false);
                        handle.sprite = CItemDataBase.spriteList[craftA.id];
                        handling_item.GetComponent <CPickItem>().SetLifeTime(0.0f);
                        ChangeSlot(true, 0);
                        ArrowEnable(true);
                        if (test)
                        {
                            tutorialRequest.DonePickUp(true);
                        }
                    }
                    else
                    {
                        OnCrafting();
                    }
                }
                can_pick     = false;
                picking_item = null;
            }
        }
    }