本文整理汇总了C#中PlayerMovement.Kill方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerMovement.Kill方法的具体用法?C# PlayerMovement.Kill怎么用?C# PlayerMovement.Kill使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerMovement
的用法示例。
在下文中一共展示了PlayerMovement.Kill方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Explore
public void Explore(PlayerMovement player)
{
if (IsExplored) return;
if (HasBomb) {
HasBomb = false;
Debug.Log("Stepped on bomb!");
if (player != null) {
player.Kill();
player.Score += ScoreManager.Instance.SCORE_BOMB;
ScoreManager.Instance.CreateScoreText(ScoreManager.Instance.Player2ScoreText, transform.position, ScoreManager.Instance.SCORE_BOMB);
}
ScreenShake.Instance.ShakeCamera();
Instantiate(ParentMap.ExplosionPrefab, transform.position + new Vector3(0, 0, -1), transform.rotation);
SoundManager.Instance.Explosion();
}
else {
if (player != null) {
player.Score += ScoreManager.Instance.SCORE_EXPLORE;
SoundManager.Instance.Step();
}
}
if (IsGoal) {
player.Score += ScoreManager.Instance.SCORE_GOAL;
ScoreManager.Instance.CreateScoreText(ScoreManager.Instance.Player2ScoreText, transform.position, ScoreManager.Instance.SCORE_GOAL);
StartCoroutine(GameManager.Instance.GameOver());
}
IsExplored = true;
P1Marked = false;
P2Marked = false;
MapTile left = ParentMap.GetTile(X - 1, Y);
MapTile right = ParentMap.GetTile(X + 1, Y);
MapTile up = ParentMap.GetTile(X, Y + 1);
MapTile down = ParentMap.GetTile(X, Y - 1);
if (left) left.IsVisible = true;
if (right) right.IsVisible = true;
if (up) up.IsVisible = true;
if (down) down.IsVisible = true;
}