public void SetData() { _blockBase = UIUtility.SafeGetComponent <FunctionBlockBase>(transform); manufactoryInfo = new ManufactoryInfo(_blockBase.functionBlock); formulaInfo = new ManufactFormulaInfo(_blockBase.functionBlock.FunctionBlockID); _blockBase.OnBlockSelectAction += Onselect; _blockBase.OnBlockAreaEnterAction += OnBlockAreaEnter; }
/// <summary> /// Refresh Count /// </summary> /// <param name="info"></param> public void RefreshFormulaSlotNum(ManufactFormulaInfo info) { _info = info; for (int i = 0; i < _info.currentInputItem.Count; i++) { var element = UIUtility.SafeGetComponent <ManuSlotElement>(InputContent.GetChild(i)); element.RefreshCount(_info.currentInputItem[i].model, _info.realInputItem[i].count); } var outputElement = UIUtility.SafeGetComponent <ManuSlotElement>(Output_Trans); outputElement.RefreshCount(_info.currentOutputItem.model, _info.realOutputItem.count); }
public void Init(ManufactFormulaInfo info, InitType type) { _info = info; switch (type) { case InitType.FormulaChange: EnhanceLine = UIUtility.FindTransfrom(transform, "EnhanceLine"); InitFormulaSlot(InitType.FormulaChange); break; case InitType.Normal: InitFormulaSlot(InitType.Normal); RefreshManuElementTrans(_info, type); break; } }
/// <summary> /// Refresh /// </summary> public void RefreshManuElementTrans(ManufactFormulaInfo info, InitType type) { _info = info; if (_info == null) { return; } var inputCount = _info.currentInputItem.Count; foreach (Transform trans in InputContent) { trans.gameObject.SetActive(false); } for (int i = 0; i < inputCount; i++) { InputContent.GetChild(i).gameObject.SetActive(true); } ///Enhance if (_info.currentEnhanceItem.model.ID == 0) { Enhance_Trans.gameObject.SetActive(false); if (type == InitType.FormulaChange) { EnhanceLine.gameObject.SetActive(false); } } else { Enhance_Trans.gameObject.SetActive(true); if (type == InitType.FormulaChange) { EnhanceLine.gameObject.SetActive(true); } } }