void GiveSignInfo_mobile(GameObject obj) { Sign_Chinese.text = string.Empty; Sign_English.text = string.Empty; Sign_Note.text = string.Empty; // try // { TextureIcon go = null; if (obj.GetComponentInChildren <TextureIcon>() == null) { Debug.LogError("无 PS 数据:" + obj.name); } else { go = obj.GetComponentInChildren <TextureIcon>(); Sign_Chinese.text = go.Info.Chinese;// "(" + go.Info.English + ")"; if (go.Info.English == "" || go.Info.English == null) { Sign_Chinese.text = go.Info.Chinese; } Sign_Note.text = go.Info.Note.Trim(); Sign_English.text = go.Info.English; } // } // catch (Exception e) // { // Sign_Chinese.text = string.Empty; // Sign_English.text = string.Empty; // Sign_Note.text = string.Empty; // expPanel.SetActive(false); // } }
void GiveSignInfo(GameObject obj) { TextureIcon go = obj.GetComponentInChildren <TextureIcon>(); try { float scrollHeight = scrollRectTf.sizeDelta.y; Chinese.text = go.Info.Chinese + "(" + go.Info.English + ")"; Explain.text = go.Info.Note.Trim(); if (PublicClass.isShowExpPanel && Explain.text != "") { expPanel.SetActive(true); } // if (Explain.text == null || Explain.text == "") // { // expPanel.SetActive(false); // } } catch (Exception e) { Chinese.text = string.Empty; Explain.text = string.Empty; expPanel.SetActive(false); } }
public void CreateSignList() { if (PPTGlobal.PPTEnv == PPTGlobal.PPTEnvironment.PPTPlayer) { for (int i = 0; i < SignElement_parent.transform.childCount; ++i) { GameObject tmp = SignElement_parent.transform.GetChild(i).gameObject; if (Bookmark.name != tmp.name) { DestroyImmediate(tmp); } } } if (SignElement_parent.transform.childCount > 1) { return; } //生成钉子 for (int j = 0; j < psmodel.Length; j++) //批量赋值,在空物体下生成面片模型 { if (psmodel[j].name.Contains("PS")) { GameObject sign = Instantiate(Resources.Load <GameObject>("Prefab/mianpian")); //面片三维展示 TextureIcon tempSign = sign.GetComponent <TextureIcon>(); GameObject signElement = Instantiate(Bookmark); signElement.SetActive(true); SignElement signElem = signElement.GetComponent <SignElement>(); //滑动栏ui脚本 signElement.transform.SetParent(SignElement_parent.transform); signElement.transform.localScale = Vector3.one; signElement.transform.localEulerAngles = Vector3.zero; signElement.transform.localPosition = new Vector3(signElement.transform.localPosition.x, signElement.transform.localPosition.y, 0); sign.name = j.ToString(); ModelInfo tempSignInfo; tempSign.whichSign = signElem; if (sign_info_dic.ContainsKey(psmodel[j].name)) //非整个模型 { tempSignInfo = sign_info_dic[psmodel[j].name]; tempSign.Info = tempSignInfo; signElem._name = tempSign.Info.Chinese; } signElem.num = (j + 1).ToString(); signElem.whichSignIcon = tempSign; //图钉 ui 属性赋值 sign.transform.parent = psmodel[j].transform; sign.transform.localPosition = Vector3.zero; sign.transform.localScale = Vector3.one; } else { DestroyImmediate(psmodel[j]); } } PublicClass.appstate = App_State.Running; }