PhoneController.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. using System;
  2. using I2.Loc;
  3. using UnityEngine;
  4. public class PhoneController : BaseBehaviour
  5. {
  6. public string LeftBtn
  7. {
  8. set
  9. {
  10. this._receiveText.text = value;
  11. }
  12. }
  13. public string RightBtn
  14. {
  15. set
  16. {
  17. this._cancelText.text = value;
  18. }
  19. }
  20. public string Name
  21. {
  22. get
  23. {
  24. return this._nameText.text;
  25. }
  26. set
  27. {
  28. this._nameText.text = value;
  29. }
  30. }
  31. public void DialOut()
  32. {
  33. this._receiveText.text = string.Empty;
  34. this._cancelText.text = ScriptLocalization.ui_phone.decline;
  35. this._animator.Play("IntoCall_Broken");
  36. }
  37. public void InCall()
  38. {
  39. this._receiveText.text = ScriptLocalization.ui_phone.accept;
  40. this._cancelText.text = ScriptLocalization.ui_phone.decline;
  41. this._animator.Play("Received");
  42. }
  43. public void Recive(bool isBreak = false)
  44. {
  45. this._receiveText.text = string.Empty;
  46. this._cancelText.text = ScriptLocalization.ui_phone.decline;
  47. this._animator.Play((!isBreak) ? "IntoInCall" : "IntoInCall_Broken");
  48. }
  49. public void CallEnd(bool isBreak = false)
  50. {
  51. this._receiveText.text = string.Empty;
  52. this._cancelText.text = string.Empty;
  53. this._animator.Play((!isBreak) ? "CallEnd" : "CallEnd_Broken");
  54. }
  55. [SerializeField]
  56. private Animator _animator;
  57. [SerializeField]
  58. private TextMesh _receiveText;
  59. [SerializeField]
  60. private TextMesh _cancelText;
  61. [SerializeField]
  62. private TextMesh _nameText;
  63. }