//设定显示信息 public void setInformation(string title, string information, MesageOperate theOperateIn) { theOperate = new MesageOperate(theOperateIn); theTitleText.text = title; theInformationText.text = information; stringForTitle = title; stringForInformation = information; if (isAutoResize) { float arr = Mathf.Clamp((float)stringForInformation.Split('\n').Length / 7, 1f, 2.8f); setSize(new Vector2(1f, arr)); } systemValues.isMessageBoxShowing = true; }
public static void choiceMessageBoxShow(string showTitle, string showText, bool autoSize = false, MesageOperate theOperateMethod = null) { if (!isGamming) { return; } if (!theChoiceMessageBoxProfab) { theChoiceMessageBoxProfab = Resources.Load <GameObject> ("UI/MessageBoxForChoice"); } if (!theChoiceMessageBoxSave) { GameObject theMessageBox = GameObject.Instantiate <GameObject> (theChoiceMessageBoxProfab); //theMessageBox.transform .localScale = new Vector3 (2,2,2); //theMessageBox.transform.localPosition = Vector3.zero; theMessageBox.transform.SetParent(transStatic); theChoiceMessageBoxSave = theMessageBox.GetComponent <choiceMessageBox> (); theChoiceMessageBoxSave.isAutoResize = autoSize; theChoiceMessageBoxSave.setInformation(showTitle, showText, theOperateMethod); } else { //print ("make choice"); theChoiceMessageBoxSave.enabled = true; theChoiceMessageBoxSave.isAutoResize = autoSize; theChoiceMessageBoxSave.setInformation(showTitle, showText, theOperateMethod); } }