骰子动画添加提交

dev_chengFeng
yuanshuai 2020-10-19 22:54:59 +08:00 committed by gaoxin
parent dc7e1c71d4
commit 0d4fd1a210
2 changed files with 381 additions and 5 deletions

View File

@ -728,6 +728,52 @@ MonoBehaviour:
m_FillClockwise: 1 m_FillClockwise: 1
m_FillOrigin: 0 m_FillOrigin: 0
m_UseSpriteMesh: 0 m_UseSpriteMesh: 0
--- !u!1 &876457167420865555
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6126398177057970904}
- component: {fileID: 1920429032850328804}
m_Layer: 5
m_Name: saizi
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &6126398177057970904
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 876457167420865555}
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:
- {fileID: 173527053000100168}
- {fileID: 8780209107040953725}
m_Father: {fileID: 1553045991312230259}
m_RootOrder: 12
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, y: 0}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1920429032850328804
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 876457167420865555}
m_CullTransparentMesh: 0
--- !u!1 &1037681890400423105 --- !u!1 &1037681890400423105
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -2302,6 +2348,7 @@ RectTransform:
- {fileID: 913146193029197762} - {fileID: 913146193029197762}
- {fileID: 1079501476154741580} - {fileID: 1079501476154741580}
- {fileID: 7264092185449797515} - {fileID: 7264092185449797515}
- {fileID: 6126398177057970904}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -2374,7 +2421,7 @@ GameObject:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 m_IsActive: 0
--- !u!224 &1079501476154741580 --- !u!224 &1079501476154741580
RectTransform: RectTransform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -4915,3 +4962,299 @@ MonoBehaviour:
m_Calls: [] m_Calls: []
m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null Culture=neutral, PublicKeyToken=null
--- !u!1001 &2011506373053754990
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 6126398177057970904}
m_Modifications:
- target: {fileID: 1838088278565218087, guid: e4e089a61b4a5474694de1035e1458d3,
type: 3}
propertyPath: m_Name
value: UI_Effect_ShaiZi_Dan
objectReference: {fileID: 0}
- target: {fileID: 1838088278565218087, guid: e4e089a61b4a5474694de1035e1458d3,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1838088278565218086, guid: e4e089a61b4a5474694de1035e1458d3,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1838088278565218086, guid: e4e089a61b4a5474694de1035e1458d3,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1838088278565218086, guid: e4e089a61b4a5474694de1035e1458d3,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1838088278565218086, guid: e4e089a61b4a5474694de1035e1458d3,
type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 1838088278565218086, guid: e4e089a61b4a5474694de1035e1458d3,
type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 1838088278565218086, guid: e4e089a61b4a5474694de1035e1458d3,
type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 1838088278565218086, guid: e4e089a61b4a5474694de1035e1458d3,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1838088278565218086, guid: e4e089a61b4a5474694de1035e1458d3,
type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1838088278565218086, guid: e4e089a61b4a5474694de1035e1458d3,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1838088278565218086, guid: e4e089a61b4a5474694de1035e1458d3,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1838088278565218086, guid: e4e089a61b4a5474694de1035e1458d3,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1838088278565218086, guid: e4e089a61b4a5474694de1035e1458d3,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1838088278565218086, guid: e4e089a61b4a5474694de1035e1458d3,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -120
objectReference: {fileID: 0}
- target: {fileID: 1838088278565218086, guid: e4e089a61b4a5474694de1035e1458d3,
type: 3}
propertyPath: m_SizeDelta.x
value: 100
objectReference: {fileID: 0}
- target: {fileID: 1838088278565218086, guid: e4e089a61b4a5474694de1035e1458d3,
type: 3}
propertyPath: m_SizeDelta.y
value: 100
objectReference: {fileID: 0}
- target: {fileID: 1838088278565218086, guid: e4e089a61b4a5474694de1035e1458d3,
type: 3}
propertyPath: m_AnchorMin.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 1838088278565218086, guid: e4e089a61b4a5474694de1035e1458d3,
type: 3}
propertyPath: m_AnchorMin.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 1838088278565218086, guid: e4e089a61b4a5474694de1035e1458d3,
type: 3}
propertyPath: m_AnchorMax.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 1838088278565218086, guid: e4e089a61b4a5474694de1035e1458d3,
type: 3}
propertyPath: m_AnchorMax.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 1838088278565218086, guid: e4e089a61b4a5474694de1035e1458d3,
type: 3}
propertyPath: m_Pivot.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 1838088278565218086, guid: e4e089a61b4a5474694de1035e1458d3,
type: 3}
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 1838088278565218086, guid: e4e089a61b4a5474694de1035e1458d3,
type: 3}
propertyPath: m_LocalScale.x
value: 2.5
objectReference: {fileID: 0}
- target: {fileID: 1838088278565218086, guid: e4e089a61b4a5474694de1035e1458d3,
type: 3}
propertyPath: m_LocalScale.y
value: 2.5
objectReference: {fileID: 0}
- target: {fileID: 1838088278565218086, guid: e4e089a61b4a5474694de1035e1458d3,
type: 3}
propertyPath: m_LocalScale.z
value: 2.5
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: e4e089a61b4a5474694de1035e1458d3, type: 3}
--- !u!224 &173527053000100168 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 1838088278565218086, guid: e4e089a61b4a5474694de1035e1458d3,
type: 3}
m_PrefabInstance: {fileID: 2011506373053754990}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &7199940856004549292
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 6126398177057970904}
m_Modifications:
- target: {fileID: 1887788510764236752, guid: 5f528ad4fe1865e4e874f4f5a6472364,
type: 3}
propertyPath: m_Name
value: UI_Effect_ShaiZi_Shuang
objectReference: {fileID: 0}
- target: {fileID: 1887788510764236752, guid: 5f528ad4fe1865e4e874f4f5a6472364,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1887788510764236753, guid: 5f528ad4fe1865e4e874f4f5a6472364,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1887788510764236753, guid: 5f528ad4fe1865e4e874f4f5a6472364,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1887788510764236753, guid: 5f528ad4fe1865e4e874f4f5a6472364,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1887788510764236753, guid: 5f528ad4fe1865e4e874f4f5a6472364,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1887788510764236753, guid: 5f528ad4fe1865e4e874f4f5a6472364,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1887788510764236753, guid: 5f528ad4fe1865e4e874f4f5a6472364,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1887788510764236753, guid: 5f528ad4fe1865e4e874f4f5a6472364,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1887788510764236753, guid: 5f528ad4fe1865e4e874f4f5a6472364,
type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1887788510764236753, guid: 5f528ad4fe1865e4e874f4f5a6472364,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1887788510764236753, guid: 5f528ad4fe1865e4e874f4f5a6472364,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1887788510764236753, guid: 5f528ad4fe1865e4e874f4f5a6472364,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1887788510764236753, guid: 5f528ad4fe1865e4e874f4f5a6472364,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1887788510764236753, guid: 5f528ad4fe1865e4e874f4f5a6472364,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1887788510764236753, guid: 5f528ad4fe1865e4e874f4f5a6472364,
type: 3}
propertyPath: m_SizeDelta.x
value: 100
objectReference: {fileID: 0}
- target: {fileID: 1887788510764236753, guid: 5f528ad4fe1865e4e874f4f5a6472364,
type: 3}
propertyPath: m_SizeDelta.y
value: 100
objectReference: {fileID: 0}
- target: {fileID: 1887788510764236753, guid: 5f528ad4fe1865e4e874f4f5a6472364,
type: 3}
propertyPath: m_AnchorMin.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 1887788510764236753, guid: 5f528ad4fe1865e4e874f4f5a6472364,
type: 3}
propertyPath: m_AnchorMin.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 1887788510764236753, guid: 5f528ad4fe1865e4e874f4f5a6472364,
type: 3}
propertyPath: m_AnchorMax.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 1887788510764236753, guid: 5f528ad4fe1865e4e874f4f5a6472364,
type: 3}
propertyPath: m_AnchorMax.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 1887788510764236753, guid: 5f528ad4fe1865e4e874f4f5a6472364,
type: 3}
propertyPath: m_Pivot.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 1887788510764236753, guid: 5f528ad4fe1865e4e874f4f5a6472364,
type: 3}
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 1887788510764236753, guid: 5f528ad4fe1865e4e874f4f5a6472364,
type: 3}
propertyPath: m_LocalScale.x
value: 2.5
objectReference: {fileID: 0}
- target: {fileID: 1887788510764236753, guid: 5f528ad4fe1865e4e874f4f5a6472364,
type: 3}
propertyPath: m_LocalScale.y
value: 2.5
objectReference: {fileID: 0}
- target: {fileID: 1887788510764236753, guid: 5f528ad4fe1865e4e874f4f5a6472364,
type: 3}
propertyPath: m_LocalScale.z
value: 2.5
objectReference: {fileID: 0}
- target: {fileID: 1887788512711656140, guid: 5f528ad4fe1865e4e874f4f5a6472364,
type: 3}
propertyPath: m_Sprite
value:
objectReference: {fileID: 21300000, guid: a264d23a006cab0489fd3c2fd48f2345,
type: 3}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 5f528ad4fe1865e4e874f4f5a6472364, type: 3}
--- !u!224 &8780209107040953725 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 1887788510764236753, guid: 5f528ad4fe1865e4e874f4f5a6472364,
type: 3}
m_PrefabInstance: {fileID: 7199940856004549292}
m_PrefabAsset: {fileID: 0}

View File

@ -20,6 +20,7 @@ local bossNum=0
local isPlayMove=0 local isPlayMove=0
local targetBtn local targetBtn
local costNum --每次摇骰子消耗道具数量 local costNum --每次摇骰子消耗道具数量
local saiziImage={"i_c_touzi01","i_c_touzi02","i_c_touzi03","i_c_touzi04","i_c_touzi05","i_c_touzi06"}
--初始化组件(用于子类重写) --初始化组件(用于子类重写)
function this:InitComponent() function this:InitComponent()
@ -70,6 +71,9 @@ function this:InitComponent()
this.helpBtn = Util.GetGameObject(self.gameObject, "helpBtn") this.helpBtn = Util.GetGameObject(self.gameObject, "helpBtn")
this.helpPosition=this.helpBtn:GetComponent("RectTransform").localPosition this.helpPosition=this.helpBtn:GetComponent("RectTransform").localPosition
this.oneSaiZiEffect=Util.GetGameObject(self.gameObject, "saizi/UI_Effect_ShaiZi_Dan")
this.twoSaiZiEffect=Util.GetGameObject(self.gameObject, "saizi/UI_Effect_ShaiZi_Shuang")
end end
@ -156,14 +160,14 @@ end
--添加事件监听(用于子类重写) --添加事件监听(用于子类重写)
function this:AddListener() function this:AddListener()
Game.GlobalEvent:AddEvent(GameEvent.XiaoYao.StartXiaoYao, this.RunMap) Game.GlobalEvent:AddEvent(GameEvent.XiaoYao.StartXiaoYao, this.PlaySaiziAnim)
Game.GlobalEvent:AddEvent(GameEvent.XiaoYao.RefreshEventShow, this.RefreshEventBtn) Game.GlobalEvent:AddEvent(GameEvent.XiaoYao.RefreshEventShow, this.RefreshEventBtn)
Game.GlobalEvent:AddEvent(GameEvent.XiaoYao.PlayEventEffect, this.PlayEffect) Game.GlobalEvent:AddEvent(GameEvent.XiaoYao.PlayEventEffect, this.PlayEffect)
end end
--移除事件监听(用于子类重写) --移除事件监听(用于子类重写)
function this:RemoveListener() function this:RemoveListener()
Game.GlobalEvent:RemoveEvent(GameEvent.XiaoYao.StartXiaoYao, this.RunMap) Game.GlobalEvent:RemoveEvent(GameEvent.XiaoYao.StartXiaoYao, this.PlaySaiziAnim)
Game.GlobalEvent:RemoveEvent(GameEvent.XiaoYao.RefreshEventShow, this.RefreshEventBtn) Game.GlobalEvent:RemoveEvent(GameEvent.XiaoYao.RefreshEventShow, this.RefreshEventBtn)
Game.GlobalEvent:RemoveEvent(GameEvent.XiaoYao.PlayEventEffect, this.PlayEffect) Game.GlobalEvent:RemoveEvent(GameEvent.XiaoYao.PlayEventEffect, this.PlayEffect)
end end
@ -192,10 +196,38 @@ function this.RefreshEventBtn()
rouleLeftTime=XiaoYaoManager.luckyluckyTurnTableRemainTime rouleLeftTime=XiaoYaoManager.luckyluckyTurnTableRemainTime
bossLeftTime,bossLeftTime=XiaoYaoManager.GetMonsterDataReMainTimesAndTime() bossLeftTime,bossLeftTime=XiaoYaoManager.GetMonsterDataReMainTimesAndTime()
end end
---播放骰子动效
function this.PlaySaiziAnim(_data)
this.startBtn:GetComponent("Button").enabled=false
Log("当前骰子数:"..#_data.pointes)
if #_data.pointes>1 then
this.twoSaiZiEffect:SetActive(true)
else
this.oneSaiZiEffect:SetActive(true)
end
if priThread then
coroutine.stop(priThread)
priThread = nil
end
priThread = coroutine.start(function()
coroutine.wait(1)
Log("当前点数aaaa".._data.pointes[1])
if #_data.pointes>1 then
Util.GetGameObject(this.twoSaiZiEffect, "GameObject/fx_ui_Effect_ShaiZi/gaizi_1/shaizi"):GetComponent("Image").sprite=Util.LoadSprite(saiziImage[_data.pointes[1]])
Util.GetGameObject(this.twoSaiZiEffect, "GameObject (1)/fx_ui_Effect_ShaiZi/gaizi_1/shaizi"):GetComponent("Image").sprite=Util.LoadSprite(saiziImage[_data.pointes[2]])
else
Util.GetGameObject(this.oneSaiZiEffect, "gaizi_1/shaizi"):GetComponent("Image").sprite=Util.LoadSprite(saiziImage[_data.pointes[1]])
end
coroutine.wait(1)
this.oneSaiZiEffect:SetActive(false)
this.twoSaiZiEffect:SetActive(false)
this.RunMap(_data)
end)
end
--开始跑图 --开始跑图
function this.RunMap(_data) function this.RunMap(_data)
this.UpdateYunYouVleShow() this.UpdateYunYouVleShow()
this.startBtn:GetComponent("Button").enabled=false
Log("开始跑图") Log("开始跑图")
local targetIndex=0 local targetIndex=0
for i = 1, #_data.pointes do for i = 1, #_data.pointes do
@ -573,6 +605,7 @@ function this:OnShow()
this.isStart:SetActive(false) this.isStart:SetActive(false)
isAutoRun=false isAutoRun=false
isPlayMove=0 isPlayMove=0
this.startBtn:GetComponent("Button").enabled=true
end end
function this:OnSortingOrderChange() function this:OnSortingOrderChange()