【发布时间】:2017-02-18 07:59:55
【问题描述】:
我想知道如何获取网络中所有可用玩家的位置。 那么如何更新我的脚本呢?
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class Pathfinding : MonoBehaviour {
Transform[] Players;
int TotalPlayerCount=0;
void Update() {
foreach (PhotonPlayer pl in PhotonNetwork.playerList) {
if (GetComponent<PhotonView> ().isMine) {
Players[TotalPlayerCount].position= //position of my player
TotalPlayerCount++;
}
else
{
Players[TotalPlayerCount].position=//position of all other player available in the room
TotalPlayerCount++;
}
}
}
【问题讨论】:
标签: c# unity3d game-engine multiplayer photon