本文整理汇总了C#中ProtoCrewMember.Die方法的典型用法代码示例。如果您正苦于以下问题:C# ProtoCrewMember.Die方法的具体用法?C# ProtoCrewMember.Die怎么用?C# ProtoCrewMember.Die使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProtoCrewMember
的用法示例。
在下文中一共展示了ProtoCrewMember.Die方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: KillCrewMember
private void KillCrewMember(ProtoCrewMember crewMember, string causeOfDeath, Vessel vessel)
{
TimeWarp.SetRate(0, false);
if (CameraManager.Instance.currentCameraMode == CameraManager.CameraMode.IVA)
{
CameraManager.Instance.SetCameraFlight();
}
string vesselName = (!vessel.isEVA) ? vessel.vesselName + " - " : "";
ScreenMessages.PostScreenMessage(vesselName + crewMember.name + " died of " + causeOfDeath + "!", 15.0f, ScreenMessageStyle.UPPER_CENTER);
this.Log(vessel.vesselName + " - " + crewMember.name + " died of " + causeOfDeath + "!");
if (!vessel.isEVA)
{
Part part = vessel.Parts.Find(p => p.protoModuleCrew.Contains(crewMember));
if (part != null)
{
part.RemoveCrewmember(crewMember);
crewMember.Die();
if (gameSettings.AllowCrewRespawn)
{
crewMember.StartRespawnPeriod(gameSettings.RespawnDelay);
}
}
}
else
{
vessel.rootPart.Die();
if (gameSettings.AllowCrewRespawn)
{
crewMember.StartRespawnPeriod(gameSettings.RespawnDelay);
}
}
gameSettings.knownCrew.Remove(crewMember.name);
}
示例2: KillCrewMember
private void KillCrewMember(ProtoCrewMember crewMember, string causeOfDeath, Vessel vessel)
{
TimeWarp.SetRate(0, false);
if (CameraManager.Instance.currentCameraMode == CameraManager.CameraMode.IVA)
{
CameraManager.Instance.SetCameraFlight();
}
ScreenMessages.PostScreenMessage(vessel.vesselName + " - " + crewMember.name + " died of " + causeOfDeath + "!", 30.0f, ScreenMessageStyle.UPPER_CENTER);
Debug.Log("TAC Life Support (LifeSupportController) [" + this.GetInstanceID().ToString("X") + "][" + Time.time + "]: " + vessel.vesselName + " - " + crewMember.name + " died of " + causeOfDeath + "!");
if (!vessel.isEVA)
{
Part part = vessel.Parts.Find(p => p.protoModuleCrew.Contains(crewMember));
if (part != null)
{
part.RemoveCrewmember(crewMember);
crewMember.Die();
if (settings.AllowCrewRespawn)
{
crewMember.StartRespawnPeriod(settings.RespawnDelay);
}
}
}
else
{
vessel.rootPart.Die();
if (settings.AllowCrewRespawn)
{
crewMember.StartRespawnPeriod(settings.RespawnDelay);
}
}
}
示例3: KillKerbal
/// <summary>
/// Kill a kerbal and erase them from the ship.
/// </summary>
/// <param name="unluckyBastard">The unlucky bastard.</param>
internal static void KillKerbal(ProtoCrewMember unluckyBastard)
{
unluckyBastard.Die();
unluckyBastard.seat.part.RemoveCrewmember(unluckyBastard);
//Yes, this is ugly. No, I don't know how to get it to -actually- kill a Kerbal instead of just listing it as "killed".
//Without doing this, the kerbal can still EVA, etc.
}
示例4: KillCrewmember
public void KillCrewmember(ProtoCrewMember pcm, Vessel vessel)
{
//This code adapted from TAC Life Support, written by taraniselsu under the (CC BY-NC-SA 3.0) license. Source available here: https://github.com/taraniselsu/TacLifeSupport/blob/master/Source/LifeSupportController.cs
TimeWarp.SetRate(0, true);
if (CameraManager.Instance.currentCameraMode == CameraManager.CameraMode.IVA)
{
CameraManager.Instance.SetCameraFlight();
}
Debug.Log("Terminus LS: " + pcm.name + " has died due to lack of life support at UT:"+Planetarium.GetUniversalTime()+"!");
ScreenMessages.PostScreenMessage(pcm.name + " has died due to lack of life support!", 4.0f, ScreenMessageStyle.UPPER_CENTER);
if (!vessel.isEVA)
{
Part part = vessel.Parts.Find(p => p.protoModuleCrew.Contains(pcm));
if (part != null)
{
part.RemoveCrewmember(pcm);
pcm.Die();
if (HighLogic.CurrentGame.Parameters.Difficulty.MissingCrewsRespawn)
{
pcm.StartRespawnPeriod();
}
}
}
else
{
vessel.rootPart.Die();
if (HighLogic.CurrentGame.Parameters.Difficulty.MissingCrewsRespawn)
{
pcm.StartRespawnPeriod();
}
}
//remove from the tracked and loaded lists
KerbalInfo ki = GetInfoForPCM(pcm, false);
TrackedKerbals.Remove(ki);
LoadedKerbals.Remove(ki);
}