ExampleInfo.cs 866 B

12345678910111213141516171819202122232425262728293031323334353637
  1. using System;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. namespace BestHTTP.Examples.Helpers.SelectorUI
  6. {
  7. public sealed class ExampleInfo : MonoBehaviour
  8. {
  9. #pragma warning disable 0649
  10. [SerializeField]
  11. private Text _header;
  12. [SerializeField]
  13. private Text _description;
  14. #pragma warning restore
  15. private SampleSelectorUI _parentUI;
  16. private SampleBase _example;
  17. public void Setup(SampleSelectorUI parentUI, SampleBase example)
  18. {
  19. this._parentUI = parentUI;
  20. this._example = example;
  21. this._header.text = this._example.name;
  22. this._description.text = this._example.Description;
  23. }
  24. public void OnExecuteExample()
  25. {
  26. this._parentUI.ExecuteExample(this._example);
  27. }
  28. }
  29. }