示例#1
0
        void Start()
        {
            physics = GetComponent <LCPhysics>();
            physics.OnPhysicsTick += OnPhysicsUpdate;
            physics.BeginPhysics();

            inputHandler = new InputHandler(InputConsumer.inst);
            NetworkServer.RegisterHandler(MsgTypeExt.USER_INPUT, inputHandler.HandleInput);
        }
示例#2
0
文件: LCPhysics.cs 项目: sjb8100/MUGA
        // 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);
        }
示例#3
0
        private void Start()
        {
            if (MUGAClient.isClient)
            {
                SetCollidersEnabled(GetComponent <InputPredictionInterpolator>() != null);
                enabled = false;
                return;
            }
            gameObjectId = GetComponent <NetworkIdentity>().netId.Value;

            if (easyInit)
            {
                LCPhysics.WatchObject(this);
                AutoAddCollidersToWatch();
            }
        }