StartDailyCtrl.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System;
  2. using UnityEngine;
  3. public class StartDailyCtrl : BaseCreateViewerCtrl
  4. {
  5. public void Init(StartDailyMgr startDailyMgr, GameObject m_goPanel)
  6. {
  7. this.m_atlas = Resources.Load<UIAtlas>("SceneStartDaily/Atlas/AtlasSceneStartDaily");
  8. this.m_goUnitPrefab = (Resources.Load("SceneStartDaily/Prefab/NumberUnit") as GameObject);
  9. this.m_goUnitParent = UTY.GetChildObject(m_goPanel, "DaysUnitParent", false);
  10. }
  11. public void CreateViewer(int data)
  12. {
  13. char[] array = data.ToString().ToCharArray();
  14. base.DelChildGameObject();
  15. foreach (char c in array)
  16. {
  17. GameObject gameObject = UnityEngine.Object.Instantiate<GameObject>(this.m_goUnitPrefab);
  18. gameObject.name = "Num_" + c;
  19. UISprite component = gameObject.GetComponent<UISprite>();
  20. component.atlas = this.m_atlas;
  21. component.spriteName = "cmd2_eyecatch_number" + c;
  22. Debug.Log(".spriteName=" + component.spriteName);
  23. base.SetTransformInfo(gameObject);
  24. BaseCreateViewerCtrl.Reposition(this.m_goUnitParent);
  25. }
  26. }
  27. protected override void SetDataForViewer()
  28. {
  29. }
  30. private const string ATLAS_PATH = "SceneStartDaily/Atlas/AtlasSceneStartDaily";
  31. private const string NUMBER_TEXTURE_PATH = "cmd2_eyecatch_number";
  32. private const string UNIT_PARENT_PATH = "DaysUnitParent";
  33. private const string UNIT_PREFAB_PATH = "SceneStartDaily/Prefab/NumberUnit";
  34. private UIAtlas m_atlas;
  35. }