当前位置: 首页>>代码示例>>C#>>正文


C# NetworkManager类代码示例

本文整理汇总了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
    }
开发者ID:MaikKlein,项目名称:UNetHelpers,代码行数:7,代码来源:AutoConnect.cs

示例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);
            }
        }
开发者ID:icedown,项目名称:RemoteTech,代码行数:31,代码来源:RTCore.cs

示例3: OnClick

 public void OnClick()
 {
     networkManager = NetworkManager.Instance;
     EventManager.Instance.RegisterListener(
         NetworkManager.Instance, "joinedRoom", gameObject, OnJoined
     );
 }
开发者ID:bill42362,项目名称:WizardFight,代码行数:7,代码来源:MatchButton.cs

示例4: Start

 void Start()
 {
     manager = GameObject.Find("Manager").GetComponent<Manager>();
     nwm = manager.GetComponent<NetworkManager>();
     nm = manager.GetComponent<NotificationManager>();
     cm = manager.GetComponent<CollisionManager>();
 }
开发者ID:Hargalaten,项目名称:meGAMEss,代码行数:7,代码来源:ShortcutManager.cs

示例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;

	}
开发者ID:hamza765,项目名称:Kelpie5,代码行数:27,代码来源:GameManager.cs

示例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);
            }
        }
    }
开发者ID:Midipil,项目名称:SansDessusDessous,代码行数:28,代码来源:NetworkStarter.cs

示例7: NetworkManagerPanel

 public NetworkManagerPanel(IrcSharkApplication app, NetworkManager servers)
     : base(app)
 {
     BoundedNetworkManager = servers;
     InitializeComponent();
     LoadSettingTabs();
 }
开发者ID:hapm,项目名称:IrcShark,代码行数:7,代码来源:NetworkManagerPanel.cs

示例8: Start

 // Use this for initialization
 void Start()
 {
     networkManager = networkController.GetComponent<NetworkManager>();
     ballGame = sphere.GetComponent<nBallGame>();
     p1Lives = 5;
     p2Lives = 5;
 }
开发者ID:jeremymwat,项目名称:homework,代码行数:8,代码来源:MasterNetworkGameController.cs

示例9: OnClick

 public void OnClick()
 {
     networkManager = NetworkManager.Instance;
     EventManager.Instance.RegisterListener(
         NetworkManager.Instance, "connectedToPhoton", gameObject, OnConnected
     );
 }
开发者ID:bill42362,项目名称:WizardFight,代码行数:7,代码来源:ConnectButton.cs

示例10: Start

    void Start() {
        manager = GetComponent<NetworkManager>();
        manager.dontDestroyOnLoad = true;

        manager.StartMatchMaker();
        Debug.Log(GetType().BaseType);
    }
开发者ID:EduardoU24,项目名称:GGJ2016,代码行数:7,代码来源:Networking.cs

示例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);
            }
        }
开发者ID:EngTurtle,项目名称:RemoteTech2,代码行数:30,代码来源:RTCore.cs

示例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));
            
        }
开发者ID:aerzy,项目名称:OpenNos,代码行数:34,代码来源:Program.cs

示例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));
 }
开发者ID:karthyks,项目名称:DeathRace,代码行数:7,代码来源:UIHandler.cs

示例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>();
 }
开发者ID:hongaaronc,项目名称:IntermediateGame,代码行数:8,代码来源:Chat.cs

示例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());
 }
开发者ID:Geor23,项目名称:Planets,代码行数:7,代码来源:LobbyGUI.cs


注:本文中的NetworkManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。