コード例 #1
0
ファイル: WindowShop.cs プロジェクト: Kinderril/Provinence2
    private void OnItemInit(BaseItem info,ItemOwner obj)
    {
        Debug.Log(obj);
        bool val = info == null;
        BuyButton.gameObject.SetActive(val);


        EquipButton.gameObject.SetActive(false);
        UnEquipButton.gameObject.SetActive(false);
        UpgradeButton.gameObject.SetActive(false);
        if (!val)
        {
            bool isEquiped = info.IsEquped;
            if (info.Slot != Slot.executable)
            {

                EquipButton.gameObject.SetActive(!isEquiped);
                UnEquipButton.gameObject.SetActive(isEquiped);
                var canBeupgraded = canBeUpgraded(info);
                UpgradeButton.gameObject.SetActive(canBeupgraded);
            }
        }

        SellButton.gameObject.SetActive(!val);
        ItemInfoElement.gameObject.SetActive(true);
    }
コード例 #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            ItemOwner ItemOwner = db.ItemOwner.Find(id);

            db.Item.Remove(ItemOwner.Item);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #3
0
ファイル: Item.cs プロジェクト: Pherpher089/Capsule-Crashers
    public virtual void OnEquipt(GameObject character)
    {
        if (character.CompareTag("Player"))
        {
            itemOwner = ItemOwner.Player;
        }
        else if (character.CompareTag("Enemy"))
        {
            itemOwner = ItemOwner.Enemy;
        }
        else
        {
            itemOwner = ItemOwner.Other;
        }

        ignoredCollider = character.gameObject.GetComponent <Collider>();
        Physics.IgnoreCollision(col, ignoredCollider);
        rigidbodyRef.isKinematic = true;
        col.isTrigger            = true;
        isEquiped = true;
    }