tutorial prompt for ship attach because people are stupid

This commit is contained in:
JohnCorby 2022-09-10 17:23:26 -07:00
parent 49e11c15e2
commit 81964da688

View File

@ -19,9 +19,14 @@ public class ShipCustomAttach : MonoBehaviour
private PlayerAttachPoint _playerAttachPoint;
/// <summary>
/// uses a static field instead of a persistent condition cuz those are synced
/// </summary>
private static bool _tutorialPrompt = true;
private void Awake()
{
Locator.GetPromptManager().AddScreenPrompt(_attachPrompt, PromptPosition.UpperRight);
Locator.GetPromptManager().AddScreenPrompt(_attachPrompt, _tutorialPrompt ? PromptPosition.Center : PromptPosition.UpperRight);
Locator.GetPromptManager().AddScreenPrompt(_detachPrompt, PromptPosition.UpperRight);
_playerAttachPoint = gameObject.AddComponent<PlayerAttachPoint>();
@ -34,8 +39,8 @@ public class ShipCustomAttach : MonoBehaviour
{
if (Locator.GetPromptManager())
{
Locator.GetPromptManager().RemoveScreenPrompt(_attachPrompt, PromptPosition.UpperRight);
Locator.GetPromptManager().RemoveScreenPrompt(_detachPrompt, PromptPosition.UpperRight);
Locator.GetPromptManager().RemoveScreenPrompt(_attachPrompt);
Locator.GetPromptManager().RemoveScreenPrompt(_detachPrompt);
}
}
@ -83,6 +88,13 @@ public class ShipCustomAttach : MonoBehaviour
transform.position = Locator.GetPlayerTransform().position;
_playerAttachPoint.AttachPlayer();
ShipManager.Instance.CockpitController._shipAudioController.PlayBuckle();
if (_tutorialPrompt)
{
_tutorialPrompt = false;
Locator.GetPromptManager().RemoveScreenPrompt(_attachPrompt);
Locator.GetPromptManager().AddScreenPrompt(_attachPrompt, PromptPosition.UpperRight);
}
}
}
}