


深圳Unity3D培训
达内深圳龙华中心
150-1322-7143
unity3D开发的对话框的制作
新建一个Sprite-->增加Box Collider-->Scroll Bar Script-->设置属性UPScroll Bar(Direction:TopToBottom 把Sprite疲塌到Background外面 Size:0.1)
新建一个子Sprite-->把子Sprite疲塌到Foreground外面-->把它的高度和宽度设置的和父Sprite同样
下边是先容输出文本
新建一个Label-->增加Box Collider--增加Text List-->增加剧本
private UITextList testList;
int i=0;
void Start () {
testList = this.GetComponent<UITextList> ();
}
void Update () {
if (Input.GetMouseButtonDown (0)) {
i++;
testList.Add ("qishituan.org"+i);
}
}
新建一个ScrollBar-->把子Sprite的Anchors属性外面的Left、Right、Top、Bottom 都设置为本身
设置Label的属性UIText List(把Label疲塌到Text Label外面,把ScrollBar疲塌到Scroll Bar外面
而后是谈天窗口的制造
制造实现的对话框。
新建一个可疲塌的Sprite(Drag Object)-->新建一个可把窗口疲塌巨细的Sprite(Drag Resize Script)-->新建一个纸质的Sprite做配景(Anchors:设置为本身)
新建一个ScrollBar,让两个Sprite同样巨细 父Sprite设置
新增加一个TextList
新增加一个TextField(Anchors:Top设为Bottom,别的都是本身
把剧本疲塌到TextFiled下面 把TextFiled疲塌到属性On Submit外面的Notify下面,并抉择响应的Method 把谈天的Label疲塌到属性Chart外面的Text List下面
public UIInput input;
public UITextList textList;
public void OnChartSubmit(){
string value = input.value;
textList.Add (value);
input.value = "";
}
想知道更多关于IT行业的信息吗?想远远不如行动,行动起来,一起加入达内,一起进入IT行业,跟着达内的脚步,一起走进如今的互联网信息时代,带给你不一样的色彩生活——【深圳Unity3D培训】
怕钱不够?就业挣钱后再付学费; 怕学不会? 真正0基础入学,120天精通; 担心就业? 7万家雇主企业,名企内部就业