private void Awake() { FindObjectOfType <PlayerInputBroadcaster>().Subscribe(gameObject); IC = FindObjectOfType <ItemCollection>(); ICU = GetComponent <ItemCollectionUI>(); ICU.OnItemUIClick += (x) => OnItemUse(x); }
public override void Load(Call call, TabModel model) { model.Items = _items = new ItemCollectionUI <TestItem>(); AddEntries(50); model.Actions = new List <TaskCreator>() { new TaskAction("Add 100 Entries", () => AddEntries(100)), new TaskAction("Add 1,000 Entries", () => AddEntries(1000)), new TaskAction("Add 10,000 Entries", () => AddEntries(10000)), }; }
public override void Load(Call call, TabModel model) { _items = new ItemCollectionUI <ListItem>(); model.Items = _items; model.Actions = new List <TaskCreator>() { new TaskDelegate("Serialize 1 object", Serialize, true, true), new TaskDelegate("Deserialize 1 object", Deserialize, true, true), new TaskDelegate("Serialize 1 million objects", SerializeOneMillionObjects, true, true), new TaskDelegate("Deserialize 1 million objects", DeserializeOneMillionObjects, true, true), }; }
private void Awake() { IC = FindObjectOfType <ItemCollection>(); ICU = GetComponent <ItemCollectionUI>(); ICU.OnItemUIClick += (x) => OnItemSelect(x); PW = FindObjectOfType <EntityManager>().Player.GetComponent <EntityWeapon>(); OnItemSelected += RefreshSelectionMarker; FindObjectOfType <PlayerInputBroadcaster>().Subscribe(gameObject); ItemUIs = new List <SelectableItemUI>(GetComponentsInChildren <SelectableItemUI>()); GetComponentInParent <PanelUI>().OnVisibilityChange += (b) => { if (!b) { StopSwap(); } }; }
public void RPC_ShowUI(Guid collectionGuid) { var col = PUN2ActionsBridge.collectionFinder.GetClientCollection(collectionGuid); if (col != null) { var uis = FindObjectsOfType <UI.ItemCollectionUI>(); foreach (var ui in uis) { if (ui.collectionName == col.collectionName) { _currentItemCollectionUI = ui; _currentItemCollectionUI.collection = (ICollection <IItemInstance>)col; _currentItemCollectionUI.window.Show(); return; } } new UnityLogger("[Collection] ").Warning("Couldn't find ItemCollectionUI that repaints collection for collection with name: " + col.ToString()); } }
public void OnTriggerUsed(Character character, TriggerEventData data) { var uis = FindObjectsOfType <ItemCollectionUI>(); var col = CollectionRegistry.byID.Get(_guid.guid) as ICollection <IItemInstance>; if (col != null) { foreach (var ui in uis) { if (ui.collectionName == col.ToString()) { _activeUI = ui; _activeUI.collection = col; _activeUI.window.Show(); return; } } new UnityLogger("[Collection] ").Warning("Couldn't find ItemCollectionUI that repaints collection for collection with name: " + col.ToString()); } new UnityLogger("[Collection] ").Warning("Couldn't find ItemCollectionUI that repaints collection for collection: " + _guid.guid); }