Skip to content

Commit

Permalink
12
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxq committed Mar 9, 2016
1 parent 0513353 commit b9ba4ef
Show file tree
Hide file tree
Showing 16 changed files with 86 additions and 18 deletions.
Binary file added Assets/MrRabZ/models/Materials/rabbit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 56 additions & 0 deletions Assets/MrRabZ/models/Materials/rabbit.png.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified Assets/login.unity
Binary file not shown.
11 changes: 3 additions & 8 deletions Assets/script/UI_LoginSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,17 @@ public void onConnectStatus(bool beSuccess)
}
else
{
print("连接错误");
text_status.text = "连接错误";
}
}
public void onLoginFailed(UInt16 errorCode)
{
print("登陆失败" + KBEngineApp.app.serverErr(errorCode));
text_status.text = "登陆失败" + KBEngineApp.app.serverErr(errorCode);
}
public void onLoginSuccessfully(UInt64 uuuid, Int32 id, Account account)
{
if (account != null)
{
print("登录成功");
text_status.text = "登录成功";
//跳转场景
Application.LoadLevel("selectAvatar");
Expand All @@ -57,20 +54,18 @@ public void onLogin()
}
public void onRegister()
{
print("connect to server...(连接到服务端...)");
text_status.text = "连接到服务端...";
KBEngine.Event.fireIn("createAccount", if_userName.text, if_passWord.text, System.Text.Encoding.UTF8.GetBytes("lxqRegister"));
}
public void onCreateAccountResult(UInt16 retcode, byte[] datas)
{
if (retcode != 0)
{
print("createAccount is error(注册账号错误)! err=" + KBEngineApp.app.serverErr(retcode));
text_status.text = "createAccount is error(注册账号错误)! err=" + KBEngineApp.app.serverErr(retcode);
print("(注册账号错误)! err=" + KBEngineApp.app.serverErr(retcode));
text_status.text = "(注册账号错误)! err=" + KBEngineApp.app.serverErr(retcode);
return;
}
print("createAccount is successfully!(注册账号成功!)");
text_status.text = "createAccount is successfully!(注册账号成功!)";
text_status.text = "注册账号成功! 请点击登录进入游戏";
}
// Update is called once per frame
void Update () {
Expand Down
2 changes: 1 addition & 1 deletion Assets/script/UI_Target.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public void activate()
public void UpdateTargetUI()
{
activate();
setHP(GE_target.hp);
setHPMax(GE_target.hpMax);
setHP(GE_target.hp);
setName(GE_target.entity_name);
}

Expand Down
Binary file modified Assets/uGUI Message Box Modal Dialog/Resources/Menu Box.prefab
Binary file not shown.
35 changes: 26 additions & 9 deletions Assets/uGUI Message Box Modal Dialog/Source/ModalBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,23 @@ public abstract class ModalBox : MonoBehaviour
Transform buttonParent;
bool isSetup;

int stringHeight(string str)
{
int row = 0;
int colomn = 0;
for (int i = 0; i < str.Length; i++ )
{
colomn ++;
if (str[i] == '\n' || colomn == 20)
{
colomn = 0;
row++;
}
}
row++;
return row * 17 + 15;

}
// This code has to be run here so that layout has already happened and preferredHeights have been calculated.
void FixedUpdate()
{
Expand All @@ -42,7 +59,7 @@ void FixedUpdate()
if (Title != null)
{
var layoutElement = Title.GetComponent<LayoutElement>();
layoutElement.minHeight = Title.preferredHeight; // Set the min height to the preferred height so that the parent dialog box vertical layout can resize correctly.
layoutElement.minHeight = stringHeight(Title.text); // Set the min height to the preferred height so that the parent dialog box vertical layout can resize correctly.
}

if (Message != null)
Expand All @@ -63,17 +80,17 @@ void FixedUpdate()
{
var buttonLayoutElement = button.GetComponent<LayoutElement>();
if (buttonLayoutElement != null)
buttonLayoutElement.minHeight = text.preferredHeight + 10;
buttonLayoutElement.minHeight = stringHeight(text.text);
}
}
}

if (Panel != null)
{
// Center the panel to it's new height
var group = Panel.GetComponent<VerticalLayoutGroup>();
Panel.sizeDelta = new Vector2(Panel.sizeDelta.x, group.preferredHeight);
}
//if (Panel != null)
//{
// // Center the panel to it's new height
// var group = Panel.GetComponent<VerticalLayoutGroup>();
// Panel.sizeDelta = new Vector2(Panel.sizeDelta.x, group.preferredHeight);
//}
}
}

Expand All @@ -94,7 +111,7 @@ protected void SetText(string message, string title)
{
if (!String.IsNullOrEmpty(title))
{
Title.text = MessageBox.LocalizeTitleAndMessage ? MessageBox.Localize(title) : title;
Title.text = /*MessageBox.LocalizeTitleAndMessage ? MessageBox.Localize(title) : */title;
}
else
{
Expand Down
Binary file modified ProjectSettings/ProjectSettings.asset
Binary file not shown.
Binary file added Temp/StagingArea/assets/bin/Data/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Temp/StagingArea/res/drawable-hdpi/app_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Temp/StagingArea/res/drawable-ldpi/app_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Temp/StagingArea/res/drawable-xhdpi/app_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Temp/StagingArea/res/drawable-xxhdpi/app_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Temp/StagingArea/res/drawable/app_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b9ba4ef

Please sign in to comment.