示例#1
0
 public void Init(UI_Control_ScrollFlow _parent)
 {
     rect   = this.GetComponent <RectTransform>();
     img    = this.GetComponent <Image>();
     parent = _parent;
     color  = img.color;
 }
示例#2
0
        public override void BuildUIContent()
        {
            base.BuildUIContent();

            MaterialList  = TargetGo.transform.Find("MeterialsGrid/Materials");
            OilList       = TargetGo.transform.Find("Oil");
            NotEnoughView = TargetGo.transform.Find("NotEnoughView");
            NotEnoughView.gameObject.SetActive(false);
            NotEnoughCloseBtn = TargetGo.transform.Find("NotEnoughView/CloseBtn").GetComponent <Button>();
            NotEnoughCloseBtn.onClick.AddListener(OnClickNotEnoughCloseBtn);

            BtnProduce = TargetGo.transform.Find("ProduceBtn").GetComponent <Button>();
            BtnProduce.onClick.AddListener(OnClickProduceBtn);
            CountInput = TargetGo.transform.Find("CountInput").GetComponent <InputField>();
            CountInput.onEndEdit.AddListener(OnCountInputChange);
            AddBtn = TargetGo.transform.Find("CountInput/AddBtn").GetComponent <Button>();
            AddBtn.onClick.AddListener(delegate() { this.OnClickChangeCount(1); });
            ReduceBtn = TargetGo.transform.Find("CountInput/ReduceBtn").GetComponent <Button>();
            ReduceBtn.onClick.AddListener(delegate() { this.OnClickChangeCount(-1); });

            scrollF = OilList.GetComponent <UI_Control_ScrollFlow>();
            ResourceMgr.Instance.LoadResource("Prefab/FcItem", OnLoadPrefab);
            ResourceMgr.Instance.LoadResource("Prefab/POilItem", OnLoadOilPrefab);

            isFrist = true;
        }
示例#3
0
 public void Init(UI_Control_ScrollFlow _parent)
 {
     rect   = GetComponent <RectTransform>();
     parent = _parent;
     if (img != null)
     {
         color = img.color;
     }
 }
示例#4
0
 public void Init(UI_Control_ScrollFlow _parent)
 {
     NeedIds = new List <NeedClass>();
     rect    = this.GetComponent <RectTransform>();
     img     = this.transform.Find("Image").GetComponent <Image>();
     LoadImage();
     SetNeedItems();
     parent = _parent;
     color  = img.color;
 }
示例#5
0
        private void InitOilPanel()
        {
            AddPanel(801);
            AddPanel(802);
            AddPanel(803);  //加入蓝莓糖
            AddPanel(804);  //加入仙丹
            AddPanel(805);  //加入玫瑰糖
            AddPanel(806);
            AddPanel(807);

            OilList.GetChild(OilList.childCount - 2).SetSiblingIndex(0);
            OilList.GetChild(OilList.childCount - 1).SetSiblingIndex(1);
            UI_Control_ScrollFlow ui_control = OilList.GetComponent <UI_Control_ScrollFlow>();

            ui_control.Refresh();
        }
示例#6
0
        //初始化要加工的精油的面板信息,只初始化一次
        private void InitOilPanel()
        {
            int _id = 301;
            UI_Control_ScrollFlow ui_control = OilList.GetComponent <UI_Control_ScrollFlow>();

            while (LoadObjctDateConfig.Instance.GetAtrribute(_id) != null)
            {
                GameObject oilItem = GameObject.Instantiate(POilItem) as GameObject;
                oilItem.transform.SetParent(OilList);
                oilItem.transform.localPosition = new Vector3(0, 23.5f, 0);
                UI_Control_ScrollFlow_Item item = oilItem.GetComponent <UI_Control_ScrollFlow_Item>();
                item.ID = _id;
                _id++;
            }
            OilList.GetChild(OilList.childCount - 2).SetSiblingIndex(0);
            OilList.GetChild(OilList.childCount - 1).SetSiblingIndex(1);
            ui_control.Refresh();
        }
示例#7
0
 private void Awake()
 {
     instance = this;
 }