Пример #1
0
    public string GetTxtById(string id)
    {
        //判断 语言类型
        id += Globals.language;
        print("  db  id " + id);
        string str = GetStrinByName(id, Duibai.GetInstance());

        print("  db  str " + str);
        return(str);
    }
Пример #2
0
 static public Duibai GetInstance()
 {
     if (instance == null)
     {
         GameObject go = new GameObject("Duibai");
         //DontDestroyOnLoad(go);
         instance = go.AddComponent <Duibai>();
     } //instance = new DataZS();
     return(instance);
 }
Пример #3
0
    void ShowTxts()
    {
        if (zzNums < 2f)
        {
            return;
        }

        if (!isTxtStart)
        {
            if (listI >= txtList.Count)
            {
                return;
            }

            isTxtStart = true;
            IsChuXian  = true;
            ShowTxt(Duibai.GetInstance().GetTxtById(txtList[listI]));
            listI++;
            //_text.transform.position = new Vector3(_text.transform.position.x, txtCSPos.y - 30, _text.transform.position.z);
            _y = _text.transform.position.y;
        }


        if (IsChuXian)
        {
            if (_y < txtCSPos.y - 0.2f)
            {
                _y += (txtCSPos.y - _text.transform.position.y) * 0.02f;
            }
            else
            {
                _y       = txtCSPos.y;
                txtNums += Time.deltaTime;
                if (txtNums >= 10)
                {
                    IsChuXian = false;
                    txtNums   = 0;
                }
            }

            if (_text.GetComponent <CanvasGroup>().alpha < 0.94)
            {
                _text.GetComponent <CanvasGroup>().alpha += (1 - _text.GetComponent <CanvasGroup>().alpha) * 0.02f;
            }
            else
            {
                _text.GetComponent <CanvasGroup>().alpha = 1;
            }
        }
        else
        {
            if (_y < txtCSPos.y + 20 - 0.4f)
            {
                _y += (txtCSPos.y + 20 - _text.transform.position.y) * 0.04f;
            }
            else
            {
                _y = txtCSPos.y + 20;

                txtNums += Time.deltaTime;
                if (txtNums >= 0.5f)
                {
                    isTxtStart = false;
                    txtNums    = 0;
                }
            }

            if (_text.GetComponent <CanvasGroup>().alpha > 0.04)
            {
                _text.GetComponent <CanvasGroup>().alpha += (0 - _text.GetComponent <CanvasGroup>().alpha) * 0.04f;
            }
            else
            {
                _text.GetComponent <CanvasGroup>().alpha = 0;
            }
        }
        _text.transform.position = new Vector3(_text.transform.position.x, _y, _text.transform.position.z);
    }