Tweaked images a little and reduced game instance discussion in root

This commit is contained in:
Steve Streeting 2020-10-23 13:03:13 +01:00
parent b56b9e65b8
commit 0b26f9b937
6 changed files with 4 additions and 21 deletions

View File

@ -70,28 +70,11 @@ you can tap into anywhere in Blueprints by searching for it:
![Game Instance Subsystem](./Resources/gameinstance.png)
Once you have access to this you can do things like tie events into the input mode
changing:
Once you have access to this you can do things like get the latest input device used:
![Game Instance Subsystem](./Resources/bpexample.png)
To access this in C++, just do this:
```c++
#include "StevesUEHelpers.h"
...
auto GS = GetStevesGameSubsystem(GetWorld());
if (GS)
{
// get current mode (first player assumed)
EInputMode CurrentInputMode = GS->GetLastInputModeUsed();
// Subscribe to input mode changes (remember this must be a UFUNCTION)
GS->OnInputModeChanged.AddUniqueDynamic(this, &AMyActor::OnInputModeChanged);
}
```
![Game Instance Subsystem](./Resources/lastinput.png)
For more details, see the [Input section](doc/Input.md).
# License

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 44 KiB

View File

@ -34,7 +34,7 @@ EInputMode Mode = GS->GetLastInputModeUsed(PlayerIndex);
Blueprint:
![Game Instance Subsystem](../Resources/bpexample.png)
![Game Instance Subsystem](../Resources/inputchangeevent.png)
C++: