Пример #1
0
    public void ReplacePlayerInput(UnityEngine.InputSystem.PlayerInput newValue)
    {
        var index     = InputComponentsLookup.PlayerInput;
        var component = (SemoGames.GameInput.PlayerInputComponent)CreateComponent(index, typeof(SemoGames.GameInput.PlayerInputComponent));

        component.Value = newValue;
        ReplaceComponent(index, component);
    }
Пример #2
0
 private void OnPlayerLeft(UnityEngine.InputSystem.PlayerInput input)
 {
     if (MasterManager.Players.Count < 2)
     {
         joinText.text = PLAYERS_NEED_TO_JOIN;
     }
     else if (MasterManager.Players.Count < 4)
     {
         joinText.text = CAN_START;
     }
 }
Пример #3
0
 private void OnPlayerJoined(UnityEngine.InputSystem.PlayerInput input)
 {
     Debug.Log("Player joined");
     if (MasterManager.Players.Count >= MIN_PLAYERS)
     {
         joinText.text = CAN_START;
     }
     else if (MasterManager.Players.Count == 4)
     {
         joinText.text = ONLY_START;
     }
 }
Пример #4
0
    public InputEntity SetPlayerInput(UnityEngine.InputSystem.PlayerInput newValue)
    {
        if (hasPlayerInput)
        {
            throw new Entitas.EntitasException("Could not set PlayerInput!\n" + this + " already has an entity with SemoGames.GameInput.PlayerInputComponent!",
                                               "You should check if the context already has a playerInputEntity before setting it or use context.ReplacePlayerInput().");
        }
        var entity = CreateEntity();

        entity.AddPlayerInput(newValue);
        return(entity);
    }
Пример #5
0
    public void ReplacePlayerInput(UnityEngine.InputSystem.PlayerInput newValue)
    {
        var entity = playerInputEntity;

        if (entity == null)
        {
            entity = SetPlayerInput(newValue);
        }
        else
        {
            entity.ReplacePlayerInput(newValue);
        }
    }
Пример #6
0
 private void Awake()
 {
     m_PlayerInput = transform.root.GetComponent <UnityEngine.InputSystem.PlayerInput>();
 }