|
@@ -11,15 +11,32 @@ namespace GFGGame
|
|
public class DailySignView : BaseWindow
|
|
public class DailySignView : BaseWindow
|
|
{
|
|
{
|
|
private UI_DailySignUI _ui;
|
|
private UI_DailySignUI _ui;
|
|
-
|
|
|
|
- private int _signCount;
|
|
|
|
|
|
+ private GameObject _gameObject0;
|
|
|
|
+ private GameObject _gameObject1;
|
|
|
|
+ private GameObject _gameObject2;
|
|
|
|
+ private GameObject _gameObject3;
|
|
|
|
+ private GameObject _gameObject4;
|
|
|
|
+ private GameObject _gameObject5;
|
|
|
|
+ private GoWrapper _wrapper0;
|
|
|
|
+ private GoWrapper _wrapper1;
|
|
|
|
+ private GoWrapper _wrapper2;
|
|
|
|
+ private GoWrapper _wrapper3;
|
|
|
|
+ private GoWrapper _wrapper4;
|
|
|
|
+ private GoWrapper _wrapper5;
|
|
|
|
+ private GGraph m_holderSign;
|
|
|
|
+ private float _signCount;
|
|
private int _month;
|
|
private int _month;
|
|
private int _day;
|
|
private int _day;
|
|
|
|
|
|
public override void Dispose()
|
|
public override void Dispose()
|
|
{
|
|
{
|
|
base.Dispose();
|
|
base.Dispose();
|
|
-
|
|
|
|
|
|
+ SceneController.DestroyObjectFromView(_gameObject0, _wrapper0);
|
|
|
|
+ SceneController.DestroyObjectFromView(_gameObject1, _wrapper1);
|
|
|
|
+ SceneController.DestroyObjectFromView(_gameObject2, _wrapper2);
|
|
|
|
+ SceneController.DestroyObjectFromView(_gameObject3, _wrapper3);
|
|
|
|
+ SceneController.DestroyObjectFromView(_gameObject4, _wrapper4);
|
|
|
|
+ SceneController.DestroyObjectFromView(_gameObject5, _wrapper5);
|
|
if (_ui != null)
|
|
if (_ui != null)
|
|
{
|
|
{
|
|
_ui.Dispose();
|
|
_ui.Dispose();
|
|
@@ -40,6 +57,17 @@ namespace GFGGame
|
|
_ui.m_btnClose.onClick.Add(Hide);
|
|
_ui.m_btnClose.onClick.Add(Hide);
|
|
_ui.m_list.itemRenderer = ListItemRender;
|
|
_ui.m_list.itemRenderer = ListItemRender;
|
|
|
|
|
|
|
|
+
|
|
|
|
+ string resPath = ResPathUtil.GetViewEffectPath("ui_league", "Answer_bgtx");
|
|
|
|
+ SceneController.AddObjectToView(null, null, _ui.m_holderFlower, resPath, out _gameObject0, out _wrapper0);
|
|
|
|
+ string resPath1 = ResPathUtil.GetViewEffectPath("ui_Activity", "Everyday_2lizi");
|
|
|
|
+ SceneController.AddObjectToView(null, null, _ui.m_holderLizi, resPath1, out _gameObject1, out _wrapper1);
|
|
|
|
+ string resPath2 = ResPathUtil.GetViewEffectPath("ui_Activity", "Everydayy_people");
|
|
|
|
+ SceneController.AddObjectToView(null, null, _ui.m_holderRole, resPath2, out _gameObject2, out _wrapper2);
|
|
|
|
+
|
|
|
|
+ string resPath4 = ResPathUtil.GetViewEffectPath("ui_fight_new", "Progress_head");
|
|
|
|
+ SceneController.AddObjectToView(null, null, _ui.m_proSign.m_holder, resPath4, out _gameObject4, out _wrapper4, 90);
|
|
|
|
+
|
|
}
|
|
}
|
|
protected override void AddEventListener()
|
|
protected override void AddEventListener()
|
|
{
|
|
{
|
|
@@ -50,15 +78,25 @@ namespace GFGGame
|
|
protected override void OnShown()
|
|
protected override void OnShown()
|
|
{
|
|
{
|
|
base.OnShown();
|
|
base.OnShown();
|
|
|
|
+ _ui.m_t0.Play(() =>
|
|
|
|
+ {
|
|
|
|
+ if (m_holderSign != null)
|
|
|
|
+ {
|
|
|
|
+ m_holderSign.visible = true;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
_month = TimeUtil.GetCurMonth();
|
|
_month = TimeUtil.GetCurMonth();
|
|
_day = TimeUtil.GetCurDay();
|
|
_day = TimeUtil.GetCurDay();
|
|
_ui.m_txtMonth.text = NumberUtil.GetOldChiniseNumberText(_month);
|
|
_ui.m_txtMonth.text = NumberUtil.GetOldChiniseNumberText(_month);
|
|
|
|
+
|
|
UpdateSignView();
|
|
UpdateSignView();
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
protected override void OnHide()
|
|
protected override void OnHide()
|
|
{
|
|
{
|
|
base.OnHide();
|
|
base.OnHide();
|
|
|
|
+ _ui.m_t0.Stop();
|
|
}
|
|
}
|
|
protected override void RemoveEventListener()
|
|
protected override void RemoveEventListener()
|
|
{
|
|
{
|
|
@@ -69,11 +107,13 @@ namespace GFGGame
|
|
private void UpdateSignView()
|
|
private void UpdateSignView()
|
|
{
|
|
{
|
|
_signCount = MathHelper.CountOnes(GameGlobal.myNumericComponent.GetAsInt(NumericType.SignDay));
|
|
_signCount = MathHelper.CountOnes(GameGlobal.myNumericComponent.GetAsInt(NumericType.SignDay));
|
|
- _ui.m_txtSignCount.text = _signCount.ToString();
|
|
|
|
|
|
+ _ui.m_proSign.m_txtSignCount.text = _signCount.ToString();
|
|
List<DailySignBonusCfg> signBonusCfgs = DailySignBonusCfgArray.Instance.GetCfgsBymonth(_month);
|
|
List<DailySignBonusCfg> signBonusCfgs = DailySignBonusCfgArray.Instance.GetCfgsBymonth(_month);
|
|
_ui.m_proSign.target.max = signBonusCfgs.Count;
|
|
_ui.m_proSign.target.max = signBonusCfgs.Count;
|
|
_ui.m_proSign.target.value = _signCount;
|
|
_ui.m_proSign.target.value = _signCount;
|
|
|
|
+ _ui.m_proSign.m_holder.x = _signCount / signBonusCfgs.Count * _ui.m_proSign.target.width - 68;
|
|
List<DailySignCfg> signCfgs = DailySignCfgArray.Instance.GetCfgsBymonth(_month);
|
|
List<DailySignCfg> signCfgs = DailySignCfgArray.Instance.GetCfgsBymonth(_month);
|
|
|
|
+ _ui.m_proSign.m_holderReward.visible = false;
|
|
for (int i = 0; i < signCfgs.Count; i++)
|
|
for (int i = 0; i < signCfgs.Count; i++)
|
|
{
|
|
{
|
|
GComponent comProBonus = _ui.m_proSign.target.GetChild("comProBonus" + i).asCom;
|
|
GComponent comProBonus = _ui.m_proSign.target.GetChild("comProBonus" + i).asCom;
|
|
@@ -90,6 +130,16 @@ namespace GFGGame
|
|
bool isGot = MathHelper.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.SignReward), signCfgs[i].day);
|
|
bool isGot = MathHelper.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.SignReward), signCfgs[i].day);
|
|
item.m_imgGot.visible = isGot;
|
|
item.m_imgGot.visible = isGot;
|
|
bool canGet = _signCount >= signCfgs[i].day && !isGot;
|
|
bool canGet = _signCount >= signCfgs[i].day && !isGot;
|
|
|
|
+ if (canGet)
|
|
|
|
+ {
|
|
|
|
+ if (_gameObject5 == null)
|
|
|
|
+ {
|
|
|
|
+ string resPath5 = ResPathUtil.GetViewEffectPath("ui_Activity", "Everyday_enable");
|
|
|
|
+ SceneController.AddObjectToView(null, null, _ui.m_proSign.m_holderReward, resPath5, out _gameObject5, out _wrapper5);
|
|
|
|
+ }
|
|
|
|
+ _ui.m_proSign.m_holderReward.visible = canGet;
|
|
|
|
+ _ui.m_proSign.m_holderReward.position = new Vector2(item.target.x, 35);
|
|
|
|
+ }
|
|
RedDotController.Instance.SetComRedDot(item.target, canGet);
|
|
RedDotController.Instance.SetComRedDot(item.target, canGet);
|
|
UI_ComProBonus.ProxyEnd();
|
|
UI_ComProBonus.ProxyEnd();
|
|
}
|
|
}
|
|
@@ -127,7 +177,13 @@ namespace GFGGame
|
|
DailySignBonusCfg bonusCfg = DailySignBonusCfgArray.Instance.GetCfgsBymonth(_month)[_index];
|
|
DailySignBonusCfg bonusCfg = DailySignBonusCfgArray.Instance.GetCfgsBymonth(_month)[_index];
|
|
ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(bonusCfg.bonusArr[0][0]);
|
|
ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(bonusCfg.bonusArr[0][0]);
|
|
bool isGot = MathHelper.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.SignDay), bonusCfg.day);
|
|
bool isGot = MathHelper.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.SignDay), bonusCfg.day);
|
|
-
|
|
|
|
|
|
+ if (bonusCfg.day == _day && !isGot && _gameObject3 == null)
|
|
|
|
+ {
|
|
|
|
+ string resPath3 = ResPathUtil.GetViewEffectPath("ui_Activity", "everyday_kuang");
|
|
|
|
+ SceneController.AddObjectToView(null, null, item.m_holderSign, resPath3, out _gameObject3, out _wrapper3);
|
|
|
|
+ m_holderSign = item.m_holderSign;
|
|
|
|
+ }
|
|
|
|
+ item.m_holderSign.visible = false;
|
|
item.m_c1.selectedIndex = itemCfg.itemType == ConstItemType.DRESS_UP ? 0 : bonusCfg.type;
|
|
item.m_c1.selectedIndex = itemCfg.itemType == ConstItemType.DRESS_UP ? 0 : bonusCfg.type;
|
|
item.m_txtDay.text = NumberUtil.GetChiniseNumberText(bonusCfg.day);// bonusCfg.day.ToString();
|
|
item.m_txtDay.text = NumberUtil.GetChiniseNumberText(bonusCfg.day);// bonusCfg.day.ToString();
|
|
if (item.m_comItem.data == null)
|
|
if (item.m_comItem.data == null)
|