Пример #1
0
        protected override void OnGamepadPluggedIn(SocketGamepad gamepad)
        {
            //Temporary until Acquire Caleb's menu system to select player


            if (PlayerSpawn.Count > 0)
            {
                //Debug.Log("Next Player: " + NextSpawn.ToString());
                if (NextSpawn < PlayerSpawn.Count)
                {
                    GameObject PlayerObj = PlayerSpawn[NextSpawn].Spawn(PlayerSpawn[NextSpawn].transform.position, PlayerSpawn[NextSpawn].transform.rotation);

                    SurvivorPlayer Player = PlayerObj.AddComponent <SurvivorPlayer>();
                    Player.Gamepad  = gamepad;
                    Player.FyoApp   = this;
                    Player.PlayerId = LocalPlayers.Count;

                    LocalPlayers.Add(Player);
                    ActiveGamepads.Add(gamepad, Player);

                    Framing.TrackedObjects.Add(Player.gameObject);
                }

                //Advance Spawn Point
                if (++NextSpawn >= PlayerSpawn.Count)
                {
                    NextSpawn = 0;
                }
            }
            else
            {
                Debug.LogError("Negative Spawn Index");
            }
        }
Пример #2
0
        protected override void OnStart()
        {
            if (XPlayerTile == null)
            {
                Debug.LogError("X Player Tile GameObject is null!");
            }
            else
            {
                XPlayer = XPlayerTile.GetComponent <TicTacToePlayer>();
            }

            if (OPlayerTile == null)
            {
                Debug.LogError("O Player Tile GameObject is null!");
            }
            else
            {
                OPlayer = OPlayerTile.GetComponent <TicTacToePlayer>();
            }

            LocalPlayers.Add(XPlayer);
            LocalPlayers.Add(OPlayer);

            Reset();
        }
Пример #3
0
        /// <summary>
        /// Raised when the Live player signed in
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnLiveGamerSignedIn(object sender, SignedInEventArgs e)
        {
            var identifiedPlayer = new LiveIdentifiedPlayer(e.Gamer);

            LocalPlayers.Add(e.Gamer.PlayerIndex, identifiedPlayer);

            OnPlayerLogin(identifiedPlayer);
        }
Пример #4
0
        /// <summary>
        /// Identifies a player
        /// </summary>
        /// <param name="playerInput">The PlayerInput instance used by the player to identify</param>
        public override void IdentifyPlayer(PlayerInput playerInput)
        {
            var identifiedPlayer = new LocalIdentifiedPlayer(playerInput);

            LocalPlayers.Add(playerInput.PlayerIndex, identifiedPlayer);

            OnPlayerLogin(identifiedPlayer);
        }