Browse Source

Merge pull request #458 from snozbot/remove-timescale

Removed timescale functions
master
Chris Gregan 9 years ago
parent
commit
8aff6aa5b9
  1. 22
      Assets/Fungus/Thirdparty/FungusLua/Resources/Lua/fungus.txt
  2. 9
      Assets/Fungus/Thirdparty/FungusLua/Scripts/LuaUtils.cs

22
Assets/Fungus/Thirdparty/FungusLua/Resources/Lua/fungus.txt vendored

@ -12,26 +12,6 @@ function M.inspect(v)
print (inspect.inspect(v)) print (inspect.inspect(v))
end end
-------
-- Time
-------
-- Returns the absolute time
-- Use this timing function to work correctly with the Lua Environment's timeScale property
function M.gettime()
return M.luautils.getTime()
end
-- Returns the delta time this frame
-- Use this timing function to work correctly with the Lua Environment's timeScale property
function M.getdeltatime()
return M.luautils.getDeltaTime()
end
function M.settimescale(s)
M.luautils.timeScale = s
end
------------- -------------
-- Coroutines -- Coroutines
------------- -------------
@ -46,7 +26,6 @@ end
-- Waits until the lamda function provided returns true, or the timeout expires. -- Waits until the lamda function provided returns true, or the timeout expires.
-- Returns true if the function succeeded, or false if the timeout expired -- Returns true if the function succeeded, or false if the timeout expired
--
function M.waitfor(fn, timeoutduration) function M.waitfor(fn, timeoutduration)
local t = M.gettime() local t = M.gettime()
while (not fn()) do while (not fn()) do
@ -128,6 +107,7 @@ function M.pass()
end end
-- Fail an integration test (requires Unity Test Tools) -- Fail an integration test (requires Unity Test Tools)
-- reason: Option string explaining why the test failed.
function M.fail(reason) function M.fail(reason)
error( debug.traceback("Test failed", 2) ) error( debug.traceback("Test failed", 2) )
M.test.fail(reason) M.test.fail(reason)

9
Assets/Fungus/Thirdparty/FungusLua/Scripts/LuaUtils.cs vendored

@ -35,15 +35,6 @@ namespace Fungus
[Tooltip("The currently selected language in the string table. Affects variable substitution.")] [Tooltip("The currently selected language in the string table. Affects variable substitution.")]
public string activeLanguage = "en"; public string activeLanguage = "en";
/// <summary>
/// Time scale factor to apply when running Lua scripts.
/// This allows pausing of time based operations by setting timescale to 0.
/// Use the GetTime() and GetDeltaTime() functions to get scaled time values.
/// If negative, then GetTime() and GetDeltaTime() return the same values as the standard Time class.
/// </summary>
[Tooltip("Time scale factor to apply when running Lua scripts. If negative then uses the same values as the standard Time class.")]
public float timeScale = -1f;
/// <summary> /// <summary>
/// Lua script file which defines the global string table used for localisation. /// Lua script file which defines the global string table used for localisation.
/// </summary> /// </summary>

Loading…
Cancel
Save