| | |
| | | |
| | | public TextMeshProUGUI timeTextNew = null; |
| | | |
| | | public TextMeshProUGUI timeStatic = null; |
| | | //public TextMeshProUGUI timeStatic = null; |
| | | |
| | | /// <summary> |
| | | /// 结算界面 |
| | |
| | | |
| | | public bool beginSkillStep = false; |
| | | |
| | | public GameObject darkGroundImg; |
| | | |
| | | // Start is called before the first frame update |
| | | void Start() |
| | | { |
| | | InitSDK(); |
| | | |
| | | bGameStart = false; |
| | | bFirstLoaded = false; |
| | | |
| | | bVibrate = new bool[4]; |
| | | bVibrate[0] = bVibrate[1] = bVibrate[2] = bVibrate[3] = false; |
| | | |
| | | if (timeStatic) |
| | | timeStatic.gameObject.SetActive(false); |
| | | EndlessBuffSelect.instance.HideBuffUI(); |
| | | EndlessSettlement settlement = SettlementUI.transform.Find("BgMask").GetComponent<EndlessSettlement>(); |
| | | settlement.Init(); |
| | | SettlementUI.SetActive(false); |
| | | EndlessMaskUI.instance.Hide(); |
| | | EndlessBossHPManager.instance.HideHP(); |
| | | EndlessScoreManager.instance.HideScore(); |
| | | |
| | | |
| | | float ratio = 0.06666667f; |
| | | RectTransform ts = GetComponent<RectTransform>(); |
| | | float tmpScale = ratio / ts.localScale.x - 1.0f; |
| | | float offect = tmpScale * (ts.sizeDelta.y * 0.5f); |
| | | //Debug.Log($"tmpScale:{tmpScale} offect:{offect}"); |
| | | Vector2 tmpOffect = new Vector2(0, offect); |
| | | transform.Find("Panel/Bottom").GetComponent<RectTransform>().anchoredPosition += tmpOffect; |
| | | transform.Find("Panel/TowerBuyBtn").GetComponent<RectTransform>().anchoredPosition += tmpOffect; |
| | | |
| | | //darkGroundImg = transform.Find("Image_DarkGround").gameObject; |
| | | darkGroundImg.GetComponent<RectTransform>().offsetMin += tmpOffect; |
| | | darkGroundImg.GetComponent<RectTransform>().offsetMax -= tmpOffect*0.5f; |
| | | |
| | | darkGroundImg.SetActive(false); |
| | | //查询是否已经做过了新手引导 |
| | | int guide = PlayerPrefs.GetInt("GemBattleGuide"); |
| | | GameConfig.IsNewbie = guide == 0; |
| | | |
| | | //GameConfig.IsNewbie = false; |
| | | if (GameConfig.IsNewbie) |
| | | { |
| | | Debug.Log("开始新手引导"); |
| | | Pause(); |
| | | uiStartMssk.gameObject.SetActive(false); |
| | | HideUIMask(); |
| | | countDownTextNew.text = ""; |
| | | countDownTextNew.gameObject.SetActive(false); |
| | | |
| | | Instantiate(Resources.Load<GameObject>("UI/Guide/GuidePanel"), GameObject.Find("BottomUI").transform); |
| | | GameObject guideObj = Instantiate(Resources.Load<GameObject>("UI/Guide/GuidePanel"), transform.Find("Panel")); |
| | | guideObj.GetComponent<RectTransform>().offsetMin += tmpOffect; |
| | | AddGuideEvent(); |
| | | } |
| | | |
| | |
| | | GameConfig.EndlessPortUseSkillTowerCount = 0; |
| | | |
| | | AudioSourceManager.Ins.Play(AudioEnum.BGM2); |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 拖拽时候黑色背景 |
| | | /// </summary> |
| | | /// <param name="isOn"></param> |
| | | public void SetDarkGround(bool isOn) |
| | | { |
| | | if (darkGroundImg.activeSelf != isOn) |
| | | darkGroundImg.SetActive(isOn); |
| | | } |
| | | private void InitSDK() |
| | | { |
| | | if (TDAA_SDKManager.Ins == null) |
| | |
| | | |
| | | if (AudioSourceManager.Ins == null) |
| | | gameObject.AddComponent<AudioSourceManager>(); |
| | | } |
| | | |
| | | public void ShowUIMask() |
| | | { |
| | | uiStartMssk.gameObject.SetActive(true); |
| | | } |
| | | |
| | | public void HideUIMask() |
| | | { |
| | | uiStartMssk.gameObject.SetActive(false); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | private void GuidePlayAppearEffect(Vector3 worldPos) |
| | | { |
| | | EndlessGameUI.instance.PlayAppearEffect(worldPos); |
| | | EndlessGameUI.instance.PlayAppearEffectGuide(worldPos); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | // 开启游戏,且隐藏中间的数字. |
| | | if (secToDo <= 0) |
| | | { |
| | | uiStartMssk.gameObject.SetActive(false); |
| | | HideUIMask(); |
| | | countDownTextNew.text = ""; |
| | | countDownTextNew.gameObject.SetActive(false); |
| | | bGameStart = true; |