本文整理汇总了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);
}
}
示例2: Start
void Start()
{
photonView = GetComponent<PhotonView> ();
NAMEPLATE = gameObject.GetComponent<TextMesh>();
playerName = GetComponentInParent<PlayerStatus> ().playerName;
photonView.RPC ("setName", PhotonTargets.All, playerName);
}
示例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];
}
}
示例4: OnEnter
public override void OnEnter ()
{
photonView = PhotonView.Get (gameObject.Value);
photonView.RPC ("LoadLevel", targets, level.Value);
Finish ();
}
示例5: OnEnter
public override void OnEnter ()
{
photonView = PhotonView.Get (gameObject.Value);
photonView.RPC (methodName.Value, targets, parameter1.GetValue (),parameter2.GetValue());
Finish ();
}
示例6: OnEnter
public override void OnEnter ()
{
photonView = PhotonView.Get (gameObject.Value);
photonView.RPC ("SetFsmBool", targets, variable.Name,value.Value);
Finish ();
}
示例7: OnEnter
public override void OnEnter ()
{
photonView = PhotonView.Get (gameObject.Value);
photonView.RPC ("SetTrigger", targets, trigger.Value);
Finish ();
}
示例8: Start
void Start()
{
myPhotonView = gameObject.GetComponent<PhotonView>();
if (myPhotonView.isMine){
myPhotonView.RPC("setLife", PhotonTargets.All );
}
}
示例9: Start
// Use this for initialization
void Start()
{
myView = this.GetComponent<PhotonView>();
if(PhotonNetwork.isMasterClient){
RandomPos();
myView.RPC ("SetPosition",PhotonTargets.AllBuffered,position);
}
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
}
}
}