1-
2- if not UnityEngine.GameObject then
3- error("Click Lua/Generate All to generate wrap files")
4- end
5-
61local Vector3 = UnityEngine.Vector3
72local GameObject = UnityEngine.GameObject
83local Profiler = UnityEngine.Profiler
@@ -12,10 +7,6 @@ local Texture2D = UnityEngine.Texture2D
127local Quaternion = UnityEngine.Quaternion
138local SkinnedMeshRenderer = UnityEngine.SkinnedMeshRenderer
149
15- function main()
16- print(jit and "jit on" or "jit off, pls run test with luajit")
17- end
18-
1910local cube = GameObject.New("Script cube")
2011
2112
@@ -65,8 +56,6 @@ function test5()
6556 local v = GameObject.New()
6657 v:AddComponent(tp)
6758 local c=v:GetComponent(tp)
68- c.shadowCastingMode = c.shadowCastingMode
69- c.receiveShadows=false
7059 end
7160 print("test5/lua " .. (os.clock() - start));
7261end
@@ -78,16 +67,5 @@ function test6()
7867 local t=Quaternion.Euler(100,100,100)
7968 local q=Quaternion.Slerp(Quaternion.identity,t,0.5)
8069 end
81- print("test6/lua jit " .. (os.clock() - start));
82- end
83-
84- function test7()
85- local transform=cube.transform
86- local Quaternion = (jit and Quaternion.__raw) or Quaternion
87- local start = os.clock()
88- for i=1,200000 do
89- local t=Quaternion.Euler(100,100,100)
90- local q=Quaternion.Slerp(Quaternion.identity,t,0.5)
91- end
92- print("test6/lua non-jit " .. (os.clock() - start));
93- end
70+ print("test6/lua " .. (os.clock() - start));
71+ end
0 commit comments