本文整理汇总了C#中PlayerInfo类的典型用法代码示例。如果您正苦于以下问题:C# PlayerInfo类的具体用法?C# PlayerInfo怎么用?C# PlayerInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PlayerInfo类属于命名空间,在下文中一共展示了PlayerInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:jhoe123,项目名称:Yonatan-Project,代码行数:8,代码来源:GameHelpers.cs
示例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;
}
开发者ID:AlexSbyshko,项目名称:Barsik,代码行数:27,代码来源:PlayersParser.cs
示例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);
}
开发者ID:renatodex,项目名称:the-fat-and-the-dungeon,代码行数:33,代码来源:MonsterController.cs
示例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);
}
}
开发者ID:Mitsugaru,项目名称:Salpakan,代码行数:27,代码来源:CoverManager.cs
示例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();
}
}
}
开发者ID:zhutaorun,项目名称:ACGCard-for-Unity3D,代码行数:26,代码来源:PlayerInfoHandler.cs
示例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);
}
}
开发者ID:ziek-za,项目名称:csc3020h_capstone,代码行数:35,代码来源:Level_NetworkController.cs
示例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();
}
开发者ID:KileyDowling,项目名称:Samples,代码行数:34,代码来源:ShipSetUp.cs
示例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;
}
开发者ID:jberg03,项目名称:GSP494-Team-A,代码行数:9,代码来源:PlayerEnergyHUD.cs
示例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);
}
开发者ID:FrankFlamme,项目名称:AntMeCore,代码行数:25,代码来源:SecureSimulationClient.cs
示例10: GameInfo
public GameInfo( PlayerInfo pOwner, PlayerInfo pOpponent, int pOwnerScore, int pOpponentScore)
{
owner = pOwner;
opponent = pOpponent;
ownerScore = pOwnerScore;
opponentScore = pOpponentScore;
}
开发者ID:jhoe123,项目名称:Yonatan-Project,代码行数:7,代码来源:GameTypes.cs
示例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);
}
开发者ID:superkaka,项目名称:mycsharp,代码行数:26,代码来源:Program.cs
示例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;
}
开发者ID:k402xxxcenxxx,项目名称:our-RPGMineSweep,代码行数:25,代码来源:PlayerContainer.cs
示例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;
}
开发者ID:svargy,项目名称:arma3beclient,代码行数:28,代码来源:ServerPlayers.cs
示例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;
}
开发者ID:jberg03,项目名称:GSP494-Team-A,代码行数:9,代码来源:PlayerHealthHUD.cs
示例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;
}
开发者ID:TamaHobbit,项目名称:DMV,代码行数:34,代码来源:PlayerManager.cs
示例16: GetInput
public void GetInput(PlayerInfo.MovementDirection current, PlayerInfo.MovementDirection previous) {
if(this.isMoving)
return;
this._canUndo = false;
this.GetCurrentBlock();
this.CheckCurrentBlock();
AIMovement.instance.ResetMovement();
AIMovement.instance.UndoPosition = this.transform.position;
if(current == PlayerInfo.MovementDirection.FORWARD) {
this._currentDirection = PlayerInfo.MovementDirection.BACKWARD;
AIMovement.instance.RotateToMovement(180.0f);
AIMovement.instance.MoveVector = new Vector3(0, 0, -1);
} else if(current == PlayerInfo.MovementDirection.RIGHT) {
this._currentDirection = PlayerInfo.MovementDirection.LEFT;
AIMovement.instance.RotateToMovement(270.0f);
AIMovement.instance.MoveVector = new Vector3(-1, 0, 0);
} else if(current == PlayerInfo.MovementDirection.BACKWARD) {
this._currentDirection = PlayerInfo.MovementDirection.FORWARD;
AIMovement.instance.RotateToMovement(0.0f);
AIMovement.instance.MoveVector = new Vector3(0, 0, 1);
} else if(current == PlayerInfo.MovementDirection.LEFT) {
this._currentDirection = PlayerInfo.MovementDirection.RIGHT;
AIMovement.instance.RotateToMovement(90.0f);
AIMovement.instance.MoveVector = new Vector3(1, 0, 0);
}
this.CheckCurrentBlock();
//AIAudio.instance.PlayMovement();
this.isMoving = true;
this.previousPos = this.currentPos;
this.currentPos = new Vector2(this.transform.position.x, this.transform.position.z);
}
开发者ID:ChrisJong,项目名称:Harmony,代码行数:35,代码来源:AIController.cs
示例17: OnPlayerGUID
public void OnPlayerGUID(PlayerInfo player)
{
if (Program.IsAdmin(player)) // bypass fuck yeah
return;
using (DatabaseClient dbClient = Program.DBManager.GetGlobalClient())
{
dbClient.AddParameter("guid", player.GUID);
DataRow row = dbClient.ReadDataRow("SELECT code,confirmed FROM whitelist_awa WHERE guid = @guid");
if (row == null)
{
// Not in whitelist, generate code and kick.
string code = GetRandomString().ToLower().Replace("o", "").Replace("0", "").Replace("l", "").Replace("1", "");
dbClient.AddParameter("ip", player.IP);
dbClient.AddParameter("code", code);
dbClient.AddParameter("name", player.Name);
dbClient.AddParameter("id", 0);
dbClient.ExecuteQuery("INSERT INTO whitelist_awa(ip,code,guid,unique_id,name) VALUES(@ip,@code,@guid,@id,@name)");
_server.GetBattlEyeClient().SendCommand(BattlEyeCommand.Kick, string.Format("{0} Whitelist code: \"{1}\"! Go to awkack.org to register", player.ID, code));
Logging.WriteServerLine(String.Format("Kicking player \"{0}\" (not on whitelist).", player.Name), _server.serverID.ToString(), ConsoleColor.Gray);
}
else if ((bool)row["confirmed"] == false) // not confirmed..
{
_server.GetBattlEyeClient().SendCommand(BattlEyeCommand.Kick, string.Format("{0} Whitelist code: \"{1}\"! Go to awkack.org to register", player.ID, row["code"]));
Logging.WriteServerLine(String.Format("Kicking player \"{0}\" (not confirmed in whitelist).", player.Name), _server.serverID.ToString(), ConsoleColor.Gray);
}
}
}
开发者ID:AudunWA,项目名称:AWARcon,代码行数:31,代码来源:Whitelist.cs
示例18: Initialize
public virtual void Initialize()
{
//can't do anything else if we don't have PlayerInfo resources loaded!
m_myPlayerInfo = m_nvs.myInfo;
if (m_myPlayerInfo.cartGameObject == null || m_myPlayerInfo.ballGameObject == null) return;
//also make sure we can get the player camera
m_myCamera = Camera.main;
if (m_myCamera == null) return;
//get info from all players
m_players = new List<PlayerInfo>();
//we don't want to use foreachs, for collection iteration errors on disconnect scenarios
for (int i = 0; i < m_nvs.players.Count; i++) {
PlayerInfo player = (PlayerInfo)m_nvs.players[i];
if (player != null) {
// do NOT want to include the player himself
if (player != m_myPlayerInfo) {
m_players.Add(player);
}
}
}
m_initialized = true;
}
开发者ID:Garm88,项目名称:bad-golf-community-edition,代码行数:26,代码来源:NetworkedHUDElement.cs
示例19: GiveMeACart
void GiveMeACart(string cartModel, string ballModel, string characterModel, NetworkMessageInfo info)
{
// create new buggy for the new guy - his must be done on the server otherwise collisions wont work!
Vector3 spawnLocation = new Vector3(0,5,0);
Vector3 velocity = new Vector3(0,0,0);
// instantiate the prefabs
GameObject cartContainerObject = (Instantiate(Resources.Load(cartModel), spawnLocation, Quaternion.identity) as GameObject);
GameObject ballGameObject = Instantiate(Resources.Load(ballModel), spawnLocation + new Vector3(3,0,0), Quaternion.identity) as GameObject;
GameObject characterGameObject = Instantiate(Resources.Load(characterModel), spawnLocation + new Vector3(0,-1,0), Quaternion.identity) as GameObject;
GameObject cartGameObject = cartContainerObject.transform.FindChild ("buggy").gameObject;
// set buggy as characters parent
characterGameObject.transform.parent = cartGameObject.transform;
// create and set viewIDs
NetworkViewID cartViewIDTransform = Network.AllocateViewID();
NetworkView cgt = cartContainerObject.AddComponent("NetworkView") as NetworkView;
cgt.observed = cartContainerObject.transform;
cgt.viewID = cartViewIDTransform;
cgt.stateSynchronization = NetworkStateSynchronization.Unreliable;
NetworkViewID cartViewIDRigidbody = Network.AllocateViewID();
NetworkView cgr = cartGameObject.AddComponent("NetworkView") as NetworkView;
cgr.observed = cartGameObject.rigidbody;
cgr.viewID = cartViewIDRigidbody;
cgr.stateSynchronization = NetworkStateSynchronization.Unreliable;
NetworkViewID ballViewID = Network.AllocateViewID();
ballGameObject.networkView.viewID = ballViewID;
NetworkViewID characterViewID = Network.AllocateViewID();
characterGameObject.networkView.viewID = characterViewID;
// tell everyone else about it
networkView.RPC("SpawnPrefab", RPCMode.Others, cartViewIDTransform, spawnLocation, velocity, cartModel);
networkView.RPC("SpawnPrefab", RPCMode.Others, ballViewID, spawnLocation, velocity, ballModel);
networkView.RPC("SpawnPrefab", RPCMode.Others, characterViewID, spawnLocation, velocity, characterModel);
// tell all players this is a player and not some random objects
networkView.RPC("SpawnPlayer", RPCMode.Others, cartViewIDTransform, cartViewIDRigidbody, ballViewID, characterViewID, 0, info.sender);
// tell the player it's theirs
networkView.RPC("ThisOnesYours", info.sender, cartViewIDTransform, ballViewID, characterViewID);
// create a PlayerInfo for it
PlayerInfo newGuy = new PlayerInfo();
newGuy.cartModel = cartModel;
newGuy.cartContainerObject = cartContainerObject;
newGuy.cartGameObject = cartGameObject;
newGuy.cartViewIDTransform = cartViewIDTransform;
newGuy.cartViewIDRigidbody = cartViewIDRigidbody;
newGuy.ballModel = ballModel;
newGuy.ballGameObject = ballGameObject;
newGuy.ballViewID = ballViewID;
newGuy.characterModel = characterModel;
newGuy.characterGameObject = characterGameObject;
newGuy.characterViewID = characterViewID;
newGuy.currentMode = 0; // set them in buggy
newGuy.player = info.sender;
// add it to the lists
nvs.players.Add(newGuy);
}
开发者ID:Ronnrein,项目名称:bad-golf-community-edition,代码行数:60,代码来源:networkManagerServer.cs
示例20: Start
// Use this for initialization
void Start()
{
cc = GetComponent<CharacterController>();
pi = GetComponent<PlayerInfo>();
mass = pi.mass;
}
开发者ID:scottlarkin,项目名称:AGD,代码行数:8,代码来源:DamageReceiver.cs
注:本文中的PlayerInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论