protected override void Parse() { for (int i = 0; i < m_reader.Row; ++i) { m_reader.MarkRow(i); ActorMeta meta = new ActorMeta(m_reader.ReadInt()); meta.NameKey = m_reader.ReadString(); meta.Address = m_reader.ReadString(); meta.SubClass = (ActorClass)m_reader.ReadInt(); meta.SubRace = (ActorRace)m_reader.ReadInt(); meta.DeadExp = m_reader.ReadInt(); meta.HealthRank = m_reader.ReadFloat(); ActorMetaManager.AddMeta(meta); } }
//在固定位置创建怪物 private void CreateMonsterAtPos(int metaId, int lv, Vector3 pos) { var meta = ActorMetaManager.GetMeta(metaId); var entity = CWorld.Instance.SpawnUnit <BotEntity>("Bot_" + meta.Name, pos); entity.Address = meta.Address; entity.Team = CUnitEntity.TeamSide.Blue; var go = entity.gameObject; var ctrl = go.AddComponent <BotController>(); var attr = entity.AttributeSet; attr.InitAttr(meta.SubClass, meta.SubRace, meta.HealthRank); attr.InitLevel(1); ActorVO vo = new ActorVO(); //vo.ai = AIMetaManager.GetMeta(ai); //vo.Init(lv); }