12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- using System;
- using UnityEngine;
- public class StartDailyCtrl : BaseCreateViewerCtrl
- {
- public void Init(StartDailyMgr startDailyMgr, GameObject m_goPanel)
- {
- this.m_atlas = Resources.Load<UIAtlas>("SceneStartDaily/Atlas/AtlasSceneStartDaily");
- this.m_goUnitPrefab = (Resources.Load("SceneStartDaily/Prefab/NumberUnit") as GameObject);
- this.m_goUnitParent = UTY.GetChildObject(m_goPanel, "DaysUnitParent", false);
- }
- public void CreateViewer(int data)
- {
- char[] array = data.ToString().ToCharArray();
- base.DelChildGameObject();
- foreach (char c in array)
- {
- GameObject gameObject = UnityEngine.Object.Instantiate<GameObject>(this.m_goUnitPrefab);
- gameObject.name = "Num_" + c;
- UISprite component = gameObject.GetComponent<UISprite>();
- component.atlas = this.m_atlas;
- component.spriteName = "cmd2_eyecatch_number" + c;
- Debug.Log(".spriteName=" + component.spriteName);
- base.SetTransformInfo(gameObject);
- BaseCreateViewerCtrl.Reposition(this.m_goUnitParent);
- }
- }
- protected override void SetDataForViewer()
- {
- }
- private const string ATLAS_PATH = "SceneStartDaily/Atlas/AtlasSceneStartDaily";
- private const string NUMBER_TEXTURE_PATH = "cmd2_eyecatch_number";
- private const string UNIT_PARENT_PATH = "DaysUnitParent";
- private const string UNIT_PREFAB_PATH = "SceneStartDaily/Prefab/NumberUnit";
- private UIAtlas m_atlas;
- }
|