一.Missile
游戏中弩箭/弓箭/飞石/炮弹等在场景中沿抛物线投射实例GameEntity即为Missile.
在场景中发射一个Missile:
<1.获取ItemObject(加载ModuleData/weapons.xml)
ItemObject obj = Game.Current.ObjectManager.GetObject<ItemObject>("boulder");
<2.根据ItemObject实例化MissionWeapon
MissionWeapon weapon = new MissionWeapon(obj, null, null, 1);
<3.设置BaseSpeed,Speed发射一个Missile
mission.AddCustomMissile(shooterAgent, weapon, missileOrigin,
missileRotation.f, missileRotation, baseSpeed, speed, false, null, -1);
二.Missile抛物线算法
抛物线 = AirFriction(空气阻尼) + Physics(Missile物理参数) + ShooterAgent(射击精度)
<1.AirFriction常量