Ejemplo n.º 1
0
    //设置内容
    public void SetText(string s)
    {
        //
        for (int i = 0; i < modelList.Count; i++)
        {
            modelList[i].gameObject.SetActive(false);
            modelList[i].transform.parent = null;
        }
        modelList.Clear();

        byte[] byteArray = System.Text.Encoding.Default.GetBytes(s);

        for (int i = 0; i < byteArray.Length; i++)
        {
            ModelTextObj obj = ModelTextManager.GetInstance().GetModelTextObj((char)byteArray[i]);
            modelList.Add(obj);
            obj.gameObject.SetActive(true);
            obj.transform.parent = transform;
            obj.textobj.GetComponent <Renderer>().material = m;

            obj.transform.localRotation = Quaternion.Euler(new Vector3(0, 180, 0));
            obj.transform.localScale    = new Vector3(1, 1, 1);
        }
        SetObjPos();
    }
Ejemplo n.º 2
0
 public static ModelTextManager GetInstance()
 {
     if (instance == null)
     {
         GameObject obj = new GameObject("ModelTextManager");
         instance = obj.AddComponent <ModelTextManager>();
         instance.Load();
     }
     return(instance);
 }
Ejemplo n.º 3
0
 private void OnDestroy()
 {
     instance = null;
 }