private void OnDestroy() { if (_instance == this) { _instance = null; } }
private void OnTriggerEnter2D(Collider2D collision) { if (firstEntry) { var vessel = collision.GetComponent <VesselController>(); if (vessel != null) { firstEntry = false; vessel.LandingSequence(); HUDLanding.Show(); } } }
void Awake() { if (_instance == null) { _instance = this; canvas = GetComponentInChildren <Canvas>(); canvas.enabled = false; textUI = canvas.GetComponentInChildren <TextMeshProUGUI>(); } else if (_instance != this) { Destroy(gameObject); } }
private void OnCollisionStay2D(Collision2D collision) { if (playerHasControl && collision.gameObject.tag == "Bottom" && landingVelocity) { HUDTimeAndDepth.StopTimer(); engineSounder.EngineOff(); scoreKeeper.EndDescent(); scoreKeeper.LandingVector(transform.up); playerHasControl = false; var score = scoreKeeper.Summarize(); Debug.Log(score.ToString()); HUDLanding.Hide(); SceneManager.LoadScene("WorkReport", LoadSceneMode.Additive); } }