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