观战声音

master
罗家炜 2025-09-09 20:56:32 +08:00
parent 3522b980a4
commit e25cf38c56
6 changed files with 46 additions and 21 deletions

View File

@ -262,8 +262,9 @@ function M:EventInit()
info:UpdateHandCard() info:UpdateHandCard()
local outcard = UIPackage.CreateObjectFromURL(_gcm_outcard_url) local outcard = UIPackage.CreateObjectFromURL(_gcm_outcard_url)
info:UpdateOutCardList(outcard, card, self._cursor) info:UpdateOutCardList(outcard, card, self._cursor)
self:PlaySound("LiChuan_MJ", p.self_user.sex, tostring(card))
self:PlayMJSound("chupai.mp3") self:PlayMJSound("chupai.mp3")
self:PlaySound("LiChuan_MJ", p.self_user.sex, tostring(card))
if seat == _room.self_player.seat then if seat == _room.self_player.seat then
_room.curren_outcard_seat = -1 _room.curren_outcard_seat = -1
end end

View File

@ -38,7 +38,7 @@ function M:InitView()
UpdateBeat:Add(self.OnUpdate, self) UpdateBeat:Add(self.OnUpdate, self)
self.HuCardImg = setmetatable(HuCardImg, { __index = self.HuCardImg }) self.HuCardImg = setmetatable(HuCardImg, { __index = self.HuCardImg })
self.Sound_path = "extend/majiang/lichuan/sound/"
local centerBox = self._view:GetChild("Comp_ConterBox") local centerBox = self._view:GetChild("Comp_ConterBox")
self._ctr_cardbox = centerBox:GetController("seat") self._ctr_cardbox = centerBox:GetController("seat")
self._tex_leftTime = centerBox:GetChild("Text_Time") self._tex_leftTime = centerBox:GetChild("Text_Time")
@ -254,19 +254,14 @@ function M:EventInit()
local card = arg[2] local card = arg[2]
local seat = p.seat local seat = p.seat
local info = self._player_card_info[self:GetPos(seat)] local info = self._player_card_info[self:GetPos(seat)]
print("lingmeng witness OutCard1", self:GetPos(seat), info)
self:RemoveCursor() self:RemoveCursor()
print("lingmeng witness OutCard1-2")
info:UpdateHandCardWitness(false) info:UpdateHandCardWitness(false)
print("lingmeng witness OutCard2")
info:UpdateOutCardList(nil, nil, self._cursor) info:UpdateOutCardList(nil, nil, self._cursor)
print("ling 2zhihouq")
self:PlaySound("LiChuan_MJ", p.self_user.sex, tostring(card))
self:PlayMJSound("chupai.mp3") self:PlayMJSound("chupai.mp3")
print("ling 2zhihou") self:PlaySound("LiChuan_MJ", p.self_user.sex, tostring(card))
if seat == _room.self_player.seat then if seat == _room.self_player.seat then
_room.curren_outcard_seat = -1 _room.curren_outcard_seat = -1
end end
@ -334,11 +329,11 @@ function M:EventInit()
-- ↓↓↓先排列好特效图片 -- ↓↓↓先排列好特效图片
if HuMsg.type > 2 and HuMsg.type < 32 then if HuMsg.type > 2 and HuMsg.type < 32 then
-- local sound_name = string.format(self.Sound_path .. "%s/%s.mp3", local sound_name = string.format(self.Sound_path .. "%s/%s.mp3",
-- ViewUtil.Sex_Chat[player.self_user.sex], ViewUtil.Sex_Chat[player.self_user.sex],
-- "he" .. HuMsg.type) "he" .. HuMsg.type)
-- ViewUtil.PlaySound(self.asset_group, sound_name) ViewUtil.PlaySound(self.asset_group, sound_name)
self:PlaySound(self.asset_group, player.self_user.sex, "he" .. HuMsg.type) -- self:PlaySound(self.asset_group, player.self_user.sex, "he" .. HuMsg.type)
local imgList = self.HuCardImg[HuMsg.type] local imgList = self.HuCardImg[HuMsg.type]
for _, img in pairs(imgList) do for _, img in pairs(imgList) do
local imgPath = "ui://Main_Majiang/" .. img local imgPath = "ui://Main_Majiang/" .. img
@ -471,11 +466,6 @@ function M:InitPlayerInfoView()
end end
end end
local majiang_asset_path = "base/main_majiang/sound/"
function M:PlayMJSound(path)
ViewUtil.PlaySound(self.asset_group, majiang_asset_path .. path)
end
function M:NewMJPlayerCardInfoView(view, index) function M:NewMJPlayerCardInfoView(view, index)
return MJMainView.NewMJPlayerCardInfoView(self, view, index) return MJMainView.NewMJPlayerCardInfoView(self, view, index)
--[[ --[[

View File

@ -1,5 +1,7 @@
local WitnessView = require("Game.View.WitnessView") local WitnessView = require("Game.View.WitnessView")
local TableBG = require("Game.Data.TableBG") local TableBG = require("Game.Data.TableBG")
local HuCardImg = import(".HuCardImg")
local bg_config = { local bg_config = {
@ -12,7 +14,7 @@ local bg_config = {
local M = {} local M = {}
setmetatable(M, { __index = WitnessView }) setmetatable(M, { __index = WitnessView })
M.HuCardImg = HuCardImg
--- Create a new --- Create a new
function M.new() function M.new()
local self = setmetatable({}, { __index = M }) local self = setmetatable({}, { __index = M })
@ -47,4 +49,19 @@ function M:InitView()
TableBG.LoadTableBG(default_bg, self._room.game_id, self._root_view, bg_config) TableBG.LoadTableBG(default_bg, self._room.game_id, self._root_view, bg_config)
end end
local majiang_asset_path = "base/main_majiang/sound/"
function M:PlayMJSound(path)
ViewUtil.PlaySound(self.asset_group, majiang_asset_path .. path)
end
function M:PlayMJMusic(path)
ViewUtil.PlayMuisc(self.asset_group, majiang_asset_path .. path)
end
function M:PlaySound(group, sex, path)
local sex_path = ViewUtil.Sex_Chat[sex]
local path1 = majiang_asset_path .. string.format("%s/%s.mp3", sex_path, path)
ViewUtil.PlaySound(group, path1)
end
return M return M

View File

@ -9,4 +9,19 @@
<namespace fullname="System.ComponentModel" preserve="all"/> <namespace fullname="System.ComponentModel" preserve="all"/>
<namespace fullname="System.Net.Configuration" preserve="all"/> <namespace fullname="System.Net.Configuration" preserve="all"/>
</assembly> </assembly>
</linker>
<!-- 保留 Assembly-CSharp 下的 ToLua 框架 -->
<assembly fullname="Assembly-CSharp">
<!-- ToLua 入口类(反射用到的一定要保留) -->
<type fullname="LuaInterface.LuaState" preserve="all"/>
<type fullname="LuaInterface.LuaFunction" preserve="all"/>
<type fullname="LuaInterface.LuaTable" preserve="all"/>
<type fullname="LuaInterface.LuaDLL" preserve="all"/>
</assembly>
<!-- 保留 FairyGUI 相关(如果你 UI 是 Lua+FairyGUI 绑定的) -->
<assembly fullname="Assembly-CSharp">
<namespace fullname="FairyGUI" preserve="all"/>
</assembly>
</linker>

View File

@ -39,6 +39,7 @@ GraphicsSettings:
- {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 16003, guid: 0000000000000000f000000000000000, type: 0}
m_PreloadedShaders: [] m_PreloadedShaders: []
m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
type: 0} type: 0}

View File

@ -791,7 +791,8 @@ PlayerSettings:
Standalone: 1 Standalone: 1
iPhone: 1 iPhone: 1
il2cppCompilerConfiguration: {} il2cppCompilerConfiguration: {}
managedStrippingLevel: {} managedStrippingLevel:
Android: 3
incrementalIl2cppBuild: {} incrementalIl2cppBuild: {}
allowUnsafeCode: 0 allowUnsafeCode: 0
additionalIl2CppArgs: additionalIl2CppArgs: