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


C# PhotonView.RPC方法代码示例

本文整理汇总了C#中PhotonView.RPC方法的典型用法代码示例。如果您正苦于以下问题:C# PhotonView.RPC方法的具体用法?C# PhotonView.RPC怎么用?C# PhotonView.RPC使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PhotonView的用法示例。


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

示例1: GetCharacter

 void GetCharacter(string _username, PhotonPlayer _player)
 {
     GameObject controller = GameObject.FindGameObjectWithTag("GameController");
     int[] _stats = controller.GetComponent<Database>().GeneratePlayerCore(_username, _player);
     myPhotonView = this.gameObject.GetComponent<PhotonView>();
     if (_stats != null)
     {
         myPhotonView.RPC("ReturnCore", _player, _stats);
     }
     else
     {
         myPhotonView.RPC("NoCharacter", _player);
     }
 }
开发者ID:pShusta,项目名称:TheFellnightPrison,代码行数:14,代码来源:PhotonRPC.cs

示例2: Start

 void Start()
 {
     photonView = GetComponent<PhotonView> ();
     NAMEPLATE = gameObject.GetComponent<TextMesh>();
     playerName = GetComponentInParent<PlayerStatus> ().playerName;
     photonView.RPC ("setName", PhotonTargets.All, playerName);
 }
开发者ID:tunderix,项目名称:LittleFishers,代码行数:7,代码来源:namePlate.cs

示例3: ResultOn

    public void ResultOn()
    {
        ResultActvie = true;
        Ending.SetActive (false);
        Canvas.GetComponent<Animator>().SetTrigger("OnResultStart");

        AudioManager.Instance.PlayBGM(win ? "resultclearbgm" : "resultfailbgm", 0.5f);

        GameObject.Find ("MyResultText").GetComponent<Text> ().text =
            (GameManager.instance.CorrectAnswerNum + GameManager.instance.IncorrectAnswerNum).ToString ()
                + "もん中、\n" + GameManager.instance.CorrectAnswerNum.ToString() + "もんせいかい!";

        myPv = this.GetComponent<PhotonView>();

        memberCorrectAnswerNum = new Dictionary<string, int>();
        memberInCorrectAnswerNum = new Dictionary<string, int>();
        myPv.RPC ("SetMemberAnswerNum", PhotonTargets.All, GameManager.instance.name, GameManager.instance.CorrectAnswerNum, GameManager.instance.IncorrectAnswerNum);

        GameObject.Find("HpGuage").transform.localScale = new Vector3(1, (GameManager.instance.BossHp > GameManager.instance.Score)? (float)(GameManager.instance.BossHp - GameManager.instance.Score) / GameManager.instance.BossHp : 0, 1);

        if (win) {
            GameObject.Find ("BackGround").GetComponent<Image> ().sprite = backgroundWin;
            GameObject.Find ("Title").GetComponent<Image> ().sprite = titleWin;
            GameObject.Find ("Enemy").GetComponent<Image> ().sprite = enemyWin[GameManager.instance.SelectLevel];
        } else {
            GameObject.Find ("BackGround").GetComponent<Image> ().sprite = backgroundLose;
            GameObject.Find ("Title").GetComponent<Image> ().sprite = titleLose;
            GameObject.Find ("Enemy").GetComponent<Image> ().sprite = enemyLose[GameManager.instance.SelectLevel];
        }
    }
开发者ID:nmrtkhs,项目名称:teacherHunting,代码行数:30,代码来源:ResultScene.cs

示例4: OnEnter

		public override void OnEnter ()
		{
			photonView = PhotonView.Get (gameObject.Value);
			photonView.RPC ("LoadLevel", targets, level.Value);
			Finish ();
			
		}
开发者ID:AlexGam,项目名称:TowerIsland,代码行数:7,代码来源:LoadLevel.cs

示例5: OnEnter

		public override void OnEnter ()
		{
			photonView = PhotonView.Get (gameObject.Value);
			photonView.RPC (methodName.Value, targets, parameter1.GetValue (),parameter2.GetValue());
			Finish ();
			
		}
开发者ID:AlexGam,项目名称:TowerIsland,代码行数:7,代码来源:SendRPC2.cs

示例6: OnEnter

		public override void OnEnter ()
		{
			photonView = PhotonView.Get (gameObject.Value);
			photonView.RPC ("SetFsmBool", targets, variable.Name,value.Value);
			Finish ();

		}
开发者ID:AlexGam,项目名称:TowerIsland,代码行数:7,代码来源:SetBool.cs

示例7: OnEnter

		public override void OnEnter ()
		{
			photonView = PhotonView.Get (gameObject.Value);
			photonView.RPC ("SetTrigger", targets, trigger.Value);
			Finish ();
			
		}
开发者ID:AlexGam,项目名称:TowerIsland,代码行数:7,代码来源:SetTrigger.cs

示例8: Start

    void Start()
    {
        myPhotonView = gameObject.GetComponent<PhotonView>();
        if (myPhotonView.isMine){

            myPhotonView.RPC("setLife", PhotonTargets.All );
        }
    }
开发者ID:unityosgt,项目名称:source,代码行数:8,代码来源:health.cs

示例9: Start

    // Use this for initialization
    void Start()
    {
        myView = this.GetComponent<PhotonView>();

        if(PhotonNetwork.isMasterClient){
            RandomPos();
            myView.RPC ("SetPosition",PhotonTargets.AllBuffered,position);
        }
    }
开发者ID:acimbru,项目名称:licenta,代码行数:10,代码来源:BonusPack.cs

示例10: DbUsernameCheck

 void DbUsernameCheck(string _username, PhotonPlayer _player)
 {
     GameObject controller = GameObject.FindGameObjectWithTag("GameController");
     bool _go = controller.GetComponent<Database>().CheckUsername(_username);
     Debug.Log("_go: " + _go);
     Debug.Log("_player: " + _player);
     myPhotonView = this.gameObject.GetComponent<PhotonView>();
     myPhotonView.RPC("DbUsercheckReturn", _player, _go);
 }
开发者ID:pShusta,项目名称:TheFellnightPrison,代码行数:9,代码来源:PhotonRPC.cs

示例11: Start

 // Use this for initialization
 void Start()
 {
     alphaWall = GameObject.Find ("AlphaWall") as GameObject;
     pv = GetComponent<PhotonView> ();
     curRoom = PhotonNetwork.room;
     bool isCustomBack = System.Convert.ToBoolean (curRoom.customProperties ["ISCUSTOMBACK"].ToString());
     string backgroundOfNewUser = curRoom.customProperties ["BACKGROUND"].ToString();
     pv.RPC ("SetBackground", PhotonTargets.All, backgroundOfNewUser, isCustomBack);
 }
开发者ID:earth88,项目名称:feuille,代码行数:10,代码来源:ChangeBackground.cs

示例12: Start

 void Start()
 {
     controller = GetComponent<NavMeshAgent>();
     GameManager.players.Add(gameObject);
     position = transform.position;
     playerAnimation = GetComponent<Animator>();
     photonView = GetComponent<PhotonView>();
     photonView.RPC("AddPlayer", PhotonTargets.AllBufferedViaServer, photonView.viewID);
     playerSpeed = controller.speed;
 }
开发者ID:Darkchicken,项目名称:SeniorProjectRPG,代码行数:10,代码来源:Runes.cs

示例13: DbLogin

    void DbLogin(string[] _creds, PhotonPlayer _player)
    {
        string _username = _creds[0];
        string _password = _creds[1];

        GameObject controller = GameObject.FindGameObjectWithTag("GameController");
        bool _go = controller.GetComponent<Database>().Login(_username, _password);

        myPhotonView = this.gameObject.GetComponent<PhotonView>();
        myPhotonView.RPC("LoginResult", _player, _go);
    }
开发者ID:pShusta,项目名称:TheFellnightPrison,代码行数:11,代码来源:PhotonRPC.cs

示例14: Start

 void Start()
 {
     health = 100;
     photonView = GetComponent<PhotonView> ();
     zombScript = GetComponent<ZombieScript> ();
     bool startAsZombie = true;
     foreach (ZombieScript zombz in FindObjectsOfType<ZombieScript>())
         if (zombz.isActiveAndEnabled)
             startAsZombie = false;
     if (startAsZombie)
         photonView.RPC ("TurnZomb", PhotonTargets.AllBufferedViaServer);
 }
开发者ID:TayoHatch,项目名称:Zombz,代码行数:12,代码来源:HealthStatusScript.cs

示例15: Start

	private void Start(){
		if (transform.root != transform) {
			EquipmentHandler handler = transform.root.gameObject.AddComponent<EquipmentHandler> ();
			handler.equipment = equipment;
			handler.defaultAttack=defaultAttack;
			Destroy(this);
			return;
		}
		photonView = PhotonView.Get (gameObject);
		if (photonView != null) {
			if ( !photonView.isMine) {
				photonView.RPC ("NetworkEquipRequest", photonView.owner, null);
			}else{
				if (defaultAttack != null) {
					gameObject.AddBehaviour(defaultAttack,attackGroup,true);
				}		
			}
		}
	}
开发者ID:AlexGam,项目名称:TowerIsland,代码行数:19,代码来源:EquipmentHandler.cs


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