Exemplo n.º 1
0
        private void RefreshUIMaterialHandle()
        {
            HeroCombineProxy HeroCombineProxyInstance          = HeroCombineProxy.instance;
            SortedDictionary <CombinePosition, uint> materials = HeroCombineProxyInstance.CombineMaterialDictionary;
            CombinePosition pos;
            HeroInfo        info;

            for (int i = 0, count = combineMaterialRootTran.Length; i < count; i++)
            {
                pos  = (CombinePosition)(i + 1);
                info = HeroCombineProxyInstance.GetHeroAt(pos);
                if (info == null)
                {
                    TransformUtil.ClearChildren(combineMaterialRootTran[i], true);
                }
                else
                {
                    HeroButton b = combineMaterialRootTran[i].GetComponentInChildren <HeroButton>();
                    if (b != null)
                    {
                        b.SetHeroInfo(info);
                        b.HideLevel();
                    }
                    else
                    {
                        GameObject go = CreateGameObject(heroButtonPrefab.gameObject, combineMaterialRootTran[i]);
                        go.transform.localScale = new Vector3(0.68f, 0.68f, 1);
                        b = go.GetComponent <HeroButton>();
                        b.SetHeroInfo(info);
                        b.HideLevel();
                    }
                    b.SetSelect(true);
                    b.HideMark();
                }
            }
        }
Exemplo n.º 2
0
        private IEnumerator AnimationCompleteCoroutine(float time)
        {
            yield return(new WaitForSeconds(time));

            Debugger.Log("animation complete");
            //show new hero icon

            _newHeroGO = CreateGameObject(heroButtonPrefab.gameObject, combineNewHeroRootTrans);
            HeroInfo info = HeroProxy.instance.GetHeroInfo((uint)HeroCombineProxy.instance.NewHeroIntanceId);

            if (info == null)
            {
                Debugger.LogError(string.Format("combine HeroInfo is not find id:{0}", HeroCombineProxy.instance.NewHeroIntanceId));
            }
            HeroButton btn = _newHeroGO.GetComponent <HeroButton>();

            btn.SetHeroInfo(info);
            btn.HideLevel();


            //delay time to reset all
            StartCoroutine(ResetToOriginCoroutine(2));
        }