Nessuna descrizione
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
siu f77eecfd2f backup 9 mesi fa
..
.sample.json backup 9 mesi fa
Player.prefab backup 9 mesi fa
Player.prefab.meta backup 9 mesi fa
README.md backup 9 mesi fa
README.md.meta backup 9 mesi fa
SimpleMultiplayerControls.inputactions backup 9 mesi fa
SimpleMultiplayerControls.inputactions.meta backup 9 mesi fa
SimpleMultiplayerDemo.unity backup 9 mesi fa
SimpleMultiplayerDemo.unity.meta backup 9 mesi fa
SimpleMultiplayerPlayer.cs backup 9 mesi fa
SimpleMultiplayerPlayer.cs.meta backup 9 mesi fa

README.md

Simple Multiplayer Demo

This demo shows a simple local multiplayer setup. Players can join by pressing buttons on the supported devices. As players join, the screen is subdivided in split-screen fashion.

Joining is handled by the PlayerManager GameObject in the scene which has the PlayerInputManager component added to it. The component references Player.prefab which is instantiated for each player that joins the game.

The prefab contains a GameObject that has a PlayerInput component added to it. The component references the actions available to each player which, by means of the control schemes defined in the asset, also determine the devices (and combinations of devices) supported by the game.

The actions available to each player are intentionally kept simple for this demonstration in order to not add irrelevant details. The only action available to players is Teleport which players can trigger through a button on their device. When trigger, they will be teleported to a random position within the game area. This serves to demonstrate that player inputs are indeed separate.

Note that each PlayerInput also references a Camera which is specific to each player. This is used by PlayerInputManager to configure the split-screen setup.