Example #1
0
 /// <summary>
 /// Begins the physics sampler.
 /// </summary>
 public void BeginPhysics()
 {
     if (physicsUpdate != null)
     {
         Debug.LogException(new InvalidOperationException("Attempted to start physics when it is already running. Ignoring request"));
         return;
     }
     snapShotter   = new SnapShotter(ticksPerSample, snapsRemembered);
     boxPool       = new ComponentPool <BoxCollider>(boxPoolStartAmount);
     capsulePool   = new ComponentPool <CapsuleCollider>(capsulePoolStartAmount);
     spherePool    = new ComponentPool <SphereCollider>(spherePoolStartAmount);
     physicsUpdate = StartCoroutine(ExecPhysics());
 }
Example #2
0
        internal Restorer(ComponentPool <BoxCollider> bP, ComponentPool <CapsuleCollider> cP, ComponentPool <SphereCollider> sP, LinkedList <TransformProfile> prof)
        {
            boxPool     = bP;
            capsulePool = cP;
            spherePool  = sP;

            profiles = prof;

            //disable all the colliders for the objects in realtime
            foreach (NetworkTransform trans in SnapShotter.objectsToWatch)
            {
                trans.SetCollidersEnabled(false);
            }
            foreach (TransformProfile profile in profiles)
            {
                RestoreFromProfile(profile);
            }
        }