当前位置:网站首页>Unity knowledge points (ugui 2)
Unity knowledge points (ugui 2)
2022-04-23 03:22:00 【C # primary advanced】
One :Button
Button
It's a composite control , There is also a Text
Child controls , This child control allows you to set Button
The content of the text displayed on the 、 typeface 、 Writing style 、 Text size 、 Color, etc. , As mentioned earlier Text Control
It's the same .
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class ZC : MonoBehaviour {
public InputField name;// Declare components ( object )
public InputField pwd;
public Text tap;
bool f = false;
public GameObject zcc;
public GameObject dl;
public void RegBtn()
{
string name2 = name.text;// Get the value of the input box
string pwd2 = pwd.text;
//print(name2 + "\t" + pwd2);
if (name2.Equals("zhang") )
{
tap.text = " This account is already registered ";
}
else
{
tap.text=" Registered successfully ";
f = true;
}
}
public void DenLu()
{
RegBtn();
if (f)
{
// Interface jump
zcc.SetActive(false);// Hide the registration interface
dl.SetActive(true);// Open the login interface
}
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class Login : ZC {
public InputField nameTxt;
public InputField passwordTxt;
public Text tap1;
public void loginBtn()
{
RegBtn();
string namel = nameTxt.text;
string passwordl = passwordTxt.text;
if (namel.Equals("") || name == null || passwordl.Equals("")||passwordl==null)
{
tap1.text = " Account number or password cannot be empty ";
}
else
{
if (namel== name.text&&passwordl== pwd.text)
{
SceneManager.LoadScene("BBGG");// Scene jump
}
else
{
tap.text = " Wrong account or password !";
}
}
}
public void rowBut()
{
nameTxt.text = null;
passwordTxt.text = null;
}
}
版权声明
本文为[C # primary advanced]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220621093546.html
边栏推荐
- IDEA查看历史记录【文件历史和项目历史】
- A set of combination boxing to create an idea eye protection scheme
- General testing technology [1] classification of testing
- Quartz. Www. 18fu Used in net core
- Iotos IOT middle platform is connected to the access control system of isecure center
- Oracle query foreign keys contain comma separated data
- Advanced sorting - fast sorting
- C-10 program error correction (recursive function): number to character
- EasyUI's combobox implements three-level query
- Chapter 7 of C language programming (fifth edition of Tan Haoqiang) analysis and answer of modular programming exercises with functions
猜你喜欢
Visual programming - drawing assignment
[Mysql] LEFT函數 | RIGHT函數
C abstract class
A comprehensive understanding of static code analysis
Visual programming -- how to customize the mouse cursor
A set of combination boxing to create an idea eye protection scheme
This new feature of C 11, I would like to call it the strongest!
Node configuration environment CMD does not take effect
Ide-idea-problem
. net webapi access authorization mechanism and process design (header token + redis)
随机推荐
"Visual programming" test paper
IOTOS物联中台对接海康安防平台(iSecure Center)门禁系统
Scenario Title: how does system a use the page of system B
打卡:4.22 C语言篇 -(1)初识C语言 - (11)指针
Super easy to use [general excel import function]
Experiment 6 input / output stream
General test technology [II] test method
Oracle query foreign keys contain comma separated data
移植tslib时ts_setup: No such file or directory、ts_open: No such file or director
Experiment 5 components and event handling
Query stored procedures in PostgreSQL
EasyUI's combobox implements three-level query
2022g2 boiler stoker examination question bank and online simulation examination
Utgard connection opcserver reported an error caused by: org jinterop. dcom. common. JIRuntimeException: Access is denied. [0x800
MySQL installation pit
月薪10k-20k都无法回答的事务问题,你会吗?
Chapter 7 of C language programming (fifth edition of Tan Haoqiang) analysis and answer of modular programming exercises with functions
Supersocket is Used in net5 - command
js递归树结构计算每个节点的叶子节点的数量并且输出
MySql关键字GROUP_CONCAT,组合连接查询