|
@@ -53,8 +53,8 @@ public class StatusController : MonoBehaviour
|
|
leftArrow.RegisterCallback<ClickEvent>(e => LeftArrowClicked(e));
|
|
leftArrow.RegisterCallback<ClickEvent>(e => LeftArrowClicked(e));
|
|
rightArrow.RegisterCallback<ClickEvent>(e => RightArrowClicked(e));
|
|
rightArrow.RegisterCallback<ClickEvent>(e => RightArrowClicked(e));
|
|
addLabel.RegisterCallback<ClickEvent>(e => AddClick(e));
|
|
addLabel.RegisterCallback<ClickEvent>(e => AddClick(e));
|
|
- remove.RegisterCallback< ClickEvent >(e => RemoveClick(e));
|
|
|
|
- transfer.RegisterCallback<ClickEvent >(e => TransferClick(e));
|
|
|
|
|
|
+ remove.RegisterCallback<ClickEvent>(e => RemoveClick(e));
|
|
|
|
+ transfer.RegisterCallback<ClickEvent>(e => TransferClick(e));
|
|
|
|
|
|
// 箭头是否显示
|
|
// 箭头是否显示
|
|
if (UserProperty.dogs.Count > 1)
|
|
if (UserProperty.dogs.Count > 1)
|
|
@@ -87,12 +87,6 @@ public class StatusController : MonoBehaviour
|
|
{
|
|
{
|
|
addLabel.style.display = DisplayStyle.Flex;
|
|
addLabel.style.display = DisplayStyle.Flex;
|
|
}
|
|
}
|
|
-
|
|
|
|
- // 刷新狗的数据
|
|
|
|
- puppy = UserProperty.dogs[GameData.focusDog];
|
|
|
|
- StatusPageUpdate();
|
|
|
|
- LabelLanguageSetting();
|
|
|
|
- StatusSummary();
|
|
|
|
}
|
|
}
|
|
|
|
|
|
//private void Start()
|
|
//private void Start()
|
|
@@ -119,6 +113,15 @@ public class StatusController : MonoBehaviour
|
|
currentPage = StausUIPage.Status;
|
|
currentPage = StausUIPage.Status;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if (currentPage == StausUIPage.Status)
|
|
|
|
+ {
|
|
|
|
+ // 刷新狗的数据
|
|
|
|
+ puppy = UserProperty.dogs[GameData.focusDog];
|
|
|
|
+ StatusPageUpdate();
|
|
|
|
+ LabelLanguageSetting();
|
|
|
|
+ StatusSummary();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
//void BackPressed()
|
|
//void BackPressed()
|
|
@@ -134,7 +137,8 @@ public class StatusController : MonoBehaviour
|
|
{
|
|
{
|
|
//backButton.clicked += BackPressed;
|
|
//backButton.clicked += BackPressed;
|
|
nameLabel.text = puppy.dog_name;
|
|
nameLabel.text = puppy.dog_name;
|
|
- if (puppy.sex == 1) {
|
|
|
|
|
|
+ if (puppy.sex == 1)
|
|
|
|
+ {
|
|
genderLabel.text = "♂";
|
|
genderLabel.text = "♂";
|
|
}
|
|
}
|
|
else
|
|
else
|
|
@@ -269,7 +273,7 @@ public class StatusController : MonoBehaviour
|
|
}
|
|
}
|
|
if (puppy.obesity > 70)
|
|
if (puppy.obesity > 70)
|
|
{
|
|
{
|
|
- if (puppy.obesity >90)
|
|
|
|
|
|
+ if (puppy.obesity > 90)
|
|
{
|
|
{
|
|
// 小于10,达到L2警告
|
|
// 小于10,达到L2警告
|
|
summary += GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "statusUI", "status", "obesity_2", EnviromentSetting.languageCode });
|
|
summary += GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "statusUI", "status", "obesity_2", EnviromentSetting.languageCode });
|
|
@@ -282,7 +286,7 @@ public class StatusController : MonoBehaviour
|
|
}
|
|
}
|
|
summary += "<br>";
|
|
summary += "<br>";
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
// 如果没有任何异常,返回正常的状态
|
|
// 如果没有任何异常,返回正常的状态
|
|
if (summary.Length == 0)
|
|
if (summary.Length == 0)
|
|
{
|
|
{
|
|
@@ -306,7 +310,7 @@ public class StatusController : MonoBehaviour
|
|
GameData.focusDog--;
|
|
GameData.focusDog--;
|
|
if (GameData.focusDog == -1)
|
|
if (GameData.focusDog == -1)
|
|
{
|
|
{
|
|
- GameData.focusDog = UserProperty.dogs.Count-1;
|
|
|
|
|
|
+ GameData.focusDog = UserProperty.dogs.Count - 1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
void BackBtnClick()
|
|
void BackBtnClick()
|
|
@@ -345,7 +349,7 @@ public class StatusController : MonoBehaviour
|
|
string msg = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "game_message", "add_dog_prompt", EnviromentSetting.languageCode });
|
|
string msg = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "game_message", "add_dog_prompt", EnviromentSetting.languageCode });
|
|
MessageBoxController.YorN_Message(msg, SwitchAddNewDog);
|
|
MessageBoxController.YorN_Message(msg, SwitchAddNewDog);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
// 跳转login 场景添加新的狗
|
|
// 跳转login 场景添加新的狗
|
|
@@ -355,12 +359,13 @@ public class StatusController : MonoBehaviour
|
|
MaskTransitions.TransitionManager.Instance.LoadLevel("Login");
|
|
MaskTransitions.TransitionManager.Instance.LoadLevel("Login");
|
|
}
|
|
}
|
|
|
|
|
|
- void RemoveClick(ClickEvent e) {
|
|
|
|
|
|
+ void RemoveClick(ClickEvent e)
|
|
|
|
+ {
|
|
string msg = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "game_message", "foster_dog_prompt", EnviromentSetting.languageCode });
|
|
string msg = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "game_message", "foster_dog_prompt", EnviromentSetting.languageCode });
|
|
msg = msg.Replace("<<dog name>>", UserProperty.dogs[GameData.focusDog].dog_name);
|
|
msg = msg.Replace("<<dog name>>", UserProperty.dogs[GameData.focusDog].dog_name);
|
|
MessageBoxController.YorN_Message(msg, FosterDog);
|
|
MessageBoxController.YorN_Message(msg, FosterDog);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
// 点击确认remove后调用寄养的程序
|
|
// 点击确认remove后调用寄养的程序
|
|
void FosterDog()
|
|
void FosterDog()
|
|
{
|
|
{
|
|
@@ -372,7 +377,8 @@ public class StatusController : MonoBehaviour
|
|
}
|
|
}
|
|
|
|
|
|
// 找回寄养的狗
|
|
// 找回寄养的狗
|
|
- void CallbackDogClick(ClickEvent e){
|
|
|
|
|
|
+ void CallbackDogClick(ClickEvent e)
|
|
|
|
+ {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -382,7 +388,7 @@ public class StatusController : MonoBehaviour
|
|
string msg = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "game_message", "transfer_dog_prompt", EnviromentSetting.languageCode });
|
|
string msg = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "game_message", "transfer_dog_prompt", EnviromentSetting.languageCode });
|
|
msg = msg.Replace("<<dog name>>", UserProperty.dogs[GameData.focusDog].dog_name);
|
|
msg = msg.Replace("<<dog name>>", UserProperty.dogs[GameData.focusDog].dog_name);
|
|
MessageBoxController.YorN_Message(msg, TransferDogRequest);
|
|
MessageBoxController.YorN_Message(msg, TransferDogRequest);
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
void TransferDogRequest()
|
|
void TransferDogRequest()
|
|
@@ -395,11 +401,12 @@ public class StatusController : MonoBehaviour
|
|
StartCoroutine(WebController.PostRequest(url, form, callback: TransferDogCallback));
|
|
StartCoroutine(WebController.PostRequest(url, form, callback: TransferDogCallback));
|
|
}
|
|
}
|
|
|
|
|
|
- void TransferDogCallback(string json){
|
|
|
|
|
|
+ void TransferDogCallback(string json)
|
|
|
|
+ {
|
|
// TODO 生成二维码,和120秒倒计时
|
|
// TODO 生成二维码,和120秒倒计时
|
|
transferCountStartTime = DateTime.Now;
|
|
transferCountStartTime = DateTime.Now;
|
|
currentPage = StausUIPage.Transfer;
|
|
currentPage = StausUIPage.Transfer;
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|