public static GameObject ReadGameObject(this NetworkReader reader)
        {
            // Don't use null propagation here as it could lead to MissingReferenceException
            NetworkIdentity networkIdentity = reader.ReadNetworkIdentity();

            return(networkIdentity != null ? networkIdentity.gameObject : null);
        }
        public static Transform ReadTransform(this NetworkReader reader)
        {
            // Don't use null propagation here as it could lead to MissingReferenceException
            NetworkIdentity networkIdentity = reader.ReadNetworkIdentity();

            return(networkIdentity != null ? networkIdentity.transform : null);
        }
        public static GameObject ReadGameObject(this NetworkReader reader)
        {
            NetworkIdentity identity = reader.ReadNetworkIdentity();

            if (identity == null)
            {
                return(null);
            }
            return(identity.gameObject);
        }
        public static NetworkBehaviour ReadNetworkBehaviour(this NetworkReader reader)
        {
            NetworkIdentity identity = reader.ReadNetworkIdentity();

            if (identity == null)
            {
                return(null);
            }

            byte componentIndex = reader.ReadByte();

            return(identity.NetworkBehaviours[componentIndex]);
        }
Beispiel #5
0
 public static GameObject ReadGameObject(this NetworkReader reader) => reader.ReadNetworkIdentity()?.gameObject;
Beispiel #6
0
 public static Transform ReadTransform(this NetworkReader reader) => reader.ReadNetworkIdentity()?.transform;
Beispiel #7
0
 public static GameObject ReadGameObject(this NetworkReader reader)
 {
     return(reader.ReadNetworkIdentity()?.gameObject);
 }
Beispiel #8
0
 public static Transform ReadTransform(this NetworkReader reader)
 {
     return(reader.ReadNetworkIdentity()?.transform);
 }