Network Manager
Workflow
A component responsible for managing the system network. It is fully integrated with Web Browser, but can be also integrated with external components. You can find this manager under the DreamOS Canvas > Managers parent.
Scripting
using UnityEngine;
using Michsky.DreamOS; // DreamOS namespace
public class SampleClass : MonoBehaviour
{
[SerializeField] private NetworkManager networkManager; // Manager variable
void YourFunction()
{
// Get connection state
bool connection = networkManager.isConnected;
// Get current network index
int index = networkManager.currentNetworkIndex;
// Connect to a network
networkManager.ConnectToNetwork("Network ID");
// Connect to a network with password
networkManager.ConnectToNetwork("Network ID", "password");
// Disconnect from the current network
networkManager.DisconnectFromNetwork();
// Create network
networkManager.CreateNetwork("ID", "Password", NetworkManager.SignalPower.Best);
// List all available networks to a specific parent
networkManager.ListNetworks(transform.parent);
// Get network index from network ID
int getIndex = networkManager.GetNetworkIndex("Network ID");
// Check if it's connected to a specific network
bool isConnectedToNetwork = networkManager.IsConnectedToNetwork("Network ID");
}
}
How can we help?
A premium WordPress theme with an integrated Knowledge Base,
providing 24/7 community-based support.