private void OnCrack(NetStream stream) { Vector3 vector = NetVector3.Read(stream, 6, 16).Dequantize(100f) + base.transform.position; Vector3 vector2 = NetVector3.Read(stream, 6, 16).Dequantize(10f) * breakTreshold; PlayCrack(vector2, vector); }
private void OnReportCollision(NetStream stream) { float impulse = NetFloat.Dequantize(stream.ReadInt32(10), 10000f, 11); Vector3 b = NetVector3.Read(stream, 3, 10).Dequantize(100f); Vector3 pos = base.transform.position + b; bag.ReportCollision(impulse, pos); }
public static NetState Read(NetStream stream) { NetState result = default(NetState); result.netId = stream.ReadNetId(); result.shatterPos = NetVector3.Read(stream, 10); result.shatterMagnitude = stream.ReadUInt32(10); result.shatterSeed = stream.ReadUInt32(10); return(result); }
public void OnReceiveCollisionAudio(NetStream stream) { if (showDebug) { Debug.Log(base.name + " Recieve Collision Audio "); } ushort libId = (ushort)stream.ReadUInt32(8); AudioChannel channel = (!stream.ReadBool()) ? (stream.ReadBool() ? AudioChannel.Body : AudioChannel.Physics) : AudioChannel.Footsteps; Vector3 b = NetVector3.Read(stream, 3, 10).Dequantize(100f); Vector3 pos = base.transform.position + b; float emit = AudioUtils.DBToValue(NetFloat.Dequantize(stream.ReadInt32(6), 64f, 6) - 32f); float num = AudioUtils.CentsToRatio(NetFloat.Dequantize(stream.ReadInt32(3, 8), 4800f, 8)); CollisionAudioHitConfig config = CollisionAudioEngine.instance.GetConfig(libId); if (config != null) { if (showDebug) { Debug.Log(base.name + " There is no audio engine "); } config.PlayWithKnownEmit(channel, null, pos, emit, num); } }
private void OnScroll(NetStream stream) { Vector3 scroll = NetVector3.Read(stream, 12).Dequantize(500f); Scroll(scroll); }