// Use this for initialization void Start() { if (handler == null) { handler = GetComponent <ControllerEventHandler>(); } joint = GetComponent <FixedJoint>(); handler.OnControllerAction .Where(x => x == "PressGrabButton") .Subscribe(x => Grab()); handler.OnControllerAction .Where(x => x == "ReleaseGrabButton") .Subscribe(x => Release()); }
public static void UnsubscribeFromControllerEvent(ControllerEventHandler handler) { if (ControllerService == null) { ControllerService = GameObject.FindObjectOfType <ControllerService>(); #if UNITY_EDITOR if (ControllerService == null && !HideWarnings) { Debug.LogError("No '" + nameof(GreenPandaAssets.Scripts.Services.ControllerService) + "' component present in the scene!"); } #endif } if (ControllerService != null) { ControllerService.UnsubscribeFromControllerEvent(handler); } }
private IEnumerator FlyButton() { ControllerEventHandler.PauseEvents(); ScreenFader.FadeOut(Color.black, 0.85f); yield return(new WaitForSeconds(1f)); if (PilotSaveManager.currentScenario.equipConfigurable) { LoadingSceneController.LoadSceneImmediate("VehicleConfiguration"); } else { BGMManager.FadeOut(2f); Loadout loadout = new Loadout(); loadout.normalizedFuel = PilotSaveManager.currentScenario.forcedFuel; loadout.hpLoadout = new string[PilotSaveManager.currentVehicle.hardpointCount]; loadout.cmLoadout = new int[] { 99999, 99999 }; if (PilotSaveManager.currentScenario.forcedEquips != null) { foreach (CampaignScenario.ForcedEquip forcedEquip in PilotSaveManager.currentScenario.forcedEquips) { loadout.hpLoadout[forcedEquip.hardpointIdx] = forcedEquip.weaponName; } } VehicleEquipper.loadout = loadout; if (PilotSaveManager.currentCampaign.isCustomScenarios) { VTScenario.LaunchScenario(VTResources.GetScenario(PilotSaveManager.currentScenario.scenarioID, PilotSaveManager.currentCampaign), false); } else { LoadingSceneController.LoadScene(PilotSaveManager.currentScenario.mapSceneName); } } ControllerEventHandler.UnpauseEvents(); }
/// <summary> /// 自动计算 /// </summary> /// <param name="patListID">病人ID</param> /// <param name="iPatType">病人类型</param> /// <param name="feeIDs">费用ID</param> /// <param name="invokeController">控制器</param> public PaymentAutoCalculate(int patListID, int iPatType, int[] feeIDs, ControllerEventHandler invokeController) : base(patListID, iPatType, feeIDs) { isFirst = true; this.invokeController = invokeController; }
public void UnsubscribeFromControllerEvent(ControllerEventHandler handler) { ControllerEvent -= handler; }
public void SubscribeForControllerEvent(ControllerEventHandler handler) { ControllerEvent += handler; }
public PaymentAutoCalculate(int _patListID, int _iPatType, int[] _feeIDs, ControllerEventHandler _InvokeController) : base(_patListID, _iPatType, _feeIDs) { InvokeController = _InvokeController; }