// Use this for initialization void Awake() { isWalking = false; jump = false; jumping = false; previouslyGrounded = true; stepCycle = 0.0f; nextStep = stepCycle / 2.0f; rotationX = camera.transform.localRotation.eulerAngles.x; rotationY = this.transform.localRotation.eulerAngles.y; userInput = Vector2.zero; moveDirection = Vector3.zero; originalCameraPosition = camera.transform.localPosition; characterController = GetComponent <CharacterController>(); audioSource = GetComponent <AudioSource>(); fovKick = new FOVKick(); fovKick.IncreaseCurve = FOVIncreaseCurve; fovKick.Setup(camera, 3.0f, 1.0f, 1.0f); headBob = new CurveControlledBob(); headBob.Setup(camera, stepInterval, 0.1f, 0.1f, 2.0f); jumpBob = new LerpControlledBob { BobDuration = 0.2f, BobAmount = 0.1f }; PlayerNumber = 0; }
static int DoBobCycle(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); LerpControlledBob obj = (LerpControlledBob)ToLua.CheckObject <LerpControlledBob>(L, 1); System.Collections.IEnumerator o = obj.DoBobCycle(); ToLua.Push(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int Offset(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); LerpControlledBob obj = (LerpControlledBob)ToLua.CheckObject <LerpControlledBob>(L, 1); float o = obj.Offset(); LuaDLL.lua_pushnumber(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int get_BobAmount(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); LerpControlledBob obj = (LerpControlledBob)o; float ret = obj.BobAmount; LuaDLL.lua_pushnumber(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index BobAmount on a nil value")); } }
static int set_BobAmount(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); LerpControlledBob obj = (LerpControlledBob)o; float arg0 = (float)LuaDLL.luaL_checknumber(L, 2); obj.BobAmount = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index BobAmount on a nil value")); } }
static int _CreateLerpControlledBob(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 0) { LerpControlledBob obj = new LerpControlledBob(); ToLua.PushObject(L, obj); return(1); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: LerpControlledBob.New")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }