BeardedManStudios.Network.SimpleNetworkedMonoBehavior.Locate C# (CSharp) Метод

Locate() публичный статический Метод

Locate a Simple Networked Monobehavior given a ID
public static Locate ( ulong id ) : SimpleNetworkedMonoBehavior
id ulong ID of the Simple Networked Monobehavior
Результат SimpleNetworkedMonoBehavior
		public static SimpleNetworkedMonoBehavior Locate(ulong id)
		{
			if (networkedBehaviors.ContainsKey(id))
				return networkedBehaviors[id];

			return null;
		}

Usage Example

Пример #1
0
        /// <summary>
        /// Prepare the NetworkingStream to be used
        /// </summary>
        /// <param name="socket">The NetWorker socket to be used</param>
        /// <param name="identifierType">The type of Identifier it is going to prepare</param>
        /// <param name="networkedBehavior">NetworkedBehavior to use</param>
        /// <param name="extra">Extra parameters to prepare</param>
        /// <param name="receivers">Who shall be receiving this NetworkingStream</param>
        /// <param name="bufferedRPC">To know if this is a Buffered RPC</param>
        /// <param name="customidentifier">A custom Identifier to be passed through</param>
        /// <returns></returns>
        public NetworkingStream Prepare(NetWorker socket, IdentifierType identifierType, ulong networkBehaviorId, BMSByte extra = null, NetworkReceivers receivers = NetworkReceivers.All, bool bufferedRPC = false, uint customidentifier = 0, ulong senderId = 0, bool noBehavior = false)
        {
            if (noBehavior)
            {
                NetworkedBehavior = null;
            }
            else
            {
                lock (networkedObjectMutex)
                {
                    NetworkedBehavior = SimpleNetworkedMonoBehavior.Locate(networkBehaviorId);
                }
            }

            if (ReferenceEquals(NetworkedBehavior, null) && (extra == null || extra.Size == 0))
            {
                throw new NetworkException(9, "Prepare was called but nothing was sent to write");
            }

            NetworkedBehaviorId = networkBehaviorId;

            return(PrepareFinal(socket, identifierType, networkBehaviorId, extra, receivers, bufferedRPC, customidentifier, senderId));
        }
All Usage Examples Of BeardedManStudios.Network.SimpleNetworkedMonoBehavior::Locate