Esempio n. 1
0
    protected override void Init()
    {
        this.isRepel = true;

        texture = transform.Find("BG").GetComponent <UITexture>();
        label   = transform.Find("Label").GetComponent <UILabel>();
        //texture.SetAnchor(transform.parent.gameObject, 0, 0, 0, 0);
        //if (GameLibrary.SceneType(SceneType.MB1))
        //{
        //    //transform.FindChild("ProgressBar_circle").gameObject.SetActive(true);
        //    GameObject mobaMatchedGo = Resources.Load<GameObject>("Prefab/UIPanel/MobaMatched");
        //    mobaMatched = NGUITools.AddChild(gameObject, mobaMatchedGo).GetComponent<MobaMatched>();
        //    mobaMatched.GetComponent<UIPanel>().depth = UIPanel.nextUnusedDepth + 1;
        //    mobaMatched.Init(Globe.mobaMyTeam, Globe.mobaEnemyTeam);
        //}
        //else if (GameLibrary.SceneType(SceneType.MB3))
        //{

        //}
        //else
        //{
        //}
        transform.FindChild("ProgressBar_liner").gameObject.SetActive(true);

        progressBar          = GetComponentInChildren <GUISingleProgressBar>();
        progressBar.onChange = OnProgressBarChange;
        //if (Globe.LoadScenceName != GameLibrary.PVP_Moba)
        //    progressBar.maxWidth = 795;
        progressBar.maxValue     = 100;
        progressBar.currentValue = 0;

        //随机背景图
        TimeSpan tiimeSpan = new TimeSpan();

        if (!string.IsNullOrEmpty(serverMgr.GetInstance().GetCreateAccountTime()))
        {
            tiimeSpan = TimeManager.Instance.CheckTimeNowadays(serverMgr.GetInstance().GetCreateAccountTime(), false);
        }
        //currentyMd = TimeManager.Instance.CheckTimeIsNowadays(serverMgr.GetInstance().GetCreateAccountTime(), false, true);
        if (tiimeSpan.Hours < 1)
        {
            index = UnityEngine.Random.Range(0, 4);
        }
        else
        {
            index = UnityEngine.Random.Range(0, tex.Length);
        }
        texture.mainTexture = tex[index];

        //随机文字小提示
        int desindex = UnityEngine.Random.Range(0, des.Length);

        label.text = des[desindex];
        //切换场景打断声音
        AudioController.Instance.StopUISound();
        //清空所有的战斗声音
        AudioController.Instance.ClearEffectSound();
        StartCoroutine(StartLoading());
    }
Esempio n. 2
0
 protected override void Init()
 {
     progressBar = transform.Find("ProgressBar").GetComponent <GUISingleProgressBar>();
     operateName = transform.Find("OperateName").GetComponent <UILabel>();
 }