Example #1
0
 public ItemGrid PutIn(PickableProp prop)
 {
     for (int i = 0; i < this._grids.Length; i++)
     {
         if (this._grids[i].isEmpty)
         {
             return(this._grids[i].PutIn(prop));
         }
     }
     Debug.LogError("Pack Overflow");
     return(null);
 }
Example #2
0
 public ItemGrid PutIn(PickableProp prop)
 {
     if (!this.isEmpty)
     {
         Debug.LogError("道具格子无空位!");
     }
     this._item         = prop.ToItem();
     this._icon_on      = prop.icon_on;
     this._icon_off     = prop.icon_off;
     this._icon.sprite  = this._icon_off;
     this._icon.enabled = true;
     return(this);
 }
Example #3
0
    public override void OnItemAction(ItemGrid grid, EventArgs e)
    {
        if (ItemPack.GetPack().isOn("电池"))
        {
            ItemPack.GetPack().TakeAway("电池");
            ItemPack.GetPack().TakeAway("没电的遥控器");

            PickableProp controllerUseable = new PickableProp();
            controllerUseable.name      = "有电的遥控器";
            controllerUseable.item_desc = "Don't let Grace find the remote controller...";
            controllerUseable.icon_off  = this.controllerUseable_off;
            controllerUseable.icon_on   = this.controllerUseable_on;

            ItemPack.GetPack().PutIn(controllerUseable);
        }
    }