Ejemplo n.º 1
0
        private void SetData(int idx, bool bPlay = false, GameObject obj = null)
        {
            GameManager      instance         = MonoSingleton <GameManager> .Instance;
            GameObject       gameObject       = !Object.op_Inequality((Object)obj, (Object)null) ? this.item : obj;
            VersusTowerParam versusTowerParam = instance.GetCurrentVersusTowerParam(-1);

            if (versusTowerParam != null && versusTowerParam.SeasonIteminame != null && (!string.IsNullOrEmpty((string)versusTowerParam.SeasonIteminame[idx]) && Object.op_Inequality((Object)gameObject, (Object)null)))
            {
                gameObject.SetActive(true);
                VersusTowerRewardItem component = (VersusTowerRewardItem)gameObject.GetComponent <VersusTowerRewardItem>();
                if (Object.op_Inequality((Object)component, (Object)null))
                {
                    component.SetData(VersusTowerRewardItem.REWARD_TYPE.Season, idx);
                }
                if (bPlay)
                {
                    this.ReqAnim(this.openAnim);
                }
                this.SetRewardName(idx, versusTowerParam);
            }
            if (!Object.op_Inequality((Object)this.arrival, (Object)null))
            {
                return;
            }
            this.arrival.SetActive(false);
        }
Ejemplo n.º 2
0
        private void Setup()
        {
            GameManager instance = MonoSingleton <GameManager> .Instance;

            VersusTowerParam[] versusTowerParam = instance.GetVersusTowerParam();
            if (versusTowerParam == null)
            {
                return;
            }
            for (int index = versusTowerParam.Length - 1; index >= 0; --index)
            {
                if (!((string)versusTowerParam[index].VersusTowerID != instance.VersusTowerMatchName) && !string.IsNullOrEmpty((string)versusTowerParam[index].ArrivalIteminame))
                {
                    GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.template);
                    if (Object.op_Inequality((Object)gameObject, (Object)null))
                    {
                        DataSource.Bind <VersusTowerParam>(gameObject, versusTowerParam[index]);
                        VersusTowerRewardItem component = (VersusTowerRewardItem)gameObject.GetComponent <VersusTowerRewardItem>();
                        if (Object.op_Inequality((Object)component, (Object)null))
                        {
                            component.Refresh();
                        }
                        if (Object.op_Inequality((Object)this.parent, (Object)null))
                        {
                            gameObject.get_transform().SetParent(this.parent.get_transform(), false);
                        }
                    }
                }
            }
            this.template.SetActive(false);
        }
 public void OnUpdateItems(int idx, GameObject obj)
 {
     if (idx < 0 || idx >= this.m_Max || this.m_Param == null)
     {
         obj.SetActive(false);
     }
     else
     {
         obj.SetActive(true);
         DataSource.Bind <VersusTowerParam>(obj, this.m_Param[idx]);
         if (this.Arrival)
         {
             VersusTowerRewardItem component = (VersusTowerRewardItem)obj.GetComponent <VersusTowerRewardItem>();
             if (!Object.op_Inequality((Object)component, (Object)null))
             {
                 return;
             }
             component.Refresh(VersusTowerRewardItem.REWARD_TYPE.Arrival, 0);
         }
         else
         {
             VersusSeasonRewardInfo component = (VersusSeasonRewardInfo)obj.GetComponent <VersusSeasonRewardInfo>();
             if (!Object.op_Inequality((Object)component, (Object)null))
             {
                 return;
             }
             component.Refresh();
         }
     }
 }
Ejemplo n.º 4
0
        private void SetupRewardItem()
        {
            GameManager          instance           = MonoSingleton <GameManager> .Instance;
            VsTowerMatchEndParam towerMatchEndParam = instance.GetVsTowerMatchEndParam();
            VersusTowerParam     versusTowerParam   = instance.GetCurrentVersusTowerParam(towerMatchEndParam.floor);

            if (versusTowerParam == null || string.IsNullOrEmpty((string)versusTowerParam.ArrivalIteminame) || UnityEngine.Object.op_Equality((UnityEngine.Object) this.rewardObj, (UnityEngine.Object)null))
            {
                return;
            }
            DataSource.Bind <VersusTowerParam>(this.rewardObj, versusTowerParam);
            VersusTowerRewardItem component = (VersusTowerRewardItem)this.rewardObj.GetComponent <VersusTowerRewardItem>();

            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null))
            {
                return;
            }
            component.Refresh(VersusTowerRewardItem.REWARD_TYPE.Arrival, 0);
        }
Ejemplo n.º 5
0
        public void Refresh()
        {
            if (Object.op_Equality((Object)this.template, (Object)null))
            {
                return;
            }
            VersusTowerParam dataOfClass = DataSource.FindDataOfClass <VersusTowerParam>(((Component)this).get_gameObject(), (VersusTowerParam)null);

            if (dataOfClass != null)
            {
                while (this.mItems.Count < dataOfClass.SeasonIteminame.Length)
                {
                    GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.template);
                    if (Object.op_Inequality((Object)gameObject, (Object)null))
                    {
                        if (Object.op_Inequality((Object)this.parent, (Object)null))
                        {
                            gameObject.get_transform().SetParent(this.parent.get_transform(), false);
                        }
                        this.mItems.Add(gameObject);
                    }
                }
                for (int idx = 0; idx < dataOfClass.SeasonIteminame.Length; ++idx)
                {
                    GameObject mItem = this.mItems[idx];
                    if (Object.op_Inequality((Object)mItem, (Object)null))
                    {
                        DataSource.Bind <VersusTowerParam>(mItem, dataOfClass);
                        mItem.SetActive(true);
                        VersusTowerRewardItem component = (VersusTowerRewardItem)mItem.GetComponent <VersusTowerRewardItem>();
                        if (Object.op_Inequality((Object)component, (Object)null))
                        {
                            component.Refresh(VersusTowerRewardItem.REWARD_TYPE.Season, idx);
                        }
                    }
                }
            }
            this.template.SetActive(false);
        }