Пример #1
0
        /// <summary>
        /// Spawn a network node
        /// </summary>
        /// <param name="Instance">The Node from where function is called</param>
        /// <param name="Scene">The packed scene to spawn</param>
        /// <param name="NodeName">The name of the new node</param>
        /// <param name="NetworkMaster">The peer that should own this, default is server</param>
        /// <param name="SpawnPos">Where the spawn this node</param>
        public static Node SpawnNetworkedNode(this Node Instance, PackedScene Scene, string NodeName,
                                              int NetworkMaster = -1, Vector3?SpawnPos = null)
        {
            MDGameSession GameSession = Instance.GetGameSession();

            return(GameSession.SpawnNetworkedNode(Scene, Instance, NodeName, NetworkMaster, SpawnPos));
        }
Пример #2
0
        /// <summary>
        /// Spawn a network node
        /// </summary>
        /// <param name="Instance">The Node from where function is called</param>
        /// <param name="NodeType">The type of node to spawn</param>
        /// <param name="NodeName">The name of the new node</param>
        /// <param name="UseRandomName">If set to true a random number will be added at the end of the node name</param>
        /// <param name="NetworkMaster">The peer that should own this, default is server</param>
        /// <param name="SpawnPos">Where the spawn this node</param>
        public static Node SpawnNetworkedNode(this Node Instance, Type NodeType, string NodeName, bool UseRandomName,
                                              int NetworkMaster = -1, Vector3?SpawnPos = null)
        {
            MDGameSession GameSession = Instance.GetGameSession();

            return(GameSession.SpawnNetworkedNode(NodeType, Instance, NodeName, UseRandomName, NetworkMaster, SpawnPos));
        }