当前位置: 首页>>代码示例>>C#>>正文


C# GameEvents类代码示例

本文整理汇总了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();
     }
 }
开发者ID:paulkelly,项目名称:BlowyBalloon,代码行数:7,代码来源:BalloonMovement.cs

示例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));
            }
        }
开发者ID:ABZB,项目名称:KSPInterstellar,代码行数:25,代码来源:PluginHelper.cs

示例3: receiveEvent

 public void receiveEvent(GameEvents.GameEvent e)
 {
     if(e.GetType().Name.Equals("CelebrateEvent"))
     {
         confetti.Play();
     }
 }
开发者ID:paulkelly,项目名称:BlowyBalloon,代码行数:7,代码来源:ConfettiCelebration.cs

示例4: receiveEvent

 public void receiveEvent(GameEvents.GameEvent e)
 {
     if(e.GetType().Name.Equals("PassGateEvent"))
     {
         PassGate();
     }
 }
开发者ID:paulkelly,项目名称:BlowyBalloon,代码行数:7,代码来源:ScoreKeeper.cs

示例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");
        }
开发者ID:droric,项目名称:KSPInterstellar,代码行数:35,代码来源:PluginHelper.cs

示例6: receiveEvent

 public void receiveEvent(GameEvents.GameEvent e)
 {
     if(e.GetType().Name.Equals("UpdateHud"))
     {
         updateHud();
     }
 }
开发者ID:paulkelly,项目名称:pkbitshop,代码行数:7,代码来源:Hud.cs

示例7: onCrewBoardVessel

 public void onCrewBoardVessel(GameEvents.FromToAction<Part, Part> data)
 {
     this.FromPartToPartHelper(
         this.getStringBuilder(),
         data
     );
 }
开发者ID:Kerbas-ad-astra,项目名称:ToadicusTools,代码行数:7,代码来源:EventSniffer.cs

示例8: OnGameSceneSwitchRequested

 private void OnGameSceneSwitchRequested(GameEvents.FromToAction<GameScenes,GameScenes> e)
 {
    if(e.from!=GameScenes.MAINMENU && e.to==GameScenes.MAINMENU)
    {
       configuration.Save();
    }
 }
开发者ID:Kerbas-ad-astra,项目名称:FinalFrontier,代码行数:7,代码来源:FinalFrontier.cs

示例9: receiveEvent

 public void receiveEvent(GameEvents.GameEvent e)
 {
     if(e.GetType().Name.Equals("BackgroundScrollEvent"))
     {
         amountToMoveX += ((BackgroundScrollEvent) e).MoveX;
         amountToMoveY += ((BackgroundScrollEvent) e).MoveY;
     }
 }
开发者ID:paulkelly,项目名称:pkbitshop,代码行数:8,代码来源:BackgroundScroll.cs

示例10: onPartCoupled

 private void onPartCoupled(GameEvents.FromToAction<Part, Part> data)
 {
     if (data.from == part)
     {
         ghostConnectionFrom = part.parent;
         ghostConnectionTo = data.to.parent;
     }
 }
开发者ID:MadDoctor5813,项目名称:SingleUseDockingPorts,代码行数:8,代码来源:ModuleSingleUseDockingPort.cs

示例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);
     }
 }
开发者ID:Corax,项目名称:EvaFuel,代码行数:8,代码来源:EvaFuelManager.cs

示例12: receiveEvent

    public void receiveEvent(GameEvents.GameEvent e)
    {
        if(e.GetType().Name.Equals("InputEvent"))
        {
            InputEvent inputEvent = (InputEvent) e;

            GetInput(inputEvent.GetDevice());
        }
    }
开发者ID:paulkelly,项目名称:BlowyBalloon,代码行数:9,代码来源:FanController.cs

示例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;
     }
 }
开发者ID:jkoritzinsky,项目名称:ShipSections,代码行数:9,代码来源:SmartRename.cs

示例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);
     }
 }
开发者ID:linuxgurugamer,项目名称:ContractConfigurator,代码行数:9,代码来源:ReachSpaceCustom.cs

示例15: receiveEvent

    public void receiveEvent(GameEvents.GameEvent e)
    {
        string gateExistScreenEventName = "GateExitScreenEvent";

        if(e.GetType().Name.Equals(gateExistScreenEventName))
        {
            AddGateToPool(((GateExitScreenEvent) e).GetGate());
        }
    }
开发者ID:paulkelly,项目名称:BlowyBalloon,代码行数:9,代码来源:SpawnGates.cs


注:本文中的GameEvents类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。