本文整理汇总了C#中NetworkManager类的典型用法代码示例。如果您正苦于以下问题:C# NetworkManager类的具体用法?C# NetworkManager怎么用?C# NetworkManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NetworkManager类属于命名空间,在下文中一共展示了NetworkManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
void Start()
{
manager = GetComponent<NetworkManager>();
#if UNITY_EDITOR
isEditor = true;
#endif
}
示例2: Start
public void Start()
{
if (Instance != null)
{
Destroy(this);
return;
}
Instance = this;
ctrlLockAddon = new AddOns.ControlLockAddon();
Satellites = new SatelliteManager();
Antennas = new AntennaManager();
Network = new NetworkManager();
Renderer = NetworkRenderer.CreateAndAttach();
FilterOverlay = new FilterOverlay();
FocusOverlay = new FocusOverlay();
TimeWarpDecorator = new TimeWarpDecorator();
FlightUIPatcher.Patch();
RTLog.Notify("RTCore {0} loaded successfully.", RTUtil.Version);
foreach (var vessel in FlightGlobals.Vessels)
{
Satellites.RegisterProto(vessel);
Antennas.RegisterProtos(vessel);
}
}
示例3: OnClick
public void OnClick()
{
networkManager = NetworkManager.Instance;
EventManager.Instance.RegisterListener(
NetworkManager.Instance, "joinedRoom", gameObject, OnJoined
);
}
示例4: Start
void Start()
{
manager = GameObject.Find("Manager").GetComponent<Manager>();
nwm = manager.GetComponent<NetworkManager>();
nm = manager.GetComponent<NotificationManager>();
cm = manager.GetComponent<CollisionManager>();
}
示例5: Start
// Use this for initialization
void Start () {
GameObject.Find("Crosshair").GetComponent<RawImage>().enabled = false;
//Set Default Mouse Settings if there isn't one
if(PlayerPrefs.GetFloat("xAxis") <= 0f || PlayerPrefs.GetFloat("yAxis") <= 0f){
PlayerPrefs.SetFloat ("xAxis", 15f);
PlayerPrefs.SetFloat ("yAxis", 15f);
PlayerPrefs.SetInt("smooth", (false ? 1 : 0));
PlayerPrefs.Save();
}
ColorPickerPanel.SetActive(false);
NM = GameObject.FindGameObjectWithTag ("NetworkManager").GetComponent<NetworkManager> ();
//Load Saved Settings when game is loaded, setting is on if not 0 (aka equal to 1)
yAxis_Text.text = PlayerPrefs.GetFloat("yAxis").ToString();
xAxis_Text.text = PlayerPrefs.GetFloat("xAxis").ToString();
smoothToggle.isOn = (PlayerPrefs.GetInt("smooth") != 0);
vSync.isOn = (PlayerPrefs.GetInt("vSync") != 0);
DOF.isOn = (PlayerPrefs.GetInt("DOF") != 0);
CMB.isOn = (PlayerPrefs.GetInt("CMB") != 0);
optionsAnim = GameObject.FindGameObjectWithTag ("OptionsPanel").GetComponent<Animator> ();
killLimit = 10;
timeLimit = 10;
killToWin = toggleKillLimit.isOn;
timeToWin = toggleTimeLimit.isOn;
}
示例6: Start
// Use this for initialization
void Start()
{
GameObject networkManager = GameObject.FindGameObjectWithTag("NetworkManager");
if (networkManager == null)
{
// SOLO
}
else
{
networkManagerScript = networkManager.GetComponent<NetworkManager>();
// MULTI
playerSolo.SetActive(false);
ennemySolo.SetActive(false);
if (Network.isServer)
{
Debug.Log("LOAD PLAYER SCENE !");
Network.Instantiate(playerViewPrefab, playerViewPrefab.transform.position, playerViewPrefab.transform.rotation, 0);
}
else
{
Debug.Log("LOAD ENNEMY SCENE !");
Network.Instantiate(ennemyViewPrefab, ennemyViewPrefab.transform.position, ennemyViewPrefab.transform.rotation, 0);
}
}
}
示例7: NetworkManagerPanel
public NetworkManagerPanel(IrcSharkApplication app, NetworkManager servers)
: base(app)
{
BoundedNetworkManager = servers;
InitializeComponent();
LoadSettingTabs();
}
示例8: Start
// Use this for initialization
void Start()
{
networkManager = networkController.GetComponent<NetworkManager>();
ballGame = sphere.GetComponent<nBallGame>();
p1Lives = 5;
p2Lives = 5;
}
示例9: OnClick
public void OnClick()
{
networkManager = NetworkManager.Instance;
EventManager.Instance.RegisterListener(
NetworkManager.Instance, "connectedToPhoton", gameObject, OnConnected
);
}
示例10: Start
void Start() {
manager = GetComponent<NetworkManager>();
manager.dontDestroyOnLoad = true;
manager.StartMatchMaker();
Debug.Log(GetType().BaseType);
}
示例11: Start
public void Start()
{
if (Instance != null)
{
Destroy(this);
return;
}
Instance = this;
Satellites = new SatelliteManager();
Antennas = new AntennaManager();
Network = new NetworkManager();
Renderer = NetworkRenderer.CreateAndAttach();
FilterOverlay = new FilterOverlay();
FocusOverlay = new FocusOverlay();
TimeQuadrantPatcher = new TimeQuadrantPatcher();
TimeQuadrantPatcher.Patch();
FlightUIPatcher.Patch();
RTLog.Notify("RTCore loaded successfully.");
foreach (var vessel in FlightGlobals.Vessels)
{
Satellites.RegisterProto(vessel);
Antennas.RegisterProtos(vessel);
}
}
示例12: Main
public static void Main(string[] args)
{
//initialize Logger
Logger.InitializeLogger(LogManager.GetLogger(typeof(Program)));
Assembly assembly = Assembly.GetExecutingAssembly();
FileVersionInfo fileVersionInfo = FileVersionInfo.GetVersionInfo(assembly.Location);
Console.Title = String.Format("OpenNos World Server v{0}", fileVersionInfo.ProductVersion);
Console.WriteLine(String.Format("===============================================================================\n"
+ " WORLD SERVER VERSION {0} by OpenNos Team\n" +
"===============================================================================\n", fileVersionInfo.ProductVersion));
//initialize DB
DataAccessHelper.Initialize();
//initialilize maps
ServerManager.Initialize();
//initialize ClientLinkManager
//TODO?
string ip = System.Configuration.ConfigurationManager.AppSettings["WorldIp"];
int port = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["WorldPort"]);
try
{
ServiceFactory.Instance.CommunicationService.Open();
}
catch (Exception ex)
{
Logger.Log.Error(ex.Message);
}
//start up network manager
NetworkManager<WorldEncryption> networkManager = new NetworkManager<WorldEncryption>(ip, port, typeof(WorldPacketHandler));
}
示例13: Start
void Start()
{
network = GameObject.Find("NetworkHandler").GetComponent<NetworkManager>();
listBg = (GameObject)Resources.Load("Prefabs/ServerList/ListBg",typeof(GameObject));
serverButton = (GameObject)Resources.Load("Prefabs/ServerList/ServerName", typeof(GameObject));
ProgressBar = (GameObject)Resources.Load("Prefabs/ServerList/Progress Bar", typeof(GameObject));
}
示例14: Start
// Use this for initialization
void Start()
{
//myInputBox = GetComponentInChildren<UnityEngine.UI.InputField>();
//myChatBox = GetComponentInChildren<UnityEngine.UI.Text>();
myNetworkView = GetComponent<NetworkView>();
myNetworkManager = Camera.main.GetComponent<NetworkManager>();
}
示例15: Start
public void Start()
{
if(NetworkServer.active && !NetworkClient.active) return;
nm = NetworkManager.singleton;
nm.client.RegisterHandler (Msgs.serverTeamMsg, OnClientReceiveTeamList);
nm.client.Send(Msgs.requestTeamMsg, new EmptyMessage());
}