Skip to content

Commit

Permalink
添加注释
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuancheng Zhang committed Apr 14, 2021
1 parent 675abc6 commit 838dc24
Show file tree
Hide file tree
Showing 6 changed files with 189 additions and 131 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---摄像机工具类
---@module Cam Utility
---@copyright Lilith Games, Avatar Team
---@author Sharif Ma
---@class CamUtil
--- 摄像机工具类
--- @module Cam Utility
--- @copyright Lilith Games, Avatar Team
--- @author Sharif Ma
--- @class CamUtil
local CamUtil = {}

---将摄像机在水平面上转动到和角色朝向一致的角度
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
--- C# 双向链表
-- @module C# doubly linked list implemented with lua
-- @copyright Lilith Games, Avatar Team
-- @author Bruce Chen
-- @see https://wiki.lilithgames.com/x/7yRZAg
-- @see https://github.com/BruceCheng1995/LuaLinkedList
--- @module C# doubly linked list implemented with lua
--- @copyright Lilith Games, Avatar Team
--- @author Bruce Chen
--- @see https://wiki.lilithgames.com/x/7yRZAg
--- @see https://github.com/BruceCheng1995/LuaLinkedList
local LinkedList = {}
local LinkedNode = {}
LinkedNode.__index = LinkedNode
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---对象池工具模块
---@module ObjPoolUtil
--- 对象池工具模块
--- @module ObjPoolUtil
--- @copyright Lilith Games, Avatar Team
--- @author Yen Yuan
local ObjPoolUtil = class('ObjPoolUtil')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--- 音效播放模块
---@module SoundUtil
---@copyright Lilith Games, Avatar Team
---@author Sharif Ma
--- @module SoundUtil
--- @copyright Lilith Games, Avatar Team
--- @author Sharif Ma
local SoundUtil = {}

function SoundUtil:Init()
Expand All @@ -16,7 +16,7 @@ end
function SoundUtil:PlaySound(_ID, _SoundSourceObj)
local Info, _Duration
local pos = _SoundSourceObj and _SoundSourceObj.Position or nil
local targetPlayer = _SoundSourceObj and world:FindPlayers() or { localPlayer }
local targetPlayer = _SoundSourceObj and world:FindPlayers() or {localPlayer}
--_SoundSourceObj = _SoundSourceObj or world.CurrentCamera
Info = self.Table_Sound[_ID]
assert(Info, '[SoundUtil] 表中不存在该ID的音效')
Expand All @@ -33,10 +33,10 @@ function SoundUtil:PlaySound(_ID, _SoundSourceObj)
end
local filePath = 'Audio/' .. Info.FileName
for i, v in pairs(targetPlayer) do
NetUtil.Fire_C('WorldSoundEvent', v, filePath, { Position = pos, Volume = Info.Volume, Loop = Info.IsLoop})
NetUtil.Fire_C('WorldSoundEvent', v, filePath, {Position = pos, Volume = Info.Volume, Loop = Info.IsLoop})
end

--[[
--[[
local Audio = world:CreateObject('AudioSource', 'Audio_' .. Info.FileName, _SoundSourceObj)
Audio.LocalPosition = Vector3.Zero
Audio.SoundClip = ResourceManager.GetSoundClip('Audio/' .. Info.FileName)
Expand All @@ -48,7 +48,6 @@ function SoundUtil:PlaySound(_ID, _SoundSourceObj)
Audio:Play()
table.insert(self.SoundPlaying, _ID)
_Duration = _Duration or 1]]

invoke(
function()
for k, v in pairs(self.SoundPlaying) do
Expand All @@ -66,7 +65,7 @@ function SoundUtil:StopSound(_ID, _isLocal)
local Info = self.Table_Sound[_ID]
assert(Info, '[SoundUtil] 表中不存在该ID的音效')
local filePath = 'Audio/' .. Info.FileName
local targetPlayer = _isLocal and { localPlayer } or world:FindPlayers()
local targetPlayer = _isLocal and {localPlayer} or world:FindPlayers()
for i, v in pairs(targetPlayer) do
NetUtil.Fire_C('StopSoundEvent', v, filePath)
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---控制某个变量随时间变化的协程类
---@module TweenController
---@copyright Lilith Games, Avatar Team
---@author An Dai
--- 控制某个变量随时间变化的协程类
--- @module TweenController
--- @copyright Lilith Games, Avatar Team
--- @author An Dai
local TweenController = class('TweenController')

---_name:类名,_sender:使用它的类,_getTotalTime:获得总时间的方法,_update _callback:回调函数 _isFix:是否在fixupdate中执行, _start: 开始函数
Expand Down
Loading

0 comments on commit 838dc24

Please sign in to comment.