MicroTutorialFaceOrb
A class in Root.Township, ATT.MicroTutorial.
An action orb that starts a micro tutorial (entry orb) or leaves it (exit orb) when a player pulls it to their face and lets go. The client sends the activation and the server spawns or despawns the tutorial.
- Listed in ATT, Features and other game namespaces
- Inherits or implements
NetworkEntityBehaviour,ISavable<MicroTutorialFaceOrbSaveData>,ISavableSave<MicroTutorialFaceOrbSaveData>,ISavableSaveBase - Derived types
MicroTutorialFaceOrbSaveData
Constructors
| Member | What it is |
|---|---|
MicroTutorialFaceOrb() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
11 private and internal fields
| Member | What it is |
|---|---|
private ActionOrb actionOrb | The action orb the player grabs. |
private float distanceBeforeOrbIsForceReleased | How far the holder can move from the origin before the orb is dropped. |
private bool isForceReleaseEnabled | Whether the orb is dropped when the holder walks away. |
private static readonly Logger logger | Class logger. |
private MicroTutorialSettings microTutorialSettings | The tutorial an entry orb starts. Saved. |
private IMicroTutorialSystem microTutorialSystem | Injected micro tutorial system. |
private Vector3 orbOrigin | Position the orb returns to, set from its spawn position. |
private MicroTutorialFaceOrbType orbType | Entry or exit. Saved. |
private MethodSync syncActivation | Method sync for the activation message. |
private MethodSync syncOrbOrigin | Method sync for the orb origin. |
private MethodSync syncSettings | Method sync for the orb type. |
Methods
| Member | What it is |
|---|---|
override void Initialize() | Creates the method syncs for activation (SyncA), settings (SyncB) and orb origin (SyncC). |
override void OnConnected(Player player) | Sends the orb type to the joining player. |
void SetTutorialSettings(MicroTutorialSettings newMicroTutorialSettings) | Sets which tutorial the orb starts and makes it an entry orb. Used by MicroTutorialOrbInjector. |
12 private and internal methods
| Member | What it is |
|---|---|
private void Activate() | Client: sends the activation to the server when the orb is validly let go. |
private async void ActivationSync(IPlayer player, Stream stream) | Server, when reading: starts the tutorial for an entry orb or despawns it for an exit orb. |
private void Awake() | Hooks the pickup and let-go events and the entity's initialization and scene destruction. |
private void Inject(IMicroTutorialSystem injectedMicroTutorialSystem) | VContainer injection of the micro tutorial system. |
private void MovedOutOfBounds(PlayerController player, Vector3 oldPosition, Vector3 newPosition, LocomotionFunction function) | Client: force-drops the orb if the holder moves further than distanceBeforeOrbIsForceReleased from its origin. |
private void OnDestroyByScene(NetworkEntity networkEntity, bool isUnload) | Clears the entity's initialization listeners. |
private void OnInteractionEnded(Interactable interactable, Interactor interactor) | Stops watching the holder's position. |
private void OnInteractionStarted(Interactable interactable, Interactor interactor) | Client: starts watching the holder's position when force release is on. |
private void ResetPosition(NetworkEntity networkEntity) | Stores the orb's spawn position as its origin, sets it as the orb target and syncs it. |
private async Task StartTutorial(IPlayer player) | Spawns the configured tutorial for the player through the server controller, after null checks. |
private void SyncOrbOrigin(IPlayer player, Stream stream) | Method sync body for the orb origin. |
private void SyncSettings(IPlayer player, Stream stream) | Method sync body for the orb type. Skipped in local test. |