void Start() { physics = GetComponent <LCPhysics>(); physics.OnPhysicsTick += OnPhysicsUpdate; physics.BeginPhysics(); inputHandler = new InputHandler(InputConsumer.inst); NetworkServer.RegisterHandler(MsgTypeExt.USER_INPUT, inputHandler.HandleInput); }
// Use this for initialization void Awake() { if (inst != null) { throw new InvalidOperationException("There must be more than 1 LC physics class in the scene. There can only be 1"); } inst = this; ticksPerSample = Utils.TICKS_PER_SEC / samplesPerSecond; Debug.Log("ticks per sample: " + ticksPerSample); snapsRemembered = Mathf.CeilToInt(samplesPerSecond * maxAcceptableLag); }
private void Start() { if (MUGAClient.isClient) { SetCollidersEnabled(GetComponent <InputPredictionInterpolator>() != null); enabled = false; return; } gameObjectId = GetComponent <NetworkIdentity>().netId.Value; if (easyInit) { LCPhysics.WatchObject(this); AutoAddCollidersToWatch(); } }