fix:1、添加项目
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
namespace FlowerPower
|
||||
{
|
||||
public class LoginModel : BaseModel
|
||||
{
|
||||
public long uid;
|
||||
public bool new_player;
|
||||
public string token;
|
||||
public long expires_at;
|
||||
public string country;
|
||||
public string invite_code;
|
||||
public string invite_url;
|
||||
public long last_login_time;
|
||||
public string play_data;
|
||||
public string setting;
|
||||
public string cdn_url;
|
||||
public long login_time;
|
||||
public long reg_time;
|
||||
public bool is_black_ip;
|
||||
public string ConfigType;
|
||||
public long play_data_ver;
|
||||
public Preferences preferences;
|
||||
public bool debug_log = true;
|
||||
public bool is_magic;
|
||||
public int enwp;
|
||||
|
||||
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
|
||||
protected override void AddListener()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2344f926dc38bb449b5663c4d75ed814
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace FlowerPower
|
||||
{
|
||||
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,14 @@
|
||||
namespace FlowerPower
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fa1e3104990281d4e877ab367549a0f8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,79 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace FlowerPower
|
||||
{
|
||||
public partial class Preferences
|
||||
{
|
||||
public decimal currency101;
|
||||
public decimal currency102;
|
||||
|
||||
public decimal maxCurrency101;
|
||||
public int thisDayWatchSlyderVideoNum;
|
||||
public long nextNewDayTime;
|
||||
public string playerName;
|
||||
public int playerAvatarId;
|
||||
public List<long> signState;
|
||||
public List<int> completeGuideList;
|
||||
public bool isResetGuide;
|
||||
public int gameOfCount;
|
||||
public int winOfGame;
|
||||
public List<string> onceStatistcList;
|
||||
public int watchVideoBeginSum;
|
||||
public bool isGod;
|
||||
public string facebookId;
|
||||
public string facebookName;
|
||||
public string facebookAvatarUrl;
|
||||
public bool isFaceBookLogin;
|
||||
public bool isGuideFinish;
|
||||
public int currentQuestionIndex;
|
||||
public int gameLevel = 1;
|
||||
public bool exchangeBindGuide;
|
||||
public string exchangeAccount;
|
||||
public string exchangeName;
|
||||
public List<int> haveRdSkin;
|
||||
public int inUseSkin;
|
||||
public string paypalAccount;
|
||||
public bool isSuccessRd;
|
||||
public List<InviteData> inviteDataList;
|
||||
public List<InviteRecord> inviteRecordList;
|
||||
public List<InviteMakeUpHistory> inviteMakeUpHistoryList;
|
||||
public bool isEditInviteCode = false;
|
||||
public decimal webViewMakeUpOnlineTime;
|
||||
public decimal webViewADTaskOnlineTime;
|
||||
public bool isShowRewardFly101 = false;
|
||||
public bool isShowRewardFly102 = false;
|
||||
|
||||
public decimal playReawrd111;
|
||||
public bool isShowRewardFly111 = false;
|
||||
public int openRewardCount = 0;
|
||||
public int interRewardShowLevel = -1;
|
||||
public bool isShowOpenReward = false;
|
||||
public bool isRealProcessing;
|
||||
public int realWatchVideo;
|
||||
public bool isClickH5Icon;
|
||||
public long lastClickMainIconTime;
|
||||
public int interH5Url1Count;
|
||||
public int interH5Url2Count;
|
||||
public List<int> makeupSatisfyGears;
|
||||
public int makeupRealReportGear;
|
||||
public bool isLastH5Tab;
|
||||
public long nextOpenWheelStampTime;
|
||||
public long adChFlyShowTime;
|
||||
public List<AdTaskData> adTaskDataList;
|
||||
public int adTaskCount;
|
||||
public int correctAnswerCount;
|
||||
public List<bool> achievementAnswerList;
|
||||
public int h5StayTime;
|
||||
public int videoWatchCount;
|
||||
public int signInCount;
|
||||
public List<bool> achievementSignInList;
|
||||
public int inviteCount;
|
||||
public bool naiveStepFinish;
|
||||
public List<MakeupTaskData> makeupTaskHistory;
|
||||
public decimal makeupTaskH5Time;
|
||||
public bool makeupConditionMark;
|
||||
public Dictionary<string, bool> statisticDictionary;
|
||||
public Saveobject saveobject;
|
||||
// public string levelData; // 关卡数据
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5c96714641282bd4599d9910970cc804
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,210 @@
|
||||
using FairyGUI;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
namespace FlowerPower
|
||||
{
|
||||
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,
|
||||
GameWin,
|
||||
H5Icon,
|
||||
LuckyWheel,
|
||||
SignIn,
|
||||
AdTask,
|
||||
Play,
|
||||
Achievement,
|
||||
H5Fly101,
|
||||
H5Fly102,
|
||||
Passview,
|
||||
}
|
||||
|
||||
public enum RewardCondition
|
||||
{
|
||||
None,
|
||||
AD,
|
||||
}
|
||||
|
||||
|
||||
public class RewardSingleData
|
||||
{
|
||||
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 int index;
|
||||
|
||||
public RewardSingleData(int id, decimal value, RewardOrigin origin, int index = 0)
|
||||
{
|
||||
this.id = id;
|
||||
this.value = value;
|
||||
this.origin = origin;
|
||||
this.index = index;
|
||||
InitData();
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
return id == 101 || id == 102 || id == 111 || id == 112;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class RewardData
|
||||
{
|
||||
private List<RewardSingleData> rewardDataList;
|
||||
|
||||
public RewardDisplayType displayType;
|
||||
|
||||
public RewardCondition condition;
|
||||
|
||||
private Action<bool> mOnCompleted;
|
||||
|
||||
public bool isSingle;
|
||||
|
||||
public decimal ctRate;
|
||||
|
||||
public RewardData()
|
||||
{
|
||||
InitData();
|
||||
}
|
||||
|
||||
public void AddCompleted(Action<bool> onCompleted)
|
||||
{
|
||||
mOnCompleted += onCompleted;
|
||||
}
|
||||
|
||||
|
||||
public void OnCompleted(bool isSuccess)
|
||||
{
|
||||
mOnCompleted?.Invoke(isSuccess);
|
||||
}
|
||||
|
||||
public void AddReward(RewardSingleData rewardSingleData)
|
||||
{
|
||||
rewardDataList ??= new List<RewardSingleData>();
|
||||
|
||||
var isNeedAdd = true;
|
||||
|
||||
foreach (var data in rewardDataList.Where(data => data.id == rewardSingleData.id))
|
||||
{
|
||||
data.value += rewardSingleData.value;
|
||||
isNeedAdd = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (isNeedAdd)
|
||||
{
|
||||
rewardDataList.Add(rewardSingleData);
|
||||
}
|
||||
}
|
||||
|
||||
private void InitData()
|
||||
{
|
||||
if (rewardDataList != null)
|
||||
{
|
||||
rewardDataList.Clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
rewardDataList = new List<RewardSingleData>();
|
||||
}
|
||||
}
|
||||
|
||||
public List<RewardSingleData> 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:
|
||||
@@ -0,0 +1,90 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace FlowerPower
|
||||
{
|
||||
public class RewardDisplayData
|
||||
{
|
||||
public RewardSingleData rewardSingleData;
|
||||
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 RewardDisplayData(RewardSingleData rewardSingleData)
|
||||
{
|
||||
this.rewardSingleData = rewardSingleData;
|
||||
showValue = rewardSingleData.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:
|
||||
Reference in New Issue
Block a user