示例#1
0
        public static GameObject ReadGameObject(this NetworkReader reader)
        {
            NetworkIdentity identity = reader.ReadNetworkIdentity();

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

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

            byte componentIndex = reader.ReadByte();

            return(identity.NetworkBehaviours[componentIndex]);
        }