private void Awake()
    {
        playerMoney     = DataPlayer.GetModule <PlayerMoney>();
        playerInventory = DataPlayer.GetModule <PlayerInventory>();

        upgradeCollection = LoadResourceController.GetUpgradeItemCollection();
        sellCollection    = LoadResourceController.GetSellItemCollection();

        InitButtons();
        InitLocalize();

        NextItem();
    }
Exemple #2
0
    /// <summary>
    /// Item constructor with params
    /// </summary>
    /// <param name="type"> A type in ResourceType. </param>
    /// <param name="id"> Unique identify of a type. </param>
    /// <param name="number"> Number of resource.. </param>
    /// <param name="itemStats"> Data of item including BaseStat and StatType. </param>
    /// <returns></returns>
    public ItemResource(int type, int id, long number, int inventoryId, int level, ItemStat[] itemStats = null) : base(type, id, number)
    {
        this.level = level;

        this.inventoryId = inventoryId;

        if (upgradeItemCollection == null)
        {
            upgradeItemCollection = LoadResourceController.GetUpgradeItemCollection();
        }

        if (itemStatCollection == null)
        {
            itemStatCollection = LoadResourceController.GetItemStat();
        }

        ReloadItemStats();
    }