public void Initialize(MasterBuildParam _master, DataBuildParam _data) { m_txtName.text = _master.name; m_txtNameBuy.text = _master.name; m_txtGold.text = _master.gold.ToString(); m_txtGoldBuy.text = _master.gold.ToString(); m_txtToken.text = _master.token.ToString(); m_txtTokenBuy.text = _master.token.ToString(); bool bHas = false; if (_data != null && 0 < _data.state) { bHas = true; } m_goRootHas.SetActive(bHas); m_goRootBuy.SetActive(!bHas); m_imgIcon.color = bHas ? Color.white : Color.gray; bool bIsToken = false; if (0 < _master.token) { bIsToken = true; } m_goRootToken.SetActive(bIsToken); m_goRootTokenBuy.SetActive(bIsToken); }
IEnumerator Start() { while (data_manager.Initialized != true) { yield return(null); } icon_build_item_arr = GetComponentsInChildren <IconBuildItem>(); foreach (IconBuildItem icon in icon_build_item_arr) { MasterBuildParam master = data_manager.master_build.list.Find(p => p.build_id == icon.m_iBuildId); DataBuildParam data = data_manager.data_build.list.Find(p => p.build_id == icon.m_iBuildId); icon.Initialize(master, data); } }
// Start is called before the first frame update void Start() { master_build.Load(m_taMasterBuild); master_build_effect.Load(m_taMasterBuildEffect); // デフォルト設定 foreach (MasterBuildParam master_build_param in master_build.list) { if (master_build_param.pre_build_id_1 == 0) { DataBuildParam add = new DataBuildParam(); add.build_id = master_build_param.build_id; add.state = 1; data_build.list.Add(add); } } Initialized = true; }