本文整理汇总了C#中MyMissionBase类的典型用法代码示例。如果您正苦于以下问题:C# MyMissionBase类的具体用法?C# MyMissionBase怎么用?C# MyMissionBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MyMissionBase类属于命名空间,在下文中一共展示了MyMissionBase类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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++;
}
}
}
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:25,代码来源:MyFortValiantMissionBase.cs
示例2: Unload
public override void Unload(MyMissionBase sender)
{
base.Unload(sender);
m_detector.OnEntityEnter -= DetectorOnOnEntityEnter;
MyScriptWrapper.OnDialogueFinished -= MyScriptWrapperOnOnDialogueFinished;
m_detector.Off();
}
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:8,代码来源:MyDetectorDialogue.cs
示例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);
}
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:8,代码来源:MyDetectorDialogue.cs
示例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);
}
}
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:11,代码来源:MySpawnpointLimiter.cs
示例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();
}
}
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:11,代码来源:MyMinesField.cs
示例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;
}
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:12,代码来源:MyMovingEntity.cs
示例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;
}
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:13,代码来源:MySpawnpointWaves.cs
示例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>();
}
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:14,代码来源:MySpawnpointWaves.cs
示例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();
}
}
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:14,代码来源:MyMovingEntity.cs
示例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);
}
}
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:16,代码来源:MyFortValiantMissionBase.cs
示例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();
}
}
}
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:16,代码来源:MyBlinkingObjects.cs
示例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();
}
}
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:18,代码来源:MyFollowHostObjective.cs
示例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();
}
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:41,代码来源:MySpawnpointSmartWaves.cs
示例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;
}
}
}
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:21,代码来源:MyHeadshake.cs
示例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();
}
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:9,代码来源:MySlaverBase2Mission.cs
示例16: BreakTheChains_OnMissionSuccess
void BreakTheChains_OnMissionSuccess(MyMissionBase sender)
{
MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.generatorspawn);
foreach (var chainEffect in m_chainEffects)
{
MyScriptWrapper.SetEntityEnabled(chainEffect, false);
}
}
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:9,代码来源:MySlaverBase2Mission.cs
示例17: m_Unlockprison1_OnMissionSuccess
void m_Unlockprison1_OnMissionSuccess(MyMissionBase sender)
{
MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.unlockspawn);
}
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:4,代码来源:MySlaverBase2Mission.cs
示例18: m_FreeSlaves_2_OnMissionSuccess
void m_FreeSlaves_2_OnMissionSuccess(MyMissionBase sender)
{
MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.freeslaves2spawn);
}
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:4,代码来源:MySlaverBase2Mission.cs
示例19: ParalyzeDefenseOnMissionUnloaded
void ParalyzeDefenseOnMissionUnloaded(MyMissionBase sender)
{
MyScriptWrapper.EntityDeath -= OnMyParalyzeDefenseEntityDeath;
}
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:4,代码来源:MySlaverBase2Mission.cs
示例20: M12HackGenerator2OnOnMissionLoaded
private void M12HackGenerator2OnOnMissionLoaded(MyMissionBase sender)
{
MyScriptWrapper.MarkEntity(MyScriptWrapper.TryGetEntity((uint)EntityID.HackGenerator2Doors), "Destroy", MyHudIndicatorFlagsEnum.SHOW_DISTANCE | MyHudIndicatorFlagsEnum.SHOW_TEXT | MyHudIndicatorFlagsEnum.SHOW_HEALTH_BARS | MyHudIndicatorFlagsEnum.SHOW_BORDER_INDICATORS, MyGuitargetMode.Enemy);
MyScriptWrapper.TryUnhideEntities(m_hackGenerator2Cargos, true);
sender.Components.Add(new MyHeadshake(0, MyHeadshake.DefaultShaking));
MyScriptWrapper.SetEntitiesEnabled(m_hackGenerator2Particles, true);
}
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:8,代码来源:MyAlienGateMission.cs
注:本文中的MyMissionBase类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论