换皮
This commit is contained in:
@@ -369,11 +369,11 @@ public class AdRedeemManager
|
||||
|
||||
if (type == "success" && successTrackKey != null)
|
||||
{
|
||||
TrackKit.SendEvent(Property.adEvent, successTrackKey, Int32.Parse(suffix));
|
||||
// TrackKit.SendEvent(Property.adEvent, successTrackKey, Int32.Parse(suffix));
|
||||
}
|
||||
else if (type == "click" && clickTrackKey != null)
|
||||
{
|
||||
TrackKit.SendEvent(Property.adEvent, clickTrackKey, Int32.Parse(suffix));
|
||||
// TrackKit.SendEvent(Property.adEvent, clickTrackKey, Int32.Parse(suffix));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace ChillConnect
|
||||
{
|
||||
if (Screen.safeArea.y != 0)
|
||||
{
|
||||
ui.top_group.y += 68;
|
||||
// ui.top_group.y += 68;
|
||||
ui.left_group.y += 68;
|
||||
ui.right_group.y += 68;
|
||||
}
|
||||
@@ -266,8 +266,7 @@ namespace ChillConnect
|
||||
// Fx_Type.fx_btn_play, ref closeCallback);
|
||||
// anim_paly.state.SetAnimation(0, "animation", true);
|
||||
|
||||
btn_play_list = new List<btn_level_play> { ui.btn_play1, ui.btn_play2, ui.btn_play3, ui.btn_play4, ui.btn_play5, ui.btn_play6, ui.btn_play7, ui.btn_play8
|
||||
, ui.btn_play9,ui.btn_play10};
|
||||
btn_play_list = new List<btn_level_play> { ui.com_level.btn_play1, ui.com_level.btn_play2, ui.com_level.btn_play3, ui.com_level.btn_play4, ui.com_level.btn_play5 };
|
||||
|
||||
InitBtn();
|
||||
Set101();
|
||||
@@ -453,16 +452,27 @@ namespace ChillConnect
|
||||
private void InitBtn()
|
||||
{
|
||||
int level_ = GameHelper.GetLevel();
|
||||
int stage_ = (level_ - 1) / 10;
|
||||
for (int i = 0; i < 10; i++)
|
||||
int start_level = 0;
|
||||
if (level_ >= 3)
|
||||
{
|
||||
int lv = stage_ * 10 + 1 + i;
|
||||
start_level = level_ - 2;
|
||||
ui.com_level.state.selectedIndex = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.com_level.state.selectedIndex = level_ - 1;
|
||||
start_level = 1;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
int lv = start_level + i;
|
||||
btn_play_list[i].text_level.text = lv.ToString();
|
||||
if (lv < level_)
|
||||
{
|
||||
btn_play_list[i].state.selectedIndex = 2;
|
||||
}
|
||||
else if ((stage_ * 10 + 1 + i) == level_)
|
||||
else if (lv == level_)
|
||||
{
|
||||
btn_play_list[i].state.selectedIndex = 1;
|
||||
btn_play_list[i].SetClick(() =>
|
||||
@@ -629,13 +639,13 @@ namespace ChillConnect
|
||||
var head = ui.btn_head as btn_head;
|
||||
GameHelper.SetSelfAvatar(head.load_avatar);
|
||||
|
||||
if (btn_play_list.Count == 0) return;
|
||||
for (int i = 0; i < btn_play_list.Count; i++)
|
||||
{
|
||||
var head1 = btn_play_list[i].btn_hall_head.btn_head as btn_head;
|
||||
GameHelper.SetSelfAvatar(head1.load_avatar);
|
||||
// if (btn_play_list.Count == 0) return;
|
||||
// for (int i = 0; i < btn_play_list.Count; i++)
|
||||
// {
|
||||
// var head1 = btn_play_list[i].btn_hall_head.btn_head as btn_head;
|
||||
// GameHelper.SetSelfAvatar(head1.load_avatar);
|
||||
|
||||
}
|
||||
// }
|
||||
;
|
||||
}
|
||||
void reCreatPur(object a = null)
|
||||
|
||||
@@ -104,18 +104,18 @@ namespace ChillConnect
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
private void InitView()
|
||||
{
|
||||
var namStr = GameHelper.GetUserName();
|
||||
ui.edit_name.input.text = namStr;
|
||||
ui.edit_name.btn_amend.SetClick(SaveName);
|
||||
// var namStr = GameHelper.GetUserName();
|
||||
// ui.edit_name.input.text = namStr;
|
||||
// ui.edit_name.btn_amend.SetClick(SaveName);
|
||||
|
||||
ui.btn_back.SetClick(OnCloseView);
|
||||
// ui.btn_back.SetClick(OnCloseView);
|
||||
// ui.btn_music.SetClick(OnClickSetMusic);
|
||||
// ui.btn_sound.SetClick(OnClickSoundBtn);
|
||||
|
||||
@@ -123,74 +123,74 @@ namespace ChillConnect
|
||||
// ui.btn_terms.menus.selectedIndex = btn_menu.Menus_terms;
|
||||
// ui.btn_official.menus.selectedIndex = btn_menu.Menus_official;
|
||||
// ui.btn_credits.menus.selectedIndex = btn_menu.Menus_credits;
|
||||
ui.btn_privacy.SetClick(() => { UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PrivacyUI_Open, 0); });
|
||||
ui.btn_terms.SetClick(() => { UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PrivacyUI_Open, 1); });
|
||||
ui.btn_official.SetClick(() => { OpenBrowser.OpenURL("https://www.chillconnect.fun"); });
|
||||
ui.btn_email.SetClick(() => {
|
||||
//OpenBrowser.OpenEmailClient(ConfigSystem.GetConfig<CommonModel>().contactUs, "Please select an email application");
|
||||
GameHelper.OpenEmail();
|
||||
});
|
||||
ui.btn_exit.SetClick(OnCloseView);
|
||||
// ui.btn_privacy.SetClick(() => { UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PrivacyUI_Open, 0); });
|
||||
// ui.btn_terms.SetClick(() => { UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PrivacyUI_Open, 1); });
|
||||
// ui.btn_official.SetClick(() => { OpenBrowser.OpenURL("https://www.chillconnect.fun"); });
|
||||
// ui.btn_email.SetClick(() => {
|
||||
// //OpenBrowser.OpenEmailClient(ConfigSystem.GetConfig<CommonModel>().contactUs, "Please select an email application");
|
||||
// GameHelper.OpenEmail();
|
||||
// });
|
||||
// ui.btn_exit.SetClick(OnCloseView);
|
||||
|
||||
// ui.btn_credits.SetClick(() => { UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PrivacyUI_Open, 2); });
|
||||
SetUID();
|
||||
SetVersion();
|
||||
RefreshMusicUI();
|
||||
// SetUID();
|
||||
// SetVersion();
|
||||
// RefreshMusicUI();
|
||||
|
||||
// 初始化滑动条位置
|
||||
ui.sound_slider.min = 0f;
|
||||
ui.sound_slider.max = 1f;
|
||||
// // 初始化滑动条位置
|
||||
// ui.sound_slider.min = 0f;
|
||||
// ui.sound_slider.max = 1f;
|
||||
|
||||
// 添加滑动条变化事件监听
|
||||
ui.sound_slider.onChanged.Add(() =>
|
||||
{
|
||||
var sound = (float)Math.Round(ui.sound_slider.value, 2);
|
||||
Debug.Log("sound 滑动条当前的值=== " + sound);
|
||||
// // 添加滑动条变化事件监听
|
||||
// ui.sound_slider.onChanged.Add(() =>
|
||||
// {
|
||||
// var sound = (float)Math.Round(ui.sound_slider.value, 2);
|
||||
// Debug.Log("sound 滑动条当前的值=== " + sound);
|
||||
|
||||
GRoot.inst.soundVolume = sound;
|
||||
PlayerPrefs.SetFloat("soundVolume", sound);
|
||||
});
|
||||
// GRoot.inst.soundVolume = sound;
|
||||
// PlayerPrefs.SetFloat("soundVolume", sound);
|
||||
// });
|
||||
|
||||
ui.music_slider.min = 0f;
|
||||
ui.music_slider.max = 1f;
|
||||
ui.music_slider.onChanged.Add(() =>
|
||||
{
|
||||
var sound = (float)Math.Round(ui.music_slider.value, 2);
|
||||
Debug.Log("music 滑动条当前的值=== " + sound);
|
||||
PlayerPrefs.SetFloat("musicSound", sound);
|
||||
AudioManager.Instance.SetBGMSound();
|
||||
// ui.music_slider.min = 0f;
|
||||
// ui.music_slider.max = 1f;
|
||||
// ui.music_slider.onChanged.Add(() =>
|
||||
// {
|
||||
// var sound = (float)Math.Round(ui.music_slider.value, 2);
|
||||
// Debug.Log("music 滑动条当前的值=== " + sound);
|
||||
// PlayerPrefs.SetFloat("musicSound", sound);
|
||||
// AudioManager.Instance.SetBGMSound();
|
||||
|
||||
});
|
||||
// });
|
||||
|
||||
ui.btn_head.SetClick(() => { UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PersonViewUI_Open); });
|
||||
// ui.btn_head.SetClick(() => { UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PersonViewUI_Open); });
|
||||
|
||||
if (GameHelper.IsGiftSwitch()) {
|
||||
ui.btn_restore.visible = false;
|
||||
}
|
||||
ui.btn_restore.SetClick(() =>
|
||||
{
|
||||
// ApplePayManager.Instance.AppleRestore((success,message)=>{
|
||||
// Debug.Log("[barry] restore success message: " + message);
|
||||
// if (success)
|
||||
// {
|
||||
// Debug.Log("[barry] restore success: " + success);
|
||||
// GameHelper.ShowTips("Restore Purchases Success!");
|
||||
// // SaveData.GetSaveObject().is_get_packreward = success;
|
||||
// if (!GameHelper.IsGiftSwitch())
|
||||
// {
|
||||
// SaveData.GetSaveObject().is_get_removead = success;
|
||||
// }
|
||||
// SaveData.GetSaveObject().have_slot = success;
|
||||
// GameDispatcher.Instance.Dispatch(GameMsg.noads_refresh);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // Debug.Log("[barry] restore failed: " + success);
|
||||
// GameHelper.ShowTips("There are no recoverable transactions");
|
||||
// }
|
||||
// });
|
||||
CtrlCloseUI();
|
||||
});
|
||||
// if (GameHelper.IsGiftSwitch()) {
|
||||
// ui.btn_restore.visible = false;
|
||||
// }
|
||||
// ui.btn_restore.SetClick(() =>
|
||||
// {
|
||||
// // ApplePayManager.Instance.AppleRestore((success,message)=>{
|
||||
// // Debug.Log("[barry] restore success message: " + message);
|
||||
// // if (success)
|
||||
// // {
|
||||
// // Debug.Log("[barry] restore success: " + success);
|
||||
// // GameHelper.ShowTips("Restore Purchases Success!");
|
||||
// // // SaveData.GetSaveObject().is_get_packreward = success;
|
||||
// // if (!GameHelper.IsGiftSwitch())
|
||||
// // {
|
||||
// // SaveData.GetSaveObject().is_get_removead = success;
|
||||
// // }
|
||||
// // SaveData.GetSaveObject().have_slot = success;
|
||||
// // GameDispatcher.Instance.Dispatch(GameMsg.noads_refresh);
|
||||
// // }
|
||||
// // else
|
||||
// // {
|
||||
// // // Debug.Log("[barry] restore failed: " + success);
|
||||
// // GameHelper.ShowTips("There are no recoverable transactions");
|
||||
// // }
|
||||
// // });
|
||||
// CtrlCloseUI();
|
||||
// });
|
||||
|
||||
|
||||
}
|
||||
@@ -199,12 +199,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()
|
||||
@@ -229,23 +229,23 @@ namespace ChillConnect
|
||||
|
||||
private void SaveName()
|
||||
{
|
||||
var name = ui.edit_name.input.text;
|
||||
Debug.Log($"SaveName=== {name}");
|
||||
if (string.IsNullOrEmpty(name) || name.IsNullOrWhiteSpace())
|
||||
{
|
||||
GameHelper.ShowTips("The input cannot be null", true);
|
||||
return;
|
||||
}
|
||||
|
||||
// if (name.Equals(GameHelper.GetPlayerInviteCode()))
|
||||
// var name = ui.edit_name.input.text;
|
||||
// Debug.Log($"SaveName=== {name}");
|
||||
// if (string.IsNullOrEmpty(name) || name.IsNullOrWhiteSpace())
|
||||
// {
|
||||
// GameHelper.ShowTips("The input cannot be null", true);
|
||||
// return;
|
||||
// }
|
||||
|
||||
if (name.Equals(DataMgr.PlayerName)) return;
|
||||
// // if (name.Equals(GameHelper.GetPlayerInviteCode()))
|
||||
// // {
|
||||
// // return;
|
||||
// // }
|
||||
|
||||
GameHelper.ShowTips("Name changed successfully");
|
||||
DataMgr.PlayerName.Value = name;
|
||||
// if (name.Equals(DataMgr.PlayerName)) return;
|
||||
|
||||
// GameHelper.ShowTips("Name changed successfully");
|
||||
// DataMgr.PlayerName.Value = name;
|
||||
}
|
||||
|
||||
private void OnClickSetMusic()
|
||||
@@ -268,10 +268,10 @@ namespace ChillConnect
|
||||
// model.IsOpenEffect ? btn_sound_on_off.On_off_on : btn_sound_on_off.On_off_off;
|
||||
// Debug.Log("barry GRoot.inst.soundVolume的值=== " + GRoot.inst.soundVolume);
|
||||
|
||||
ui.sound_slider.value = GRoot.inst.soundVolume;
|
||||
// ui.sound_slider.value = GRoot.inst.soundVolume;
|
||||
|
||||
// Debug.Log("barry music volume的值=== " + PlayerPrefs.GetFloat("musicSound", 1.0f));
|
||||
ui.music_slider.value = PlayerPrefs.GetFloat("musicSound", 1.0f);
|
||||
// // Debug.Log("barry music volume的值=== " + PlayerPrefs.GetFloat("musicSound", 1.0f));
|
||||
// ui.music_slider.value = PlayerPrefs.GetFloat("musicSound", 1.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -490,7 +490,6 @@ namespace ChillConnect
|
||||
|
||||
|
||||
|
||||
item.is_full.selectedIndex = 0;
|
||||
// if (index < pass_level)//进度条
|
||||
// {
|
||||
//
|
||||
@@ -517,23 +516,23 @@ namespace ChillConnect
|
||||
|
||||
if (pass_level > 0)
|
||||
{
|
||||
item.progress_0_top.height = 204;
|
||||
item.is_full.selectedIndex = 2;
|
||||
item.progress_0_top.height = top_progress;
|
||||
|
||||
|
||||
if (((float)(GameHelper.GetGameExp() - Passportrewards_list[0].Eliminating_quantity) / (Passportrewards_list[1].Eliminating_quantity - Passportrewards_list[0].Eliminating_quantity)) > 0.5)
|
||||
{
|
||||
item.progress_0_down.height = 204;
|
||||
item.progress_0_down.height = down_progress;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
item.progress_0_down.height = (float)(GameHelper.GetGameExp() - Passportrewards_list[0].Eliminating_quantity) / (Passportrewards_list[1].Eliminating_quantity - Passportrewards_list[0].Eliminating_quantity) * 2 * 204;
|
||||
item.progress_0_down.height = (float)(GameHelper.GetGameExp() - Passportrewards_list[0].Eliminating_quantity) / (Passportrewards_list[1].Eliminating_quantity - Passportrewards_list[0].Eliminating_quantity) * 2 * down_progress;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
item.progress_0_top.height = (float)GameHelper.GetGameExp() / Passportrewards_list[0].Eliminating_quantity * 226;
|
||||
item.progress_0_top.height = (float)GameHelper.GetGameExp() / Passportrewards_list[0].Eliminating_quantity * top_progress;
|
||||
item.progress_0_down.height = 0;
|
||||
|
||||
}
|
||||
@@ -545,11 +544,11 @@ namespace ChillConnect
|
||||
|
||||
if (((float)(GameHelper.GetGameExp() - Passportrewards_list[index - 2].Eliminating_quantity) / (Passportrewards_list[index - 1].Eliminating_quantity - Passportrewards_list[index - 2].Eliminating_quantity)) > 0.5)
|
||||
{
|
||||
float height = (((float)(GameHelper.GetGameExp() - Passportrewards_list[index - 2].Eliminating_quantity) / (Passportrewards_list[index - 1].Eliminating_quantity - Passportrewards_list[index - 2].Eliminating_quantity)) - 0.5f) * 2 * 226;
|
||||
if (height > 226)
|
||||
float height = (((float)(GameHelper.GetGameExp() - Passportrewards_list[index - 2].Eliminating_quantity) / (Passportrewards_list[index - 1].Eliminating_quantity - Passportrewards_list[index - 2].Eliminating_quantity)) - 0.5f) * 2 * top_progress;
|
||||
if (height > top_progress)
|
||||
{
|
||||
height = 226;
|
||||
item.is_full.selectedIndex = 2;
|
||||
height = top_progress;
|
||||
|
||||
}
|
||||
item.progress_2_top.height = height;
|
||||
}
|
||||
@@ -563,8 +562,8 @@ namespace ChillConnect
|
||||
|
||||
if (pass_level >= index)
|
||||
{
|
||||
item.is_full.selectedIndex = 2;
|
||||
item.progress_1_top.height = 229;
|
||||
|
||||
item.progress_1_top.height = top_progress;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -573,9 +572,9 @@ namespace ChillConnect
|
||||
|
||||
if (((float)(GameHelper.GetGameExp() - Passportrewards_list[index - 2].Eliminating_quantity) / (Passportrewards_list[index - 1].Eliminating_quantity - Passportrewards_list[index - 2].Eliminating_quantity)) > 0.5)
|
||||
{
|
||||
item.is_full.selectedIndex = 2;
|
||||
float height = (((float)(GameHelper.GetGameExp() - Passportrewards_list[index - 2].Eliminating_quantity) / (Passportrewards_list[index - 1].Eliminating_quantity - Passportrewards_list[index - 2].Eliminating_quantity)) - 0.5f) * 2 * 229;
|
||||
if (height > 229) height = 229;
|
||||
|
||||
float height = (((float)(GameHelper.GetGameExp() - Passportrewards_list[index - 2].Eliminating_quantity) / (Passportrewards_list[index - 1].Eliminating_quantity - Passportrewards_list[index - 2].Eliminating_quantity)) - 0.5f) * 2 * top_progress;
|
||||
if (height > top_progress) height = top_progress;
|
||||
item.progress_1_top.height = height;
|
||||
}
|
||||
else item.progress_1_top.height = 0;
|
||||
@@ -592,16 +591,16 @@ namespace ChillConnect
|
||||
{
|
||||
if (((float)(GameHelper.GetGameExp() - Passportrewards_list[index - 1].Eliminating_quantity) / (Passportrewards_list[index].Eliminating_quantity - Passportrewards_list[index - 1].Eliminating_quantity)) <= 0.5)
|
||||
{
|
||||
float height = (float)(GameHelper.GetGameExp() - Passportrewards_list[index - 1].Eliminating_quantity) / (Passportrewards_list[index].Eliminating_quantity - Passportrewards_list[index - 1].Eliminating_quantity) * 2 * 229;
|
||||
if (height > 229)
|
||||
float height = (float)(GameHelper.GetGameExp() - Passportrewards_list[index - 1].Eliminating_quantity) / (Passportrewards_list[index].Eliminating_quantity - Passportrewards_list[index - 1].Eliminating_quantity) * 2 * down_progress;
|
||||
if (height > down_progress)
|
||||
{
|
||||
height = 229;
|
||||
height = down_progress;
|
||||
}
|
||||
item.progress_1_down.height = height;
|
||||
}
|
||||
else
|
||||
{
|
||||
item.progress_1_down.height = 229;
|
||||
item.progress_1_down.height = down_progress;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -609,11 +608,13 @@ namespace ChillConnect
|
||||
{
|
||||
if (pass_level > index)
|
||||
{
|
||||
item.progress_1_down.height = 229;
|
||||
item.progress_1_down.height = down_progress;
|
||||
}
|
||||
else item.progress_1_down.height = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
private int top_progress=105;
|
||||
private int down_progress=116;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ namespace ChillConnect
|
||||
|
||||
if (Screen.safeArea.y != 0)
|
||||
{
|
||||
ui.top_group.y += 68;
|
||||
// ui.top_group.y += 68;
|
||||
|
||||
}
|
||||
ui.btn_add.y += 35;
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace ChillConnect
|
||||
ui.title.text = isTerm == 2 ? "View Credits" : title;
|
||||
|
||||
MarkdownKit.Instance.ShowAsRichText(ui.text_list, BisTerm ? "user" : "privacy",
|
||||
new Color(0.42f, 0.53f, 0.62f), (b, state) =>
|
||||
new Color(171f/255, 142f/255, 122f/255), (b, state) =>
|
||||
{
|
||||
|
||||
});
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace ChillConnect
|
||||
TrackKit.SendEvent(GameHelper.getTrackEvenName(),Property.GoldShow);
|
||||
|
||||
ui.top_gold.GetChild("text_gold").text = GameHelper.Get101Str(GameHelper.GetGoldNumber());
|
||||
ui.shop_panel_parent.shopPanel.pay_type.selectedIndex = !GameHelper.IsAdModelOfPay() ? 1 : 0;
|
||||
// ui.shop_panel_parent.shopPanel.pay_type.selectedIndex = !GameHelper.IsAdModelOfPay() ? 1 : 0;
|
||||
|
||||
if (GameHelper.IsAdModelOfPay())
|
||||
{
|
||||
@@ -172,7 +172,7 @@ namespace ChillConnect
|
||||
|
||||
void GetAward(decimal gold, int index)
|
||||
{
|
||||
var item = ui.shop_panel_parent.shopPanel.gold_list.GetChildAt(index);
|
||||
var item = ui.gold_list.GetChildAt(index);
|
||||
var start = GameHelper.GetUICenterPosition(item);
|
||||
var end = GameHelper.GetUICenterPosition(ui.top_gold.GetChild("gold_anim"));
|
||||
|
||||
@@ -271,8 +271,8 @@ namespace ChillConnect
|
||||
|
||||
void initList()
|
||||
{
|
||||
ui.shop_panel_parent.shopPanel.gold_list.itemRenderer = setRemaintime;
|
||||
ui.shop_panel_parent.shopPanel.gold_list.numItems = list.Count > 6 ? 6 : list.Count;
|
||||
ui.gold_list.itemRenderer = setRemaintime;
|
||||
ui.gold_list.numItems = list.Count > 6 ? 6 : list.Count;
|
||||
|
||||
SetTextString();
|
||||
}
|
||||
|
||||
@@ -2,12 +2,10 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using DG.Tweening;
|
||||
using FairyGUI;
|
||||
using FGUI.Common_01;
|
||||
using FGUI.Turntable_11;
|
||||
using IgnoreOPS;
|
||||
using Spine.Unity;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -17,15 +15,16 @@ namespace ChillConnect
|
||||
{
|
||||
private WheelViewUICtrl ctrl;
|
||||
private WheelViewModel model;
|
||||
private readonly int[] vidieWeight = new int[12];
|
||||
private readonly int[] vidieWeight = new int[8];
|
||||
private TurntableModel turntableData;
|
||||
|
||||
private List<com_coin> ItemList = new();
|
||||
private bool isClickSpin;
|
||||
private bool isClickAbleWatchAD = true;
|
||||
|
||||
private SkeletonAnimation normalAnim;
|
||||
// private SkeletonAnimation turnAnim;
|
||||
private SkeletonAnimation awardAnim;
|
||||
// private SkeletonAnimation awardAnim;
|
||||
private Action closeCallback;
|
||||
|
||||
|
||||
@@ -68,10 +67,6 @@ namespace ChillConnect
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
// if (Screen.safeArea.y != 0)
|
||||
// {
|
||||
// // ui..y += Screen.safeArea.y;
|
||||
// }
|
||||
|
||||
LoadLastCheckDate();
|
||||
|
||||
@@ -87,15 +82,14 @@ namespace ChillConnect
|
||||
ItemList.Add(disc.award6);
|
||||
ItemList.Add(disc.award7);
|
||||
ItemList.Add(disc.award8);
|
||||
ItemList.Add(disc.award9);
|
||||
ItemList.Add(disc.award10);
|
||||
ItemList.Add(disc.award11);
|
||||
ItemList.Add(disc.award12);
|
||||
|
||||
HallManager.Instance.UpdateSecondEvent += UpdateTime;
|
||||
|
||||
turntableData = ConfigSystem.GetConfig<TurntableModel>();
|
||||
|
||||
|
||||
normalAnim = FXManager.Instance.SetFx<SkeletonAnimation>(ui.light_parent, Fx_Type.fx_wheel, ref closeCallback);
|
||||
|
||||
UpdateTime();
|
||||
|
||||
refreshData();
|
||||
@@ -146,14 +140,16 @@ namespace ChillConnect
|
||||
//初始化页面逻辑
|
||||
private void InitView()
|
||||
{
|
||||
|
||||
normalAnim.state.SetAnimation(0, "zhuanpan_zhizhen_idle", 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.btn_close.SetClick(() =>
|
||||
ui.spin.touchable = false;
|
||||
ui.close.SetClick(() =>
|
||||
{
|
||||
CtrlCloseUI();
|
||||
});
|
||||
@@ -170,52 +166,24 @@ namespace ChillConnect
|
||||
var id = turntable.wheel_item;
|
||||
var quantity = turntable.quantity;
|
||||
|
||||
item.text_num.text = "x" + (id == 0 ? GameHelper.Get101Str((decimal)quantity) : quantity.ToString());
|
||||
if (!GameHelper.IsGiftSwitch() && id == 102)
|
||||
{
|
||||
id = 101;
|
||||
quantity *= 10;
|
||||
}
|
||||
|
||||
setItemUrl(item.item_icon, id, (int)quantity);
|
||||
item.text_num.text = id == 102 ? GameHelper.Get102Str((decimal)quantity) : GameHelper.Get101Str((decimal)quantity);
|
||||
item.status.selectedIndex = id == 102 ? com_coin.Status_b : com_coin.Status_a;
|
||||
}
|
||||
|
||||
|
||||
var times = DataMgr.ThisDayWatchSlyderVideoNum.Value;
|
||||
var limits = GameHelper.GetCommonModel().wheelTimes[0];
|
||||
ui.text_spin.SetVar("times", times.ToString()).FlushVars();
|
||||
ui.text_spin.SetVar("limits", limits.ToString()).FlushVars();
|
||||
ui.spin.text_spintimes.SetVar("times", times.ToString()).FlushVars();
|
||||
ui.spin.text_spintimes.SetVar("limits", limits.ToString()).FlushVars();
|
||||
|
||||
}
|
||||
|
||||
public string GetIndex(int quantity)
|
||||
{
|
||||
// 验证输入是否为有效数值
|
||||
if (quantity < 0)
|
||||
{
|
||||
throw new ArgumentException("Quantity must be a non-negative integer.");
|
||||
}
|
||||
|
||||
// 使用 switch 表达式明确处理边界条件
|
||||
return quantity switch
|
||||
{
|
||||
<= 80 => "1",
|
||||
> 80 and <= 150 => "2",
|
||||
> 150 => "3",
|
||||
};
|
||||
}
|
||||
|
||||
void setItemUrl(GLoader loader, int urltype, int quantity)
|
||||
{
|
||||
if (urltype == 0)
|
||||
{
|
||||
string idx = GetIndex(quantity);
|
||||
|
||||
loader.url = $"ui://Turntable_11/spin_gold{idx}";
|
||||
}
|
||||
else if (urltype == 1) loader.url = "ui://Common_01/spin_remove";
|
||||
else if (urltype == 2) loader.url = "ui://Common_01/spin_undo";
|
||||
else if (urltype == 3) loader.url = "ui://Common_01/spin_refresh";
|
||||
// if(urltype > 0) loader.SetScale(0.7f, 0.7f);
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected override void OnOpen(object args)
|
||||
{
|
||||
}
|
||||
@@ -268,160 +236,72 @@ namespace ChillConnect
|
||||
}
|
||||
}
|
||||
|
||||
void hideAllLight()
|
||||
{
|
||||
for (int i = 0; i < ItemList.Count; i++)
|
||||
{
|
||||
ItemList[i].light.visible = false;
|
||||
ItemList[i].light1.visible = false;
|
||||
ItemList[i].light_anim.visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void Spin()
|
||||
{
|
||||
// normalAnim.SetActive(false);
|
||||
|
||||
if (awardAnim != null)
|
||||
{
|
||||
// 停止之前的动画并释放资源
|
||||
awardAnim.state.ClearTracks();
|
||||
awardAnim = null;
|
||||
}
|
||||
|
||||
hideAllLight();
|
||||
|
||||
ui.disc.rotation = 0;
|
||||
normalAnim.state.SetAnimation(0, "zhuanpan_zhizhen_run", true);
|
||||
isClickSpin = true;
|
||||
ui.btn_close.touchable = false;
|
||||
ui.btn_close.grayed = false;
|
||||
ui.close.touchable = false;
|
||||
ui.close.grayed = false;
|
||||
|
||||
ui.btn_spin.touchable = false;
|
||||
|
||||
var index = CommonHelper.GetIndexByChanceList(vidieWeight);
|
||||
AudioManager.Instance.PlayDynamicEffect(AudioConst.wheel_spin);
|
||||
var data = turntableData.DataList[index];
|
||||
Debug.Log("spin index=== : " + index);
|
||||
int allNum = ItemList.Count * 6 + index;
|
||||
int itemCount = ItemList.Count;
|
||||
float[] timess = (float[])ReceivePlanes(allNum);
|
||||
var angle = 3600 - (data.Seq - 1) * 45;
|
||||
AudioManager.Instance.PlayDynamicEffect(AudioConst.wheel_spin);
|
||||
DOTween.To(() => ui.disc.rotation, e => ui.disc.rotation = e, angle, turnTime)
|
||||
.SetEase(Ease.OutQuad);
|
||||
|
||||
float totalTimes = timess.Last();
|
||||
for (int i = 0; i < allNum; i++)
|
||||
{
|
||||
int currentIndex = i % itemCount;
|
||||
float time = timess[i];
|
||||
|
||||
DOVirtual.DelayedCall(time, () =>
|
||||
{
|
||||
int selectI = currentIndex + 1;
|
||||
if (currentIndex + 1 > itemCount - 1)
|
||||
{
|
||||
selectI = 0;
|
||||
}
|
||||
ItemList[selectI].light.visible = true;
|
||||
ItemList[selectI].light1.visible = true;
|
||||
|
||||
ItemList[currentIndex].light.visible = false;
|
||||
ItemList[currentIndex].light1.visible = false;
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
ResultTween = DOVirtual.DelayedCall(totalTimes, () => ReceivePlane(data, index));
|
||||
ResultTween = DOVirtual.DelayedCall(turnTime, () => ReceivePlane(data));
|
||||
|
||||
}
|
||||
|
||||
private Array ReceivePlanes(int nums)
|
||||
private void ReceivePlane(Turntable vo)
|
||||
{
|
||||
float start = 0.25f;
|
||||
float end = 0.06f;
|
||||
float delta = 0.02f;
|
||||
float lastDelta = 0.1f;
|
||||
|
||||
float delay = start;
|
||||
float[] sum = new float[nums];
|
||||
for (int i = 0; i < nums; i++)
|
||||
{
|
||||
if (i == 0)
|
||||
{
|
||||
sum[i] = delay;
|
||||
}
|
||||
else
|
||||
{
|
||||
sum[i] = sum[i - 1] + delay;
|
||||
}
|
||||
|
||||
if (delay > end)
|
||||
{
|
||||
delay -= delta;
|
||||
}
|
||||
else
|
||||
{
|
||||
delay = end;
|
||||
}
|
||||
|
||||
//后8个间隔变慢
|
||||
if (i >= nums - 8)
|
||||
{
|
||||
sum[i] += lastDelta;
|
||||
}
|
||||
}
|
||||
|
||||
return sum;
|
||||
}
|
||||
|
||||
private void ReceivePlane(Turntable vo, int index)
|
||||
{
|
||||
ItemList[index].light1.visible = false;
|
||||
|
||||
ItemList[index].light_anim.visible = true;
|
||||
awardAnim = FXManager.Instance.SetFx<SkeletonAnimation>(ItemList[index].light_anim, Fx_Type.fx_wheel, ref closeCallback);
|
||||
awardAnim.state.SetAnimation(0, "animation", true);
|
||||
normalAnim.state.SetAnimation(0, "zhuanpan_win", true);
|
||||
|
||||
DOVirtual.DelayedCall(1.5f, () =>
|
||||
{
|
||||
isClickSpin = false;
|
||||
ResultTween = null;
|
||||
ui.btn_close.touchable = true;
|
||||
ui.btn_close.grayed = false;
|
||||
ui.close.touchable = true;
|
||||
ui.close.grayed = false;
|
||||
|
||||
ui.btn_spin.cont_spin.selectedIndex = btn_go1.Spin_grey;
|
||||
ui.btn_spin.cont_spin.selectedIndex = 1;
|
||||
|
||||
ui.btn_spin.cont_state.selectedIndex = btn_go1.State_Video;
|
||||
ui.btn_spin.cont_state.selectedIndex = 1;
|
||||
|
||||
var id = vo.wheel_item;
|
||||
var quantity = vo.quantity;
|
||||
Debug.Log($"barry ReceivePlane===: {id} {quantity}");
|
||||
if (id == 0)
|
||||
{
|
||||
var startPoint = GameHelper.GetUICenterPosition(ItemList[index]);
|
||||
var endPoint = GameHelper.GetUICenterPosition(ui.point);
|
||||
|
||||
var rewardData = new RewardData();
|
||||
var rewardSingleData = new RewardSingleData(101, (decimal)quantity, RewardOrigin.LuckyWheel, index)
|
||||
{
|
||||
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) =>
|
||||
{
|
||||
|
||||
});
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.GetReward, rewardData);
|
||||
}
|
||||
else
|
||||
if (!GameHelper.IsGiftSwitch() && id == 102)
|
||||
{
|
||||
GameHelper.AddItemNumber(id - 1, (int)quantity);
|
||||
GameHelper.ShowTips("Successfully received");
|
||||
id = 101;
|
||||
quantity *= 10;
|
||||
}
|
||||
|
||||
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];
|
||||
DataMgr.ThisDayWatchSlyderVideoNum.Value++;
|
||||
DataMgr.ThisDayWatchSlyderVideoNum.Value = DataMgr.ThisDayWatchSlyderVideoNum.Value + 1;
|
||||
|
||||
UpdateTime();
|
||||
refreshData();
|
||||
@@ -435,11 +315,10 @@ namespace ChillConnect
|
||||
DateTime currentTime = DateTime.Now;
|
||||
|
||||
|
||||
ui.btn_spin.cont_state.selectedIndex = btn_go1.State_Limit;
|
||||
ui.btn_spin.cont_state.selectedIndex = 2;
|
||||
ui.btn_spin.touchable = false;
|
||||
ui.btn_spin.enabled = false;
|
||||
ui.btn_spin.cont_spin.selectedIndex = btn_go1.Spin_grey;
|
||||
ui.btn_spin.img_saveingpot.visible = false;
|
||||
ui.btn_spin.cont_spin.selectedIndex = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -447,24 +326,15 @@ namespace ChillConnect
|
||||
{
|
||||
ui.btn_spin.touchable = true;
|
||||
ui.btn_spin.enabled = true;
|
||||
ui.btn_spin.cont_spin.selectedIndex = btn_go1.Spin_none;
|
||||
ui.btn_spin.cont_state.selectedIndex = btn_go1.State_None;
|
||||
if (GameHelper.IsGiftSwitch() && ConfigSystem.GetConfig<CommonModel>().PiggyBankSwitch == 1)
|
||||
{
|
||||
ui.btn_spin.img_saveingpot.visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.btn_spin.img_saveingpot.visible = false;
|
||||
}
|
||||
ui.btn_spin.cont_spin.selectedIndex = 0;
|
||||
ui.btn_spin.cont_state.selectedIndex = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.btn_spin.touchable = false;
|
||||
ui.btn_spin.enabled = false;
|
||||
ui.btn_spin.cont_spin.selectedIndex = btn_go1.Spin_grey;
|
||||
ui.btn_spin.cont_state.selectedIndex = btn_go1.State_Video;
|
||||
ui.btn_spin.img_saveingpot.visible = false;
|
||||
ui.btn_spin.cont_spin.selectedIndex = 1;
|
||||
ui.btn_spin.cont_state.selectedIndex = 1;
|
||||
}
|
||||
|
||||
ui.btn_spin.text_time.text = model.NextOpenWheelTimeStr;
|
||||
|
||||
@@ -25,8 +25,8 @@ namespace ChillConnect
|
||||
private static void RegisterFont()
|
||||
{
|
||||
UIManager uiManager = UIManager.Instance;
|
||||
uiManager.RegisterDefaultFont("Helvetica");
|
||||
uiManager.RegisterFont("Helvetica");
|
||||
uiManager.RegisterDefaultFont("LilitaOne-Regular");
|
||||
uiManager.RegisterFont("LilitaOne-Regular");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,6 @@ namespace Dont_Confuse
|
||||
}
|
||||
public void haveSimCard(string have)
|
||||
{
|
||||
Debug.Log("ppppppppppppppppppppp" + have);
|
||||
if (have == "TRUE") NetworkManager.haveSimCard = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user