Exemple #1
0
        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;
        }
Exemple #2
0
 public void SetParent(NetworkTransform parent, bool worldPositionStays)
 {
     SetParent(parent.Transform, worldPositionStays);
 }
Exemple #3
0
        /* 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);
        }