Permalink
Browse files

更新UI

  • Loading branch information...
vhbvb committed Aug 18, 2017
1 parent ed65f66 commit 5558cafbd7beaaf4508aa3a23b08bd1190f11a41
View
BIN .DS_Store
Binary file not shown.
Binary file not shown.
View
Binary file not shown.
@@ -141,7 +141,7 @@
<HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/UnityVR/RuntimeEditor/UnityEngine.VR.dll</HintPath>
</Reference>
<Reference Include="ICSharpCode.SharpZipLib">
<HintPath>/Users/youzu/Desktop/WorkProjects/Github&OSChina/SMSSDK-for-Unity3D/Unity3DForSMSSDK/Assets/iOSAutoPackage/Editor/SDKPorter/XCodeEditor/ICSharpCode.SharpZipLib.dll</HintPath>
<HintPath>/Users/youzu/Desktop/SMSSDK-for-Unity3D/Unity3DForSMSSDK/Assets/iOSAutoPackage/Editor/SDKPorter/XCodeEditor/ICSharpCode.SharpZipLib.dll</HintPath>
</Reference>
<Reference Include="UnityEditor.Graphs">
<HintPath>/Applications/Unity/Unity.app/Contents/Managed/UnityEditor.Graphs.dll</HintPath>
@@ -46,90 +46,105 @@ void OnGUI ()
{
scale = Screen.width / 320;
}
float btnWidth = 200 * scale;
float btnHeight = 30 * scale;
float btnTop = 50 * scale;
GUI.skin.button.fontSize = Convert.ToInt32(14 * scale);
GUI.skin.label.fontSize = Convert.ToInt32 (14 * scale);
GUI.skin.label.alignment = TextAnchor.MiddleCenter;
GUI.skin.textField.fontSize = Convert.ToInt32 (14 * scale);
GUI.skin.textField.alignment = TextAnchor.MiddleCenter;
GUI.Label (new Rect ((Screen.width - btnWidth) / 2, btnTop+5, 100, btnHeight), "手机号");
float btnWidth = 200 * scale;
float btnHeight = 35 * scale;
float btnTop = 20 * scale;
GUI.skin.button.fontSize = Convert.ToInt32(16 * scale);
phone = GUI.TextField(new Rect((Screen.width - btnWidth) / 2 + 100, btnTop, btnWidth - 100, btnHeight), phone);
if (GUI.Button(new Rect((Screen.width - btnWidth) / 2, btnTop, btnWidth, btnHeight), "GetCodeSMS"))
{
smssdk.getCode (CodeType.TextCode, phone, "86");
}
btnTop += btnHeight + 10 * scale;
GUI.Label (new Rect ((Screen.width - btnWidth) / 2, btnTop+5, 100, btnHeight), "区号");
btnTop += btnHeight + 20 * scale;
if (GUI.Button(new Rect((Screen.width - btnWidth) / 2, btnTop, btnWidth, btnHeight), "GetCodeVoice"))
{
zone = GUI.TextField(new Rect((Screen.width - btnWidth) / 2 + 100, btnTop, btnWidth - 100, btnHeight), zone);
smssdk.getCode (CodeType.VoiceCode, phone, "86");
}
btnTop += btnHeight + 10 * scale;
GUI.Label (new Rect ((Screen.width - btnWidth) / 2, btnTop+5, 100, btnHeight), "验证码");
//添加textField 输入验证码
btnTop += btnHeight + 20 * scale;
code = GUI.TextField(new Rect((Screen.width - btnWidth) / 2, btnTop, btnWidth, btnHeight), code);
code = GUI.TextField(new Rect((Screen.width - btnWidth) / 2 + 100, btnTop, btnWidth - 100, btnHeight), code);
btnTop += btnHeight + 20 * scale;
btnTop += btnHeight + 10 * scale;
if (GUI.Button(new Rect((Screen.width - btnWidth) / 2, btnTop, btnWidth, btnHeight), "GetCodeSMS"))
{
smssdk.getCode (CodeType.TextCode, phone, zone);
}
btnTop += btnHeight + 10 * scale;
if (GUI.Button(new Rect((Screen.width - btnWidth) / 2, btnTop, btnWidth, btnHeight), "CommitCode"))
{
smssdk.commitCode (phone, "86",code);
}
btnTop += btnHeight + 10 * scale;
if (GUI.Button(new Rect((Screen.width - btnWidth) / 2, btnTop, btnWidth, btnHeight), "GetCodeVoice"))
{
btnTop += btnHeight + 20 * scale;
smssdk.getCode (CodeType.VoiceCode, phone, zone);
}
btnTop += btnHeight + 10 * scale;
if (GUI.Button(new Rect((Screen.width - btnWidth) / 2, btnTop, btnWidth, btnHeight), "GetCountryCode"))
{
smssdk.getSupportedCountryCode ();
}
btnTop += btnHeight + 20 * scale;
btnTop += btnHeight + 10 * scale;
if (GUI.Button(new Rect((Screen.width - btnWidth) / 2, btnTop, btnWidth, btnHeight), "GetFriends"))
{
smssdk.getFriends ();
}
btnTop += btnHeight + 20 * scale;
btnTop += btnHeight + 10 * scale;
if (GUI.Button(new Rect((Screen.width - btnWidth) / 2, btnTop, btnWidth, btnHeight), "SubmitUserInfo"))
{
userInfo.avatar = "www.mob.com";
userInfo.phoneNumber = phone;
userInfo.zone = zone;
userInfo.nickName = "David";
userInfo.uid = "18616261983";
userInfo.uid = "1234567890";
smssdk.submitUserInfo (userInfo);
}
btnTop += btnHeight + 20 * scale;
btnTop += btnHeight + 10 * scale;
if (GUI.Button(new Rect((Screen.width - btnWidth) / 2, btnTop, btnWidth, btnHeight), "GetVersionNumber"))
{
smssdk.getVersion ();
}
btnTop += btnHeight + 20 * scale;
btnTop += btnHeight + 10 * scale;
if (GUI.Button(new Rect((Screen.width - btnWidth) / 2, btnTop, btnWidth, btnHeight), "EnableWarn"))
{
smssdk.enableWarn (true);
}
//展示register UI界面
btnTop += btnHeight + 20 * scale;
btnTop += btnHeight + 10 * scale;
if (GUI.Button(new Rect((Screen.width - btnWidth) / 2, btnTop, btnWidth, btnHeight), "showRegisterUIView"))
{
smssdk.showRegisterPage (CodeType.TextCode);
}
//展示contractFriends UI界面
btnTop += btnHeight + 20 * scale;
btnTop += btnHeight + 10 * scale;
if (GUI.Button(new Rect((Screen.width - btnWidth) / 2, btnTop, btnWidth, btnHeight), "showContractsUIView"))
{
smssdk.showContactsPage ();
}
//展示回调结果
btnTop += btnHeight + 20 * scale;
btnTop += btnHeight + 10 * scale;
GUI.Label(new Rect((Screen.width - btnWidth) / 2, btnTop, btnWidth, btnHeight), result);
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.

0 comments on commit 5558caf

Please sign in to comment.