public void _Show() { if (enableStatsTab) { uiStatsTab.Show(); } if (perkTabType == _PerkTabType.LevelList) { uiLPerkTabDisplay.Show(); } else if (perkTabType == _PerkTabType.RepeatableList) { uiPerkTabList.Show(); } else if (perkTabType == _PerkTabType.Item) { uiPerkTab.Show(); } isOn = true; if (!LevelPerkMenuOnly) { butClose.SetActive(true); } Cursor.visible = true; UIMainControl.FadeIn(canvasGroup, 0.25f, thisObj); }
public void _NewUnit(Unit unit) { if (!UIMainControl.EnableHPOverlay()) { return; } for (int i = 0; i < unitOverlayList.Count; i++) { if (unitOverlayList[i].unit != null) { continue; } unitOverlayList[i].unit = unit; unitOverlayList[i].gameObject.SetActive(true); return; } GameObject newObj = UI.Clone(unitOverlayList[0].gameObject); unitOverlayList.Add(newObj.GetComponent <UIUnitOverlay>()); unitOverlayList[unitOverlayList.Count - 1].unit = unit; unitOverlayList[unitOverlayList.Count - 1].gameObject.SetActive(true); }
IEnumerator DelayHide() { yield return(StartCoroutine(UIMainControl.WaitForRealSeconds(0.25f))); isOn = false; thisObj.SetActive(false); }
public void _Hide() { UIMainControl.FadeOut(canvasGroup, 0.25f); butClose.SetActive(false); Cursor.visible = false; StartCoroutine(DelayHide()); }
IEnumerator Start() { yield return(null); if (!UIMainControl.EnableItemSelectTab()) { thisObj.SetActive(false); } List <Ability> abilityList = AbilityManager.GetAbilityList(); for (int i = 0; i < abilityList.Count; i++) { if (i == 0) { abilityItemList[i].Init(); } else { abilityItemList.Add(UISelectItem.Clone(abilityItemList[0].rootObj, "Item" + (i + 1))); } abilityItemList[i].imgIcon.sprite = abilityList[i].icon; abilityItemList[i].label.text = abilityList[i].name; abilityItemList[i].selectHighlight.SetActive(false); //abilityItemList[i].buttonObj.SetActive(false); } if (abilityList.Count == 0) { abilityItemList[0].rootObj.SetActive(false); } UnitPlayer player = GameControl.GetPlayer(); for (int i = 0; i < player.weaponList.Count; i++) { if (i == 0) { weaponItemList[i].Init(); } else { weaponItemList.Add(UISelectItem.Clone(weaponItemList[0].rootObj, "Item" + (i + 1))); } weaponItemList[i].imgIcon.sprite = player.weaponList[i].icon; weaponItemList[i].label.text = player.weaponList[i].weaponName; weaponItemList[i].selectHighlight.SetActive(false); //weaponItemList[i].buttonObj.SetActive(false); } tabObject.SetActive(false); }
void Start() { player = GameControl.GetPlayer(); joystickAim.transform.parent.gameObject.SetActive(player.enableTurretRotate); fireButton.SetActive(!player.enableTurretRotate); if (!UIMainControl.EnableItemSelectTab()) { weaponAbilityTabButton.SetActive(false); } if (!UILevelPerkMenu.Enabled()) { levelPerkButton.SetActive(false); } Debug.Log("StartStart " + UILevelPerkMenu.Enabled()); }
IEnumerator Start() { yield return(null); if (!GameControl.EnableAbility() || AbilityManager.GetAbilityList().Count == 0) { DisableAllButtons(); yield break; } initiated = true; singleButton = !UIMainControl.ListAllAbility(); if (singleButton) { buttonList[0].Init(); buttonList[0].labelAlt.enabled = false; OnSwitchAbility(AbilityManager.GetAbilityList()[AbilityManager.GetSelectID()]); selectT.gameObject.SetActive(false); } else { List <Ability> abilityList = AbilityManager.GetAbilityList(); for (int i = 0; i < abilityList.Count; i++) { if (i == 0) { buttonList[i].Init(); } else { buttonList.Add(UIButton.Clone(buttonList[0].rootObj, "AbilityButton" + (i + 1))); } buttonList[i].imgIcon.sprite = abilityList[i].icon; buttonList[i].labelAlt.text = (i + 1).ToString(); buttonList[i].label.text = ""; } yield return(null); //give it one frame delay for the layoutGroup to rearrange the buttons selectT.localPosition = buttonList[AbilityManager.GetSelectID()].rectT.localPosition; } }
public void _Show(bool won) { Cursor.visible = true; if (won) { lbTitle.text = "Level Cleared!"; butContinueObj.SetActive(true); } else { lbTitle.text = "Level Lost"; butContinueObj.SetActive(UIMainControl.ShowContinueButtonWhenLost()); } UIMainControl.FadeIn(canvasGroup, 0.25f, thisObj); }
// Update is called once per frame void LateUpdate() { if (unit == null) { if (thisObj.activeInHierarchy) { thisObj.SetActive(false); } return; } if (unit.hitPoint >= unit.hitPointFull) { if (image.enabled) { image.enabled = false; } } else { if (!image.enabled) { image.enabled = true; } } if (!thisObj.activeInHierarchy) { return; } Vector3 screenPos = Camera.main.WorldToScreenPoint(unit.thisT.position + new Vector3(0, 2, 0)); screenPos.z = 0; rectT.localPosition = screenPos * UIMainControl.GetScaleFactor(); rectT.sizeDelta = new Vector2((unit.hitPoint / unit.hitPointFull) * fullSize.x, fullSize.y); }
void Update() { UnitPlayer player = GameControl.GetPlayer(); if (player == null) { return; } cursorT.localPosition = Input.mousePosition * UIMainControl.GetScaleFactor(); rectDefaultCursor.sizeDelta = cursorDefaultSize + new Vector2(player.GetRecoil() * 2, player.GetRecoil() * 2); if (player.Reloading()) { ShowReloading(); imgReloading.fillAmount = player.GetCurrentReload() / player.GetReloadDuration(); } else { HideReloading(); } }
IEnumerator DestroyMessage(GameObject obj) { if (enableZoom) { TweenScale(obj.transform, 0.1f, new Vector3(1.1f, 1.1f, 1.1f)); yield return(new WaitForSeconds(0.2f)); TweenScale(obj.transform, 0.2f, new Vector3(1.0f, 1.0f, 1.0f)); } float duration = 0; while (duration < 1.25f) { duration += Time.unscaledDeltaTime; yield return(null); } if (fadeOut) { UIMainControl.FadeOut(obj.GetComponent <CanvasGroup>(), 0.5f); } if (scaleDown) { TweenScale(obj.transform, 0.5f, new Vector3(0.5f, 0.5f, 0.5f)); } duration = 0; while (duration < 0.75f) { duration += Time.unscaledDeltaTime; yield return(null); } msgTList.Remove(obj.transform); Destroy(obj); }
public void _Show() { UIMainControl.FadeIn(canvasGroup, 0.25f, thisObj); //thisObj.SetActive(true); }
private float scrollCD = 0; //for switching weapon using mouse scroll void Awake() { instance = this; }
public void _Hide() { UIMainControl.FadeOut(canvasGroup, 0.25f, thisObj); }
public void _Show() { Cursor.visible = true; UIMainControl.FadeIn(canvasGroup, 0.25f, thisObj); }
public void _Hide() { Cursor.visible = false; UIMainControl.FadeOut(canvasGroup, 0.25f, thisObj); }
public void OnResumeButton() { UIMainControl.ResumeGame(); }
public void OnCloseButton(GameObject butObj = null, int pointerID = -1) { UIMainControl.CloseLevelPerkMenu(); }
public void OnLevelPerkButton() { UIMainControl.ToggleLevelPerkMenu(); }
public void OnMenuButton() { UIMainControl.TogglePause(); }
public void _Hide() { UIMainControl.FadeOut(canvasGroup, 0.25f, thisObj); //thisObj.SetActive(false); }