private void startInterface() { if (playerShip) { Equipment[] eq = playerShip.getEquipment(); if (eq.Length > 0) { debugText = transform.Find("DebugLog/Text").GetComponent <UnityEngine.UI.Text>(); equipmentTilesHolder = transform.Find("ShipEquipment").GetComponent <RectTransform>(); tileScaleAddButton = transform.Find("ShipEquipment/TopPanel/TileScaleAddButton").GetComponent <UnityEngine.UI.Button>(); tileScaleSubButton = transform.Find("ShipEquipment/TopPanel/TileScaleSubButton").GetComponent <UnityEngine.UI.Button>(); topPanelButton1 = transform.Find("ShipEquipment/TopPanel/TopPanelButton1").GetComponent <UnityEngine.UI.Button>(); topPanelButton2 = transform.Find("ShipEquipment/TopPanel/TopPanelButton2").GetComponent <UnityEngine.UI.Button>(); topPanelButton3 = transform.Find("ShipEquipment/TopPanel/TopPanelButton3").GetComponent <UnityEngine.UI.Button>(); tileScaleAddButton.onClick.AddListener(tileScaleAddButtonClick); tileScaleSubButton.onClick.AddListener(tileScaleSubButtonClick); topPanelButton1.onClick.AddListener(topPanelButton1Click); topPanelButton2.onClick.AddListener(topPanelButton2Click); topPanelButton3.onClick.AddListener(topPanelButton3Click); overviewTransform = transform.Find("Overview/Viewport/Content"); targetTilesHolder = transform.Find("TargetTilesHolder").GetComponent <RectTransform>(); messagesHolder = transform.Find("Messages/Viewport/Content"); setEquipment(eq); setOwner(playerShip); InvokeRepeating("refreshOverview", 0f, 1f); } } }
private void startEq() { equipment = ship.getEquipment(); for (int i = 0; i < equipment.Length; i++) { equipment[i].setTarget(enemy); equipment[i].activate(); } }