本文整理汇总了C#中MinerWars.AppCode.Game.Entities.MyEntity.SetName方法的典型用法代码示例。如果您正苦于以下问题:C# MyEntity.SetName方法的具体用法?C# MyEntity.SetName怎么用?C# MyEntity.SetName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MinerWars.AppCode.Game.Entities.MyEntity
的用法示例。
在下文中一共展示了MyEntity.SetName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnSpawnpointBotSpawned
void OnSpawnpointBotSpawned(MyEntity spawnpoint, MyEntity spawnedBot)
{
foreach (var sp in m_firstWave)
{
if (spawnpoint == MyScriptWrapper.GetEntity(sp))
{
MyScriptWrapper.SetSleepDistance(spawnedBot, 3000);
}
}
foreach (var item in new List<uint> { (uint)EntityID.SP4_1, (uint)EntityID.SP4_2 })
{
if (spawnpoint.EntityId.Value.NumericValue == item)
{
MyScriptWrapper.StopFollow(spawnedBot);
if (m_momoBoss != null)
{
MyScriptWrapper.SetEntityDestructible(spawnedBot, false);
MyScriptWrapper.Follow(m_momoBoss, spawnedBot);
MyScriptWrapper.SetSleepDistance(spawnedBot, 3000);
}
else
{
Debug.Assert(true, "Boss entity is null. Cannot identify leader");
}
}
}
if (spawnpoint == MyScriptWrapper.GetEntity((uint)EntityID.MomoZappaSP))
{
spawnedBot.SetName("Momo");
spawnedBot.DisplayName = MyTexts.MomoZappa;
m_momoBoss = (MySmallShipBot) spawnedBot;
m_objective07SpeakWithMomo.BotToTalkId = MyScriptWrapper.GetEntityId(m_momoBoss);
MyScriptWrapper.SetEntityDestructible(m_momoBoss, false);
m_momoBoss.LookTarget = MySession.PlayerShip;
m_momoBoss.Health = m_momoBoss.MaxHealth = 1000;
MyScriptWrapper.SetSleepDistance(spawnedBot, 3000);
MyScriptWrapper.ActivateSpawnPoint((uint) EntityID.SP4_1);
MyScriptWrapper.ActivateSpawnPoint((uint) EntityID.SP4_2);
}
if (spawnpoint == MyScriptWrapper.GetEntity((uint)EntityID.BR_SP_Boss))
{
spawnedBot.DisplayName = MyTexts.GangsterBoss;
m_blackRavenBoss = (MySmallShipBot)spawnedBot;
MyScriptWrapper.SetEntityDestructible(m_blackRavenBoss, false);
MyScriptWrapper.ChangeFaction(m_blackRavenBoss, MyMwcObjectBuilder_FactionEnum.Traders);
m_blackRavenBoss.LookTarget = MySession.PlayerShip;
m_blackRavenBoss.Health = m_blackRavenBoss.MaxHealth = 500;
MyScriptWrapper.SetSleepDistance(spawnedBot, 5000);
m_blackRavenBoss.OnDie += OnGangsterBossDied;
foreach (var item in new List<uint>
{
(uint) EntityID.BR_SP_1,
(uint) EntityID.BR_SP_2,
(uint) EntityID.BR_SP_3,
(uint) EntityID.BR_SP_4,
(uint) EntityID.BR_SP_Boss
})
{
MyScriptWrapper.ActivateSpawnPoint(item);
}
}
foreach (var item in m_spawns)
{
if (spawnpoint == MyScriptWrapper.GetEntity(item) && spawnedBot != m_blackRavenBoss)
{
MyScriptWrapper.SetSleepDistance(spawnedBot, 5000);
if (m_blackRavenBoss != null && !m_blackRavenBoss.Closed)
{
if (ActiveObjectives.Contains(m_objective12BrFight))
{
MyScriptWrapper.SetEntityDestructible(spawnedBot, true);
MyScriptWrapper.ChangeFaction(spawnedBot, MyMwcObjectBuilder_FactionEnum.Slavers);
}
else
{
MyScriptWrapper.SetEntityDestructible(spawnedBot, false);
MyScriptWrapper.ChangeFaction(spawnedBot, MyMwcObjectBuilder_FactionEnum.Traders);
}
MyScriptWrapper.Follow(m_blackRavenBoss, spawnedBot);
}
else
{
MyScriptWrapper.SetEntityDestructible(spawnedBot, true);
MyScriptWrapper.ChangeFaction(spawnedBot, MyMwcObjectBuilder_FactionEnum.Slavers);
((MySmallShipBot)spawnedBot).Attack(MySession.PlayerShip);
}
}
}
}