提交
This commit is contained in:
@@ -0,0 +1,479 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using DG.Tweening;
|
||||
using BingoBrain.Core;
|
||||
using BingoBrain.HotFix;
|
||||
using Spine.Unity;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class CardBoardEntity
|
||||
{
|
||||
public GameCell GoCell = new();
|
||||
|
||||
public CardBoardData data = new();
|
||||
public List<CardEntity> cardList = new();
|
||||
public bool isFinish;
|
||||
public bool isBingoing;
|
||||
|
||||
public SkeletonAnimation bingGoSke;
|
||||
private ParticleSystem[] idleSys = new ParticleSystem[3];
|
||||
private ParticleSystem[] enterSys = new ParticleSystem[3];
|
||||
private ParticleSystem exitSys;
|
||||
|
||||
private Vector3 originPos = new(-3.38f, 2.96f);
|
||||
private float offset = 1.685f;
|
||||
private Transform finishMask;
|
||||
|
||||
private List<int> needShowBingoList = new();
|
||||
private Gsss showBingoSequence = new();
|
||||
|
||||
private bool isDelayCheckBingo;
|
||||
|
||||
public List<int> bingoedList = new();
|
||||
|
||||
public void SetData()
|
||||
{
|
||||
InitGameObj();
|
||||
InitCardList();
|
||||
InitReward();
|
||||
}
|
||||
|
||||
void InitReward()
|
||||
{
|
||||
var coinCount = Random.Range(BingoCell.MinCoinCount, BingoCell.MaxCoinCount + 1);
|
||||
var cashCount = Random.Range(BingoCell.MinCashCount, BingoCell.MaxCashCount + 1);
|
||||
|
||||
var list = GlobalHarmony.GetRandomList(
|
||||
cardList.FindAll(tmp => !tmp.data.isSelect && !tmp.data.isCoin && tmp.data.type == CardPropType.none),
|
||||
coinCount);
|
||||
if (list != null)
|
||||
{
|
||||
foreach (var card in list)
|
||||
{
|
||||
card.data.type = CardPropType.coin;
|
||||
}
|
||||
}
|
||||
|
||||
list = GlobalHarmony.GetRandomList(
|
||||
cardList.FindAll(tmp => !tmp.data.isSelect && !tmp.data.isCoin && tmp.data.type == CardPropType.none),
|
||||
cashCount);
|
||||
if (list != null)
|
||||
{
|
||||
foreach (var card in list)
|
||||
{
|
||||
card.data.type = CardPropType.cash;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var card in cardList)
|
||||
{
|
||||
card.SetReward();
|
||||
}
|
||||
}
|
||||
|
||||
private void InitGameObj()
|
||||
{
|
||||
if (GoCell.gameObject == null)
|
||||
{
|
||||
GoCell.InitByPath("Prefab.Game.Card", "CardBoard", () =>
|
||||
{
|
||||
GoCell.transform.SetParent(BingoCell.root, false);
|
||||
GoCell.gameObject.SetActive(false);
|
||||
finishMask = GoCell.transform.Find("Finish");
|
||||
DoSomething();
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
DoSomething();
|
||||
}
|
||||
}
|
||||
|
||||
private void DoSomething()
|
||||
{
|
||||
if (!bingGoSke)
|
||||
{
|
||||
FX.Instance.GetFx<SkeletonAnimation>(Fx_Type.spine_bingo, sk =>
|
||||
{
|
||||
bingGoSke = sk;
|
||||
bingGoSke.transform.SetParent(GoCell.transform);
|
||||
bingGoSke.transform.localPosition = Vector3.zero;
|
||||
idleSys[0] = bingGoSke.transform.Find("fx_lizi_idle01").GetComponent<ParticleSystem>();
|
||||
idleSys[1] = bingGoSke.transform.Find("fx_lizi_idle02").GetComponent<ParticleSystem>();
|
||||
idleSys[2] = bingGoSke.transform.Find("fx_lizi_idle03").GetComponent<ParticleSystem>();
|
||||
enterSys[0] = bingGoSke.transform.Find("fx_lizi_enter01").GetComponent<ParticleSystem>();
|
||||
enterSys[1] = bingGoSke.transform.Find("fx_lizi_enter02").GetComponent<ParticleSystem>();
|
||||
enterSys[2] = bingGoSke.transform.Find("fx_lizi_enter03").GetComponent<ParticleSystem>();
|
||||
for (var i = 0; i < 3; i++)
|
||||
{
|
||||
idleSys[i].gameObject.SetActive(false);
|
||||
enterSys[i].gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
exitSys = bingGoSke.transform.Find("fx_lizi_exit").GetComponent<ParticleSystem>();
|
||||
bingGoSke.gameObject.SetActive(false);
|
||||
GoCell.gameObject.SetActive(true);
|
||||
finishMask.gameObject.SetActive(false);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
bingGoSke.gameObject.SetActive(false);
|
||||
GoCell.gameObject.SetActive(true);
|
||||
finishMask.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
private void InitCardList()
|
||||
{
|
||||
var index = 0;
|
||||
var isFirst = cardList.Count == 0;
|
||||
foreach (var cardData in data.cardNumList)
|
||||
{
|
||||
CardEntity cardEntity;
|
||||
if (isFirst)
|
||||
{
|
||||
cardEntity = new CardEntity();
|
||||
cardEntity.InitGameObj(() =>
|
||||
{
|
||||
cardEntity.data.index = index;
|
||||
cardEntity.data.cardBoard = this;
|
||||
cardList.Add(cardEntity);
|
||||
SetByIndex(cardEntity.Game.transform, index);
|
||||
cardEntity.Game.transform.SetParent(GoCell.transform, false);
|
||||
index++;
|
||||
|
||||
cardEntity.data.isSelect = false;
|
||||
cardEntity.data.isCoin = false;
|
||||
cardEntity.data.isDelaySelect = false;
|
||||
cardEntity.data.type = CardPropType.none;
|
||||
cardEntity.data.num = cardData;
|
||||
cardEntity.SetByData();
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
cardEntity = cardList[index];
|
||||
cardEntity.InitGameObj(() =>
|
||||
{
|
||||
cardEntity.data.isSelect = false;
|
||||
cardEntity.data.isCoin = false;
|
||||
cardEntity.data.isDelaySelect = false;
|
||||
cardEntity.data.type = CardPropType.none;
|
||||
cardEntity.data.num = cardData;
|
||||
cardEntity.SetByData();
|
||||
});
|
||||
index++;
|
||||
}
|
||||
|
||||
if (index == data.cardNumList.Count)
|
||||
{
|
||||
finishMask.SetAsLastSibling();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SetByIndex(Transform gameObjTransform, int index)
|
||||
{
|
||||
if (gameObjTransform != null)
|
||||
{
|
||||
gameObjTransform.localPosition = originPos + new Vector3(index / BingoCell.bingoCount * offset,
|
||||
index % BingoCell.bingoCount * -(offset + 0.02f));
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("[ BingoBrain ] gameObjTransform is null");
|
||||
}
|
||||
}
|
||||
|
||||
public void OnReset()
|
||||
{
|
||||
needShowBingoList.Clear();
|
||||
bingoedList.Clear();
|
||||
data.selectList.Clear();
|
||||
data.cardNumList.Clear();
|
||||
isBingoing = false;
|
||||
isFinish = false;
|
||||
foreach (var card in cardList)
|
||||
{
|
||||
card.OnReset();
|
||||
}
|
||||
|
||||
for (var i = 0; i < 3; i++)
|
||||
{
|
||||
idleSys[i].gameObject.SetActive(false);
|
||||
enterSys[i].gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
exitSys.gameObject.SetActive(false);
|
||||
|
||||
showBingoSequence?.Cancel();
|
||||
}
|
||||
|
||||
public void DelayCheckBingo()
|
||||
{
|
||||
if (BingoCell.isProcedure)
|
||||
{
|
||||
isDelayCheckBingo = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
CheckBingo();
|
||||
}
|
||||
}
|
||||
|
||||
public void CheckBingo()
|
||||
{
|
||||
if (BingoCell.isProcedure)
|
||||
{
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (BingoCell.bingoCardboardIndex != -1 && BingoCell.bingoCardboardIndex != data.index)
|
||||
{
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
var bingoType = IsBingo(data.selectList);
|
||||
while (bingoType != -1)
|
||||
{
|
||||
BingoCell.bingoCardboardIndex = data.index;
|
||||
isBingoing = true;
|
||||
bingoedList.Add(bingoType);
|
||||
PreferencesMgr.Instance.BingoSum += 1;
|
||||
|
||||
needShowBingoList.Add(bingoType);
|
||||
bingoType = IsBingo(data.selectList);
|
||||
}
|
||||
|
||||
showBingoSequence = new Gsss();
|
||||
if (needShowBingoList.Count != 0)
|
||||
{
|
||||
|
||||
showBingoSequence.Add(obj =>
|
||||
{
|
||||
var delay = 0.2f;
|
||||
foreach (var tmpType in needShowBingoList)
|
||||
{
|
||||
var count = BingoCell.bingoDic[tmpType].Count;
|
||||
|
||||
for (var j = 0; j < count; j++)
|
||||
{
|
||||
var index = BingoCell.bingoDic[tmpType][j];
|
||||
if (cardList[index].data.isCoin)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
cardList[index].SetCoin(delay);
|
||||
}
|
||||
}
|
||||
|
||||
DOVirtual.DelayedCall(delay, obj.InvokeComplete).SetAutoKill();
|
||||
});
|
||||
|
||||
|
||||
showBingoSequence.Add((obj) =>
|
||||
{
|
||||
Audio.Instance.PlayDynamicEffect("Bingo");
|
||||
|
||||
int bingoingNumber = Mathf.Clamp(bingoedList.Count, 0, 3);
|
||||
NAAVsa.SetSkin(bingGoSke, "default");
|
||||
this.bingGoSke.gameObject.SetActive(true);
|
||||
switch (bingoingNumber)
|
||||
{
|
||||
case 1:
|
||||
this.bingGoSke.state.SetAnimation(0, "single", false);
|
||||
break;
|
||||
case 2:
|
||||
this.bingGoSke.state.SetAnimation(0, "double", false);
|
||||
break;
|
||||
case 3:
|
||||
this.bingGoSke.state.SetAnimation(0, "multiple", false);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
enterSys[bingoingNumber - 1].gameObject.SetActive(true);
|
||||
idleSys[bingoingNumber - 1].gameObject.SetActive(true);
|
||||
finishMask.gameObject.SetActive(true);
|
||||
if (bingoedList.Count >= 3 && !isDelayCheckBingo)
|
||||
{
|
||||
DOVirtual.DelayedCall(1.8f, () =>
|
||||
{
|
||||
NAAVsa.SetSkin(bingGoSke, "default");
|
||||
idleSys[bingoingNumber - 1].gameObject.SetActive(true);
|
||||
enterSys[bingoingNumber - 1].gameObject.SetActive(false);
|
||||
obj.InvokeComplete();
|
||||
}).SetAutoKill();
|
||||
}
|
||||
else
|
||||
{
|
||||
DOVirtual.DelayedCall(1.5f, () =>
|
||||
{
|
||||
exitSys.gameObject.SetActive(true);
|
||||
idleSys[bingoingNumber - 1].gameObject.SetActive(false);
|
||||
enterSys[bingoingNumber - 1].gameObject.SetActive(false);
|
||||
|
||||
DOVirtual.DelayedCall(0.8f, (TweenCallback)(() =>
|
||||
{
|
||||
finishMask.gameObject.SetActive(false);
|
||||
this.bingGoSke.gameObject.SetActive(false);
|
||||
exitSys.gameObject.SetActive(false);
|
||||
|
||||
obj.InvokeComplete();
|
||||
}));
|
||||
}).SetAutoKill();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
if (needShowBingoList.Count > 1)
|
||||
{
|
||||
|
||||
showBingoSequence.Add(true, obj =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(SkinInfo.ChestUI_Open);
|
||||
UICtrlDispatcher.Instance.AddOnceListener(SkinInfo.ChestUI_Close,
|
||||
_ => { obj.InvokeComplete(); });
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (showBingoSequence.Count != 0)
|
||||
{
|
||||
|
||||
showBingoSequence.Add(obj =>
|
||||
{
|
||||
if (BingoCell.KeyCardSum >= 3)
|
||||
{
|
||||
|
||||
UICtrlDispatcher.Instance.AddOnceListener(SkinInfo.BingoCardUI_Close, o =>
|
||||
{
|
||||
|
||||
obj.InvokeComplete();
|
||||
});
|
||||
BingoCell.OpenActivityUI();
|
||||
}
|
||||
else
|
||||
{
|
||||
obj.InvokeComplete();
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
if (BingoCell.KeyCardSum >= 3)
|
||||
{
|
||||
showBingoSequence.Add(obj =>
|
||||
{
|
||||
if (BingoCell.KeyCardSum >= 3)
|
||||
{
|
||||
|
||||
UICtrlDispatcher.Instance.AddOnceListener(SkinInfo.BingoCardUI_Close, o =>
|
||||
{
|
||||
|
||||
obj.InvokeComplete();
|
||||
});
|
||||
BingoCell.OpenActivityUI();
|
||||
}
|
||||
else
|
||||
{
|
||||
obj.InvokeComplete();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (showBingoSequence.Count != 0)
|
||||
{
|
||||
BingoCell.isProcedure = true;
|
||||
GameDispatcher.Instance.Dispatch(BingoInfo.AddPause, 1);
|
||||
showBingoSequence.onFinish = OnFinish;
|
||||
showBingoSequence.Run();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
isBingoing = false;
|
||||
BingoCell.isProcedure = false;
|
||||
showBingoSequence.onFinish = null;
|
||||
|
||||
|
||||
CheckFinish();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnFinish()
|
||||
{
|
||||
GameDispatcher.Instance.Dispatch(BingoInfo.AddPause, -1);
|
||||
needShowBingoList.Clear();
|
||||
BingoCell.bingoCardboardIndex = -1;
|
||||
|
||||
BingoCell.isProcedure = false;
|
||||
if (isDelayCheckBingo)
|
||||
{
|
||||
|
||||
isDelayCheckBingo = false;
|
||||
CheckBingo();
|
||||
GameDispatcher.Instance.Dispatch(BingoInfo.CheckBingo, data.index);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (isBingoing)
|
||||
{
|
||||
isBingoing = false;
|
||||
CheckFinish();
|
||||
GameDispatcher.Instance.Dispatch(BingoInfo.CheckBingo, data.index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CheckFinish()
|
||||
{
|
||||
if (bingoedList.Count >= 3)
|
||||
{
|
||||
|
||||
isFinish = true;
|
||||
|
||||
if (!bingGoSke.gameObject.activeInHierarchy)
|
||||
{
|
||||
bingGoSke.gameObject.SetActive(true);
|
||||
NAAVsa.SetSkin(bingGoSke, "default");
|
||||
|
||||
idleSys[2].gameObject.SetActive(true);
|
||||
finishMask.gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
if (!BingoCell.IsInGame)
|
||||
{
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
GameDispatcher.Instance.Dispatch(BingoInfo.FinishOneCardBoard, this);
|
||||
}
|
||||
}
|
||||
|
||||
public int IsBingo(List<int> selectList)
|
||||
{
|
||||
foreach (var kv in from kv in BingoCell.bingoDic
|
||||
where !bingoedList.Contains(kv.Key)
|
||||
let isAllMatch = kv.Value.All(selectList.Contains)
|
||||
where isAllMatch
|
||||
select kv)
|
||||
{
|
||||
return kv.Key;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b39336ad4d2546cfb31bb301d9c8e68e
|
||||
timeCreated: 1699945567
|
||||
@@ -0,0 +1,286 @@
|
||||
using System;
|
||||
using DG.Tweening;
|
||||
using BingoBrain.Core;
|
||||
using BingoBrain.HotFix;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using Spine;
|
||||
using UnityEngine.UI;
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class CardEntity
|
||||
{
|
||||
public CardData data = new CardData();
|
||||
public GameCell Game = new GameCell();
|
||||
private TextMeshPro text;
|
||||
private SpriteRenderer alphaNum;
|
||||
private GameObject selectStar;
|
||||
private GameObject coin;
|
||||
|
||||
private Transform reward;
|
||||
|
||||
private Tween alphaTween;
|
||||
|
||||
public void InitGameObj(Action action)
|
||||
{
|
||||
if (Game.gameObject == null)
|
||||
{
|
||||
string card_name = "CardItem";
|
||||
if (GameHelper.IsGiftSwitch()) card_name = "CardItem_gift";
|
||||
Game.InitByPath("Prefab.Game.Card", card_name, () =>
|
||||
{
|
||||
text = Game.transform.Find("num").GetComponent<TextMeshPro>();
|
||||
selectStar = Game.transform.Find("selectStar").gameObject;
|
||||
reward = Game.transform.Find("reward");
|
||||
coin = Game.transform.Find("coin").gameObject;
|
||||
alphaNum = text.transform.GetChild(0).GetComponent<SpriteRenderer>();
|
||||
Game.transform.localScale = Vector3.one * 1.04f;
|
||||
TriggerBingo.Get(Game.gameObject).onClick = OnClick;
|
||||
alphaNum.color = new Color(1f, 1f, 1f, 0f);
|
||||
action?.Invoke();
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
alphaNum.color = new Color(1f, 1f, 1f, 0f);
|
||||
action?.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
public void SetByData()
|
||||
{
|
||||
// alphaNum.text = text.text = GameHelper.GetNum(data.num);
|
||||
text.text = GameHelper.GetNum(data.num);
|
||||
if (data.cardBoard.data.selectList.Contains(data.index))
|
||||
{
|
||||
data.isSelect = true;
|
||||
}
|
||||
|
||||
if (data.isDelaySelect)
|
||||
{
|
||||
if (!data.cardBoard.data.selectList.Contains(data.index))
|
||||
{
|
||||
CheckReward();
|
||||
data.cardBoard.data.selectList.Add(data.index);
|
||||
data.isSelect = true;
|
||||
}
|
||||
}
|
||||
|
||||
SetIsSelect();
|
||||
}
|
||||
|
||||
public void AddToSelectedList()
|
||||
{
|
||||
data.isDelaySelect = true;
|
||||
}
|
||||
|
||||
public void SetReward()
|
||||
{
|
||||
if (data.type == CardPropType.none || data.isSelect)
|
||||
{
|
||||
reward.gameObject.SetActive(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
reward.gameObject.SetActive(true);
|
||||
for (int i = 0; i < reward.childCount; i++)
|
||||
{
|
||||
reward.GetChild(i).gameObject.SetActive(i == (int)data.type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void OnReset()
|
||||
{
|
||||
alphaTween?.Pause();
|
||||
delayedCall?.Kill();
|
||||
delayedCall = null;
|
||||
alphaNum.color = new Color(1f, 1f, 1f, 0f);
|
||||
data.cardBoard.isFinish = false;
|
||||
data.cardBoard.isBingoing = false;
|
||||
data.isSelect = false;
|
||||
data.isCoin = false;
|
||||
}
|
||||
|
||||
private void OnClick(PointerEventData pointerEventData)
|
||||
{
|
||||
if (!BingoCell.IsInGame)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (data.cardBoard.isFinish)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (data.cardBoard.isBingoing)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (BingoCell.isCallFinish)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (BingoCell.isGameOver)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (NNfds.IsPointerOnUI())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (data.isDelaySelect)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (BingoCell.calledList.Contains(data.num))
|
||||
{
|
||||
Audio.Instance.PlayDynamicEffect("daub");
|
||||
}
|
||||
else
|
||||
{
|
||||
Audio.Instance.PlayDynamicEffect("daub_error");
|
||||
}
|
||||
|
||||
if (!data.isSelect && BingoCell.calledList.Contains(data.num))
|
||||
{
|
||||
data.isSelect = true;
|
||||
data.cardBoard.data.selectList.Add(data.index);
|
||||
|
||||
CheckReward();
|
||||
SetIsSelect();
|
||||
data.cardBoard.CheckBingo();
|
||||
GameDispatcher.Instance.Dispatch(BingoInfo.SelectOneNum, this);
|
||||
if (!PreferencesMgr.Instance.IsCompleteFirstGame)
|
||||
{
|
||||
PreferencesMgr.Instance.IsCompleteFirstGame = true;
|
||||
}
|
||||
|
||||
alphaTween?.Pause();
|
||||
alphaNum.color = new Color(1f, 1f, 1f, 0f);
|
||||
var effect = Battle.Instance.ShungTik.Get("Effect.spark.fx_number_enter", "fx_number_enter");
|
||||
effect.transform.SetParent(Game.transform, false);
|
||||
DOVirtual.DelayedCall(1, () => { ReleaseEffect(effect); }).SetAutoKill();
|
||||
}
|
||||
}
|
||||
|
||||
private void ReleaseEffect(GameObject effect)
|
||||
{
|
||||
Battle.Instance.ShungTik.Release(effect);
|
||||
}
|
||||
|
||||
private void CheckReward()
|
||||
{
|
||||
var val = GetSumToType(data.type);
|
||||
var startPot = GameHelper.WoldToUIPot(Game.transform.position);
|
||||
var rewardData = new RewardData
|
||||
{
|
||||
displayType = RewardDisplayType.RewardFly | RewardDisplayType.ValueChange
|
||||
};
|
||||
var rewardSingleData = new Goda(101, val, RewardOrigin.Play)
|
||||
{
|
||||
startPosition = startPot
|
||||
};
|
||||
|
||||
switch (data.type)
|
||||
{
|
||||
case CardPropType.coin:
|
||||
rewardSingleData.id = 101;
|
||||
rewardData.AddReward(rewardSingleData);
|
||||
GameDispatcher.Instance.Dispatch(BingoInfo.GetReward, rewardData);
|
||||
|
||||
break;
|
||||
case CardPropType.coinx3:
|
||||
rewardSingleData.id = 101;
|
||||
rewardData.AddReward(rewardSingleData);
|
||||
GameDispatcher.Instance.Dispatch(BingoInfo.GetReward, rewardData);
|
||||
break;
|
||||
case CardPropType.cash:
|
||||
|
||||
rewardSingleData.id = 102;
|
||||
rewardData.AddReward(rewardSingleData);
|
||||
if (GameHelper.IsGiftSwitch()) UICtrlDispatcher.Instance.Dispatch(SkinInfo.StarRewardUI_Open);
|
||||
else GameDispatcher.Instance.Dispatch(BingoInfo.GetReward, rewardData);
|
||||
break;
|
||||
case CardPropType.cashx3:
|
||||
rewardSingleData.id = 102;
|
||||
rewardData.AddReward(rewardSingleData);
|
||||
if (GameHelper.IsGiftSwitch()) UICtrlDispatcher.Instance.Dispatch(SkinInfo.StarRewardUI_Open, true);
|
||||
else GameDispatcher.Instance.Dispatch(BingoInfo.GetReward, rewardData);
|
||||
break;
|
||||
case CardPropType.fanpai:
|
||||
BingoCell.AddKeyCardSum(1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public static decimal GetSumToType(CardPropType type)
|
||||
{
|
||||
var coinVO = GameHelper.GetDynamicVersion_Coin();
|
||||
var cashVO = GameHelper.GetDynamicVersion_Cash();
|
||||
switch (type)
|
||||
{
|
||||
case CardPropType.coin:
|
||||
return coinVO.coinRange[0];
|
||||
case CardPropType.coinx3:
|
||||
return coinVO.coinRange[1];
|
||||
case CardPropType.cash:
|
||||
{
|
||||
var sum = (int)((cashVO.cashRange[1] - cashVO.cashRange[0]) / cashVO.range);
|
||||
return (decimal)(cashVO.cashRange[0] + (UnityEngine.Random.Range(0, sum + 1) * cashVO.range));
|
||||
}
|
||||
case CardPropType.cashx3:
|
||||
{
|
||||
var sum = (int)((cashVO.cashRange2[1] - cashVO.cashRange2[0]) / cashVO.range);
|
||||
return (decimal)(cashVO.cashRange2[0] + (UnityEngine.Random.Range(0, sum + 1) * cashVO.range));
|
||||
}
|
||||
default:
|
||||
return 100;
|
||||
}
|
||||
}
|
||||
|
||||
private float tweenTime = 0.5f;
|
||||
private Tween delayedCall;
|
||||
|
||||
public void TweenAlphaNum()
|
||||
{
|
||||
delayedCall = DOVirtual.DelayedCall((float)GameHelper.GetCommonModel().hintDelayTime, () =>
|
||||
{
|
||||
delayedCall = null;
|
||||
if (data.isSelect)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
alphaTween ??= alphaNum.DOFade(1, tweenTime).SetLoops(-1, LoopType.Yoyo);
|
||||
|
||||
alphaTween.Restart();
|
||||
});
|
||||
}
|
||||
|
||||
void SetIsSelect()
|
||||
{
|
||||
text.gameObject.SetActive(!data.isSelect);
|
||||
selectStar.SetActive(data.isSelect);
|
||||
coin.SetActive(false);
|
||||
reward.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
public void SetCoin(float time = 0.2f)
|
||||
{
|
||||
data.isCoin = true;
|
||||
selectStar.SetActive(false);
|
||||
coin.SetActive(true);
|
||||
text.gameObject.SetActive(false);
|
||||
|
||||
coin.transform.DOScale(1.2f, time / 2).SetLoops(2, LoopType.Yoyo);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6d4ccef593e44aa3883824a14fdf747b
|
||||
timeCreated: 1699945567
|
||||
@@ -0,0 +1,103 @@
|
||||
using System;
|
||||
|
||||
using UnityEngine;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
|
||||
public class GodDa
|
||||
{
|
||||
public Goda Goda;
|
||||
|
||||
public bool isPlayAudio;
|
||||
|
||||
public string audioName;
|
||||
|
||||
public bool isNeedFly;
|
||||
public bool isNeedValueChange;
|
||||
|
||||
public event Action<decimal> UpdateCb;
|
||||
public event Action EndEventCb;
|
||||
public event Action UICloseEventCb;
|
||||
|
||||
private decimal coinAddTime = 0.45m;
|
||||
|
||||
public bool isSingle;
|
||||
|
||||
|
||||
private decimal showValue;
|
||||
|
||||
|
||||
private decimal showAddValue;
|
||||
|
||||
private bool isCompleted;
|
||||
|
||||
public GodDa(Goda goda)
|
||||
{
|
||||
this.Goda = goda;
|
||||
showValue = goda.GetTotalValue();
|
||||
showAddValue = showValue;
|
||||
}
|
||||
|
||||
public void SetUpdate(Action<decimal> updateCb)
|
||||
{
|
||||
UpdateCb = updateCb;
|
||||
}
|
||||
|
||||
public void Update()
|
||||
{
|
||||
if (isCompleted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var val = showValue * Convert.ToDecimal(Time.deltaTime) / coinAddTime;
|
||||
if (showAddValue >= val)
|
||||
{
|
||||
showAddValue -= val;
|
||||
if (isNeedValueChange)
|
||||
{
|
||||
UpdateCb?.Invoke(val);
|
||||
}
|
||||
}
|
||||
else if (showAddValue > 0)
|
||||
{
|
||||
if (isNeedValueChange)
|
||||
{
|
||||
UpdateCb?.Invoke(showAddValue);
|
||||
}
|
||||
|
||||
showAddValue = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
EndEvent();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void SetUpdateComplete(Action endEventCb)
|
||||
{
|
||||
EndEventCb = endEventCb;
|
||||
}
|
||||
|
||||
public void EndEvent()
|
||||
{
|
||||
EndEventCb?.Invoke();
|
||||
EndEventCb = null;
|
||||
isCompleted = true;
|
||||
}
|
||||
|
||||
public void UICloseEvent()
|
||||
{
|
||||
UICloseEventCb?.Invoke();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
UpdateCb = null;
|
||||
EndEventCb = null;
|
||||
UICloseEventCb = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 96c535e1964438c499609fb7a2376428
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
|
||||
public class PlayData
|
||||
{
|
||||
public Dictionary<string, object> data;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cb09473f43a1ee34d82911835fdb7a1c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,37 @@
|
||||
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
|
||||
public partial class Preferences
|
||||
{
|
||||
public int gameStartCount = 0;
|
||||
|
||||
|
||||
public int loginGameTodayTimes = 0;
|
||||
|
||||
|
||||
public int videoEffective_count;
|
||||
|
||||
|
||||
public bool isLogEffective = false;
|
||||
|
||||
|
||||
public long data_ver = 0;
|
||||
|
||||
|
||||
public bool haveBeenGameStart = false;
|
||||
|
||||
|
||||
public string date = string.Empty;
|
||||
|
||||
|
||||
public int lastLoginDays = 0;
|
||||
|
||||
|
||||
public int xpReachedRewardIndex = -1;
|
||||
|
||||
|
||||
public int playerXP;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fa1e3104990281d4e877ab367549a0f8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,290 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
public partial class Preferences
|
||||
{
|
||||
public int currency101=50;
|
||||
|
||||
|
||||
public int max101;
|
||||
|
||||
|
||||
public long nextNewDayTime;
|
||||
|
||||
public long ballonCdTime;
|
||||
|
||||
|
||||
public int toDayMaxScore;
|
||||
|
||||
|
||||
public int historyMaxScore;
|
||||
|
||||
|
||||
public string playerName;
|
||||
|
||||
|
||||
public string code;
|
||||
|
||||
|
||||
public int playerAvatarId=1;
|
||||
|
||||
|
||||
public int ticketGameNum;
|
||||
|
||||
|
||||
public int moneyGameNum;
|
||||
|
||||
|
||||
public int loginDay;
|
||||
|
||||
|
||||
public int watchVideoBeginSum;
|
||||
|
||||
|
||||
public int active;
|
||||
|
||||
|
||||
public decimal currency102;
|
||||
|
||||
|
||||
public decimal max102;
|
||||
|
||||
|
||||
public List<bool> dailyTaskState;
|
||||
|
||||
|
||||
public List<bool> dailyTaskActiveState;
|
||||
|
||||
|
||||
public List<Task> activeMissions;
|
||||
|
||||
|
||||
public List<int> finishTaskList;
|
||||
|
||||
|
||||
public List<long> signState;
|
||||
|
||||
|
||||
public List<int> completeGuideList;
|
||||
|
||||
public bool isResetGuide;
|
||||
|
||||
|
||||
public int watchVideoSum;
|
||||
|
||||
|
||||
public bool isOpenedInvite;
|
||||
|
||||
public bool isGod;
|
||||
|
||||
|
||||
public bool isGuideFinish;
|
||||
|
||||
#region FaceBook登录
|
||||
|
||||
public string facebookId;
|
||||
|
||||
|
||||
public string facebookName;
|
||||
|
||||
|
||||
public string facebookAvatarUrl;
|
||||
|
||||
|
||||
public bool isFaceBookLogin;
|
||||
|
||||
#endregion
|
||||
|
||||
public bool isShowRewardFly101 = false;
|
||||
public bool isShowRewardFly102 = false;
|
||||
public bool isShowRewardFly105 = false;
|
||||
public bool isShowRewardFly106 = false;
|
||||
|
||||
#region 转盘
|
||||
|
||||
public int thisDayWatchSlyderVideoNum;
|
||||
|
||||
#endregion
|
||||
|
||||
#region 内购
|
||||
|
||||
public List<int> realIssueIdLst;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
public bool isPayBind;
|
||||
|
||||
|
||||
public string paypalAccount;
|
||||
|
||||
|
||||
public bool isSuccessRedeem;
|
||||
|
||||
|
||||
public bool isOpenRedeem = false;
|
||||
|
||||
|
||||
public int gameOfCount;
|
||||
|
||||
|
||||
public int initPropFireCountUsed;
|
||||
|
||||
|
||||
public int initPropBombCountUsed;
|
||||
|
||||
#region 兑换
|
||||
|
||||
public bool exchangeBindGuide;
|
||||
|
||||
|
||||
public string exchangeAccount;
|
||||
|
||||
|
||||
public string exchangeName;
|
||||
|
||||
|
||||
public string exchangeCoinAccount;
|
||||
|
||||
|
||||
public string exchangeCoinFName;
|
||||
|
||||
|
||||
public string exchangeCoinLName;
|
||||
|
||||
|
||||
public string exchangeMailbox;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
public int clearBubbleCount;
|
||||
|
||||
|
||||
public int usePropCount;
|
||||
|
||||
|
||||
public int winLeftExtraBallCount;
|
||||
|
||||
|
||||
public bool isRateUs;
|
||||
|
||||
|
||||
public int dailyTaskWinCount;
|
||||
|
||||
public bool isOpenedRealGift;
|
||||
|
||||
|
||||
public decimal webViewOnlineTime;
|
||||
|
||||
|
||||
public bool isClickH5Icon;
|
||||
|
||||
|
||||
public bool isShowOpenReward = false;
|
||||
|
||||
|
||||
public int openRewardCount = 0;
|
||||
|
||||
public bool isRealProcessing;
|
||||
|
||||
|
||||
public int realWatchVideo;
|
||||
|
||||
|
||||
public bool isEditInviteCode = false;
|
||||
|
||||
public decimal webViewMakeUpOnlineTime;
|
||||
|
||||
public decimal webViewADTaskOnlineTime;
|
||||
|
||||
public List<int> withdrawGear;
|
||||
|
||||
|
||||
public long adCashFlyShowTime;
|
||||
|
||||
|
||||
public int cardBoardIndex;
|
||||
|
||||
|
||||
public int bingoSum;
|
||||
|
||||
|
||||
public bool isFirstBingo = true;
|
||||
|
||||
|
||||
public bool isFirstComboBingo = true;
|
||||
|
||||
|
||||
public bool isCompleteFirstGame;
|
||||
|
||||
|
||||
public bool isFirstPropFull = true;
|
||||
|
||||
|
||||
public int gameSum;
|
||||
|
||||
#region 转盘
|
||||
|
||||
public bool isOnceWheel;
|
||||
|
||||
|
||||
public List<float> ferrWheelLst;
|
||||
|
||||
|
||||
public List<float> videlWheelLst;
|
||||
|
||||
|
||||
public string wheelVersion;
|
||||
|
||||
|
||||
public long nextOpenWheelStampTime;
|
||||
|
||||
#endregion
|
||||
|
||||
#region 签到模块
|
||||
|
||||
public long openDailyBonusStampTime;
|
||||
|
||||
#endregion
|
||||
|
||||
#region 统计
|
||||
|
||||
public Dictionary<string, bool> statisticDictionary;
|
||||
public Dictionary<int, bool> statisticMakeupDictionary;
|
||||
public List<int> statisticCashTarget;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
public long nextRecoveryTime;
|
||||
|
||||
|
||||
public int cardBoardSum = -1;
|
||||
|
||||
|
||||
public bool isFirstSlot = true;
|
||||
|
||||
|
||||
public bool isFirstBox = true;
|
||||
|
||||
|
||||
public bool isSecondEndShow = true;
|
||||
|
||||
|
||||
public int sum777;
|
||||
|
||||
|
||||
public Dictionary<long, int> bankDic;
|
||||
|
||||
|
||||
public List<DailyBonusItem> dailyBonusItemLst;
|
||||
public int h5StayTime;
|
||||
public decimal makeupTaskH5Time;
|
||||
|
||||
// public List<MakeupTaskData> makeupTaskHistory;
|
||||
// public List<MakeupTaskData> coinMakeupTaskHistory;
|
||||
public decimal coinMakeupTaskH5Time;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5c96714641282bd4599d9910970cc804
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,341 @@
|
||||
using FairyGUI;
|
||||
using System.Linq;
|
||||
|
||||
using UnityEngine;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
[Flags]
|
||||
|
||||
public enum RewardDisplayType
|
||||
{
|
||||
None = 0b_0000_0000,
|
||||
|
||||
|
||||
Number = 0b_0000_0001,
|
||||
|
||||
|
||||
ValueChange = 0b_0000_0010,
|
||||
|
||||
|
||||
Dialog = 0b_0000_0100,
|
||||
|
||||
|
||||
RewardFly = 0b_0000_1000,
|
||||
}
|
||||
|
||||
|
||||
|
||||
public enum RewardOrigin
|
||||
{
|
||||
None,
|
||||
Ballon,
|
||||
MoreCard,
|
||||
PickBox,
|
||||
PlayBallon,
|
||||
Slot,
|
||||
PlayCard,
|
||||
Wheel,
|
||||
Redeem,
|
||||
|
||||
|
||||
Naive,
|
||||
|
||||
|
||||
GameWin,
|
||||
|
||||
|
||||
H5Icon,
|
||||
|
||||
|
||||
H5Fly102,
|
||||
|
||||
|
||||
Invite,
|
||||
|
||||
|
||||
SignIn,
|
||||
|
||||
|
||||
Play,
|
||||
|
||||
|
||||
OpenReward,
|
||||
|
||||
DailyTask,
|
||||
|
||||
LuckyWheel,
|
||||
|
||||
BuyGold,
|
||||
AdTask
|
||||
}
|
||||
|
||||
|
||||
|
||||
public enum RewardCondition
|
||||
{
|
||||
None,
|
||||
|
||||
|
||||
AD,
|
||||
}
|
||||
|
||||
|
||||
public class Goda
|
||||
{
|
||||
public int id;
|
||||
|
||||
|
||||
public int type;
|
||||
|
||||
|
||||
public decimal value;
|
||||
|
||||
|
||||
public decimal multiRate;
|
||||
|
||||
|
||||
public decimal rate;
|
||||
|
||||
|
||||
public decimal GetTotalValue()
|
||||
{
|
||||
return Math.Round(value * rate, 2);
|
||||
}
|
||||
|
||||
|
||||
public RewardOrigin origin;
|
||||
|
||||
|
||||
public Vector2 startPosition;
|
||||
|
||||
|
||||
public Vector2 endPosition;
|
||||
|
||||
public Goda(int id, decimal value, RewardOrigin origin)
|
||||
{
|
||||
this.id = id;
|
||||
this.value = value;
|
||||
this.origin = origin;
|
||||
InitData();
|
||||
}
|
||||
public Goda(int id, decimal value, RewardOrigin origin, Vector2 startPosition) : this(id, value,
|
||||
origin)
|
||||
{
|
||||
this.startPosition = startPosition;
|
||||
}
|
||||
|
||||
|
||||
private void InitData()
|
||||
{
|
||||
InitRate();
|
||||
InitMultiRate();
|
||||
}
|
||||
|
||||
|
||||
private void InitRate()
|
||||
{
|
||||
if (rate == 0)
|
||||
{
|
||||
rate = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void InitMultiRate()
|
||||
{
|
||||
if (multiRate == 0)
|
||||
{
|
||||
multiRate = 1;
|
||||
}
|
||||
}
|
||||
|
||||
public void InitFlyPosition()
|
||||
{
|
||||
InitStartPosition();
|
||||
InitEndPosition();
|
||||
}
|
||||
|
||||
private void InitStartPosition()
|
||||
{
|
||||
if (startPosition == Vector2.zero)
|
||||
{
|
||||
startPosition = GRoot.inst.size / 2;
|
||||
}
|
||||
}
|
||||
|
||||
private void InitEndPosition()
|
||||
{
|
||||
if (endPosition == Vector2.zero && id != 0)
|
||||
{
|
||||
var itemUI = GameHelper.GetItemUI(id);
|
||||
var gObject = itemUI?.GetChildAt(1);
|
||||
if (gObject != null)
|
||||
{
|
||||
endPosition = itemUI.LocalToRoot((Vector2)gObject.position + gObject.size / 2, GRoot.inst);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public bool IsCanFly()
|
||||
{
|
||||
return IsCanFly(id);
|
||||
}
|
||||
|
||||
|
||||
public static bool IsCanFly(int id)
|
||||
{
|
||||
if (id == 101 || id == 102 || id == 105 || id == 106)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class RewardData
|
||||
{
|
||||
public List<Goda> rewardDataList;
|
||||
|
||||
|
||||
public RewardDisplayType displayType;
|
||||
|
||||
|
||||
public RewardCondition condition;
|
||||
|
||||
|
||||
private Action<bool> mOnCompleted;
|
||||
|
||||
|
||||
public bool isSingle;
|
||||
|
||||
public decimal ctRate;
|
||||
|
||||
public RewardData()
|
||||
{
|
||||
InitData();
|
||||
}
|
||||
|
||||
public RewardData(int rewardId, decimal rewardValue, RewardOrigin origin, int rate) : this()
|
||||
{
|
||||
AddReward(rewardId, rewardValue, origin, rate);
|
||||
}
|
||||
|
||||
public RewardData(int rewardId, decimal rewardValue, RewardOrigin origin, int rate,
|
||||
Action<bool> onCompleted) : this(
|
||||
rewardId, rewardValue, origin, rate)
|
||||
{
|
||||
mOnCompleted = onCompleted;
|
||||
}
|
||||
|
||||
private RewardData(List<Goda> rewardDataList)
|
||||
{
|
||||
AddRewardList(rewardDataList);
|
||||
}
|
||||
|
||||
private RewardData(List<Goda> rewardDataList, Action<bool> onCompleted) : this(rewardDataList)
|
||||
{
|
||||
mOnCompleted = onCompleted;
|
||||
}
|
||||
|
||||
|
||||
private void AddRewardList(List<Goda> rewardDataList)
|
||||
{
|
||||
if (rewardDataList != null)
|
||||
{
|
||||
foreach (var rewardData in rewardDataList)
|
||||
{
|
||||
AddReward(rewardData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void SetCompleted(Action<bool> onCompleted)
|
||||
{
|
||||
mOnCompleted = onCompleted;
|
||||
}
|
||||
|
||||
|
||||
public void AddCompleted(Action<bool> onCompleted)
|
||||
{
|
||||
mOnCompleted += onCompleted;
|
||||
}
|
||||
|
||||
|
||||
public void OnCompleted(bool isSuccess)
|
||||
{
|
||||
mOnCompleted?.Invoke(isSuccess);
|
||||
}
|
||||
|
||||
public Action<bool> GetCompleted()
|
||||
{
|
||||
return mOnCompleted;
|
||||
}
|
||||
|
||||
|
||||
public void AddReward(Goda goda)
|
||||
{
|
||||
rewardDataList ??= new List<Goda>();
|
||||
|
||||
var isNeedAdd = true;
|
||||
|
||||
foreach (var data in rewardDataList.Where(data => data.id == goda.id))
|
||||
{
|
||||
data.value += goda.value;
|
||||
isNeedAdd = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (isNeedAdd)
|
||||
{
|
||||
rewardDataList.Add(goda);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void AddReward(int rewardId, decimal rewardValue, RewardOrigin origin, int rate = 1)
|
||||
{
|
||||
var rewardSingleData = new Goda(rewardId, rewardValue, origin)
|
||||
{
|
||||
rate = rate
|
||||
};
|
||||
AddReward(rewardSingleData);
|
||||
}
|
||||
|
||||
|
||||
public bool IsContainReward(int rewardId)
|
||||
{
|
||||
return rewardDataList.Any(data => data.id == rewardId);
|
||||
}
|
||||
|
||||
|
||||
private void InitData()
|
||||
{
|
||||
if (rewardDataList != null)
|
||||
{
|
||||
rewardDataList.Clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
rewardDataList = new List<Goda>();
|
||||
}
|
||||
}
|
||||
|
||||
public List<Goda> GetRewardDataList()
|
||||
{
|
||||
return rewardDataList;
|
||||
}
|
||||
|
||||
public int GetRewardFlyCount()
|
||||
{
|
||||
return GetRewardDataList().Count(rewardSingleData => rewardSingleData.IsCanFly());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3ab2c0def1063b543b89fed5d33423d4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user