更新bug
This commit is contained in:
@@ -296,9 +296,9 @@ namespace ChillConnect
|
||||
ui.head_red.visible = PlayerPrefs.GetInt("player_head_red", 0) == 0;
|
||||
ui.btn_head.SetClick(() =>
|
||||
{
|
||||
if (PlayerPrefs.GetInt("player_head_red", 0) == 0) PlayerPrefs.SetInt("player_head_red", 1);
|
||||
ui.head_red.visible = PlayerPrefs.GetInt("player_head_red", 0) == 0;
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PersonViewUI_Open);
|
||||
// if (PlayerPrefs.GetInt("player_head_red", 0) == 0) PlayerPrefs.SetInt("player_head_red", 1);
|
||||
// ui.head_red.visible = PlayerPrefs.GetInt("player_head_red", 0) == 0;
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.MenuUI_Open);
|
||||
});
|
||||
|
||||
var btnCoin = ui.btn_gold as com_gold;
|
||||
@@ -444,6 +444,10 @@ namespace ChillConnect
|
||||
else
|
||||
OnClickPlay();
|
||||
});
|
||||
ui.btn_setting.SetClick(() =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PersonViewUI_Open);
|
||||
});
|
||||
}
|
||||
private void OnClickTask(bool isLevel)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using FairyGUI;
|
||||
using FGUI.Common_01;
|
||||
using FGUI.Setting_07;
|
||||
using IgnoreOPS;
|
||||
// using SGModule.ApplePay;
|
||||
@@ -22,7 +23,7 @@ namespace ChillConnect
|
||||
{
|
||||
uiName = UIConst.MenuUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
@@ -101,16 +102,56 @@ namespace ChillConnect
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private int _selectIndex = 0;
|
||||
private const int TotalItem = 8;
|
||||
private void UpdataAvatar(object obj = null)
|
||||
{
|
||||
// var head = ui.btn_head.head as btn_head;
|
||||
// var head = ui.btn_head.head as btn_head;
|
||||
|
||||
// GameHelper.SetSelfAvatar(head.load_avatar);
|
||||
// GameHelper.SetSelfAvatar(head.load_avatar);
|
||||
}
|
||||
private void UpdateItem(int index, GObject items)
|
||||
{
|
||||
Debug.Log($"updateItem============index =={index}");
|
||||
var currentIndex = index + 1;
|
||||
var head = items as btn_item_head;
|
||||
var imgHead = head.head as btn_head;
|
||||
|
||||
TextureHelper.SetAvatarToLoader(currentIndex, imgHead.load_avatar);
|
||||
head.head_select.selectedIndex = _selectIndex == currentIndex
|
||||
? btn_item_head.Head_select_select
|
||||
: btn_item_head.Head_select_none;
|
||||
|
||||
head.SetClick(() =>
|
||||
{
|
||||
_selectIndex = currentIndex;
|
||||
ui.list.numItems = TotalItem;
|
||||
|
||||
SetHeadPic();
|
||||
PreferencesDispatcher<int>.Instance.Dispatch(DataMsg.playerAvatarId);
|
||||
});
|
||||
}
|
||||
private void SetAvatar()
|
||||
{
|
||||
if (_selectIndex != -1 && _selectIndex != DataMgr.PlayerAvatarId.Value)
|
||||
{
|
||||
DataMgr.PlayerAvatarId.Value = _selectIndex;
|
||||
}
|
||||
}
|
||||
|
||||
private void SetHeadPic()
|
||||
{
|
||||
SetAvatar();
|
||||
|
||||
// var head = ui.head as btn_head;
|
||||
// if (head == null) return;
|
||||
// TextureHelper.SetAvatarToLoader(_selectIndex, head.load_avatar);
|
||||
}
|
||||
private void InitView()
|
||||
{
|
||||
_selectIndex= DataMgr.PlayerAvatarId.Value;
|
||||
ui.list.itemRenderer = UpdateItem;
|
||||
ui.list.numItems = TotalItem;
|
||||
// var namStr = GameHelper.GetUserName();
|
||||
// ui.edit_name.input.text = namStr;
|
||||
// ui.edit_name.btn_amend.SetClick(SaveName);
|
||||
@@ -191,7 +232,8 @@ namespace ChillConnect
|
||||
// // });
|
||||
// CtrlCloseUI();
|
||||
// });
|
||||
|
||||
ui.btn_close.SetClick(CtrlCloseUI);
|
||||
ui.btn_select.SetClick(CtrlCloseUI);
|
||||
|
||||
}
|
||||
|
||||
@@ -199,12 +241,12 @@ namespace ChillConnect
|
||||
private void SetVersion()
|
||||
{
|
||||
// Debug.Log($"SetVersion====== {Application.version}");
|
||||
// ui.text_version.SetVar("count", Application.version).FlushVars();
|
||||
// ui.text_version.SetVar("count", Application.version).FlushVars();
|
||||
}
|
||||
|
||||
private void SetUID()
|
||||
{
|
||||
// ui.text_uid.SetVar("UID", GameHelper.GetLoginModel().Uid.ToString()).FlushVars();
|
||||
// ui.text_uid.SetVar("UID", GameHelper.GetLoginModel().Uid.ToString()).FlushVars();
|
||||
}
|
||||
|
||||
public override void OnSwitchLanguage()
|
||||
|
||||
@@ -128,11 +128,11 @@ namespace ChillConnect
|
||||
ui.list.numItems = TotalItem;
|
||||
if (GameHelper.IsGiftSwitch())
|
||||
{
|
||||
ui.btn_restore.visible = false;
|
||||
// ui.btn_restore.visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.btn_us.visible = false;
|
||||
ui.btn_us.visible = true;
|
||||
}
|
||||
ui.btn_restore.SetClick(() =>
|
||||
{
|
||||
|
||||
@@ -141,14 +141,13 @@ namespace ChillConnect
|
||||
private void InitView()
|
||||
{
|
||||
|
||||
normalAnim.state.SetAnimation(0, "zhuanpan_zhizhen_idle", true);
|
||||
normalAnim.state.SetAnimation(0, "daiji", true);
|
||||
for (var i = 0; i < ItemList.Count; i++)
|
||||
{
|
||||
vidieWeight[i] = turntableData.DataList[i].weight;
|
||||
}
|
||||
ui.disc.rotation = 0;
|
||||
ui.btn_spin.SetClick(SpineAnim);
|
||||
ui.spin.touchable = false;
|
||||
ui.close.SetClick(() =>
|
||||
{
|
||||
CtrlCloseUI();
|
||||
@@ -179,8 +178,11 @@ namespace ChillConnect
|
||||
|
||||
var times = DataMgr.ThisDayWatchSlyderVideoNum.Value;
|
||||
var limits = GameHelper.GetCommonModel().wheelTimes[0];
|
||||
ui.spin.text_spintimes.SetVar("times", times.ToString()).FlushVars();
|
||||
ui.spin.text_spintimes.SetVar("limits", limits.ToString()).FlushVars();
|
||||
// ui.spin.text_spintimes.SetVar("times", times.ToString()).FlushVars();
|
||||
// ui.spin.text_spintimes.SetVar("limits", limits.ToString()).FlushVars();
|
||||
|
||||
ui.text_spintimes.SetVar("times", times.ToString()).FlushVars();
|
||||
ui.text_spintimes.SetVar("limits", limits.ToString()).FlushVars();
|
||||
|
||||
}
|
||||
|
||||
@@ -240,7 +242,7 @@ namespace ChillConnect
|
||||
{
|
||||
// normalAnim.SetActive(false);
|
||||
ui.disc.rotation = 0;
|
||||
normalAnim.state.SetAnimation(0, "zhuanpan_zhizhen_run", true);
|
||||
normalAnim.state.SetAnimation(0, "zhuandong", true);
|
||||
isClickSpin = true;
|
||||
ui.close.touchable = false;
|
||||
ui.close.grayed = false;
|
||||
@@ -260,7 +262,7 @@ namespace ChillConnect
|
||||
|
||||
private void ReceivePlane(Turntable vo)
|
||||
{
|
||||
normalAnim.state.SetAnimation(0, "zhuanpan_win", true);
|
||||
normalAnim.state.SetAnimation(0, "zhongjiang", true);
|
||||
|
||||
DOVirtual.DelayedCall(1.5f, () =>
|
||||
{
|
||||
@@ -276,28 +278,33 @@ namespace ChillConnect
|
||||
var id = vo.wheel_item;
|
||||
var quantity = vo.quantity;
|
||||
|
||||
if (!GameHelper.IsGiftSwitch() && id == 102)
|
||||
if (id == 0)
|
||||
{
|
||||
id = 101;
|
||||
quantity *= 10;
|
||||
var startPoint = GameHelper.GetUICenterPosition(ui.startpoint);
|
||||
var endPoint = GameHelper.GetUICenterPosition(ui.point);
|
||||
|
||||
var rewardData = new RewardData();
|
||||
var rewardSingleData = new RewardSingleData(101, (decimal)quantity, RewardOrigin.LuckyWheel)
|
||||
{
|
||||
startPosition = startPoint,
|
||||
endPosition = new Vector2(endPoint.x - 150, endPoint.y - 136),
|
||||
};
|
||||
rewardData.AddReward(rewardSingleData);
|
||||
rewardData.displayType = RewardDisplayType.RewardFly | RewardDisplayType.Dialog |
|
||||
RewardDisplayType.ValueChange;
|
||||
rewardData.AddCompleted((isScu) =>
|
||||
{
|
||||
normalAnim.state.SetAnimation(0, "daiji", true);
|
||||
});
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.GetReward, rewardData);
|
||||
}
|
||||
else
|
||||
{
|
||||
GameHelper.AddItemNumber(id - 1, (int)quantity);
|
||||
GameHelper.ShowTips("Successfully received");
|
||||
}
|
||||
|
||||
var endPoint = GameHelper.GetUICenterPosition(ui.point);
|
||||
|
||||
var rewardData = new RewardData();
|
||||
var rewardSingleData = new RewardSingleData(id, (decimal)quantity, RewardOrigin.LuckyWheel)
|
||||
{
|
||||
endPosition = new Vector2(endPoint.x - 150, endPoint.y - 136),
|
||||
};
|
||||
rewardData.AddReward(rewardSingleData);
|
||||
rewardData.displayType = RewardDisplayType.RewardFly | RewardDisplayType.ValueChange;
|
||||
rewardData.AddCompleted((isScu) =>
|
||||
{
|
||||
normalAnim.state.SetAnimation(0, "zhuanpan_zhizhen_idle", true);
|
||||
|
||||
});
|
||||
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.GetReward, rewardData);
|
||||
|
||||
DataMgr.NextOpenWheelStampTime.Value =
|
||||
GameHelper.GetNowTime() + GameHelper.GetCommonModel().wheelTimes[1];
|
||||
|
||||
Reference in New Issue
Block a user