public virtual void Awake() { transform = new NetworkTransform(this, base.transform); transform.UseNetwork = false; if (base.transform.parent != null) { transform.parent = base.transform.parent; } transform.position = base.transform.position; transform.rotation = base.transform.rotation; transform.localScale = base.transform.localScale; transform.UseNetwork = true; }
public void SetParent(NetworkTransform parent, bool worldPositionStays) { SetParent(parent.Transform, worldPositionStays); }
/* public void Detach() { * Transform.SetParent(null); * * if(!UseNetwork) { * return; * } * * Client.Current.WriteHeader(NetworkData.UpdateParent); * Client.Out.WriteLong(long.MinValue); * Client.Current.WriteTcp(); * } */ public void SetParent(NetworkTransform parent) { SetParent(parent == null ? null : parent.Transform); }