Пример #1
0
        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;
        }
Пример #2
0
        /// <summary>
        /// General FuntionBlock
        /// </summary>
        /// <param name="infoData"></param>
        /// <param name="modifierBase"></param>
        public void AddManufactoryBlockModifier(ManufactoryInfo manuInfo, FunctionBlockInfoData baseInfo, ModifierBase modifierBase)
        {
            if (modifierBase == null)
            {
                Debug.LogError("Modifier Base Data is null");
                return;
            }
            if (modifierBase.ParseTargetType(modifierBase.Target) != ModifierTarget.FunctionBlock)
            {
                Debug.LogError("ModifierTargetError  Name=" + modifierBase.ModifierName);
                return;
            }

            ModifierData data = null;

            switch (modifierBase.ParseModifierFunctionBlockType(modifierBase.effectType))
            {
            case ModifierFunctionBlockType.ManuSpeed:
                //Modifier Speed
                if (!IsAddFunctionBlockModifier(baseInfo, modifierBase))
                {
                    data = ModifierData.Create(modifierBase, delegate
                    {
                        manuInfo.AddCurrentSpeed(modifierBase.Value);
                        UIManager.Instance.SendMessageToWnd(UIPath.WindowPath.BlockManu_Page, new UIMessage(UIMsgType.UpdateSpeedText, new List <object>(1)
                        {
                            manuInfo.CurrentSpeed
                        }));
                    });
                }
                break;

            case ModifierFunctionBlockType.EnergyCostNormal:
                //Modifier EnergyCost
                if (!IsAddFunctionBlockModifier(baseInfo, modifierBase))
                {
                    data = ModifierData.Create(modifierBase, delegate
                    {
                        manuInfo.AddEnergyCostNormal(modifierBase.Value);
                    });
                }
                break;
            }

            if (data != null)
            {
                baseInfo.blockModifier.OnAddModifier(data);
            }
        }
Пример #3
0
 public void DoManufactModifier(ManufactoryInfo manuInfo, FunctionBlockInfoData baseInfo, string modifierName)
 {
     ModifierManager.Instance.AddManufactBlockModifier(manuInfo, baseInfo, modifierName);
 }
Пример #4
0
 public void AddManufactBlockModifier(ManufactoryInfo manuInfo, FunctionBlockInfoData baseInfo, string modifierName)
 {
     AddManufactoryBlockModifier(manuInfo, baseInfo, GetModifierBase(modifierName));
 }