Exemplo n.º 1
0
        public void ShowActivitiesData(SoliderUnit _unit, bool _isLocal)
        {
            if (!_isLocal)
            {
                if (cacheCommandUnit || cacheSoliderUnit)
                {
                    return;
                }
            }

            CanvasGroupAdjust(intBtnArray, false);
            CanvasGroupAdjust(commanderPlane, false);
            CanvasGroupAdjust(soliderPlane, true);
            soliderAffiliationImage.sprite = _unit.affiliationSprite;
            soliderText.text            = _unit.soliderType.ToString();
            soliderAffiliationText.text = _unit.affiliationName;

            soliderCommanderText.text = string.Concat("指挥官:", _unit.mineCommanderUnit.unitName);
            soliderAttackText.text    = string.Concat("攻击力:", _unit.attackValue[0], " + ",
                                                      _unit.isInMineCommanderRange ? _unit.mineCommanderUnit.correctedAttack[0] : 0);
            soliderDefenseText.text = string.Concat("防御力:", _unit.defenseValue[0], " + ",
                                                    _unit.isInMineCommanderRange ? _unit.mineCommanderUnit.correctedDefense[0] : 0);
            soliderMoveText.text        = string.Concat("移动:", _unit.moveRangeValue[0]);
            soliderHealthPointText.text = string.Concat("生命值:", _unit.healthValue[0], " / ", _unit.healthValue[1]);
            soliderMagicPointText.text  = string.Concat("魔法值:", _unit.magicValue[0], " / ", _unit.healthValue[1]);
        }
Exemplo n.º 2
0
        public override void Execute(bool _isLinear)
        {
            SoliderUnit temp = Instantiate(template);

            temp.NodeInitData();

            SoliderConfig.SoliderData data = soliderConfig.soliderDataArray.FirstOrDefault(x => x.soliderType == soliderType);

            // int[]
            temp.SetIntArrayData(ref temp.healthValue, data.healthValue);
            temp.SetIntArrayData(ref temp.magicValue, data.magicValue);
            temp.SetIntArrayData(ref temp.attackValue, data.attackValue);
            temp.SetIntArrayData(ref temp.attackRangeValue, data.attackRangeValue);
            temp.SetIntArrayData(ref temp.defenseValue, data.defenseValue);
            temp.SetIntArrayData(ref temp.moveRangeValue, data.moveRangeValue);
            temp.SetIntArrayData(ref temp.skillRangeValue, data.skillRangeValue);

            temp.affiliationName = followCommander.GetCampData().campType.ToString();
            temp.managerKeyName  = followCommander.managerKeyName;

            // sprite
            temp.activityConfig    = data.activityConfig;
            temp.affiliationSprite = followCommander.GetCampData().affiliationSprite;

            // component
            temp.PlayActivityAnim(false);
            temp.mRendererComponent.sprite = data.activityConfig.normalSprite;
            temp.hpText.text             = data.healthValue.ToString();
            temp.professionSprite.sprite = followCommander.GetCampData().affiliationSprite;

            // enum
            temp.soliderType  = soliderType;
            temp.movingType   = data.activityConfig.movingType;
            temp.troopsType   = followCommander.GetCampData().troopType;
            temp.skillMastery = data.skillMastery;

            // pos
            Vector3Int calculateValue = LoadInfo.Instance.sceneTileMapManager.GetUnitSpacePos(followCommander.showPos);

            calculateValue.z        = -1;
            temp.transform.position = calculateValue;
            temp.currentPos         = calculateValue;

            temp.mineCommanderUnit = followCommander.GetCacheCommanderUnit();
            temp.mineCommanderUnit.AddSoliderUnits(temp);

            temp.campColor = followCommander.GetCampData().campColor;
            temp.manager   = LoadInfo.Instance.activitiesManager;
            temp.manager.AddActivitiesUnit(temp);

            State = NodeState.Succeed;
        }
Exemplo n.º 3
0
        /// <summary>
        /// 清空选中信息
        /// </summary>
        public void ClearUIInfo()
        {
            cacheSoliderUnit = null;
            cacheCommandUnit = null;

            CanvasGroupAdjust(intBtnArray, false);
            CanvasGroupAdjust(commanderPlane, false);
            CanvasGroupAdjust(soliderPlane, false);

            // UnitOtherActionPlane
            roundOverBtn.gameObject.SetActive(true);
            skillBtn.gameObject.SetActive(false);
            treatBtn.gameObject.SetActive(false);
            detailPanelBtn.gameObject.SetActive(false);


            SetCanNotClickPanelState(false);
        }
Exemplo n.º 4
0
 /// <summary>
 /// 士兵选中方法
 /// </summary>
 /// <param name="_unit"></param>
 public void SetActivitiesData(SoliderUnit _unit)
 {
     cacheSoliderUnit = _unit;
     SetCanNotClickPanelState(false);
     OnSetActivitiesData(_unit);
 }