﻿using Gaazar;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[RequireComponent(typeof(Rigidbody))]
[DisallowMultipleComponent]
public class NettedRigidbody : NettedBehavior
{
    // Start is called before the first frame update
    [SyncVar]
    float drag;
    [SyncVar]
    float angularDrag;
    [SyncVar]
    Vector3 velocity;
    [SyncVar]
    Vector3 angularVelocity;
    [SyncVar]
    float mass;
    [SyncVar]
    Vector3 com;


    Rigidbody r;
    void Start()
    {
        r = GetComponent<Rigidbody>();
       
    }
    public override void OnReceivePost()
    {
        r.mass = mass;
        r.centerOfMass = com;
        r.velocity = velocity;
        r.angularVelocity = angularVelocity;
        r.drag = drag;
        r.angularDrag = angularDrag;
    }

    // Update is called once per frame

}
