public void Init(VAnimalInfo info) { Hp = info.Hp; AttackPhysic = info.AttackPhysic; AttackCriticalPossibility = info.AttackCriticalPossibility; MoveSpeed = info.MoveSpeed; }
void LoadHero(int Id) { _Captain = new VHero(); VAnimalInfo info = VGame.Instance.AnimalTemManager.GetHero(Id); _Captain.Init(info, new Vector3(-2, -1.8f, -3), VGame.Instance.Clientplayer.GetWeapon); }
void LoadMonster(MapInfo map) { VMonster mon = new VMonster(); VAnimalInfo info = VGame.Instance.AnimalTemManager.GetMonster(map.Monster); mon.Init(info, new Vector3(0, -0.5f, -2), 0); _MonsterTab.Add(info.Id, mon); }
void LoadDesk(MapInfo map) { VDesk desk = new VDesk(); VAnimalInfo info = VGame.Instance.AnimalTemManager.GetDesk(map.Desk); desk.Init(info, new Vector3(2, 2, -8), 0); _DeskTab.Add(info.Id, desk); }
public virtual void Init(VAnimalInfo info, Vector3 pos, int weaponId) { _Info = info; GameObject spr = GameObject.Instantiate(Resources.Load(info.Path + "/" + info.Id.ToString())) as GameObject; spr.name = info.Id.ToString(); spr.transform.position = pos; _Handle = spr.transform; _CC = this._Handle.gameObject.GetComponent <CharacterController>(); if (_CC == null) { _CC = this._Handle.gameObject.AddComponent <CharacterController>(); } _JumpSpeed = Main.Instance.JumpSpeed; _Animation = this._Handle.gameObject.GetComponent <SkeletonAnimation>(); if (_Animation == null) { Debug.LogError(info.Id + " 没有骨骼动画 "); } _State = VHeroAttackState.Idle; _HP = 11; //TODO: 此处确定 人物初始朝向 int face = 1; if (face.Equals(FaceType.Left)) { this.FaceType = FaceType.Left; } else if (face.Equals(FaceType.Right)) { this.FaceType = FaceType.Right; } _Attribute = new VAttribute(); _Attribute.Init(info); _Weapon = new VWeapon(); _Weapon.Init(this, weaponId); }
public void Load(Dictionary <int, VAnimalInfo> setting, string path) { setting.Clear(); VTabFile tab = new VTabFile(path); int height = tab.GetHeight(); for (int row = 2; row <= height; row++) { VAnimalInfo info = new VAnimalInfo(); info.Id = tab.GetInteger(row, "Id"); info.Path = tab.GetString(row, "Path"); info.Name = tab.GetString(row, "Name"); info.Level = tab.GetInteger(row, "Level"); info.Hp = tab.GetFloat(row, "Hp"); info.Defense = tab.GetFloat(row, "Defense"); info.AttackPhysic = tab.GetFloat(row, "AttackPhysic"); info.AttackCriticalPossibility = tab.GetFloat(row, "AttackCriticalPossibility"); info.MoveSpeed = tab.GetFloat(row, "MoveSpeed"); setting.Add(info.Id, info); } }
public override void Init(VAnimalInfo info, Vector3 pos, int weaponId) { base.Init(info, pos, weaponId); }