本文整理汇总了C#中Player.Init方法的典型用法代码示例。如果您正苦于以下问题:C# Player.Init方法的具体用法?C# Player.Init怎么用?C# Player.Init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Player
的用法示例。
在下文中一共展示了Player.Init方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitPlayers
void InitPlayers()
{
GameObject playerPrefab = Resources.Load<GameObject>("Prefabs/Player");
GameObject player1 = Instantiate(playerPrefab) as GameObject;
player1.name = "Player_1";
player_1 = player1.GetComponent<Player>();
player_1.Init();
player_1.Name = "Player 1";
player_1.Team = 1;
player_1.Element0 = Element.Fire;
player_1.Element1 = Element.Earth;
player_1.Element2 = Element.Water;
player_1.Element3 = Element.Nature;
GameObject player2 = Instantiate(playerPrefab) as GameObject;
player2.name = "Player_2";
player_2 = player2.GetComponent<Player>();
player_2.Init();
player_2.Name = "Player 2";
player_2.Team = 2;
player_2.Element0 = Element.Dark;
player_2.Element1 = Element.Light;
player_2.Element2 = Element.Electric;
player_2.Element3 = Element.Ice;
m_hud.SetPlayerInfo(player_1);
player_1.StartTurn();
}
示例2: Start
void Start()
{
Player tester = new Player();
tester.Init(Library.GetHandCards());
players.Add(tester);
if (setManager != null)
{ setManager.Init(Library.TestDeck()); }
tester.StartTurn();
}
示例3: Start
// Use this for initialization
void Start () {
aniControlScript = (PlayerAnimationControl)this.transform.FindChild("Male001").GetComponent<PlayerAnimationControl>();
moveBaseScript = (PlayerMoveBase)this.GetComponent<PlayerMoveBase>();
directionIcon = this.transform.FindChild("icon");
specialAttackIcon = this.transform.FindChild("SpecialAttackIcon");
player = gameObject.AddComponent<Player>();
player.Init(1000);
SceneMng.instance.AddMainPlayer(player);
}
示例4: CheckPlayerExists
protected Player CheckPlayerExists(ISession session, string playerKey)
{
Player player = null;
try
{
player = session.CreateCriteria(typeof(Player))
.List<Player>().FirstOrDefault(x => x.Member.MemberKey.Equals(playerKey));
}
catch (NullReferenceException) { }
if (player != null) return player;
var member = session.CreateCriteria(typeof(Member))
.List<Member>().FirstOrDefault(x => x.MemberKey.Equals(playerKey));
if (member == null) return null;
player = new Player {Member = member};
player.Init();
return player;
}
示例5: CreatePlayers
public void CreatePlayers() {
boardInput = GetComponent<ChessInput> ();
HumanPlayer whiteHuman = null;
HumanPlayer blackHuman = null;
AIPlayer whiteAI = null;
AIPlayer blackAI = null;
if (blackPlayerType == PlayerType.Human) {
ChessUI.instance.SetBoardOrientation(false);
blackHuman = new HumanPlayer ();
boardInput.AddPlayer (blackHuman);
} else {
blackAI = new AIPlayer ();
}
if (whitePlayerType == PlayerType.Human) {
ChessUI.instance.SetBoardOrientation(true);
whiteHuman = new HumanPlayer ();
boardInput.AddPlayer (whiteHuman);
FindObjectOfType<NotationInput>().SetPlayer(whiteHuman);
} else {
whiteAI = new AIPlayer ();
}
whitePlayer = (Player)whiteHuman ?? (Player)whiteAI;
blackPlayer = (Player)blackHuman ?? (Player)blackAI;
whitePlayer.OnMove += OnMove;
blackPlayer.OnMove += OnMove;
whitePlayer.Init (true);
blackPlayer.Init (false);
whiteToPlay = Board.IsWhiteToPlay ();
RequestMove ();
}
示例6: SetupGame
void SetupGame()
{
//Setup Board
Board.Tiles = Board.gameObject.GetComponent<BoardCreator>().BuildBoard(boardParent, BoardWidth, BoardHeight);
//Setup Camera
Camera.main.GetComponent<CameraControl>().XMax = (BoardWidth - 1) * 1.2f + 0.6f + 6;
Camera.main.GetComponent<CameraControl>().YMax = (BoardHeight - 1) * 1.03f + 6;
//Setup Player
GameObject pTmp = (GameObject)GameObject.Instantiate(Resources.Load("Assets/Prefabs/Player") as GameObject, Vector3.zero, Quaternion.identity);
player = pTmp.GetComponent<Player>();
player.Init(this, Board.getRandomTile());
Camera.main.GetComponent<CameraControl>().CenterCamera(player.tileID);
//Setup AI
AI.Init(Enemies);
//Setup Game
//Start Turn
NextTurn();
UIManager.setUI(player);
}
示例7: Start
void Start ()
{
MinionManager.Instance.Init();
opponent = new Player();
you = new Player();
activePlayer = you;
yourPlayerDeck = new PlayerDeck();
opponentPlayerDeck = new PlayerDeck();
yourPlayerDeck.Init(PlayerType.You);
opponentPlayerDeck.Init(PlayerType.Opponent);
opponent.Init(PlayerType.Opponent);
you.Init(PlayerType.You);
opponent.GameStart();
you.GameStart();
activePlayer.FirstStartTurn();
NextTurnButton.ReleasedEvent += StartFight;
}
示例8: Awake
void Awake()
{
Character = GetComponent<Player> ();
Character.Init(MoveAccel);
}
示例9: AddStats
public bool AddStats(List<DLStat> statsList)
{
using (var session = NHibernateHelper.OpenSession())
{
using (var transaction = session.BeginTransaction())
{
try
{
var bwccXmlDoc = new XmlDocument();
bwccXmlDoc.Load(
HttpContext.Current.Server.MapPath(
"~/Modules/ivNet.Club/App_Data/MySql/members.xml"));
var memberType = session.CreateCriteria(typeof (MemberType))
.List<MemberType>().FirstOrDefault(x => x.Name.Equals("Player"));
foreach (var dlStat in statsList)
{
// HowOut
var howout = session.CreateCriteria(typeof (HowOut))
.List<HowOut>().FirstOrDefault(x => x.Name.Equals(dlStat.HowOut)) ??
new HowOut();
if (howout.Id == 0)
{
howout.Name = dlStat.HowOut;
SetAudit(howout);
session.Save(howout);
}
// Fixture
var fixture = session.CreateCriteria(typeof (Fixture))
.List<Fixture>().FirstOrDefault(x => x.FixtureKey.Equals(dlStat.FixtureKey)) ??
new Fixture();
// Player
var player = session.CreateCriteria(typeof (Player))
.List<Player>().FirstOrDefault(x => x.Member.MemberKey.Equals(dlStat.MemberKey)) ??
new Player();
if (player.Id == 0)
{
// Member
var member = session.CreateCriteria(typeof (Member))
.List<Member>().FirstOrDefault(x => x.MemberKey.Equals(dlStat.MemberKey)) ??
new Member();
if (member.Id != 0)
{
member.AddMemberType(memberType);
SetAudit(member);
session.SaveOrUpdate(member);
player = new Player
{
Member = member
};
player.Init();
SetTypeNickname(player, bwccXmlDoc, member.LegacyId);
SetAudit(player);
session.SaveOrUpdate(player);
}
//else
//{
// var cakes = "";
//}
}
//if (fixture.Id == 0)
//{
// var zozo = "";
//}
if (howout.Name != "DNB")
{
var battingStat = new BattingStat
{
Position = dlStat.Position,
Runs = dlStat.RunsScored,
Player = player,
Fixture = fixture,
HowOut = howout
};
SetAudit(battingStat);
session.SaveOrUpdate(battingStat);
}
if (dlStat.OversBowled>0)
{
var bowlingStat = new BowlingStat
{
Overs = dlStat.OversBowled,
Maidens = dlStat.Maidens,
//.........这里部分代码省略.........
示例10: Loaded
public void Loaded (Player player) {
player.transform.position = startingPoint.position;
player.Init ();
ActivateDoor (false);
}
示例11: InitPlayer
void InitPlayer()
{
jugador= Player.Create(this, new Vector2(0,0));
jugador.Init();
}
示例12: SetPlayer
public void SetPlayer(GameObject player)
{
if (player == null)
return;
PlayerObject = new Player();
PlayerObject.Name = "Player1";
PlayerObject.WorldObject = player;
PlayerObject.Init();
BattleMan.Init(PlayerObject, ActiveCharacters);
SpawnMobsInRooms();
SetupTreasures();
}