本文整理汇总了C#中MyMissionBase类的典型用法代码示例。如果您正苦于以下问题:C# MyMissionBase类的具体用法?C# MyMissionBase怎么用?C# MyMissionBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MyMissionBase类属于命名空间,在下文中一共展示了MyMissionBase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Update
public override void Update(MyMissionBase sender)
{
if (m_isFirstUpdate)
{
for (int i = 0; i < m_scannersStartTimes.Count; i++)
{
m_scannersStartTimes[i] = sender.MissionTimer.ElapsedTime + MyMwcUtils.GetRandomInt(0, 3)*1000;
}
m_isFirstUpdate = false;
}
else
{
var index =0;
foreach (MyEntity scanner in m_scanners)
{
if (m_scannersStartTimes[index] < sender.MissionTimer.ElapsedTime)
{
scanner.Enabled = !scanner.Enabled;
m_scannersStartTimes[index] = sender.MissionTimer.ElapsedTime + m_scannersUpdateTimes[index];
}
index++;
}
}
}
示例2: Unload
public override void Unload(MyMissionBase sender)
{
base.Unload(sender);
m_detector.OnEntityEnter -= DetectorOnOnEntityEnter;
MyScriptWrapper.OnDialogueFinished -= MyScriptWrapperOnOnDialogueFinished;
m_detector.Off();
}
示例3: Load
public override void Load(MyMissionBase sender)
{
m_detector = MyScriptWrapper.GetDetector(MyScriptWrapper.GetEntity(m_detectorId));
m_detector.On();
m_detector.OnEntityEnter += DetectorOnOnEntityEnter;
MyScriptWrapper.OnDialogueFinished += MyScriptWrapperOnOnDialogueFinished;
base.Load(sender);
}
示例4: Unload
public override void Unload(MyMissionBase sender)
{
base.Unload(sender);
foreach (uint id in m_spawnpointIDs)
{
MySpawnPoint spawnpoint;
if (MyEntities.TryGetEntityById(new MyEntityIdentifier(id), out spawnpoint))
spawnpoint.RemoveLimiter(this);
}
}
示例5: Load
public override void Load(MyMissionBase sender)
{
base.Load(sender);
for (int i = 0; i < m_mines.GetLength(0); i++)
{
MyEntityDetector mineDetector = MyScriptWrapper.GetDetector(m_mines[i, 1]);
mineDetector.OnEntityPositionChange +=mineDetector_OnEntityPositionChange;
mineDetector.On();
}
}
示例6: Load
public override void Load(MyMissionBase sender)
{
base.Load(sender);
m_ship = m_shipId.HasValue ? MyScriptWrapper.GetEntity(m_shipId.Value) : MyScriptWrapper.GetEntity(m_shipName);
m_trajectory = new MyLine(m_ship.GetPosition(), MyScriptWrapper.GetEntity(m_targetId).GetPosition());
if (m_isShip)
{
MyScriptWrapper.PrepareMotherShipForMove(m_ship);
}
m_shipMoving = true;
}
示例7: Unload
public override void Unload(MyMissionBase sender)
{
base.Unload(sender);
if (m_detector != null)
{
m_detector.OnEntityEnter -= OnDetector;
m_detector.Off();
}
MyScriptWrapper.OnSpawnpointBotSpawned -= OnSpawnpointBotSpawned;
MyScriptWrapper.EntityDeath -= EntityDeath;
}
示例8: Load
public override void Load(MyMissionBase sender)
{
base.Load(sender);
m_detector = MyScriptWrapper.GetDetector(m_detectorID);
if (m_detector != null)
{
m_detector.OnEntityEnter += OnDetector;
m_detector.On();
}
m_currentWave = 0;
m_spawnedBots = new List<MyEntity>();
}
示例9: Update
public override void Update(MyMissionBase sender)
{
base.Update(sender);
var progress = sender.MissionTimer.ElapsedTime / (float)m_time;
if (progress < 1.0f && m_shipMoving)
{
var position = Vector3.SmoothStep(m_trajectory.From, m_trajectory.To, progress);
MyScriptWrapper.Move(m_ship, position);
}
else
{
StopShip();
}
}
示例10: Load
public override void Load(MyMissionBase sender)
{
m_scanners = new List<MyPrefabScanner>();
m_isFirstUpdate = true;
m_scannersStartTimes = new List<int>();
foreach (var mScannersId in m_scannersIds)
{
var scanner = MyScriptWrapper.GetEntity(mScannersId) as MyPrefabScanner;
scanner.OnEntityScanned += ScannerOnOnEntityScanned;
m_scanners.Add(scanner);
m_scannersStartTimes.Add(0);
}
}
示例11: Update
public override void Update(MyMissionBase sender)
{
base.Update(sender);
if (m_enabled)
{
if (sender.MissionTimer.ElapsedTime > m_nextChange)
{
m_nextChange = sender.MissionTimer.ElapsedTime + m_blinkingPeriod;
m_highlited = !m_highlited;
if (m_highlited) m_nextChange = sender.MissionTimer.ElapsedTime + 2*m_blinkingPeriod;
UpdateHighlighting();
}
}
}
示例12: SetObjectives
public void SetObjectives(MyMissionBase mission)
{
if (mission != null)
{
this.Name = mission.Name;
this.Description = mission.Description;
this.NameTemp = mission.NameTemp;
this.DescriptionTemp = mission.DescriptionTemp;
}
else
{
Name = MyTextsWrapperEnum.EmptyDescription;
NameTemp = new StringBuilder();
Description = MyTextsWrapperEnum.EmptyDescription;
DescriptionTemp = new StringBuilder();
}
}
示例13: Load
public override void Load(MyMissionBase sender)
{
base.Load(sender);
m_spawnPoints.Clear();
if (m_spawnPointIDs == null)
{ //Add all spawnpoints in mission
List<uint> list = new List<uint>();
foreach (MyEntity entity in MyEntities.GetEntities())
{
MySpawnPoint spawnPoint = entity as MySpawnPoint;
if (spawnPoint != null && MyFactions.GetFactionsRelation(MySession.PlayerShip.Faction, spawnPoint.Faction) == MyFactionRelationEnum.Enemy && !m_excludedSpawnPointIDs.Contains(spawnPoint.EntityId.Value.NumericValue))
{
list.Add(spawnPoint.EntityId.Value.NumericValue);
spawnPoint.OnActivatedChanged += new Action<MySpawnPoint>(spawnPoint_OnActivatedChanged);
}
}
m_spawnPointIDs = list.ToArray();
}
foreach (uint spawnPointID in m_spawnPointIDs)
{
m_spawnPoints.Add(MyEntities.GetEntityById(new MyEntityIdentifier(spawnPointID)) as MySpawnPoint);
}
MyScriptWrapper.OnSpawnpointBotSpawned += OnSpawnpointBotSpawned;
m_currentBotsCount = 0;
foreach (MySpawnPoint spawnPoint in m_spawnPoints)
{
spawnPoint.LeftToSpawn = 0;
spawnPoint.FirstSpawnTimer = 0;
spawnPoint.RespawnTimer = 0;
m_currentBotsCount += spawnPoint.GetShipCount();
spawnPoint.Deactivate();
}
UpdateCurrentBotCount();
}
示例14: Update
public override void Update(MyMissionBase sender)
{
base.Update(sender);
if (Time.HasValue)
{
if (m_shakeIndex < m_shakeWaves.Count &&
sender.MissionTimer.GetElapsedTime().TotalMilliseconds > Time.Value + m_shakeWaves[m_shakeIndex])
{
if (m_shakeIndex == 0)
{
MyScriptWrapper.IncreaseHeadShake(FirstShake);
}
else
{
MyScriptWrapper.IncreaseHeadShake(MyMwcUtils.GetRandomFloat(NextShakesMin, NextShakesMax) * MathHelper.Max(0, 1.0f - Damping * m_shakeIndex));
}
++m_shakeIndex;
}
}
}
示例15: Return_OnMissionLoaded
void Return_OnMissionLoaded(MyMissionBase sender)
{
MySmallShipBot transport1 = (MySmallShipBot)MyScriptWrapper.GetEntity((uint)EntityID.ShipTransport1);
transport1.SetWaypointPath("transport");
transport1.Patrol();
MySmallShipBot transport2 = (MySmallShipBot)MyScriptWrapper.GetEntity((uint)EntityID.ShipTransport2);
transport2.SetWaypointPath("transport");
transport2.Patrol();
}