using System; using UnityEngine; public class StartDailyCtrl : BaseCreateViewerCtrl { public void Init(StartDailyMgr startDailyMgr, GameObject m_goPanel) { this.m_atlas = Resources.Load("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(this.m_goUnitPrefab); gameObject.name = "Num_" + c; UISprite component = gameObject.GetComponent(); 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; }