private void Awake() { gameObject.SetActive(false); partyPanel = FindObjectOfType <UIPartyPanel>(); playerInfoPanel = FindObjectOfType <UIPlayerInfoPanel>(); characterController = FindObjectOfType <BattleSystem.CharacterController>(); }
public void ConsumeItemFromUI() { PartyMember member = partyPanel.LookUpSelectedPartyMember(); if (!IsCraftingItem(itemToConsume.item) && member != null) { ConsumableInventory consumableInventory = FindObjectOfType <ConsumableInventory>(); bool success = consumableInventory.UseItemOutsideOfBattle(member, itemToConsume.item); if (success) { consumableInventory.ClearAndParseUInventory(); UIPlayerInfoPanel infoPanel = FindObjectOfType <UIPlayerInfoPanel>(); if (!infoPanel.gameObject.activeSelf) { infoPanel.gameObject.SetActive(true); } infoPanel.Populate(member.characterName); } else { GiveItem(itemToConsume.item); } } itemToConsume.UpdateItem(null); }
/// <summary> /// Updates the player info panels to be displayed on the UI /// </summary> public void updatePlayerInfoPanels() { Transform panel = _PlayerInfosPanel.GetChild(0); UIPlayerInfoPanel infoPanel = panel.GetComponent <UIPlayerInfoPanel> (); infoPanel.uiUpdate(_CurrentPlayer); /* * // Keep track of index to assign a player to a PlayerInfoPanel * int pIndex = 0; * * // Get the list of Player names * List<string> pNames = GameManager.getPlayerNames (); * * // Instantiate a Player object to loop through the list of GameManager.players * Player _P; * * // Loop through each GameManager.Players * // Assign the Player to the Panel * foreach (Transform panel in _PlayerInfosPanel) * { * // GUsing pIndex to get the corresponding Player username * // Use that string to getPlayer * _P = GameManager.getPlayer ( pNames [pIndex] ); * * // Update the PlayerInfoPanel with the player _P info * panel.GetComponent<UIPlayerInfoPanel> ().uiUpdate (_P); * * pIndex++; * }*/ }
public SceneGame(GameSystem gs, GameWorldSystem gw) : base(gs) { gameWorld = gw; tileMapStatus = new DefaultStatus(this); mapSpritesInfo = new TileMapSprites.MapSpritesInfo(gameWorld); zoomableTileMapSprites = new ZoomableTileMapSprites <TileMapSprites>(); addChild(zoomableTileMapSprites); uiPlayerInfoPanel = new UIPlayerInfoPanel(gameSystem, gameWorld, new Point(formMain.Width - 540, 30)); uiTileInfoPanel = new UITileInfoPanel(gameSystem, new Point(30, formMain.Height - 108)); addChild(uiPlayerInfoPanel); addChild(uiTileInfoPanel); loadMap(); }