public async void PlayAudio(AudioClipType type) { var clipRef = _audioList.First(x => x.Type == type).ClipRef; var audioClip = await AssetsController.LoadAsset <AudioClip>(clipRef); _audioSource.PlayOneShot(audioClip); }
public async void SetCellData(RawObject raw, int count) { var sprite = await AssetsController.LoadAsset <Sprite>(raw.IconRef); SetRawIcon(sprite); SetRawText(count.ToString()); }
public async void SetCellData(BattleUnitObject unit) { var sprite = await AssetsController.LoadAsset <Sprite>(unit.Data.IconRef); SetCellBg(unit.Team); SetCellIcon(sprite); }
public async void SetResultData() { var sprite = await AssetsController.LoadAsset <Sprite>(Active.RawData.IconRef); SetPartIcon(sprite); SetPartQuality(ActiveQuality); }
public async void SetProductInfo() { var productData = _storageMenuController.Items.ActiveItem.ItemData; var sprite = await AssetsController.LoadAsset <Sprite>(productData.IconRef); SetProductIcon(sprite); SetProductTitle(productData.Key); specifications.SetSpecificationsData(); }
public async void SetSidebarData() { var unitData = _unitsMenuController.Roster.ActiveUnit.UnitData; unitName.text = _localisationController.GetLanguageValue(unitData.Key); unitIcon.sprite = await AssetsController.LoadAsset <Sprite>(unitData.IconRef); specification.SetSpecificationData(); }
private async void SetProductionCellInfo() { var craftObj = _productionController.GetProduction(_productionCell.Id); var craftItem = _productsController.GetProduct(craftObj.Key); var sprite = await AssetsController.LoadAsset <Sprite>(craftItem.IconRef); _productionCell.SetCellIcon(sprite); }
public async void SetItemData() { var sprite = await AssetsController.LoadAsset <Sprite>(ActiveItem.ItemData.IconRef); SetItemTitle(ActiveItem.ItemData.Key); SetItemIcon(sprite); specification.SetSpecificationData(); }
public async void SetSchemeData() { var productData = _craftMenuController.Scheme.items.ActiveItem.ItemData; var sprite = await AssetsController.LoadAsset <Sprite>(productData.IconRef); SetProductIcon(sprite); parts.SetPartsData(); }
public async void PlayMusic() { var random = new Random().Next(0, _musicList.Count); var clipRef = _musicList[random].ClipRef; var audioClip = await AssetsController.LoadAsset <AudioClip>(clipRef); Debug.Log($"<color=#ffb3ff>Audio Manager: Playing sound {audioClip.name}</color>"); _audioSource.PlayOneShot(audioClip); }
public async void SetUnitData(BattleUnitObject unit) { Unit = unit; var sprite = await AssetsController.LoadAsset <Sprite>(unit.Data.IconRef); SetUnitIcon(sprite); SetUnitTeam(unit.Team); Unit.OnSetHealth += StartHealthBarAnimation; }
public async void SetData(RawType raw) { var sprite = await AssetsController.LoadAsset <Sprite>(_iconUtil.GetRawIcon(raw)); var rawCountKey = LocalisationKeys.RawKeys[raw]; var rawCount = _controllersResolver.GetStoreByType(ItemType.Raw).GetItem(rawCountKey).GetCount(); SetIcon(sprite); SetCount(rawCount); }
public async void SetSidebarData() { var data = ActiveItem.Equipment; var sprite = await AssetsController.LoadAsset <Sprite>(data.IconRef); SetItemTitle(data.Key); SetItemIcon(sprite); specs.SetSpecData(); select.SetButtonInteractable(); }
public async void SetEquipmentData(ProductObject product, ItemQuality quality = ItemQuality.Common) { var sprite = await AssetsController.LoadAsset <Sprite>(product?.IconRef); var active = (bool)sprite; SetEquipmentIcon(sprite, active); SetQualityIcon(quality, active); plusIcon.enabled = !active; itemTypeImage.enabled = !active; }
public async void SetPartInfo(OrderObject order) { var index = transform.GetSiblingIndex(); if (index < order.parts.Count) { var part = order.parts[index]; var data = part.data; var store = _controllersResolver.GetStoreByType(data.ItemType); var itemCount = store.GetItem(data.Slug).GetCount(part.quality); var sprite = await AssetsController.LoadAsset <Sprite>(data.Icon); SetPartIcon(sprite); SetPartText($"{itemCount}/{part.count}"); SetPartQuality(part.quality); } else { ResetPartInfo(); } }
private async void SetRawIcon(AssetReference spriteRef) { var sprite = await AssetsController.LoadAsset <Sprite>(spriteRef); rawIcon.sprite = sprite; }