boss 提交
parent
b3fac6731e
commit
db5dbbf700
|
|
@ -1,5 +1,100 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &41390864946974133
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1674928087596347695}
|
||||
- component: {fileID: 3273262054332790659}
|
||||
- component: {fileID: 1641927487149379558}
|
||||
- component: {fileID: 6947017730827442480}
|
||||
m_Layer: 5
|
||||
m_Name: icon
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1674928087596347695
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 41390864946974133}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 5562965766551207654}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &3273262054332790659
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 41390864946974133}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &1641927487149379558
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 41390864946974133}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 0
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
|
||||
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
m_Sprite: {fileID: 21300000, guid: 5341503cbcd7cd54a9f1cac2364cffef, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
--- !u!114 &6947017730827442480
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 41390864946974133}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 1679637790, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_IgnoreLayout: 0
|
||||
m_MinWidth: -1
|
||||
m_MinHeight: -1
|
||||
m_PreferredWidth: 75
|
||||
m_PreferredHeight: 75
|
||||
m_FlexibleWidth: -1
|
||||
m_FlexibleHeight: -1
|
||||
m_LayoutPriority: 1
|
||||
--- !u!1 &111316968386865160
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -810,6 +905,82 @@ MonoBehaviour:
|
|||
m_Calls: []
|
||||
m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
|
||||
Culture=neutral, PublicKeyToken=null
|
||||
--- !u!1 &3219225128960542539
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 5562965766551207654}
|
||||
- component: {fileID: 5149688219218794396}
|
||||
- component: {fileID: 7138683243361003100}
|
||||
m_Layer: 5
|
||||
m_Name: layout
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &5562965766551207654
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3219225128960542539}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 0.99978995, y: 0.99978995, z: 0.99978995}
|
||||
m_Children:
|
||||
- {fileID: 1674928087596347695}
|
||||
- {fileID: 479749012021978643}
|
||||
m_Father: {fileID: 4107591401879039839}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0.37497807, y: 0.5}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &5149688219218794396
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3219225128960542539}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: -405508275, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Padding:
|
||||
m_Left: 0
|
||||
m_Right: 0
|
||||
m_Top: 0
|
||||
m_Bottom: 0
|
||||
m_ChildAlignment: 4
|
||||
m_Spacing: 0
|
||||
m_ChildForceExpandWidth: 1
|
||||
m_ChildForceExpandHeight: 0
|
||||
m_ChildControlWidth: 1
|
||||
m_ChildControlHeight: 1
|
||||
--- !u!114 &7138683243361003100
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3219225128960542539}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 1741964061, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_HorizontalFit: 2
|
||||
m_VerticalFit: 2
|
||||
--- !u!1 &3365572594122376224
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -1483,6 +1654,85 @@ MonoBehaviour:
|
|||
m_LineSpacing: 1
|
||||
m_Text: "\u8C01\u8C01\u8C01\u8C01\u8C01"
|
||||
LanguageIndex: 11096
|
||||
--- !u!1 &7113542421379039402
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 479749012021978643}
|
||||
- component: {fileID: 7168286033210327038}
|
||||
- component: {fileID: 4954469749930636233}
|
||||
m_Layer: 5
|
||||
m_Name: num
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &479749012021978643
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7113542421379039402}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 5562965766551207654}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &7168286033210327038
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7113542421379039402}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &4954469749930636233
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7113542421379039402}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.21960784, g: 0.14901961, b: 0, a: 1}
|
||||
m_RaycastTarget: 0
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
|
||||
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
m_FontData:
|
||||
m_Font: {fileID: 12800000, guid: 4b73e9e4512d17e4daeea351e090d33c, type: 3}
|
||||
m_FontSize: 48
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 0
|
||||
m_MinSize: 3
|
||||
m_MaxSize: 48
|
||||
m_Alignment: 4
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 1
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: 200
|
||||
--- !u!1 &7171890179328870863
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -2123,6 +2373,7 @@ RectTransform:
|
|||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 6785485563758215467}
|
||||
- {fileID: 5562965766551207654}
|
||||
m_Father: {fileID: 7555683376229264185}
|
||||
m_RootOrder: 3
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
|
|
|
|||
|
|
@ -4515,4 +4515,18 @@ function this.JourneyDoResponse(func)
|
|||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function this.StartXiaoyaoBossFightRequest(index)
|
||||
local data = MapInfoProto_pb.JourneyFightRequest()
|
||||
data.monsterIndex = index
|
||||
local msg = data:SerializeToString()
|
||||
-- Network:SendMessageWithCallBack(MessageTypeProto_pb.JOURNEY_DO_REQUEST, MessageTypeProto_pb.JOURNEY_DO_RESPONSE, msg, function(buffer)
|
||||
-- local data = buffer:DataByte()
|
||||
-- local msg = MapInfoProto_pb.JourneyGetInfoResponse()
|
||||
-- msg:ParseFromString(data)
|
||||
-- if func then
|
||||
-- func(msg)
|
||||
-- end
|
||||
-- end)
|
||||
end
|
||||
return this
|
||||
|
|
@ -14,6 +14,10 @@ local ArtConfig = ConfigManager.GetConfig(ConfigName.ArtResourcesConfig)
|
|||
|
||||
local monsterGroupPrefabs = {}
|
||||
local rewardPrefabs = {}
|
||||
local costId = 0
|
||||
local costNum = 0
|
||||
|
||||
local fightBossIndex = 0
|
||||
function XiaoYaoLuckyBossPopup:InitComponent()
|
||||
this.root = self.gameObject
|
||||
this.btnBack =Util.GetGameObject(this.root,"Panel/bg/btnBack")
|
||||
|
|
@ -22,13 +26,15 @@ function XiaoYaoLuckyBossPopup:InitComponent()
|
|||
this.e_liveRoot=Util.GetGameObject(this.root,"Panel/EnemyInfo/liveRoot")
|
||||
this.e_name=Util.GetGameObject(this.root,"Panel/EnemyInfo/name/text"):GetComponent("Text")
|
||||
this.e_level=Util.GetGameObject(this.root,"Panel/EnemyInfo/name/level/Text"):GetComponent("Text")
|
||||
this.hp = Util.GetGameObject(this.root,"Panel/EnemyInfo/hp/Image"):GetComponent("Image")
|
||||
|
||||
this.e_fightBtn=Util.GetGameObject(this.root,"Panel/EnemyInfo/fight")
|
||||
this.heroList=Util.GetGameObject(this.root,"Panel/EnemyInfo/Scroll/heroList")
|
||||
this.rewardList=Util.GetGameObject(this.root,"Panel/EnemyInfo/rewardScroll/rewardList")
|
||||
this.iconPre=Util.GetGameObject(this.root,"Panel/EnemyInfo/Scroll/pre")
|
||||
end
|
||||
|
||||
this.timeText = Util.GetGameObject(this.root,"Panel/EnemyInfo/remainTime"):GetComponent("Text")
|
||||
end
|
||||
|
||||
function XiaoYaoLuckyBossPopup:BindEvent()
|
||||
Util.AddClick(this.btnBack,function()
|
||||
|
|
@ -36,22 +42,64 @@ function XiaoYaoLuckyBossPopup:BindEvent()
|
|||
end)
|
||||
|
||||
Util.AddClick(this.e_fightBtn,function()
|
||||
|
||||
if BagManager.GetItemCountById(costId) < costNum then
|
||||
PopupTipPanel.ShowTip("消耗道具不足")
|
||||
else
|
||||
XiaoYaoManager.ExecuteFightBattle(curMonsterGroup.monsterIndex,function()
|
||||
fightBossIndex = curMonsterGroup.monsterIndex
|
||||
this:OnShow()
|
||||
end)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
function XiaoYaoLuckyBossPopup:OnOpen()
|
||||
|
||||
local config = ConfigManager.GetConfigDataByKey(ConfigName.FreeTravel,"MapID",XiaoYaoManager.curMapId)
|
||||
costId = config.BossConsume[1]
|
||||
costNum = config.BossConsume[2]
|
||||
end
|
||||
|
||||
function XiaoYaoLuckyBossPopup:OnShow()
|
||||
monsterGroup = XiaoYaoManager.GetMonsterDatas()
|
||||
curMonsterGroup = monsterGroup[1]
|
||||
this:RefreshMonsterList()
|
||||
this:SetSelectHero()
|
||||
if fightBossIndex == 0 then
|
||||
curMonsterGroup = monsterGroup[1]
|
||||
else
|
||||
local isExist = false
|
||||
for i = 1,#monsterGroup do
|
||||
if monsterGroup[i].monsterIndex == fightBossIndex then
|
||||
curMonsterGroup = monsterGroup[i]
|
||||
isExist = true
|
||||
break
|
||||
end
|
||||
end
|
||||
if not isExist then
|
||||
curMonsterGroup = monsterGroup[1]
|
||||
end
|
||||
end
|
||||
|
||||
this:InitMonsterList()
|
||||
this:SetSelectHero(curMonsterGroup)
|
||||
this:TimerDown()
|
||||
end
|
||||
|
||||
function this:TimerDown()
|
||||
if this.Timer then
|
||||
this.timer:Stop()
|
||||
this.timer = nil
|
||||
end
|
||||
local timeDown = curMonsterGroup.remainTime
|
||||
this.timeText.text = "剩余时间:"..TimeToHMS(timeDown)
|
||||
this.timer = Timer.New(function()
|
||||
if timeDown < 1 then
|
||||
this:OnShow()
|
||||
return
|
||||
end
|
||||
timeDown = timeDown - 1
|
||||
this.timeText.text = "剩余时间:"..TimeToHMS(timeDown)
|
||||
end, 1, -1, true)
|
||||
self.timer:Start()
|
||||
end
|
||||
function this:InitMonsterList()
|
||||
for i = 1 ,#monsterGroupPrefabs do
|
||||
monsterGroupPrefabs[i].gameObject:SetActive(false)
|
||||
|
|
@ -64,94 +112,56 @@ function this:InitMonsterList()
|
|||
this:SetSingleMonster(monsterGroupPrefabs[i],monsterGroup[1])
|
||||
end
|
||||
end
|
||||
|
||||
function XiaoYaoLuckyBossPopup:SetSingleMonster(go,data)
|
||||
local frame = Util.GetGameObject(go,"frame"):GetComponent("Image")
|
||||
local icon = Util.GetGameObject(go,"icon"):GetComponent("Image")
|
||||
local lv = Util.GetGameObject(go,"lv/Text"):GetComponent("Text")
|
||||
local choosed = Util.GetGameObject(go,"choosed")
|
||||
local _data = monsterGroup[data.monsterId]
|
||||
local _data = MonsterConfig[data.monsterId]
|
||||
frame.sprite = Util.LoadSprite("")
|
||||
icon.sprite = Util.LoadSprite("")
|
||||
icon.sprite = Util.LoadSprite(GetResourcePath(heroConfig[_data.MonsterId].Icon))
|
||||
lv.text = _data.Level
|
||||
if data.monsterIndex == curMonsterGroup.monsterIndex then
|
||||
Util.GetGameObject(go,"choosed"):SetActive(true)
|
||||
else
|
||||
Util.GetGameObject(go,"choosed"):SetActive(false)
|
||||
end
|
||||
Util.AddOnceClick(go,function()
|
||||
if curMonsterGroup.monsterId == data.monsterId then
|
||||
else
|
||||
this:SetSelectHero()
|
||||
curMonsterGroup = data
|
||||
this:SetSelectHero(data)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function XiaoYaoLuckyBossPopup:SetSelectHero()
|
||||
local itemId = 10001
|
||||
local itemNum = 1
|
||||
|
||||
local t = MonsterGroupConfig[monsterGroupId].Contents[1][2]
|
||||
local monsterId = MonsterConfig[t].MonsterId
|
||||
function XiaoYaoLuckyBossPopup:SetSelectHero(monsterData)
|
||||
local _data = MonsterConfig[monsterData.monsterId]
|
||||
local monsterId = _data.MonsterId
|
||||
local paintingId = heroConfig[monsterId].Live
|
||||
local pos = heroConfig[monsterId].Position
|
||||
|
||||
_LiveName = ArtConfig[paintingId].Name
|
||||
_LiveNode = poolManager:LoadLive(_LiveName, this.e_liveRoot.transform, Vector3.one * heroConfig[monsterId].Scale*0.7, Vector3.New(pos[1], pos[2], 0))
|
||||
this.e_level.text = "lv."..MonsterConfig[t].Level
|
||||
this.e_name.text = MonsterConfig[t].ReadingName
|
||||
this.e_level.text = "lv.".. _data.Level
|
||||
this.e_name.text = _data.ReadingName
|
||||
this.hp.fillAmount = monsterData.monsterHp/_data.Hp
|
||||
|
||||
local d={}
|
||||
d = {}--MapManager.trialHeroInfo
|
||||
for k = 1, this.heroGrid.transform.childCount do
|
||||
this.heroGrid.transform:GetChild(k-1).gameObject:SetActive(false)
|
||||
if monsterData.attackNum > 0 then
|
||||
Util.GetGameObject(this.e_fightBtn,"Text").gameObject:SetActive(false)
|
||||
Util.GetGameObject(this.e_fightBtn,"layout").gameObject:SetActive(true)
|
||||
else
|
||||
Util.GetGameObject(this.e_fightBtn,"Text").gameObject:SetActive(true)
|
||||
Util.GetGameObject(this.e_fightBtn,"layout").gameObject:SetActive(false)
|
||||
end
|
||||
local closeChoosed=function() --有开着选择的全关了
|
||||
for i, v in ipairs(herosList) do
|
||||
local c=Util.GetGameObject(v,"choosed").gameObject
|
||||
if c.activeSelf then
|
||||
c:SetActive(false)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for index, value in ipairs(d) do
|
||||
local item = herosList[index]
|
||||
if not item then
|
||||
item=newObjToParent(this.iconPre,this.heroGrid)
|
||||
item.name="pre"..index
|
||||
herosList[index]=item
|
||||
end
|
||||
item.gameObject:SetActive(true)
|
||||
|
||||
local frame=Util.GetGameObject(item,"frame"):GetComponent("Image")
|
||||
local icon=Util.GetGameObject(item,"icon"):GetComponent("Image")
|
||||
local pro=Util.GetGameObject(item,"proIcon"):GetComponent("Image")
|
||||
local lv=Util.GetGameObject(item,"lv/Text"):GetComponent("Text")
|
||||
local star=Util.GetGameObject(item,"star")
|
||||
local choosed=Util.GetGameObject(item,"choosed")
|
||||
local hpExp=Util.GetGameObject(item,"hpExp"):GetComponent("Slider")
|
||||
frame.sprite=Util.LoadSprite(GetHeroQuantityImageByquality(heroConfig[value.tmpId].Quality,value.star))
|
||||
icon.sprite= Util.LoadSprite(GetResourcePath(heroConfig[value.tmpId].Icon))
|
||||
pro.sprite=Util.LoadSprite(GetProStrImageByProNum(heroConfig[value.tmpId].PropertyName))
|
||||
lv.text=value.level
|
||||
SetHeroStars(star, value.star)
|
||||
|
||||
--选择
|
||||
choosed:SetActive(MapTrialManager.selectHeroDid==value.heroId)
|
||||
|
||||
Util.AddOnceClick(item,function()
|
||||
if value.heroHp>0 then
|
||||
closeChoosed()
|
||||
choosed:SetActive(true)
|
||||
MapTrialManager.selectHeroDid=value.heroId
|
||||
Game.GlobalEvent:DispatchEvent(GameEvent.Map.RefreshHeroHp,false,nil,false)
|
||||
else
|
||||
PopupTipPanel.ShowTip(Language[11247])
|
||||
end
|
||||
end)
|
||||
|
||||
--血量相关
|
||||
hpExp.value=value.heroHp/10000
|
||||
Util.SetGray(item,value.heroHp<=0)--死啦
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function XiaoYaoLuckyBossPopup:SetSelectKuang()
|
||||
for i = 1 ,#monsterGroupPrefabs do
|
||||
Util.GetGameObject(monsterGroupPrefabs[i],"choosed"):SetActive(true)
|
||||
end
|
||||
end
|
||||
|
||||
function this:OnClose()
|
||||
|
||||
|
|
@ -160,6 +170,5 @@ end
|
|||
function this:OnDestroy()
|
||||
_LiveName = {}
|
||||
_LiveNode = {}
|
||||
herosList={}
|
||||
end
|
||||
return this
|
||||
|
|
@ -8,6 +8,7 @@ this.MonsterData={}
|
|||
this.luckyTurnTableRewards={}
|
||||
this.luckyluckyTurnTableTimes = 0
|
||||
this.luckyluckyTurnTableRemainTime = 0
|
||||
|
||||
--打开逍遥游地图列表界面
|
||||
function this.OpenMapList()
|
||||
Log("点击打开逍遥游地图列表界面")
|
||||
|
|
@ -130,4 +131,35 @@ function this.GetMonsterDataReMainTimesAndTime()
|
|||
return #this.MonsterData,this.MonsterData[#this.MonsterData].remainTime
|
||||
end
|
||||
|
||||
--开始战斗
|
||||
function this.ExecuteFightBattle(id,func)
|
||||
NetManager.StartXiaoyaoBossFightRequest(id,function(msg)
|
||||
local fightData = BattleManager.GetBattleServerData(msg,0)
|
||||
UIManager.OpenPanel(UIName.BattlePanel, fightData, BATTLE_TYPE.DAILY_CHALLENGE,function(result)
|
||||
if func then
|
||||
func()
|
||||
end
|
||||
if result.result == 0 then
|
||||
if this.levelData[this.curType].state == 1 then
|
||||
UIManager.OpenPanel(UIName.XuanYuanMirrorPanelList,this.curType)
|
||||
else
|
||||
UIManager.OpenPanel(UIName.XuanYuanMirrorPanel)
|
||||
end
|
||||
elseif result.result == 1 then
|
||||
this.levelData[this.curType].passId = id
|
||||
this.UpdateLevelState(this.curType)
|
||||
PrivilegeManager.RefreshPrivilegeUsedTimes(XuanYuanMirrorManager.freeTimeId, 1)
|
||||
CheckRedPointStatus(RedPointType.People_Mirror)
|
||||
if this.levelData[this.curType].state == 1 then
|
||||
UIManager.OpenPanel(UIName.XuanYuanMirrorPanelList,this.curType)
|
||||
else
|
||||
UIManager.OpenPanel(UIName.XuanYuanMirrorPanel)
|
||||
end
|
||||
UIManager.OpenPanel(UIName.RewardItemPopup,msg.drop,1,function()
|
||||
end)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
return XiaoYaoManager
|
||||
Loading…
Reference in New Issue