本文整理汇总了C#中GameEvents类的典型用法代码示例。如果您正苦于以下问题:C# GameEvents类的具体用法?C# GameEvents怎么用?C# GameEvents使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GameEvents类属于命名空间,在下文中一共展示了GameEvents类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: receiveEvent
public void receiveEvent(GameEvents.GameEvent e)
{
if(e.GetType().Name.Equals("CelebrateEvent"))
{
GetComponent<BalloonFaceAnim>().Celebrate();
}
}
示例2: OnVesselSituationChange
void OnVesselSituationChange(GameEvents.HostedFromToAction<Vessel, Vessel.Situations> change)
{
bool shouldReinitialise = false;
if (change.from == Vessel.Situations.DOCKED)
shouldReinitialise = true;
if (change.to == Vessel.Situations.DOCKED)
shouldReinitialise = true;
if (shouldReinitialise)
{
ORSHelper.removeVesselFromCache(change.host);
Debug.Log("[KSP Interstellar] GameEventSubscriber - OnVesselSituationChange reinitialising");
var generators = change.host.FindPartModulesImplementing<FNGenerator>();
generators.ForEach(g => g.OnStart(PartModule.StartState.Docked));
var radiators = change.host.FindPartModulesImplementing<FNRadiator>();
radiators.ForEach(g => g.OnStart(PartModule.StartState.Docked));
}
}
示例3: receiveEvent
public void receiveEvent(GameEvents.GameEvent e)
{
if(e.GetType().Name.Equals("CelebrateEvent"))
{
confetti.Play();
}
}
示例4: receiveEvent
public void receiveEvent(GameEvents.GameEvent e)
{
if(e.GetType().Name.Equals("PassGateEvent"))
{
PassGate();
}
}
示例5: OnVesselSituationChange
void OnVesselSituationChange(GameEvents.HostedFromToAction<Vessel, Vessel.Situations> change)
{
//Debug.Log("[KSP Interstellar] OnVesselSituationChange is called with situation " + change.from.ToString() + " to " + change.to.ToString() + " on vessel " + change.host.name);
bool shouldReinitialise = false;
if (change.from == Vessel.Situations.DOCKED)
{
//Debug.Log("[KSP Interstellar] GameEventSubscriber - OnVesselSituationChange situation changed from Docked");
shouldReinitialise = true;
}
if (change.to == Vessel.Situations.DOCKED)
{
//Debug.Log("[KSP Interstellar] GameEventSubscriber - OnVesselSituationChange situation changed to Docked");
shouldReinitialise = true;
}
if (shouldReinitialise)
{
Debug.Log("[KSP Interstellar] GameEventSubscriber - OnVesselSituationChange reinitialising");
var generators = change.host.FindPartModulesImplementing<FNGenerator>();
generators.ForEach(g => g.OnStart(PartModule.StartState.Docked));
var radiators = change.host.FindPartModulesImplementing<FNRadiator>();
radiators.ForEach(g => g.OnStart(PartModule.StartState.Docked));
}
//Debug.Log("[KSP Interstellar] GameEventSubscriber - OnVesselSituationChange is finished");
}
示例6: receiveEvent
public void receiveEvent(GameEvents.GameEvent e)
{
if(e.GetType().Name.Equals("UpdateHud"))
{
updateHud();
}
}
示例7: onCrewBoardVessel
public void onCrewBoardVessel(GameEvents.FromToAction<Part, Part> data)
{
this.FromPartToPartHelper(
this.getStringBuilder(),
data
);
}
示例8: OnGameSceneSwitchRequested
private void OnGameSceneSwitchRequested(GameEvents.FromToAction<GameScenes,GameScenes> e)
{
if(e.from!=GameScenes.MAINMENU && e.to==GameScenes.MAINMENU)
{
configuration.Save();
}
}
示例9: receiveEvent
public void receiveEvent(GameEvents.GameEvent e)
{
if(e.GetType().Name.Equals("BackgroundScrollEvent"))
{
amountToMoveX += ((BackgroundScrollEvent) e).MoveX;
amountToMoveY += ((BackgroundScrollEvent) e).MoveY;
}
}
示例10: onPartCoupled
private void onPartCoupled(GameEvents.FromToAction<Part, Part> data)
{
if (data.from == part)
{
ghostConnectionFrom = part.parent;
ghostConnectionTo = data.to.parent;
}
}
示例11: onEvaStart
public void onEvaStart(GameEvents.FromToAction<Part, Part> data)
{
double fuel = data.from.RequestResource("MonoPropellant", 5);
if (fuel < 5)
{
data.to.RequestResource("EVA Propellant", 5 - fuel);
}
}
示例12: receiveEvent
public void receiveEvent(GameEvents.GameEvent e)
{
if(e.GetType().Name.Equals("InputEvent"))
{
InputEvent inputEvent = (InputEvent) e;
GetInput(inputEvent.GetDevice());
}
}
示例13: OnRenameVessel
private void OnRenameVessel(GameEvents.HostedFromToAction<Vessel, string> data)
{
UnityEngine.Debug.Log("SmartRename: " + part.name);
if( vessel.id == data.host.id && data.from == initialName)
{
UnityEngine.Debug.Log($"[{nameof(ShipSections)}] [{nameof(SmartRename)}] Updating initial vessel name to {data.to}");
initialName = data.to;
}
}
示例14: OnVesselSituationChange
protected void OnVesselSituationChange(GameEvents.HostedFromToAction<Vessel, Vessel.Situations> hfta)
{
if (hfta.to == Vessel.Situations.SUB_ORBITAL ||
hfta.to == Vessel.Situations.ORBITING ||
hfta.to == Vessel.Situations.ESCAPING)
{
SetState(ParameterState.Complete);
}
}
示例15: receiveEvent
public void receiveEvent(GameEvents.GameEvent e)
{
string gateExistScreenEventName = "GateExitScreenEvent";
if(e.GetType().Name.Equals(gateExistScreenEventName))
{
AddGateToPool(((GateExitScreenEvent) e).GetGate());
}
}