コード例 #1
0
ファイル: MatchViewModel.cs プロジェクト: reposhelf/Cm93
        public void Substitute()
        {
            var subbedPlayer     = Team.Players.Single(p => p.Number == SelectedNumber);
            var substitutePlayer = SelectedSubstitute;

            SubstitutedPlayers.Add(subbedPlayer);

            substitutePlayer.Location.XamlX = subbedPlayer.Location.XamlX;
            substitutePlayer.Location.XamlY = subbedPlayer.Location.XamlY;

            TeamFormation[TeamFormation.
                          Where(kvp => kvp.Value.Number == subbedPlayer.Number).
                          Select(kvp => kvp.Key).Single()] = substitutePlayer;

            UpdatePlayerShirts();

            PlayerNumbers.Remove(SelectedNumber);
            PlayerSubstitutes.Remove(substitutePlayer);

            NotifyOfPropertyChange(() => PlayerSubstitutes);
            NotifyOfPropertyChange(() => PlayerNumbers);

            SelectedNumber     = 0;
            SelectedSubstitute = null;

            ++SubstitutesUsed;
        }
コード例 #2
0
 public void SetMass(MassTypes massType, PlayerNumbers playerNumber)
 {
     if (
         !(massType is MassTypes.Void) &&
         playerNumber == this.speedController
         )
     {
         GetComponent <Rigidbody>().mass = massType == MassTypes.Heavy
             ? this.heavyMass
             : this.lightMass;
     }
 }
コード例 #3
0
        public override void Initialize(PlayerNumbers pNumber)
        {
            playerNumber = pNumber;

            client = GameObject.Find("Network").GetComponent <UnityClient>();

            mainCamera = GameObject.Find("Main Camera").GetComponent <Camera>();
            if (mainCamera == null)
            {
                Debug.LogError("mainCamera is not set, will cause errors");
            }
        }
コード例 #4
0
ファイル: GameManager.cs プロジェクト: AceBreaker/LaserBattle
 public void ChangeTurn()
 {
     currentTurnPlayer.GetComponent <Player>().ToggleTurn();
     foreach (Transform child in transform)
     {
         currentTurnPlayer = child.gameObject;
         currentTurnPlayer.GetComponent <Player>().ToggleTurn();
         number = currentTurnPlayer.GetComponent <Player>().GetPlayerNumber();
         //currentTurnPlayer.GetComponent<Player>().GetPlayerNumber();
         child.SetAsLastSibling();
         break;
     }
 }
コード例 #5
0
        public void ShowWinner(PlayerNumbers player)
        {
            if (!CheckForWinnerTextGameObject())
            {
                return;
            }
            gameOverUI.SetActive(true);
            switch (player)
            {
            case PlayerNumbers.ONE:
            {
                winnerText.text  = redWinsText;
                winnerText.color = redWinsColor;
                break;
            }

            case PlayerNumbers.TWO:
            {
                winnerText.text  = blueWinsText;
                winnerText.color = blueWinsColor;
                break;
            }

            case PlayerNumbers.THREE:
            {
                Debug.LogError("Currently does not support three players");
                break;
            }

            case PlayerNumbers.FOUR:
            {
                Debug.LogError("Currently does not support four players");
                break;
            }

            default:
                Debug.LogError("PlayerNumbers is not valid");
                break;
            }
        }
コード例 #6
0
        public void ChangeColor(PlayerNumbers player)
        {
            switch (player)
            {
            case PlayerNumbers.ONE:
            {
                outline1.effectColor = outline3.effectColor = redColor;
                Color blah = new Color(redColor.r, redColor.g, redColor.b, 0.062f);
                Debug.Log(blah.r.ToString() + " " + blah.g.ToString() + " " + blah.b.ToString() + " " + blah.a.ToString());
                outline2.effectColor = blah;
                break;
            }

            case PlayerNumbers.TWO:
            {
                outline1.effectColor = outline3.effectColor = blueColor;
                Color blah = new Color(blueColor.r, blueColor.g, blueColor.b, 0.062f);
                Debug.Log(blah.r.ToString() + " " + blah.g.ToString() + " " + blah.b.ToString() + " " + blah.a.ToString());
                outline2.effectColor = blah;
                break;
            }

            case PlayerNumbers.THREE:
            {
                Debug.LogError("Three players not currently supported");
                break;
            }

            case PlayerNumbers.FOUR:
            {
                Debug.LogError("Four players not currently supported");
                break;
            }

            default:
                break;
            }
        }
コード例 #7
0
 public override void Initialize(PlayerNumbers pNumber)
 {
     //client = GameObject.Find("Network").GetComponent<UnityClient>();
 }
コード例 #8
0
ファイル: ControllerUtils.cs プロジェクト: chrismcmath/Ent2D
 public static bool Action1Up(PlayerNumbers playerNumber)
 {
     return Action1Up((int) playerNumber);
 }
コード例 #9
0
ファイル: ControllerUtils.cs プロジェクト: chrismcmath/Ent2D
 public static bool PauseDown(PlayerNumbers playerNumber)
 {
     return PauseDown((int) playerNumber);
 }
コード例 #10
0
ファイル: ControllerUtils.cs プロジェクト: chrismcmath/Ent2D
 public static float LeftStickVertical(PlayerNumbers playerNumber)
 {
     return LeftStickVertical((int) playerNumber);
 }
コード例 #11
0
ファイル: ControllerUtils.cs プロジェクト: chrismcmath/Ent2D
 public static float LeftStickHorizontal(PlayerNumbers playerNumber)
 {
     return LeftStickHorizontal((int) playerNumber);
 }
コード例 #12
0
ファイル: ControllerUtils.cs プロジェクト: chrismcmath/Ent2D
 public static bool Action2Down(PlayerNumbers playerNumber)
 {
     return Action2Down((int) playerNumber);
 }
コード例 #13
0
 public virtual void Initialize(PlayerNumbers pNumber)
 {
 }