//Metodo che rilascia l'oggetto dall'inventario. public void leaveItem(ItemScript.TYPE_ITEM type){ if (this.ITEMS [type] == 1) { removeItem (type); switch (type) { case ItemScript.TYPE_ITEM.DICE: Instantiate (Item_1,PointSpawnItem.transform.position,Quaternion.identity); PlaySoundEffect(5); break; case ItemScript.TYPE_ITEM.BALL: Instantiate (Item_2,PointSpawnItem.transform.position,Quaternion.identity); PlaySoundEffect(5); break; case ItemScript.TYPE_ITEM.DECORATION: Instantiate (Item_3,PointSpawnItem.transform.position,Quaternion.identity); PlaySoundEffect(5); break; case ItemScript.TYPE_ITEM.PUMPKIN: Instantiate (Item_4,PointSpawnItem.transform.position,Quaternion.identity); PlaySoundEffect(5); break; } } }
public void StoreItemExit(ItemScript.TYPE_ITEM type){ if (!SoundIsPlaying(10)) PlaySoundEffect(10); this.ITEMS [type] = 2; }
public int getItemPin(ItemScript.TYPE_ITEM type){ return this.ITEMS [type]; }
public bool hasStoreItem(ItemScript.TYPE_ITEM type){ return (this.ITEMS[type] == 2) ? true : false; }
public void removeItem(ItemScript.TYPE_ITEM type){ this.ITEMS [type] = 0; }
public void addItem(ItemScript.TYPE_ITEM type,int pin){ this.ITEMS [type] = pin; PlaySoundEffect(4); Invoke ("ShowCanvasItemStoredPlayer", 0.5f); Invoke ("HideCanvasItemStoredPlayer", 2.5f); }