/// <summary> /// Initialize the Item with the values of the _itemServer. /// </summary> /// <param name="_itemServer"></param> public virtual void Initialize(ItemServer _itemServer) { id = _itemServer.id; itemName = _itemServer.itemName; icon = Resources.Load <Sprite>("Sprites/" + _itemServer.image); ColorUtility.TryParseHtmlString(_itemServer.color, out color); }
/// <summary> /// Initialize the Currency with the values of the _itemServer. /// </summary> /// <param name="_itemServer"></param> public override void Initialize(ItemServer _itemServer) { if (!(_itemServer is CurrencyServer itemCurrencyServer)) { return; } base.Initialize(_itemServer); enabled = itemCurrencyServer.enabled; defaultAmount = itemCurrencyServer.defaultAmount; maxAmount = itemCurrencyServer.maxAmount; }
/// <summary> /// Initialize the Skin with the values of the _itemServer as SkinServer. /// </summary> /// <param name="_itemServer"></param> public override void Initialize(ItemServer _itemServer) { if (!(_itemServer is SkinServer itemSkinServer)) { return; } base.Initialize(_itemServer); enabled = itemSkinServer.enabled; unlockAtStart = itemSkinServer.unlockAtStart; price = itemSkinServer.price; }