コード例 #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]);
        }