ReporterMessageReceiver.cs 883 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using UnityEngine;
  2. using System.Collections;
  3. public class ReporterMessageReceiver : MonoBehaviour
  4. {
  5. Reporter reporter;
  6. void Start()
  7. {
  8. reporter = gameObject.GetComponent<Reporter>();
  9. }
  10. void OnPreStart()
  11. {
  12. //To Do : this method is called before initializing reporter,
  13. //we can for example check the resultion of our device ,then change the size of reporter
  14. if (reporter == null)
  15. reporter = gameObject.GetComponent<Reporter>();
  16. if (Screen.width < 1000)
  17. reporter.size = new Vector2(32, 32);
  18. else
  19. reporter.size = new Vector2(48, 48);
  20. reporter.UserData = "Put user date here like his account to know which user is playing on this device";
  21. }
  22. void OnHideReporter()
  23. {
  24. //TO DO : resume your game
  25. }
  26. void OnShowReporter()
  27. {
  28. //TO DO : pause your game and disable its GUI
  29. }
  30. void OnLog(Reporter.Log log)
  31. {
  32. //TO DO : put you custom code
  33. }
  34. }