ClanInfoViewStack.cs 510 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. using UnityEngine;
  2. using System.Collections;
  3. public class ClanInfoViewStack : ViewStack
  4. {
  5. private int clanId = 0;
  6. protected override void Awake ()
  7. {
  8. base.Awake ();
  9. InitCompleted.AddListener(Refresh);
  10. }
  11. public void SetClanId(int clanId)
  12. {
  13. this.clanId = clanId;
  14. for(int i=0; i<viewArr.Length; i++)
  15. {
  16. viewArr [i].data = clanId;
  17. }
  18. Refresh ();
  19. }
  20. public void Refresh()
  21. {
  22. if (!initialized)
  23. return;
  24. if (clanId == 0) {
  25. viewIndex = 0;
  26. } else {
  27. viewIndex = 1;
  28. }
  29. }
  30. }