Esempio n. 1
0
 public void ShatterLocal(Vector3 pos, Vector3 impulse)
 {
     if (!NetGame.isClient)
     {
         shattered = true;
         pos       = collider.ClosestPointOnBounds(pos);
         uint num = (uint)Random.Range(0, 1023);
         netState = new NetState
         {
             shatterPos       = QuantizePos(pos),
             shatterMagnitude = (uint)NetFloat.Quantize(impulse.magnitude, 10000f, 11),
             shatterSeed      = num,
             netId            = NetStream.GetDynamicScopeId()
         };
         pos = DequantizePos(netState.shatterPos);
         Shatter(pos, impulse, impulse.magnitude, num, netState.netId);
     }
 }