• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# NetworkManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中NetworkManager的典型用法代码示例。如果您正苦于以下问题:C# NetworkManager类的具体用法?C# NetworkManager怎么用?C# NetworkManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



NetworkManager类属于命名空间,在下文中一共展示了NetworkManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: Awake

 void Awake()
 {
     button = GetComponent<Button> ();
     text = GetComponentInChildren<Text> ();
     image = GetComponent<Image> ();
     networkManager = GameObject.FindGameObjectWithTag ("NetworkManager").GetComponent<NetworkManager> ();
 }
开发者ID:Avatarchik,项目名称:survival-shooter-multiplayer-unity3d-files,代码行数:7,代码来源:JoinNextRoundButton.cs


示例17: Start

        public void Start()
        {
            if (Instance != null)
            {
                Destroy(this);
                return;
            }

            Instance = this;

            Satellites = new SatelliteManager();
            Antennas = new AntennaManager();
            Network = new NetworkManager();
            Renderer = NetworkRenderer.AttachToMapView();

            mConfig = new MapViewConfigFragment();
            mTimePatcher = new TimeQuadrantPatcher();

            mTimePatcher.Patch();
            FlightUIPatcher.Patch();

            RTLog.Notify("RTCore loaded successfully.");

            foreach (var vessel in FlightGlobals.Vessels)
            {
                Satellites.RegisterProto(vessel);
                Antennas.RegisterProtos(vessel);
            }
        }
开发者ID:ergthbeb,项目名称:RemoteTech2,代码行数:29,代码来源:RTCore.cs


示例18: Start

    void Start ()
    {
        modelName = "";
        GameObject manager = GameObject.Find("NetworkManager");
        if(!PhotonNetwork.isMasterClient)
        {
            networkManager = manager.GetComponent<NetworkManager>();
            string playerName = networkManager.playerData[0];
            modelName = networkManager.playerData[1];
            networkManager.photonView.RPC("LoadModelMarker", PhotonTargets.MasterClient, playerName, modelName);
        }

        else
        {
            networkManager = manager.GetComponent<NetworkManager>();
            fieldName = networkManager.playerData[1];
            networkManager.photonView.RPC("LoadField", PhotonTargets.All, fieldName);
            for(int i = 0; i < networkManager.ObjectMasterData.Count; i ++)
            {
                string objectName = networkManager.ObjectMasterData[i][0];
                string markerName = networkManager.ObjectMasterData[i][1];
                if(markerName != "None")
                    networkManager.photonView.RPC("LoadObjectServer", PhotonTargets.All, objectName, markerName);
            }
        }
    }
开发者ID:grahamliphts,项目名称:Ar-Dungeon,代码行数:26,代码来源:LinkModelsMakers.cs


示例19: LoadingScreen

 private LoadingScreen(ScreenManager screenManager, NetworkManager nManager, GameScreen[] screens)
 {
     isNetworkGame = true;
     netManager = nManager;
     screensToLoad = screens;
     TransitionOnTime = TimeSpan.FromSeconds(1.0);
 }
开发者ID:nchoumitsky,项目名称:Meatieroids,代码行数:7,代码来源:LoadingScreen.cs


示例20: Start

	//GameManager gameManager;

	void Start() {
		//Makes this object stay throughout the entire scene
		if (dontDestroyOnLoad) {
			DontDestroyOnLoad (transform.gameObject);
		}
		network = FindObjectOfType<NetworkManager> ();

		//Find the Socket Component in the Game Scene
		GameObject go = GameObject.Find("SocketIO");
		socket = go.GetComponent<SocketIOComponent>();

		//Register what kind of messages the client receives
		socket.On ("ConnectionTest", NetTest);
		socket.On ("JoinRoom", NetLogin);
		//socket.On ("Response", NetResponse);
		socket.Connect ();

		//Start Connection Test
		if (socket.IsConnected) {
			//Debug.Log ("Connected to Server!");
			StartCoroutine("ConnectionTest");
		} else {
			Debug.Log ("Not Connected...");
		}

	}
开发者ID:andrewpk95,项目名称:CS492Week4-5,代码行数:28,代码来源:ServerManager.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# NetworkMessage类代码示例发布时间:2022-05-24
下一篇:
C# NetworkDisconnection类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap