// Token: 0x06001403 RID: 5123 RVA: 0x00073BD0 File Offset: 0x00071DD0 public bool AddDefaultItem(BaseUberStrikeItemView itemView) { if (itemView != null) { if (itemView.ItemClass == UberstrikeItemClass.FunctionalGeneral) { IUnityItem unityItem; if (this._shopItemsById.TryGetValue(itemView.ID, out unityItem)) { ItemConfigurationUtil.CopyProperties <BaseUberStrikeItemView>(unityItem.View, itemView); } } else if (string.IsNullOrEmpty(itemView.PrefabName)) { Debug.LogWarning("Missing PrefabName for item: " + itemView.Name); } else { Debug.LogError(string.Concat(new string[] { "Missing UnityItem for: '", itemView.Name, "' with PrefabName: '", itemView.PrefabName, "'" })); } } return(false); }
// Token: 0x06001088 RID: 4232 RVA: 0x000663F8 File Offset: 0x000645F8 private void InitializeQuickItem(GameObject quickItemObject, LoadoutSlotType slot, InventoryItem inventoryItem) { int slotIndex = this.GetSlotIndex(slot); QuickItem component = quickItemObject.GetComponent <QuickItem>(); if (component) { component.gameObject.SetActive(true); for (int i = 0; i < component.gameObject.transform.childCount; i++) { component.gameObject.transform.GetChild(i).gameObject.SetActive(false); } component.gameObject.name = inventoryItem.Item.Name; component.transform.parent = GameState.Current.Player.WeaponAttachPoint; if (component.rigidbody) { component.rigidbody.isKinematic = true; } ItemConfigurationUtil.CopyProperties <UberStrikeItemQuickView>(component.Configuration, inventoryItem.Item.View); ItemConfigurationUtil.CopyCustomProperties(inventoryItem.Item.View, component.Configuration); if (component.Configuration.RechargeTime <= 0) { int index = slotIndex; QuickItemBehaviour behaviour = component.Behaviour; behaviour.OnActivated = (Action)Delegate.Combine(behaviour.OnActivated, new Action(delegate() { this.UseConsumableItem(inventoryItem); this.Restriction.DecreaseUse(index); this.NextCooldownFinishTime = Time.time + 0.5f; })); this.Restriction.InitializeSlot(slotIndex, component, inventoryItem.AmountRemaining); } else { component.Behaviour.CurrentAmount = component.Configuration.AmountRemaining; } component.Behaviour.FocusKey = this.GetFocusKey(slot); IGrenadeProjectile grenadeProjectile = component as IGrenadeProjectile; if (grenadeProjectile != null) { grenadeProjectile.OnProjectileEmitted += delegate(IGrenadeProjectile p) { Singleton <ProjectileManager> .Instance.AddProjectile(p, Singleton <WeaponController> .Instance.NextProjectileId()); GameState.Current.Actions.EmitQuickItem(p.Position, p.Velocity, inventoryItem.Item.View.ID, GameState.Current.PlayerData.Player.PlayerId, p.ID); }; } if (this._quickItems[slotIndex]) { UnityEngine.Object.Destroy(this._quickItems[slotIndex].gameObject); } this._quickItems[slotIndex] = component; } else { Debug.LogError("Failed to initialize QuickItem"); } GameData.Instance.OnQuickItemsChanged.Fire(); }