public void initRAL(RoleAttributeList RAL , SDConstants.CharacterType CType, int lv = 0) { currentRAL = RAL; _type = CType; initRAL_AD_Panel(); }
// Start is called before the first frame update void Start() { _unit = GetComponentInParent <BattleRoleData>(); status = GetComponentInChildren <SDHeroBattleStatus>(); _characterType = _unit._Tag; initHpPanel(); }
public void initEnemyCharacterModel(string enemyId, float scale = 1, UDE _ude = UDE.Animation) { thisCMCsUDE = _ude; id = enemyId; CType = SDConstants.CharacterType.Enemy; skinName = "default"; initCharacterModel(scale); }
public void checkCurrentUnitTag() { if (_currentBattleUnit._Tag == SDConstants.CharacterType.Hero) { _currentBUType = SDConstants.CharacterType.Hero; } else { _currentBUType = SDConstants.CharacterType.Enemy; } }
/// <summary> /// 英雄标准技能自动化后的目标选择 /// </summary> public void chooseAutoBattleTarget() { _currentSkill = _currentActionPanel.CurrentSkill; bool ToHero = true; if (_currentSkill.ThisSkillAim == SkillAim.Self || _currentSkill.ThisSkillAim == SkillAim.All) { _currentTargetUnit = _currentBattleUnit; _currentTUType = _currentBattleUnit._Tag; return; } else if (_currentSkill.ThisSkillAim == SkillAim.Friend && _currentBattleUnit.IsEnemy) { ToHero = false; } else if (_currentSkill.ThisSkillAim == SkillAim.Other && !_currentBattleUnit.IsEnemy) { ToHero = false; } if (ToHero) { if (Remaining_SRL.Count <= 0) { Debug.Log("GameOver"); } else { int _rand = UnityEngine.Random.Range(0, Remaining_SRL.Count); if (_currentSkill.name.Contains("Heal")) { _rand = AutoHealTarget(false); } _currentTargetUnit = Remaining_SRL[_rand]; _currentTUType = SDConstants.CharacterType.Hero; } } else { //if (Remaining_ORL.Count <= 0) BattleSuccess(); //else if (Remaining_ORL.Count > 0) { int _rand = UnityEngine.Random.Range(0, Remaining_ORL.Count); if (_currentSkill.name.Contains("Heal")) { _rand = AutoHealTarget(true); } _currentTargetUnit = Remaining_ORL[_rand]; _currentTUType = SDConstants.CharacterType.Enemy; } } }
public void initHeroDetailPanel(int hashcode , SDConstants.CharacterType type = SDConstants.CharacterType.Hero) { Type = type; if (Type == SDConstants.CharacterType.Hero) { equipList.BuildEquipListBase(); equipList.HD = this; if (_hero == null) { _hero = equipList.gameObject.AddComponent <SDHero>(); } ID = SDDataManager.Instance.getHeroIdByHashcode(hashcode); GDEHeroData hero = SDDataManager.Instance.GetHeroOwnedByHashcode(hashcode); Hashcode = hashcode; setHero(Hashcode); setHelmet(Hashcode); setBreastplate(Hashcode); // setGardebras(Hashcode);//已过期 setLegging(Hashcode); setJewelry(Hashcode, false); setJewelry(Hashcode, true); setWeapon(Hashcode); InitHeroBasicProperties(); RALPanel.initRAL(this.RoleBasicRA , Type , SDDataManager.Instance.getLevelByExp(hero.exp));//视觉展示属性 setRoleBaseMessiage(); if (LvText) { int exp = hero.exp; int lv = SDDataManager.Instance.getLevelByExp(exp); LvText.text = SDGameManager.T("Lv.") + lv; } readHeroSkills(); // heroHeadImg.initHeroCharacterModel(Hashcode, SDConstants.HERO_MODEL_BIG_RATIO); } }
/// <summary> /// 敌人释放技能时判定目标 /// </summary> public void chooseRandomHeroToAttack() { //Debug.Log("敌方:" + _currentBattleUnit.name + " 自动选择目标"); _currentSkill = _currentActionPanel.CurrentSkill; if (_currentSkill.ThisSkillAim == SkillAim.Other) { _currentTargetUnit = Remaining_SRL[TauntFunction()]; _currentTUType = SDConstants.CharacterType.Hero; } else { if (_currentSkill.ThisSkillAim == SkillAim.Self || _currentSkill.ThisSkillAim == SkillAim.All) { _currentTargetUnit = _currentBattleUnit; } else { int _rand = UnityEngine.Random.Range(0, Remaining_ORL.Count); _currentTargetUnit = Remaining_ORL[_rand]; _currentTUType = SDConstants.CharacterType.Enemy; } } }
public void initHeroCharacterModel(int hashcode, float scale = 1, UDE _ude = UDE.Animation) { thisCMCsUDE = _ude; heroHashcode = hashcode; id = SDDataManager.Instance.getHeroIdByHashcode(hashcode); CType = SDConstants.CharacterType.Hero; skinName = SDDataManager.Instance.getHeroSkinNameInSkeleton(hashcode); // GDEEquipmentData weapon = SDDataManager.Instance.getHeroWeapon(hashcode); if (weapon == null || weapon.hashcode <= 0 || string.IsNullOrEmpty(weapon.id)) { notShowWeaponSlot = true; } else { notShowWeaponSlot = false; weaponId = weapon.id; } // initCharacterModel(scale); }
public override void initData(string id, string name, string desc, CharacterSex sex, string faceIcon , SDConstants.CharacterType ctype = SDConstants.CharacterType.Enemy) { base.initData(id, name, desc, sex, faceIcon, ctype); }
public virtual void initData(string id, string name, string desc, CharacterSex sex, string faceIcon, SDConstants.CharacterType ctype) { ID = id; Name = name; DESC = desc; Sex = sex; CharacterType = ctype; }
public void ConfirmSkillAndTarget() { ActionConfirm = false; if (_currentActionPanel == null || _currentActionPanel.CurrentSkill == null) { return; } _currentSkill = _currentActionPanel.CurrentSkill; int touchId = SelectController.WhenPointDownIndex(); if (_currentSkill.ThisSkillAim == SkillAim.Self || _currentSkill.RandomTarget) { if (confirmSkillStep == 0) { confirmSkillStep = 1; } else if (confirmSkillStep == 1) { ActionConfirm = true; _currentTargetUnit = All_Array[touchId]; _currentTUType = _currentTargetUnit._Tag; // if (_currentSkill.ThisSkillAim != SkillAim.Self) { SelectController.ConfirmTarget(touchId); } else { currentTouchId = 0; } } } else { if (All_Array[touchId].IsOptionTarget) { if (currentTouchId < 0) { currentTouchId = touchId; } if (touchId != currentTouchId) { currentTouchId = touchId; confirmSkillStep = 0; } else { if (confirmSkillStep == 1) { ActionConfirm = true; } else if (confirmSkillStep == 0) { confirmSkillStep = 1; _currentTargetUnit = All_Array[currentTouchId]; _currentTUType = _currentTargetUnit._Tag; SelectController.ConfirmTarget(touchId); } } } else { RolePlayJumpAnim(All_Array[touchId]); Debug.Log("无效目标"); } } }
// Start is called before the first frame update void Start() { _unit = GetComponentInParent <BattleRoleData>(); _characterType = _unit._Tag; refreshState(); }