void Awake() { display = GameObject.Find("NPCSpeech").GetComponent <Canvas>(); weaponDisplay = GameObject.Find("WeaponSelectView").GetComponent <Canvas>(); weaponContainer = GameObject.Find("WeaponSelectContainer/Viewport/Content"); choiceDisplay = GameObject.Find("ChoiceView").GetComponent <Canvas>(); choiceContainer = GameObject.Find("ChoiceView/ChoiceButtons"); speechDisplay = GameObject.Find("SpeechView").GetComponent <Canvas>(); speechText = GameObject.Find("SpeechView/Text").GetComponent <Text>(); healDisplay = GameObject.Find("HealView").GetComponent <Canvas>(); upgradeDisplay = GameObject.Find("UpgradeScreen").GetComponent <UpgradeUI>(); roundStatusDisplay = GameObject.Find("RoundStatusView").GetComponent <Canvas>(); timerText = GameObject.Find("RoundStatusView/Status/Countdown").GetComponent <Text>(); playerHP = GameObject.Find("PlayerInfo/HP/Slider").GetComponent <Slider>(); healthText = GameObject.Find("PlayerInfo/HP/Text").GetComponent <Text>(); healPointsText = GameObject.Find("HealView/PointsRemaining").GetComponent <Text>(); player = GameObject.Find("Player").GetComponent <Player>(); pointsDisplay = GameObject.Find("PointCounter").GetComponent <Canvas>(); pointCounter = pointsDisplay.gameObject.GetComponent <Text>(); weaponInfoDisplay = GameObject.Find("WeaponInfoView").GetComponent <Canvas>(); dialogueSFX = GameObject.Find("NPCSpeech").GetComponent <AudioSource>(); updatePlayerHP(player.getHealth(), player.getHealth()); }
private void Start() { controller = GetComponentInParent <RestController>(); statusUI = GetComponentInChildren <StatusUI>(); wheelUI = GetComponentInChildren <UnitWheelUI>(); equipUI = GetComponentInChildren <EquipUI>(); upgradeUI = GetComponentInChildren <UpgradeUI>(); Hide(); }
private void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(this.gameObject); } }
public void upgradeOnClick() { // find the parent of the button (the skill) then find the sibling index to determine what skill # to upgrade Player player = GameObject.Find("Player").GetComponent <Player>(); UpgradeUI UI = GameObject.Find("UpgradeScreen").GetComponent <UpgradeUI>(); int skillNumber = this.transform.parent.GetSiblingIndex(); UI.upgradeSkill(skillNumber); player.usePoints(pointsNeeded); sfx.Play(); }
/// <summary> /// /// Initialise the upgrade list object. Updates the text properties of the object /// /// </summary> public void InitUpgradeListObject(UpgradeData _upgradeData, UpgradeUI _upgradeUI, DeckData _currentDeck, bool _isToAdd, int completedScenarios = 0) { upgradeData = _upgradeData; upgradeUI = _upgradeUI; currentDeck = _currentDeck; isToAdd = _isToAdd; upgradeNameText.text = _upgradeData.Name; honourPointsText.text = _upgradeData.GetHonourPointsCost(completedScenarios).ToString(); if (completedScenarios > 0) { honourPointsText.color = GameManager.instance.colourManager.GetStatModColour(StatisticStatuses.Buffed); } }
//Производит улучшение башни по клику мыши //Стоимость улучшения - 50 золота private void OnMouseDown() { Vector3 mousePos = Input.mousePosition; mousePos.z = Camera.main.nearClipPlane + 1; UpgradeUI.transform.position = Camera.main.ScreenToWorldPoint(mousePos); UpgradeUI.SetActive(true); int gold = PlayerData.GetComponent <PlayerData>().Gold; if (gold >= 50) { PlayerData.GetComponent <PlayerData>().Gold -= 50; DamagePoints++; } }
public void SetupShop(Dictionary <int, UpgradeLogic> upgrades) { foreach (Transform g in ShopUI.transform) { //Debug.Log(g.name); Destroy(g.gameObject); } foreach (UpgradeLogic upgrade in upgrades.Values) { UpgradeUI current = Instantiate(ShopItemObject, ShopUI.transform); current.Setup(upgrade); } Button close = Instantiate(ClosePrefab, ShopUI.transform); close.onClick.AddListener(() => OpenShop()); }
// Use this for initialization void Awake() { me = this; }
// Use this for initialization void Start() { me = this; upgrade = GetComponentInChildren <UpgradeUI>(); }
public void Start() { upgradeUI = FindObjectOfType <UpgradeUI>(); }
public void SetUpgradeUI(UpgradeUI ui) { Debug.Log(this); upgradeUI = ui; }
void Start() { energyUI = FindObjectOfType <EnergyGameUI>(); upgradeUI = FindObjectOfType <UpgradeUI>(); LeafEnergy(1, new Vector3(Screen.width * 2f, Screen.height * 2f, 0f)); }