Exemple #1
0
        public bool CreateBaseInfo(Vector3 blockPos, FunctionBlock blockBase, FunctionBlockModifier modifier)
        {
            BlockID   = blockBase.FunctionBlockID;
            block     = blockBase;
            blockType = FunctionBlockModule.GetFunctionBlockType(BlockID);
            dataModel = new FunctionBlockDataModel();
            dataModel.Create(BlockID);
            BlockPos = blockPos;

            blockModifier          = modifier;
            modifierRootType       = FunctionBlockModule.FetchBlockModifierRootType(blockType);
            districtUnlockDataList = FunctionBlockModule.GetBlockDistrictUnlockData(blockBase.FunctionBlockID);

            levelInfo = new FunctionBlockLevelInfo(blockBase);

            //District



            //Set active district build
            for (int i = 0; i < districtUnlockDataList.Count; i++)
            {
                if (districtUnlockDataList[i].UnlockDefault == true)
                {
                    ActiveDistrictBuildList.Add(DistrictModule.GetDistrictDataByKey(districtUnlockDataList[i].DistrictID));
                }
            }
            //TODO
            return(true);
        }
Exemple #2
0
        ///Block Enter Info

        public void ShowBlockEnterInfo(FunctionBlockDataModel model, Vector3 pos)
        {
            if (_enterInfo != null)
            {
                if (_enterInfo.SetUpEnterInfo(model, pos))
                {
                    isShowBlockEnterInfo = true;
                }
            }
        }
Exemple #3
0
        public bool SetUpEnterInfo(FunctionBlockDataModel model, Vector3 pos)
        {
            _model = model;
            if (model.ID != 0)
            {
                transform.localPosition = pos;
                gameObject.SetActive(true);
                _anim.Play();
                _name.text   = model.Name;
                _icon.sprite = model.Icon;

                return(true);
            }
            return(false);
        }