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); }
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; } }
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; } }
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); }
public void ReplacePlayerInput(UnityEngine.InputSystem.PlayerInput newValue) { var entity = playerInputEntity; if (entity == null) { entity = SetPlayerInput(newValue); } else { entity.ReplacePlayerInput(newValue); } }
private void Awake() { m_PlayerInput = transform.root.GetComponent <UnityEngine.InputSystem.PlayerInput>(); }