public void ShowActivitiesData(CommanderUnit _unit, bool _isLocal) { if (!_isLocal) { if (cacheCommandUnit || cacheSoliderUnit) { return; } } CanvasGroupAdjust(intBtnArray, false); CanvasGroupAdjust(soliderPlane, false); CanvasGroupAdjust(commanderPlane, true); faceImage.sprite = _unit.unitFaceSprite; commanderAffiliationImage.sprite = _unit.affiliationSprite; nameText.text = _unit.unitName; roleText.text = _unit.roleTpe.ToString(); commanderAffiliationText.text = _unit.affiliationName; levelText.text = "LV " + _unit.levelValue; levelSlider.maxValue = _unit.levelSliderUpgradeValue; levelSlider.value = _unit.levelSliderValue; commanderAttackText.text = string.Concat("攻击力:", _unit.attackValue[0]); commanderDefenseText.text = string.Concat("防御力:", _unit.defenseValue[0]); commanderMoveText.text = string.Concat("移动:", _unit.moveRangeValue[0]); commanderHealthPointText.text = string.Concat("生命值:", _unit.healthValue[0], " / ", _unit.healthValue[1]); commanderMagicPointText.text = string.Concat("魔法值:", _unit.magicValue[0], " / ", _unit.magicValue[1]); commandRangeText.text = string.Concat("指挥范围:", _unit.commandRangeValue[0]); correctedText.text = string.Concat("修正值:", _unit.correctedAttack[0], " / " + _unit.correctedDefense[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); }
/// <summary> /// 指挥官选中方法 /// </summary> /// <param name="_unit"></param> public void SetActivitiesData(CommanderUnit _unit) { cacheCommandUnit = _unit; SetCanNotClickPanelState(false); OnSetActivitiesData(_unit); }
public override void Execute(bool _isLinear) { campData = LoadInfo.Instance.gameManager.GetCampData(managerKeyName); CommanderUnit temp = Instantiate(template); temp.NodeInitData(); // int[] temp.SetIntArrayData(ref temp.healthValue, healthValue); temp.SetIntArrayData(ref temp.magicValue, magicValue); temp.SetIntArrayData(ref temp.commandRangeValue, commandRangeValue); temp.SetIntArrayData(ref temp.correctedAttack, correctedAttackValue); temp.SetIntArrayData(ref temp.correctedDefense, correctedDefenseValue); temp.SetIntArrayData(ref temp.attackValue, attackValue); temp.SetIntArrayData(ref temp.attackRangeValue, attackRangeValue); temp.SetIntArrayData(ref temp.defenseValue, defenseValue); temp.SetIntArrayData(ref temp.moveRangeValue, moveValue); temp.SetIntArrayData(ref temp.skillRangeValue, skillRangeValue); // int temp.levelValue = levelValue; temp.levelSliderValue = levelSliderValue; temp.levelSliderUpgradeValue = levelSliderUpgradeValue; // string temp.unitName = unitName; temp.affiliationName = campData.campType.ToString(); temp.managerKeyName = managerKeyName; // scriptable temp.activityConfig = activityConfig; // sprite temp.unitFaceSprite = unitFaceSprite; temp.affiliationSprite = campData.affiliationSprite; // component temp.PlayActivityAnim(false); temp.mRendererComponent.sprite = activityConfig.normalSprite; temp.hpText.text = healthValue.ToString(); temp.professionSprite.sprite = campData.affiliationSprite; // enum temp.roleTpe = roleType; temp.troopsType = campData.troopType; temp.movingType = activityConfig.movingType; temp.skillMastery = skillMastery; // pos Vector3Int calculateValue = LoadInfo.Instance.sceneTileMapManager.GetUnitSpacePos(showPos); temp.transform.position = calculateValue; temp.currentPos = calculateValue; // other temp.campColor = campData.campColor; temp.manager = LoadInfo.Instance.activitiesManager; temp.manager.AddActivitiesUnit(temp); cacheCommanderUnit = temp; State = NodeState.Succeed; }