public override void OnAwakeInitialize(bool isNetObject) { /// If not a NetObject, we need to register our timing callbacks directly with the NetMaster /// since there is no NetObject to generate these. if (!isNetObject) { NetMaster.onPreSimulates.Add(this); NetMaster.onPreUpdates.Add(this); } rb = GetComponent <Rigidbody>(); rb2d = GetComponent <Rigidbody2D>(); /// Force RBs to be kinematic if ((rb && !rb.isKinematic) || (rb2d && !rb2d.isKinematic)) { Debug.LogWarning(GetType().Name + " doesn't work with non-kinematic rigidbodies. Setting to kinematic."); if (rb) { rb.isKinematic = true; } else { rb2d.isKinematic = true; } } syncTransform = GetComponent <SyncTransform>(); Recalculate(); }
public Frame(SyncTransform sst, int frameId) : base(frameId) { m = new Matrix(); cm = new CompressedMatrix(); telem = new Matrix(); telecm = new CompressedMatrix(); sst.transformCrusher.Capture(sst.transform, cm, m); var par = sst.transform.parent; parentHash = par ? par.GetInstanceID() : -1; }
public override void OnAwake() { base.OnAwake(); syncTransform = GetComponent <SyncTransform>(); respawnStateInfo = new StateChangeInfo( respawnState, transform.parent ? transform.parent.GetComponent <Mount>() : null, transform.localPosition, transform.localEulerAngles, null, true); transform.GetNestedComponentsInChildren(onStateChangeCallbacks); transform.GetComponents(onTeleportCallbacks); mountsLookup = netObj.GetComponent <MountsLookup>(); }
public void Set(SyncTransform sst, int frameId) { sst.transformCrusher.Capture(sst.transform, cm, m); }