求教unityunity账号怎么注册册

Unity3D教程:Unity3D利用PHP+Mysql实现注册激活验证登陆 | Unity3D教程手册
当前位置 :
>> Unity3D教程:Unity3D利用PHP+Mysql实现注册激活验证登陆
Unity3D教程:Unity3D利用PHP+Mysql实现注册激活验证登陆
fopen(/alidata/www/default/wp-content/plugins/devformatter/geshi/geshi/csharp.php) []: failed to open stream: No such file or directory in /alidata/www/old_default/wp-content/plugins/devformatter/devgeshi.php on line 103
fopen(/alidata/www/default/wp-content/plugins/devformatter/geshi/geshi/csharp.php) []: failed to open stream: No such file or directory in /alidata/www/old_default/wp-content/plugins/devformatter/devgeshi.php on line 103
fopen(/alidata/www/default/wp-content/plugins/devformatter/geshi/geshi/csharp.php) []: failed to open stream: No such file or directory in /alidata/www/old_default/wp-content/plugins/devformatter/devgeshi.php on line 103
fopen(/alidata/www/default/wp-content/plugins/devformatter/geshi/geshi/csharp.php) []: failed to open stream: No such file or directory in /alidata/www/old_default/wp-content/plugins/devformatter/devgeshi.php on line 103
工具:Unity3.5+WampSever
实现的功能:图片验证码,注册登录,邮箱验证激活
测试请使用英文!
首先创建数据库:
Unity3D教程:Unity3D利用PHP+Mysql实现注册激活验证登陆
&&&01CREATE TABLE IF NOT EXISTS `scores` (
02&03`id` int(10) NOT NULL AUTO_INCREMENT,
04&05`name` varchar(30) CHARACTER SET utf8 NOT NULL,
06&07`password` varchar(50) CHARACTER SET utf8 NOT NULL,
08&09`email` varchar(500) CHARACTER SET utf8 NOT NULL,
10&11`flag` int(1) NOT NULL,
12&13`code` varchar(500) CHARACTER SET utf8 NOT NULL,
14&15`session` int(5) NOT NULL,
16&17PRIMARY KEY (`id`)
18&19) ENGINE=InnoDB
DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
20&21INSERT INTO `scores` (`id`, `name`, `password`, `email`, `flag`, `code`, `session`) VALUES
22&23(1, 'admin', 'a5ae4a801fc3', '', 1, 'a5ae4a801fc3', 29136);
插入一条记录,admin,密码admin。然后打开unity3D,新建场景,新建一个GUITexture,坐标调整为(0.04,0.81,0),然后将js代码赋给camera。代码如下:
&&&001#pragma strict
002&003private var secretKey=&hashcode&;
004&005private var formNick = &&; //this is the field where the player will put the name to login
006&007private var formPassword = &&; //this is his password
008&009private var formEmail = &&;
010&011private var formyzm = &&;
012&013var formText = &&; //log
014&015var CheckUserURL = &http://localhost/checkuser.php&; //检测帐户
016&017var RegisterURL = &http://localhost/register.php&;//注册
018&019var imageURL = &http://localhost/image.php&;//生成验证码的php文件
020&021var hash = &hashcode&; //验证码,需要与php文件中一致
022&023var reg:boolean =//切换注册页面
024&025public var tu:GUIT//GUITexture
026&027private var textrect = Rect (10, 150, 500, 500); //gui rect
028&029function Start()
032&033LoadImage();
036&037function OnGUI() {if(reg==false)
040&041tu.enabled =
042&043GUI.Label( Rect (10, 10, 80, 20), &Your name:& ); //text with your nick
044&045GUI.Label( Rect (10, 30, 80, 20), &Your pass:& );
046&047GUI.Label( Rect (10, 50, 80, 20), &yanzhengma:& );
048&049formNick = GUI.TextField ( Rect (90, 10, 100, 20), formNick ); //here you will insert the new value to variable formNick
050&051formPassword = GUI.TextField ( Rect (90, 30, 100, 20), formPassword ); //same as above, but for password
052&053formyzm = GUI.TextField(Rect(90,50,100,20),formyzm);if ( GUI.Button ( Rect (10, 120, 100, 20) , &Try login& ) ){ //just a button
054&055Login();
058&059if ( GUI.Button ( Rect (220, 120, 100, 20) , &Chanage Pic& ) ){ //just a button
060&061LoadImage();
064&065if ( GUI.Button ( Rect (120, 120, 100, 20) , &Register& ) ){ //just a button
066&067reg=
072&073if(reg==true)
076&077tu.enabled =
078&079GUI.Label( Rect (10, 10, 80, 20), &Your name:& ); //text with your nick
080&081GUI.Label( Rect (10, 30, 80, 20), &Your pass:& );
082&083GUI.Label( Rect (10, 50, 80, 20), &Your Email:& );
084&085formNick = GUI.TextField ( Rect (90, 10, 100, 20), formNick ); //here you will insert the new value to variable formNick
086&087formPassword = GUI.TextField ( Rect (90, 30, 100, 20), formPassword ); //same as above, but for password
088&089formEmail = GUI.TextField ( Rect (90, 50, 200, 20), formEmail );
090&091if ( GUI.Button ( Rect (10, 120, 100, 20) , &Login& ) ){ //just a buttonreg=
094&095if ( GUI.Button ( Rect (120, 120, 100, 20) , &Register& ) ){ //just a button
096&097Register();
100&101}GUI.TextArea( textrect, formText );
104&105function LoadImage()
108&109var form = new WWWForm();
110&111form.AddField( &act&, &62& );
112&113var w = WWW(imageURL, form);
114&115 //we wait for the form to check the PHP file, so our game dont just hang
116&117if (w.error != null) {
118&119print(w.error); //if there is an error, tell us
122&123else {
124&125print(&Test ok&);
126&127tu.texture = w.
128&129w.Dispose(); //clear our form in game
134&135function Login() {
136&137var form = new WWWForm(); //here you create a new form connection
138&139form.AddField( &hash&, hash ); //add your hash code to the field myform_hash, check that this variable name is the same as in PHP file
140&141form.AddField( &name&, formNick );
142&143form.AddField( &password&, formPassword );
144&145form.AddField( &yzm& ,formyzm);
146&147var w = WWW(CheckUserURL, form); //here we create a var called 'w' and we sync with our URL and the form
148&149 //we wait for the form to check the PHP file, so our game dont just hang
150&151if (w.error != null) {
152&153print(w.error); //if there is an error, tell us
156&157else {
158&159print(&Test ok&);
160&161formText = w. //here we return the data our PHP told us
162&163w.Dispose(); //clear our form in game
164&165if(formText==&密码正确,欢迎登录&)
168&169Application.LoadLevel(1);
174&175formNick = &&; //just clean our variables
176&177formPassword = &&;
178&179formyzm = &&;
182&183function Register()
186&187var form = new WWWForm(); //here you create a new form connection
188&189form.AddField( &hash&, hash ); //add your hash code to the field myform_hash, check that this variable name is the same as in PHP file
190&191form.AddField( &name&, formNick );
192&193form.AddField( &password&, formPassword );
194&195form.AddField( &email&, formEmail);
196&197var w = WWW(RegisterURL, form); //here we create a var called 'w' and we sync with our URL and the form
198&199 //we wait for the form to check the PHP file, so our game dont just hang
200&201if (w.error != null) {
202&203print(w.error); //if there is an error, tell us
206&207else {
208&209print(&Register ok&);
210&211w.Dispose(); //clear our form in game
214&215formNick = &&; //just clean our variables
216&217formPassword = &&;
218&219formyzm = &&;
在服务器端目录下,放置以下php文件:
Unity3D教程:Unity3D利用PHP+Mysql实现注册激活验证登陆
然后在Unity中设置php文件的连接地址,并将GUITexture拖给赋值的GUITexture。
Unity3D教程:Unity3D利用PHP+Mysql实现注册激活验证登陆
然后运行即可。
Unity3D教程:Unity3D利用PHP+Mysql实现注册激活验证登陆
Unity3D教程:Unity3D利用PHP+Mysql实现注册激活验证登陆
点击下载:
【上一篇】
【下一篇】
您可能还会对这些文章感兴趣!小白求助,账号注册不了_unity吧_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:20,714贴子:
小白求助,账号注册不了收藏
在注册页面填写了相关信息,都经过确认填写无误(后面是绿色的对号)点击蓝色的 Create account 没任何反应。 求指教。。
提供科学,权威,准确的科普信息内容和相关资讯,让科技知识在网上,生活中流行
我直接进不去注册的网站
登录百度帐号推荐应用
为兴趣而生,贴吧更懂你。或新人求教!_unity吧_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:20,714贴子:
新人求教!收藏
为什么使用UI txet的时候场景面板可以看见那些字,到了游戏界面就看不见了
提供科学,权威,准确的科普信息内容和相关资讯,让科技知识在网上,生活中流行
沿着Y轴旋转90°
把那个坐标调整一下
登录百度帐号推荐应用
为兴趣而生,贴吧更懂你。或}

我要回帖

更多关于 教育培训机构注册要求 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信