public CharacterParameterModel[] GetEnemyModelList() { CharacterParameterModel[] modelList = new CharacterParameterModel[armyEntity.sheets [1].list.Count]; int index = 0; foreach(var model in armyEntity.sheets[1].list) { CharacterParameterModel paramModel = new CharacterParameterModel (); paramModel.id = model.id; paramModel.maxHp = model.maxHp; paramModel.attack = model.attack; paramModel.defence = model.defence; paramModel.speed = model.speed; paramModel.critical = model.critical; paramModel.maxSp = model.maxSp; paramModel.attackRange = model.attackRange; paramModel.attackInterval = model.attackInterval; paramModel.bodyRadius = model.bodyRadius; modelList [index] = paramModel; index++; } return modelList; }
public override void Initialize(CharacterParameterModel model) { base.Initialize (model); skillController = GetComponent<SkillController> (); if (skillController != null) { skillController.Init (); } }
public override void Initialize(CharacterParameterModel model) { base.Initialize (model); isBoss = true; skillController = GetComponent<SkillController>(); slash = transform.FindChild ("Model/EffectAttack").GetComponent<EffectSlash> (); rangeSector = transform.FindChild("Model/SkillRange").GetComponent<SkillRangeSector>(); skillController.Init(); slash.Init (); rangeSector.InitSector(); }
public CharacterParameterModel[] GetArmyModelList() { List<CharacterParameterModel> modelList = new List<CharacterParameterModel>(); int index = 0; foreach(var item in memberEntity.sheets[0].list) { if(item.id == 0) { continue; } CharacterParameterModel paramModel = new CharacterParameterModel (); var model = armyEntity.sheets[0].list.Find( x => x.id == item.id); paramModel.id = model.id; paramModel.maxHp = model.maxHp; paramModel.attack = model.attack; paramModel.defence = model.defence; paramModel.speed = model.speed; paramModel.critical = model.critical; paramModel.maxSp = model.maxSp; paramModel.attackRange = model.attackRange; paramModel.attackInterval = model.attackInterval; paramModel.bodyRadius = model.bodyRadius; modelList.Add(paramModel); index++; } // foreach(var model in armyEntity.sheets[0].list) // { // CharacterParameterModel paramModel = new CharacterParameterModel (); // paramModel.maxHp = model.maxHp; // paramModel.attack = model.attack; // paramModel.defence = model.defence; // paramModel.speed = model.speed; // paramModel.attackRange = model.attackRange; // paramModel.attackInterval = model.attackInterval; // // modelList [index] = paramModel; // // index++; // } return modelList.ToArray(); }
public virtual void Initialize(CharacterParameterModel model) { this.characterMove = GetComponent<CharacterMove>(); this.animationController = new AnimationController(); animationController.SetAnimator(transform.FindChild("Model").GetComponent<Animator>()); hud = transform.FindChild("HUD").GetComponent<CharacterHUD>(); hud.InitHUD(); InitCharacterParam (model); canMove = true; isInitialized = true; canDrag = true; ChangeState(ActionState.Idle); }
protected virtual void InitCharacterParam(CharacterParameterModel model) { this.characterParam.maxHp = model.maxHp; this.characterParam.attack = model.attack; this.characterParam.defence = model.defence; this.characterParam.speed = model.speed; this.characterParam.critical = model.critical; this.characterParam.maxSp = model.maxSp; this.characterParam.attackRange = model.attackRange; this.characterParam.attackInterval = model.attackInterval; this.characterParam.bodyRadius = model.bodyRadius; this.characterParam.hp = this.characterParam.maxHp; skillDamage = characterParam.attack * 5; }
void ConfigureArmies(CharacterParameterModel[] modelList) { Transform armiesParent = this.transform.root.FindChild ("Armies"); GameObject cachedObj; for(int i = 0; i < modelList.Length; i++) { if(modelList[i].id == 0) continue; cachedObj = Resources.Load<GameObject>((new StringBuilder("Army/Army_").Append(modelList[i].id.ToString())).ToString()); ArmyBaseController army = Instantiate(cachedObj).GetComponent<ArmyBaseController>(); army.transform.SetParent(armiesParent); if(modelList[i].id == 5) { hideArmy = army; hideParam = modelList[i]; army.gameObject.SetActive(false); continue; } Vector3 startPos = this.transform.root.FindChild ("StartPoints").FindChild("StartPoint_"+(i+1).ToString()).position; army.transform.position = startPos; army.Initialize(modelList[i]); army.SetHUDHandle(uiCanvas.FindChild("Offset/Bottom/Armies").GetChild(i).GetComponent<CharacterHUDHandle>()); this.armiesList.Add(army); } cachedObj = null; }
public override void Initialize(CharacterParameterModel model) { base.Initialize (model); slash = transform.FindChild ("Model/EffectAttack").GetComponent<EffectSlash> (); slash.Init (); }