Guideboard.cs 784 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System;
  2. using I2.Loc;
  3. using UnityEngine;
  4. [RequireComponent(typeof(BoxCollider2D))]
  5. public class Guideboard : BaseBehaviour
  6. {
  7. private bool HasShown { get; set; }
  8. private void Start()
  9. {
  10. this._levelName = ScriptLocalization.Get("ui/levelName/" + LevelManager.SceneName);
  11. if (this._normalSize == 144)
  12. {
  13. this._normalSize = 108;
  14. }
  15. }
  16. private void OnTriggerEnter2D(Collider2D collision)
  17. {
  18. if (!collision.CompareTag("Player"))
  19. {
  20. return;
  21. }
  22. if (this.HasShown)
  23. {
  24. return;
  25. }
  26. R.Ui.LevelName.Show(this._levelName, this._normalSize, this._duration, true);
  27. this.HasShown = true;
  28. }
  29. private string _levelName;
  30. [SerializeField]
  31. private int _normalSize = 108;
  32. [SerializeField]
  33. private float _duration = 1f;
  34. }