当前位置:网站首页>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
边栏推荐
- Docker拉取mysql并连接
- AWS from entry to actual combat: creating accounts
- Web Course Design - his system
- Iotos IOT middle platform is connected to the access control system of isecure center
- Fiddler use
- When migrating tslib_ setup: No such file or directory、ts_ open: No such file or director
- 你真的懂hashCode和equals吗???
- Idempotency practice operation, explaining idempotency based on business
- js递归树结构计算每个节点的叶子节点的数量并且输出
- 2022年做跨境电商五大技巧小分享
猜你喜欢
![[Mysql] LEFT函数 | RIGHT函数](/img/26/82e0f2280de011636c26931a74e749.png)
[Mysql] LEFT函数 | RIGHT函数

打卡:4.22 C语言篇 -(1)初识C语言 - (11)指针
![General test technology [II] test method](/img/b7/f661f446616ad6bfbbf48eb03ea82d.png)
General test technology [II] test method

. net webapi access authorization mechanism and process design (header token + redis)

2022t elevator repair test simulation 100 questions and online simulation test

二进制文件版本控制工具选择难?看完这篇你会找到答案

软件测试相关知识~
![Super easy to use [general excel import function]](/img/9b/ef18d1b92848976b5a141af5f239b5.jpg)
Super easy to use [general excel import function]

《C语言程序设计》(谭浩强第五版) 第9章 用户自己建立数据类型 习题解析与答案

研讨会回放视频:如何提升Jenkins能力,使其成为真正的DevOps平台
随机推荐
C-10 program error correction (recursive function): number to character
Problem a: face recognition
Idea view history [file history and project history]
Course design of Database Principle -- material distribution management system
Do you really understand hashcode and equals???
MySQL query specifies that a row is sorted to the first row
Visual programming -- how to customize the mouse cursor
Why is bi so important to enterprises?
一文了解全面静态代码分析
[Mysql] LEFT函數 | RIGHT函數
. net core current limiting control - aspnetcoreratelimit
MySQL grouping query rules
Experiment 5 components and event handling
[mock data] fastmock dynamically returns the mock content according to the incoming parameters
The website JS in. Net core cefsharp chromium WebBrowser calls the C method in winfrom program
可以接收多种数据类型参数——可变参数
Chapter 8 of C language programming (fifth edition of Tan Haoqiang) is good at using pointer exercises to analyze and answer
2022 团体程序设计天梯赛 模拟赛 L2-4 哲哲打游戏 (25 分)
月薪10k-20k都无法回答的事务问题,你会吗?
JS, bind the event for a label with input, and then bind the stand-alone event in the parent element. The event is executed twice and solved