private void CreateMonster(MapMonsterCall data) { Vector3 bornEulerAngles = data.EulerAngles; Vector3 bornPosition = GlobalTools.NavSamplePosition(data.Position); TransformParam param = TransformParam.Create(bornPosition, bornEulerAngles); int serialId = GameEntry.Level.CreateEnemy(data.Id, param); mMonsterGUIDSet.Add(serialId); }
private void CreateMonster() { if (Region == null) { Debug.LogError("找不到区域" + Region.Id); return; } Vector3 pos = GlobalTools.RandomOnCircle(5) + Region.Position; Vector3 angle = new Vector3(0, UnityEngine.Random.Range(0, 360), 0); TransformParam param = TransformParam.Create(pos, angle); int serialId = GameEntry.Level.CreateEnemy(MonsterID, param); m_Monsters.Add(serialId); }
private void LoadMount() { int mountId = UnityEngine.Random.Range(100001, 100003); TransformParam param = TransformParam.Create(CachedTransform.position, CachedTransform.eulerAngles); int entityId = GameEntry.Entity.GenerateSerialId(); MountEntityData data = new MountEntityData(entityId, mountId, ActorType.Mount, BattleCampType.Ally, this) { Position = param.Position, Rotation = Quaternion.Euler(param.EulerAngles), Scale = param.Scale }; GameEntry.Level.AddRole <MountRole>(data); this.Mount = entityId; }