本文整理汇总了C#中PlayerInfo类的典型用法代码示例。如果您正苦于以下问题:C# PlayerInfo类的具体用法?C# PlayerInfo怎么用?C# PlayerInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PlayerInfo类属于命名空间,在下文中一共展示了PlayerInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetLocalPlayerInfo
//use to get the local player info
public static PlayerInfo GetLocalPlayerInfo()
{
if( mLocalPlayer == null)
mLocalPlayer = new PlayerInfo( "lcl", "Local Player", false);
return mLocalPlayer;
}
示例2: Parse
public IEnumerable<PlayerInfo> Parse(byte[] data)
{
var players = new List<PlayerInfo>();
var reader = new PacketReader(data);
var header = reader.ReadByte();
var chard = Convert.ToChar(header);
var numberOfPlayers = reader.ReadByte();
for (byte i = 1; i <= numberOfPlayers; i++)
{
var player = new PlayerInfo();
if (!reader.IsEnd)
{
player.Index = reader.ReadByte(); // always returns 0
player.Index = i;
player.Name = reader.ReadUTFString();
player.Score = reader.ReadLong();
player.Duration = reader.ReadFloat();
}
players.Add(player);
}
return players;
}
示例3: Awake
// Use this for initialization
void Awake () {
Debug.Log ("battle sights start ");
this._npc = new NpcAttributes();
this._npc._name = this._name;
this._npc._hp = this._hp;
this._npc._attack_power = this._attack_power;
this._npc._defense_power = this._defense_power;
this._npc.init();
StartCoroutine("sp_BattleSight");
this._playerInfo = new PlayerInfo();
this._hudActionsMapper = new List<Animator>();
this._hudActionsMapper.Add (GameObject.Find ("Attack_ScaryFace").GetComponent<Animator>());
this._hudActionsMapper.Add (GameObject.Find ("Attack_Food").GetComponent<Animator>());
this._hudActionsMapper.Add (GameObject.Find ("Attack_Pose").GetComponent<Animator>());
this._hudActionsMapper.Add (GameObject.Find ("Attack_Fart").GetComponent<Animator>());
this._leroyAnimationMapper = new List<string>();
this._leroyAnimationMapper.Add ("attack_scaryface");
this._leroyAnimationMapper.Add ("attack_food");
this._leroyAnimationMapper.Add ("attack_pose");
this._leroyAnimationMapper.Add ("attack_fart");
BattleActionsController battleActionController = Pick.Instance.getBattleActionsController();
this._hudActionSoundMapper = new List<AudioSource>();
this._hudActionSoundMapper.Add (battleActionController._AttackScaryFace);
this._hudActionSoundMapper.Add (battleActionController._AttackFood);
this._hudActionSoundMapper.Add (battleActionController._AttackPose);
this._hudActionSoundMapper.Add (battleActionController._AttackFart);
}
示例4: MaskPlayer
public void MaskPlayer(PlayerInfo player)
{
UnitPiece[] pieces = new UnitPiece[player.Pieces.Count];
player.Pieces.CopyTo(pieces, 0);
for (int i = 0; i < pieces.Length; i++)
{
BoardPosition boardPosition = UnitManager.GetPositionForUnitPiece(pieces[i]);
Transform transform = BoardManager.GetTransformForPosition(boardPosition);
Vector3 coverPosition = transform.position;
coverPosition.z = GOLayer.COVER_LAYER;
GameObject cover = covers[i];
if (cover.activeInHierarchy)
{
for (int j = i + 1; j < covers.Count; j++)
{
cover = covers[j];
if (!cover.activeInHierarchy)
{
break;
}
}
}
cover.transform.position = coverPosition;
cover.SetActive(true);
coverBoardPositions.Add(boardPosition, cover);
}
}
示例5: Process
public void Process(SocketModel model)
{
if (model.returnCode == ReturnCode.Success)
{
//服务器正常返回
PlayerInfoDTO data = JsonCoding<PlayerInfoDTO>.decode(model.message);
PlayerInfo playerInfo = new PlayerInfo();
playerInfo.UUID = data.UUID;
playerInfo.uid = data.uid;
playerInfo.playerName = data.playerName;
playerInfo.level = data.level;
playerInfo.coin = data.coin;
playerInfo.gem = data.gem;
playerInfo.vipExpire = data.vipExpire;
//UDP返回的数据不提交给全局
Global.Instance.playerInfo = playerInfo;
if (Global.Instance.scene == SceneType.MenuScene)
{
//更新UI数据
GameObject.FindGameObjectWithTag(Tags.SceneController).GetComponent<MenuScene>().UpdatePlayerInfo();
}
}
}
示例6: JoinedRoom
void JoinedRoom()
{
Debug.Log("Connected to Room");
PhotonNetwork.Instantiate(respawner.name,Vector3.zero,Quaternion.identity,0);
PlayerInfo newPlayer = new PlayerInfo(_MainController.playerName);
neutPlayers.Add(newPlayer);
Debug.Log("PhotonNetwork.playerList.Length "+PhotonNetwork.playerList.Length);
if (neutPlayers.Count <= 1){
for (int i = 0; i < PhotonNetwork.playerList.Length - 1; i++){
newPlayer = new PlayerInfo("blank_name");
neutPlayers.Add(newPlayer);
}
}
//-1 so don't count us
//for (int i = 0; i < PhotonNetwork.playerList.Length - 1; i++){
// newPlayer = new PlayerInfo("blank_name");
// neutPlayers.Add(newPlayer);
//}
Map_TerrainController tc = Terrain.activeTerrain.GetComponent<Map_TerrainController>();
tc.SetTerrainHeightMap();
tc.SetFreezeMap();
tc.SetClampMap ();
Debug.Log ("hm reset");
if (firstPlayer){
Debug.Log("Host Joined");
firstPlayer = false;
//mapController.GetComponent<Level_MapController>().SetLevelObjects(false);
//tc.SetTerrainTexture (0, 0, tc.terrain.terrainData.alphamapWidth, tc.terrain.terrainData.alphamapHeight);
}
}
示例7: AllowUserToPlace5Ships
public void AllowUserToPlace5Ships(GameBoard gameBoard, PlayerInfo playerInfo)
{
Console.WriteLine("Hello, {0}! Let's place your ships \n", playerInfo.UserName);
//places ship
int counter = 0;
//iterates through for all 5 placements
while (counter < 5)
{
Console.WriteLine("\n-- Place Ship #{0}", counter+1);
ShipSetUp setUpYourShip = new ShipSetUp(); // acces UI Ship Placement
PlaceShipRequest shipRequest = new PlaceShipRequest(); // initiates placeship request business logic
//assigns user entered ship placeemnt biz logic request using the associated board dictionary
shipRequest = setUpYourShip.SetUpShip(gameBoard.BoardDictionary,counter);
//assigns ship request to player1's board
//PlaceShip method on the Board(biz logic) checks if the PlaceShip is valid
ShipPlacement placeShipResult = playerInfo.MyBoard.PlaceShip(shipRequest);
if (placeShipResult != ShipPlacement.Ok )
{
Console.WriteLine("\n\t\t****ERROR -- INVALID SHIP PLACEMENT****\n");
counter--;
}
;
counter++;
}
Console.WriteLine("Thank you for your input {0}! Press enter to clear the console so the other player cannot cheat!", playerInfo.UserName);
Console.ReadLine();
Console.Clear();
}
示例8: Start
//public Texture texture;
// Use this for initialization
void Start()
{
energyBarLength = Screen.width / 2;
playerEnergy = this.transform.GetComponent<PlayerInfo>();
maxEnergy = playerEnergy.MaxEnergy;
currentEnergy = playerEnergy.energy;
}
示例9: InitSimulation
protected override void InitSimulation(int seed, LevelInfo level, PlayerInfo[] players, Slot[] slots)
{
simulation = new SecureSimulation(extensionPaths);
// Settings aufbauen
Setup settings = new Setup();
settings.Seed = seed;
settings.Level = level.Type;
settings.Player = new TypeInfo[AntMe.Level.MAX_SLOTS];
settings.Colors = new PlayerColor[AntMe.Level.MAX_SLOTS];
for (int i = 0; i < AntMe.Level.MAX_SLOTS; i++)
{
// Farben übertragen
settings.Colors[i] = slots[i].ColorKey;
// KIs einladen
if (players[i] != null)
{
settings.Player[i] = players[i].Type;
}
}
simulation.Start(settings);
}
示例10: GameInfo
public GameInfo( PlayerInfo pOwner, PlayerInfo pOpponent, int pOwnerScore, int pOpponentScore)
{
owner = pOwner;
opponent = pOpponent;
ownerScore = pOwnerScore;
opponentScore = pOpponentScore;
}
示例11: doRequestPlayers
static void doRequestPlayers(BaseProtocolVO baseVO)
{
var vo = (RequestPlayers)baseVO;
var players = new PlayerInfo[3];
for (int i = 1; i <= 3; i++)
{
players[i - 1] = new PlayerInfo()
{
uid = i + 20000,
name = "qqq" + i,
status = i % 2 == 0,
type = (PlayerType)i,
maxResetTimes = i,
fff = i * 100 + i * 0.11111f,
createTime = DateTime.Now,
items = new[] { 111, 222, 777 },
};
}
var response = new ResponsePlayers()
{
status = true,
players = players,
};
server.Send(response, baseVO.customData);
}
示例12: Load
public PlayerInfo Load()
{
PlayerInfo loadedPlayer = new PlayerInfo();
loadedPlayer.Name = PlayerPrefs.GetString("name");
loadedPlayer.id = PlayerPrefs.GetInt("id");
loadedPlayer.diamonds = PlayerPrefs.GetInt("diamonds");
loadedPlayer.helmet = PlayerPrefs.GetInt("helmet");
loadedPlayer.armor = PlayerPrefs.GetInt("armor");
loadedPlayer.pants = PlayerPrefs.GetInt("pants");
loadedPlayer.shoes = PlayerPrefs.GetInt("shoes");
for (int i = 1; i <= PlayerPrefs.GetInt("c_index"); i++)
{
loadedPlayer.Characters.Add(PlayerPrefs.GetInt("c" + i.ToString()));
}
for (int i = 1; i <= PlayerPrefs.GetInt("e_index"); i++)
{
loadedPlayer.Equipments.Add(PlayerPrefs.GetInt("e" + i.ToString()));
}
for (int i = 1; i <= 6; i++)
{
loadedPlayer.Status.Add(PlayerPrefs.GetInt("s" + i.ToString()));
}
return loadedPlayer;
}
示例13: Parse
public static ServerPlayers Parse(byte[] data)
{
var parser = new ResponseParser(data);
parser.CurrentPosition += 5; //Header
var result = new ServerPlayers();
result.PlayerCount = parser.GetByte();
result.Players = new PlayerInfo[result.PlayerCount];
for (var i = 0; i < result.PlayerCount; i++)
{
var p = new PlayerInfo();
p.N = parser.GetByte();
p.Name = parser.GetStringToTermination();
p.Score = parser.GetLong();
p.Time = TimeSpan.FromSeconds(parser.GetDouble());
//parser.CurrentPosition+=4;
result.Players[i] = p;
//break;
}
return result;
}
示例14: Start
//public Texture texture;
// Use this for initialization
void Start()
{
healthBarLength = Screen.width / 2;
playerHealth = this.transform.GetComponent<PlayerInfo>();
maxHealth = playerHealth.MaxHealth;
currentHealth = playerHealth.health;
}
示例15: AddPlayerToPlayerManager
public bool AddPlayerToPlayerManager(int photonPlayerID, int index)
{
bool succes = false;
// find player in connected clinets list and write playerInfo to the list of playerinfo's
PhotonPlayer[] players = PhotonNetwork.playerList;
for (int i = 0; i < players.Length; i++)
{
if (players[i].ID == photonPlayerID)
{
PhotonPlayer photonPlayer = players[i];
PlayerInfo pInfo = new PlayerInfo();
pInfo.PhotonPlayer = photonPlayer;
pInfo.PlayerObject = null;
pInfo.SlotID = index;
// add playerInfo to players List
m_PlayerInfoList[index] = (pInfo);
// Assign player to Scoreboard slot
ScoreBoard.GetInstance().AssignPlayerToSlot(photonPlayer, index);
// Log message to players
string coloredPlayerName = ColorUtility.ColorRichtText(m_SlotColorList[index], photonPlayer.name);
EventLog.GetInstance().LogMessage( "<b>" + coloredPlayerName + "</b> has connected!");
succes = true;
}
}
return succes;
}