コード例 #1
0
    //接受点击每个小格子传来消息
    public void OnInventoryClick(object[] objectArray)
    {
        InventoryItem      it   = objectArray[0] as InventoryItem;
        InventoryItemUI    itUI = null;
        KnapspackRoleEquip kre  = null;
        bool isLeft             = false;

        if (it.Inventory.InventoryTYPE == InventoryType.Equip)
        {
            isLeft = (bool)objectArray[1];
            if (isLeft)
            {
                itUI = objectArray[2] as InventoryItemUI;
            }
            else
            {
                kre = objectArray[2] as KnapspackRoleEquip;
            }
            equip.Show(it, itUI, isLeft);
        }
        else
        {
            itUI = objectArray[2] as InventoryItemUI;
            inventoryPopup.Show(it, itUI);
        }
        if ((it.Inventory.InventoryTYPE == InventoryType.Equip && isLeft) || it.Inventory.InventoryTYPE != InventoryType.Equip)
        {
            this.itUI = objectArray[2] as InventoryItemUI;
            EnableButton(itUI.it.Inventory.Price * itUI.it.Count);
        }
    }
コード例 #2
0
    void Awake()
    {
        helmEquip = transform.Find("HelmSprite").GetComponent<KnapspackRoleEquip>();
        clothEquip = transform.Find("ClothSprite").GetComponent<KnapspackRoleEquip>();
        weaponEquip = transform.Find("WeaponSprite").GetComponent<KnapspackRoleEquip>();
        shoesEquip = transform.Find("ShoesSprite").GetComponent<KnapspackRoleEquip>();
        necklaceEquip = transform.Find("NecklaceSprite").GetComponent<KnapspackRoleEquip>();
        braceletEquip = transform.Find("BraceletSprite").GetComponent<KnapspackRoleEquip>();
        ringEquip = transform.Find("RingSprite").GetComponent<KnapspackRoleEquip>();
        wingEquip = transform.Find("WingSprite").GetComponent<KnapspackRoleEquip>();

        detailBtn = transform.Find("DetialButton").GetComponent<UIButton>();

        lifeLabel = transform.Find("LifeBg/Label").GetComponent<UILabel>();
        damageLabel = transform.Find("DamageBg/Label").GetComponent<UILabel>();
        expSlider = transform.Find("ExpProgressBar/expslider").GetComponent<UISlider>();
        explabel = transform.Find("ExpProgressBar/expslider/Label").GetComponent<UILabel>();
        labelName = transform.Find("LabelName").GetComponent<UILabel>();

        playerInfo._instance.OnPlayerInfoChanged += this.OnPlayerInfoChanged;
    }
コード例 #3
0
    void Awake()
    {
        helmEquip     = transform.Find("HelmSprite").GetComponent <KnapspackRoleEquip>();
        clothEquip    = transform.Find("ClothSprite").GetComponent <KnapspackRoleEquip>();
        weaponEquip   = transform.Find("WeaponSprite").GetComponent <KnapspackRoleEquip>();
        shoesEquip    = transform.Find("ShoesSprite").GetComponent <KnapspackRoleEquip>();
        necklaceEquip = transform.Find("NecklaceSprite").GetComponent <KnapspackRoleEquip>();
        braceletEquip = transform.Find("BraceletSprite").GetComponent <KnapspackRoleEquip>();
        ringEquip     = transform.Find("RingSprite").GetComponent <KnapspackRoleEquip>();
        wingEquip     = transform.Find("WingSprite").GetComponent <KnapspackRoleEquip>();

        detailBtn = transform.Find("DetialButton").GetComponent <UIButton>();

        lifeLabel   = transform.Find("LifeBg/Label").GetComponent <UILabel>();
        damageLabel = transform.Find("DamageBg/Label").GetComponent <UILabel>();
        expSlider   = transform.Find("ExpProgressBar/expslider").GetComponent <UISlider>();
        explabel    = transform.Find("ExpProgressBar/expslider/Label").GetComponent <UILabel>();
        labelName   = transform.Find("LabelName").GetComponent <UILabel>();

        playerInfo._instance.OnPlayerInfoChanged += this.OnPlayerInfoChanged;
    }