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


C# NetworkView类代码示例

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


NetworkView类属于命名空间,在下文中一共展示了NetworkView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AllocateNetworkViewID

	public void AllocateNetworkViewID(string _requestID, NetworkView _networkView)
	{
		if (mAllocateRequests.ContainsKey(_requestID))
		{
			Debug.Log("Request " + _requestID + " is incomplete. Please wait.");
			return;
		}

		if (mAllocationCache.ContainsKey(_requestID)) 
		{
			_networkView.viewID = mAllocationCache[_requestID];
			return;
		}

		if (Network.isServer) 
		{
			_networkView.viewID = Network.AllocateViewID();
			mAllocationCache.Add(_requestID, _networkView.viewID);
		}
		else if (Network.isClient)
		{
			mAllocateRequests.Add(_requestID, new WeakReference(_networkView));
			networkView.RPC("NetworkViewAllocator_RequestViewID", RPCMode.Server, Network.player, _requestID);
		}
		else 
		{
			Debug.Log("The connect is not established yet, try after connected to server.");
			return;
		}
	}
开发者ID:kiki9014,项目名称:snugdc-project-ricochet,代码行数:30,代码来源:NetworkViewAllocator.cs

示例2: CombatHandler

    public CombatHandler(NetworkView nv)
    {
        _nv = nv;

        //Get Memory for the list
        _effectDictionary = new Dictionary<PlayerObject, List<DynamicEffect>>(SIZE);
    }
开发者ID:CKovacs,项目名称:JnRProject,代码行数:7,代码来源:CombatHandler.cs

示例3: Awake

 void Awake()
 {
     cam = GetComponentInChildren<Camera>();
     animator = (Animator)GetComponent<Animator> ();
     networkView = GetComponent<NetworkView> ();
     Respawn ();
 }
开发者ID:terdened,项目名称:Tanks,代码行数:7,代码来源:Player.cs

示例4: Start

 void Start()
 {
     m_animator = GetComponentInChildren<Animator>();
     myNetworkView = GetComponent<NetworkView>();
     myAudioSource = GetComponent<AudioSource>();
     SetColliders( false );
 }
开发者ID:EricEspinoza,项目名称:GalleryRailShooter,代码行数:7,代码来源:Target.cs

示例5: Start

 void Start()
 {
     tParent = transform.parent;
     networkView = tParent.GetComponent <NetworkView>();
     gameObject.SetActive(networkView.isMine);
     gm = GameManager.Instance;
 }
开发者ID:bruteostrich,项目名称:GnomeArena,代码行数:7,代码来源:CamHandler.cs

示例6: Awake

 void Awake()
 {
     animationState = 0;
     animator = (Animator)GetComponent<Animator> ();
     animator.SetInteger ("State", animationState);
     networkView = GetComponent<NetworkView> ();
 }
开发者ID:terdened,项目名称:Tanks,代码行数:7,代码来源:Bulet.cs

示例7: Start

 // Use this for initialization
 void Start()
 {
     gameLogic = GameObject.Find("GameLogic").GetComponent<RPCUpdates>();
     audio = GetComponent<AudioSource>();
     sphere = GetComponent<Rigidbody> ();
     nV = GetComponent<NetworkView>();
 }
开发者ID:znafz,项目名称:foos,代码行数:8,代码来源:playerMovement.cs

示例8: OnConnectedToServer

 void OnConnectedToServer()
 {
     if (Server.g && Server.g.IsClient()) {
         m_networkView = GetComponent<NetworkView>();
         Server.g.SyncViewIds (m_networkView, "Avatar");
     }
 }
开发者ID:jceipek,项目名称:ORGI,代码行数:7,代码来源:AvatarNetworking.cs

示例9: Find

        /// <summary>
        /// find a networkview based on a networkviewid that was serialized into an rpc
        /// </summary>
        /// <param name="message">uses deserialize, so the read location does advance</param>
        /// <param name="view"></param>
        /// <returns></returns>
        public bool Find(ref NetIncomingMessage message, out NetworkView view)
        {
            var id = new NetworkViewId();
            id.OnDeserialize(message);

            return Find(id, out view);
        }
开发者ID:traleven,项目名称:PNet,代码行数:13,代码来源:NetworkViewManager.cs

示例10: OnTriggerStay

    void OnTriggerStay(Collider coll)
    {
        if (coll.tag == "Player")
        {
           // GameObject hitPlayer = coll.gameObject;

            nView = coll.GetComponent<NetworkView>();

            nView.RPC("NetworkTakeDamageFromWeapon", nView.owner, 1);

        }
        if (coll.tag == "Boss")
        {
            // GameObject hitPlayer = coll.gameObject;
            nView = coll.GetComponent<NetworkView>();
            nView.RPC("NetworkTakeDamageFromWeapon", nView.owner, 1);

            if (nView.isMine)
            {
                Sentry companion;
                companion = nView.GetComponent<Sentry>();
                companion.ClientTakeDamageFromWeapon(1);
            }
            else
            {
                nView.RPC("NetworkTakeDamageFromWeapon", nView.owner, 1);
            }
        }
    }
开发者ID:Dankerprouduct,项目名称:Derp-Bots,代码行数:29,代码来源:Fire.cs

示例11: Start

	public void Start ()
	{
		//Initializes on start up to listen for messages
		//make sure this game object has both UDPPackIO and OSC script attached
		
		UDPPacketIO udp = (UDPPacketIO)GetComponent("UDPPacketIO");
		udp.init(RemoteIP, SendToPort, ListenerPort);
		handler = (Osc)GetComponent("Osc");
		handler.init(udp);
		handler.SetAllMessageHandler(AllMessageHandler);


		tornadoSlider = GameObject.Find("Tornado Slider").GetComponent<UnityEngine.UI.Slider>();
		munchkinSlider = GameObject.Find("Munchkin Slider").GetComponent<UnityEngine.UI.Slider>();
		poppySlider = GameObject.Find("Poppy Slider").GetComponent<UnityEngine.UI.Slider>();
		monkeySlider = GameObject.Find("Monkey Slider").GetComponent<UnityEngine.UI.Slider>();
		fireSlider = GameObject.Find("Fire Slider").GetComponent<UnityEngine.UI.Slider>();
		transSpeedSlider = GameObject.Find("Transition Slider").GetComponent<UnityEngine.UI.Slider>();


		nv = GameObject.Find("Network").GetComponent<NetworkView>();

		Debug.Log("Osc Running");
		
	}
开发者ID:theomission,项目名称:ozUnity,代码行数:25,代码来源:OzOscReceiver.cs

示例12: 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

示例13: addScopeNetView

 public void addScopeNetView(NetworkView[] pNetworkViews)
 {
     foreach (var lNetworkView in pNetworkViews)
     {
         addScopeNetView(lNetworkView);
     }
 }
开发者ID:Seraphli,项目名称:TheInsectersWar,代码行数:7,代码来源:BoundNetworkScope.cs

示例14: Awake

	void Awake()
	{
		MyNetworkView = gameObject.GetComponent<NetworkView> ();
		OnlineName = gameObject.name;
		// maybe reload the last used name from PlayerPrefs or generate a random name
		BroadcastNickName();
	}
开发者ID:Deus0,项目名称:Zeltex,代码行数:7,代码来源:NetworkedPlayer.cs

示例15: Buffer

	public static void Buffer(NetworkView view, string func, RPCMode mode, params object[] args) 
	{
		//first fix up the mode so no one accidentally passes in a buffered mode
		if(mode == RPCMode.AllBuffered)
			mode = RPCMode.All;
		else if(mode  == RPCMode.OthersBuffered)
			mode = RPCMode.Others;
			
		if(m_RPCs == null)
			m_RPCs = new BufferedRPC[0];
		BufferedRPC [] temp = new BufferedRPC[m_RPCs.Length+1];
		if(m_RPCs.Length > 0)
			m_RPCs.CopyTo(temp,0);
		
		BufferedRPC tempRPC = new BufferedRPC();
		tempRPC.func = func;
		tempRPC.mode = mode;
		if(args != null)
		{
			// for(int i = 0; i < args.Length; i++)
				// Debug.Log(args[i].ToString() + ", ");
			tempRPC.args = new object[args.Length];
			args.CopyTo(tempRPC.args,0);
		}
		tempRPC.view = view;
		temp[temp.Length-1] = tempRPC;
		m_RPCs = temp;
		
		view.RPC(func, mode, args);
	}
开发者ID:richard3d,项目名称:BlitzBeez,代码行数:30,代码来源:ServerRPC.cs


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