好感度第一次提交

dev_chengFeng
jiaoyangna 2021-09-14 14:45:22 +08:00
parent 982e0c5268
commit d9c2f3451b
7 changed files with 124 additions and 1 deletions

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: eb33b6aa680ee2e48a5d43d52ea63a4b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -199,6 +199,8 @@ local ManagerNames = {
--!!!!红点管理(尽量放在最后)!!!!--
"Story/StoryMapManager",
"linglongbaojing/LingLongBaoJingManager",
--好感度
"Likability/LikabilityManager",
"Player/RedpotManager",
}

View File

@ -216,6 +216,7 @@ ConfigName = {
LingLongPool = "LingLongPool",
SurpriseBoxConfig = "SurpriseBox",
JourneyWithWind = "JourneyWithWind",
LikeAbility = "LikeAbility",
}
require "Framework/GameDataBase"

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e872869a7f88682428365af619e5272b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,95 @@
LikabilityManager = {}
local this = LikabilityManager
function this.Initialize()
this.AllHeroDataLikAbility = {}
this.HeroLvList = {}
this.TotalLvList = {}
end
function this.InitializeTableData()
for k,v in ConfigPairs(ConfigManager.GetConfig(ConfigName.LikeAbility))
end
function this.UpdateAllBackData(msg)
for i = 1,#msg.heros do
this.UpdatelBackData(msg.heros[i].heroId,msg.heros[i].value)
end
end
function this.UpdatelBackData(heroId,value)
if not this.AllHeroDataLikAbility[heroId] then
this.AllHeroDataLikAbility[heroId] = {}
end
this.AllHeroDataLikAbility[heroId].value = value
this.AllHeroDataLikAbility[heroId].likeLv = this.GetHeroLikeLv(value)
end
function this.GetTotalHeroLikeLv()
local totalCurNum = 0
for k,v in pairs(this.AllHeroDataLikAbility) do
totalCurNum = totalCurNum + v.value
end
local totalLv,totalNum = this.GetLv(1,totalCurNum)
return totalCurNum,totalLv,totalNum
end
--indexType 1 获取总好感度等级 2获取单个神将好感度等级
function this.GetLv(indexType,value)
local list = {}
if indexType == 1 then
list = this.TotalLvList
else
list = this.HeroLvList
end
for i = 1,#list do
if not list[i].value or list[i].value <= 0 or value < list[i].value then
return list[i].lv,list[i].value
end
end
end
--indexType 1 获取总好感度属性 2获取单个神将好感度属性
--index -1 获取累加的好感度属性 其他 获取某级的好感度属性
--lv 累加到某级
function this.GetProData(indexType,index,lv)
local list = {}
if indexType == 1 then
list = this.TotalLvList
else
list = this.HeroLvList
end
for _,n in ipairs(list) do
if not heroSkinAllHeroProVal[n[1]] then
heroSkinAllHeroProVal[n[1]] = 0
end
heroSkinAllHeroProVal[n[1]] = heroSkinAllHeroProVal[n[1]] + n[2]
end
end
function this.GetTotalForce(heroData)
local SingleProVal = {}
local AllHeroProVal = {}
local lv,totalNum = 0,0
if this.AllHeroDataLikAbility[heroData.id] then
lv,totalNum = this.GetLv(2,this.AllHeroDataLikAbility[heroData.id].value)
SingleProVal = this.GetProData(2,-1,lv)
end
local totalCurNum,totalLv,totalNum = this.GetTotalHeroLikeLv()
AllHeroProVal = this.GetProData(1,-1,lv)
for _,v in pairs(this.skinDatas) do
if heroData.skinId ~= v.id then
if this.skinDatas[v.id] and this.skinDatas[v.id].UnlockProperty and #this.skinDatas[v.id].UnlockProperty > 0 then
end
end
end
return heroSkinSingleProVal, heroSkinAllHeroProVal
end
function this.CheckRedPot()
end
return this

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 4023d5f294e8d3941be2354ba51c5b21
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -23,6 +23,7 @@ namespace GameEditor.FrameTool
string addKey;
string targetPath;
int index;
Vector2 scrollPos;
// Add menu named "My Window" to the Window menu
[MenuItem("Build/Config")]
static void Init()
@ -76,12 +77,13 @@ namespace GameEditor.FrameTool
SetConfigData(sr.ReadToEnd());
}
EditorGUILayout.EndHorizontal();
scrollPos = EditorGUILayout.BeginScrollView(scrollPos, false,true);
if (dic != null && dic.Count > 0)
{
index = 0;
RefreshWindowShow2(dic);
}
EditorGUILayout.EndScrollView();
EditorGUILayout.BeginHorizontal();
targetPath = GUILayout.TextArea(targetPath);
if (GUILayout.Button("Brown", GUILayout.ExpandWidth(false)))