123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191 |
- //using UnityEngine;
- //using System.Collections;
- //using System;
- //using System.Collections.Generic;
- ///// <summary>
- /////
- ///// </summary>
- //public class UI_PVPWinnerScrollFlowComponment : MonoBehaviour
- //{
- // /// <summary>
- // /// 操作控制层
- // /// </summary>
- // public UI_ScrollFlow mScrollFlow;
- // /// <summary>
- // /// 模板
- // /// </summary>
- // public GameObject mPrefab;
- // /// <summary>
- // /// 子对象节点
- // /// </summary>
- // public GameObject mNodes;
- // /// <summary>
- // ///
- // /// </summary>
- // private bool isDetial = false;
- // /// <summary>
- // /// 初始化UI
- // /// </summary>
- // public void InitComponments(bool isDetial = false)
- // {
- // this.isDetial = isDetial;
- // mPrefab = this.transform.Find("prefab").gameObject;
- // mPrefab.SetActive(false);
- // mNodes = this.transform.Find("Nodes").gameObject;
- // mScrollFlow = mNodes.GetComponent<UI_ScrollFlow>();
- // if (mScrollFlow == null)
- // {
- // AssemblyHelper.Instance.BindScript("UI_ScrollFlow", mNodes);
- // mScrollFlow = mNodes.GetComponent<UI_ScrollFlow>();
- // }
- // mNodes.GetComponent<RectTransform>().anchoredPosition = new Vector2(0, -100);
- // mScrollFlow.InitPvp_ComponmentsSetting();
- // mScrollFlow.goItemPrefab = mPrefab;
- // mScrollFlow.nodeContent = mNodes.GetComponent<RectTransform>();
- // CreateElement();
- // }
- // /// <summary>
- // /// 创建元素
- // /// </summary>
- // private void CreateElement()
- // {
- // mScrollFlow.onInitializeItem = onInitializeItem;
- // mScrollFlow.Init(0);
- // }
- // /// <summary>
- // /// 元素初始化
- // /// </summary>
- // /// <param name="go"> 元素对象 </param>
- // /// <param name="dataIndex"> 数据索引 </param>
- // private void onInitializeItem(GameObject go, int dataIndex)
- // {
- // UI_Pvp_PreviousWinnerElement element = go.GetComponent<UI_Pvp_PreviousWinnerElement>();
- // if (null == element)
- // {
- // AssemblyHelper.Instance.BindScript("UI_Pvp_PreviousWinnerElement", go);
- // element = go.GetComponent<UI_Pvp_PreviousWinnerElement>();
- // }
- // element.Init(this.isDetial);
- // element.Action_SelectedSomeCard = OnClicked_Select;
- // if (dataIndex >= 0 && dataIndex < mDataList.Count)
- // {
- // element.SetData(dataIndex,mDataList[dataIndex]);
- // if (elements.ContainsKey(dataIndex))
- // {
- // elements[dataIndex] = go;
- // }
- // else
- // {
- // elements.Add(dataIndex, go);
- // }
- // }
- // }
- // /// <summary>
- // /// 刷新元素
- // /// </summary>
- // /// <param name="heroUIDList">英雄列表</param>
- // /// <param name="bResetPos"> 是否重设位置 </param>
- // public void SetHeroData(List<PvpChallengerDataVo> heroUIDList, bool bResetPos = false)
- // {
- // mDataList = new List<PvpChallengerDataVo>();
- // elements = new Dictionary<int, GameObject>();
- // mDataList.AddRange(heroUIDList);
- // mScrollFlow.Hero_DataChanged(heroUIDList.Count, bResetPos);
- // if (heroUIDList.Count == 0)
- // {
- // mScrollFlow.enabled = false;
- // }
- // else
- // {
- // mScrollFlow.enabled = true;
- // }
- // }
- // /// <summary>
- // /// 数据列表
- // /// </summary>
- // private List<PvpChallengerDataVo> mDataList = new List<PvpChallengerDataVo>();
- // /// <summary>
- // /// 子对象集合
- // /// </summary>
- // private Dictionary<int, GameObject> elements = new Dictionary<int, GameObject>();
- // /// <summary>
- // /// 点击卡牌事件
- // /// </summary>
- // internal Action<int> Action_SelectedSomeCard;
- // /// <summary>
- // /// 点击选择
- // /// </summary>
- // /// <param name="go">按钮对象</param>
- // private void OnClicked_Select(GameObject go)
- // {
- // UI_ScrollFlow_Item script = go.GetComponent<UI_ScrollFlow_Item>();
- // if (script == null)
- // {
- // return;
- // }
- // if (mScrollFlow.Current != script)
- // {
- // mScrollFlow.ToAppointedItem(script);
- // }
- // else
- // {
- // UI_Pvp_PreviousWinnerElement ele = go.GetComponent<UI_Pvp_PreviousWinnerElement>();
- // if (ele == null)
- // {
- // return;
- // }
- // if (Action_SelectedSomeCard != null)
- // {
- // Action_SelectedSomeCard(mScrollFlow.Current.Index);
- // }
- // }
- // }
- // /// <summary>
- // ///
- // /// </summary>
- // /// <param name="index"></param>
- // public void SetCurrentIndexForOther(int index)
- // {
- // if (mScrollFlow.Current.Index != index)
- // {
- // UI_ScrollFlow_Item script = mNodes.transform.Find(index.ToString()).GetComponent<UI_ScrollFlow_Item>();
- // if (script != null)
- // {
- // mScrollFlow.ToAppointedItem(script);
- // }
- // }
- // }
- //}
|