Exemplo n.º 1
0
 public bool RemovePlayer(PinouPlayer player)
 {
     if (player != null)
     {
         player.Destroy();
         _players.Remove(player);
         OnPlayerRemoved.Invoke(player);
         return(true);
     }
     return(false);
 }
Exemplo n.º 2
0
 protected override void OnSafeStart()
 {
     if (_absoluteFocusByDefault == true)
     {
         ReceiveAbsoluteFocus(_absoluteFocusMode);
     }
     else if (_playerFocusByDefault > -1)
     {
         PinouPlayer player = PinouApp.Player.GetPlayerByID(_playerFocusByDefault);
         if (player != null)
         {
             player.Focus(this, _playerFocusMode);
         }
     }
 }
 private void Update()
 {
     if (IsLinked == false)
     {
         switch (_linkingMethod)
         {
         case LinkingMethod.PlayerInputReceiver:
             PinouPlayer player = PinouApp.Player.GetPlayerByID(_playerID);
             if (player != null && player.Focuses.Length > 0)
             {
                 _currentReceiver = player.Focuses[0];
             }
             break;
         }
     }
 }
Exemplo n.º 4
0
        public void LooseFocus(PinouPlayer player)
        {
            if (_focusingPlayer == player)
            {
                _focusingPlayer = null;
                OnLoosePlayerFocus.Invoke(this, player);
            }

            if (player.IsFocused(this) == true)
            {
                player.RemoveFocus(this);
            }

            if (_playerFocused.Contains(this) == true)
            {
                _playerFocused.Remove(this);
            }
        }
Exemplo n.º 5
0
        public void ReceiveFocus(PinouPlayer player)
        {
            _focusReceiveMode = FocusReceiveMode.Player;
            if (_focusingPlayer != null)
            {
                _focusingPlayer.RemoveFocus(this);
            }

            if (_focusingPlayer != player)
            {
                _focusingPlayer = player;
                OnReceivePlayerFocus.Invoke(this, player);
            }

            if (_playerFocused.Contains(this) == false)
            {
                _playerFocused.Add(this);
            }
        }