void Start() { DontDestroyOnLoad (gameObject); if (instance != null) //seperate from the singleton class to allow deletion of gameobject rather than script Destroy(gameObject); else instance = this; }
public void lastFrikingThingToSay() { orvilleAudSource.Stop(); orvilleAudSource.clip = orvilleVoices[clipInd++]; orvilleAudSource.Play(); orvilleManager.startTalking(); var subtitle = "Orville: \"Okay, Wilbur! Why don’t you give it a test flight whenever you are ready!\""; subtitleManager.playSubtitleForTime(subtitle, 6f, null); tapToFly.SetActive(true); currentTriggerManager = startFlying; }
public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) { var userNotificationSettings = UIUserNotificationSettings.GetSettingsForTypes(UIUserNotificationType.Alert, new NSSet()); UIApplication.SharedApplication.RegisterUserNotificationSettings(userNotificationSettings); _triggerManager = new TriggerManager(); var wrongTemperatureRule = TemperatureRule.TemperatureBetween(2, 8, "841a40679cd3f7d4"); var tempTrigger = new Trigger(new Rule[] { wrongTemperatureRule }, "WrongTemperture"); _triggerManager.ChangedState += TriggerManagerOnChangedState; _triggerManager.StartMonitoringForTrigger(tempTrigger); return true; }
public void enterPlane() { orvilleManager.stopTalking(); tapToEnterPlaneCanvas.SetActive(false); currentTriggerManager = null; startingCamera.SetActive(false); startingRenderer.SetActive(false); airplaneCardboard.SetActive(true); // Cardboard.SDK.Recenter(); // Start the tutorial segment for pitch airplaneControllerScript.enablePitchMovement(); tutScript.startFrontRudder(); }
private void StartReminderTrigger() { var firstHour = (int)FirstHourSwitch.SelectedRowInComponent (0); var secondHour = (int)SecondHourSwitch.SelectedRowInComponent (0); var goingToWork = DateRule.HourBetween (firstHour, secondHour); var insideCarRule = ProximityRule.InRangeOfNearableType (NearableType.Car); var noBagRule = ProximityRule.OutsideRangeOfNearableType (NearableType.Bag); var forgotBagTrigger = new Trigger (new Rule[]{ goingToWork, insideCarRule, noBagRule }, TriggerId); if (triggerManager == null) { triggerManager = new TriggerManager (); } triggerManager.StartMonitoringForTrigger (forgotBagTrigger); }
void AddTrigger() { TriggerManager newTrig = new TriggerManager(); stMachine.controlledTriggers.Add(newTrig); newTrig.inspectorCorner = curMousePos - globalViewOffset; }
IEnumerator waitBeforeLettingTap() { yield return new WaitForSeconds(1f); tapToContinueToPlaneCanvas.SetActive(true); currentTriggerManager = startOrvillePlaneInstructions; }
// Use this for initialization void Start() { currentTriggerManager = openingTriggerManager; airplaneControllerScript.disablePitchMovement(); airplaneControllerScript.disableRollMovement(); airplaneControllerScript.disableYawMovement(); }
void startOrvillePlaneInstructions() { currentTriggerManager = null; tapToContinueToPlaneCanvas.SetActive(false); orvilleManager.startTalking(); orvilleAudSource.Stop(); orvilleAudSource.clip = orvilleVoices[clipInd++]; orvilleAudSource.Play(); orvilleManager.startTalking(); var subtitle = "Orville: \"Alright, just to refresh you, let’s go over the innovative functions of our flyer that makes it different than anything else, the three-axis control. Go ahead and take a look at the back rudder.\""; subtitleManager.playSubtitleForTime(subtitle, 14f, startRearRudderSequence); }
private void Start() { manager = transform.parent.GetComponent <TriggerManager>(); }
public void turnOnEngine() { tapToTurnEngineOn.SetActive(false); currentTriggerManager = null; airplaneControllerScript.turnEngineOn(); lastFrikingThingToSay(); }
private void UnRegisterTrigger() { MobaMessageManager.UnRegistMessage((ClientMsg)25030, new MobaMessageFunc(this.OnPvpStartGame)); TriggerManager.DestroyTrigger(this._changePlayerTrigger); this._changePlayerTrigger = null; }
public void LoadData() { TriggerGroup triggerGroup = TriggerManager.getInstance().AddSkillTrigger(this); triggerGroupList.Add(triggerGroup); }
public override void Init() { base.Init(); this.skillItem = ResourceManager.LoadPath <SkillShowItem>("Prefab/UI/PlayHUD/SkillShowItem", null, 0); this.ChangePlayerTrigger = TriggerManager.CreateGameEventTrigger(GameEvent.ChangePlayer, null, new TriggerAction(this.ChangePlayer)); this.listener = TriggerManager.CreateGameEventTrigger(GameEvent.UpdateView, null, new TriggerAction(this.UpdateGoldView)); this.mFriendListen = TriggerManager.CreateGameEventTrigger(GameEvent.GameStart, null, new TriggerAction(this.OnGameStart)); this.PVEAnchor = this.transform.Find("PVEAnchor"); this.Kill = this.transform.Find("PVEAnchor/Kill"); this.Death = this.transform.Find("PVEAnchor/Death"); this.killLabel = this.transform.Find("PVEAnchor/Kill/KillNumLabel").GetComponent <UILabel>(); this.DeathLabel = this.transform.Find("PVEAnchor/Death/DeathNumLabel").GetComponent <UILabel>(); this.PVE_Boss = this.PVEAnchor.Find("Boss/BossNumLabel").GetComponent <UILabel>(); this.PVE_Assists = this.PVEAnchor.Find("Assists/AssistsNumLabel").GetComponent <UILabel>(); this.PVPAnchor = this.transform.Find("PVPAnchor"); this.PVP_KillLabel = this.PVPAnchor.Find("Kill/KillNumLabel").GetComponent <UILabel>(); this.PVP_Death = this.PVPAnchor.Find("Death/DeathNumLabel").GetComponent <UILabel>(); this.PVE_Time = this.PVEAnchor.Find("Time/TimeLabel").GetComponent <UILabel>(); this.PVP_Time = this.PVPAnchor.Find("Time/TimeLabel").GetComponent <UILabel>(); this.PVP_Assists = this.PVPAnchor.Find("Assists/AssistsNumLabel").GetComponent <UILabel>(); this.PVP_Boss = this.PVPAnchor.Find("Boss/BossNumLabel").GetComponent <UILabel>(); this.BottomRightAnchor = this.transform.Find("BottomRightAnchor"); this.bottomPveAnchor = this.BottomRightAnchor.Find("Pve"); this.bottomPvpAnchor = this.BottomRightAnchor.Find("Pvp"); this.LeftTopAnchor = this.transform.Find("LeftTopAnchor"); this.SkillPveBtn = this.bottomPveAnchor.Find("SkillBtn"); this.SkillPvpBtn = this.bottomPvpAnchor.Find("SkillBtn"); this.SkillPveSprite = this.SkillPveBtn.GetComponent <UISprite>(); this.SkillPveSprite2 = this.bottomPveAnchor.Find("SkillBtn/SkillBtn2").GetComponent <UISprite>(); this.SkillPvpSprite = this.SkillPvpBtn.GetComponent <UISprite>(); this.SkillPvpSprite2 = this.bottomPvpAnchor.Find("SkillBtn/SkillBtn2").GetComponent <UISprite>(); this.StatisticPveBtn = this.bottomPveAnchor.Find("StatisticBtn"); this.StatisticPvpBtn = this.bottomPvpAnchor.Find("StatisticBtn"); this.StatisticBtn1 = this.LeftTopAnchor.Find("StatisticBtn"); this.B_Game = this.transform.Find("Center/Game"); this.Suspend = this.bottomPveAnchor.Find("Suspend"); this.Setting = this.bottomPvpAnchor.Find("Setting"); this.Suspend1 = this.LeftTopAnchor.Find("Suspend"); this.FPSLabel = this.transform.Find("Center/Game/FPS/Label").GetComponent <UILabel>(); this.DelayLabel = this.transform.Find("Center/Game/Delay/Label").GetComponent <UILabel>(); this.BottomAnchor = this.transform.Find("BottomAnchor"); this.TestBtn = this.bottomPveAnchor.Find("TestBtn"); this.DebugObj = this.bottomPvpAnchor.Find("Debug"); this.ResetBtn = this.bottomPveAnchor.Find("ResetBtn"); this.SpeedBtn = this.DebugObj.Find("SpeedBtn"); this.SpeedLabel = this.SpeedBtn.Find("speed").GetComponent <UILabel>(); this.ResetSpeedBtn = this.DebugObj.Find("ResetSpeedBtn"); this.skillBackBg = this.transform.Find("BottomAnchor/SkillBg/BackBg"); this.LevelBtn = this.DebugObj.Find("LevelBtn"); this.EnableHeroAIBnt = this.DebugObj.Find("Toggle/EnableHeroAI"); this.EnableMonsterAIBnt = this.DebugObj.Find("Toggle/EnableMonsterAI"); this.EnableTowerAIBnt = this.DebugObj.Find("Toggle/EnableTowerAI"); this.EnableAllAIBnt = this.DebugObj.Find("Toggle/EnableAllAI"); this.NoMonsterBnt = this.DebugObj.Find("Toggle/NoMontser"); this.NoSkillCdBnt = this.DebugObj.Find("Toggle/NoSkillCd"); this.NoSkillCostBnt = this.DebugObj.Find("Toggle/NoSkillCost"); this.WhoIsYourDady = this.DebugObj.Find("Toggle/WhoIsYourDady"); this.AddBlood = this.DebugObj.Find("Toggle/AddBlood"); this.Toggle = this.DebugObj.Find("Toggle"); this.heroTargetInfo = this.transform.Find("TargetBox/HeroTarget"); this.heroTexture = this.heroTargetInfo.Find("Sprite/Texture").GetComponent <UITexture>(); this.heroBloodSprite = this.heroTargetInfo.Find("HPBar/SlideBlood").GetComponent <UISprite>(); this.heroHpNumber = this.heroTargetInfo.Find("HPBar/HPNumber").GetComponent <UILabel>(); this.heroKillInfo = this.heroTargetInfo.Find("KillInfo/KillNumber").GetComponent <UILabel>(); this.otherTargetInfo = this.transform.Find("TargetBox/OtherTarget"); this.otherTexture = this.otherTargetInfo.Find("Sprite/Texture").GetComponent <UITexture>(); this.backTexture = this.otherTexture.mainTexture; this.otherBloodSprite = this.otherTargetInfo.Find("HPBar/HPBar/SlideBlood").GetComponent <UISprite>(); this.otherHpNumber = this.otherTargetInfo.Find("HPBar/HPBar/HPNumber").GetComponent <UILabel>(); this.otherName = this.otherTargetInfo.Find("Name/name").GetComponent <UILabel>(); this.skillBg = this.BottomAnchor.Find("SkillBg").GetComponent <UIPanel>(); this.B_Grid = this.BottomAnchor.Find("SkillBg/Grid").GetComponent <UIGrid>(); UIEventListener.Get(this.Suspend.gameObject).onClick = new UIEventListener.VoidDelegate(this.OnSuspend); UIEventListener.Get(this.Setting.gameObject).onClick = new UIEventListener.VoidDelegate(this.OnSuspend); UIEventListener.Get(this.SkillPveBtn.gameObject).onClick = new UIEventListener.VoidDelegate(this.ClickSkillBtn); UIEventListener.Get(this.SkillPvpBtn.gameObject).onClick = new UIEventListener.VoidDelegate(this.ClickSkillBtn); UIEventListener.Get(this.SkillPveSprite2.gameObject).onClick = new UIEventListener.VoidDelegate(this.ClickSkillBtn); UIEventListener.Get(this.SkillPvpSprite2.gameObject).onClick = new UIEventListener.VoidDelegate(this.ClickSkillBtn); UIEventListener.Get(this.StatisticPveBtn.gameObject).onClick = new UIEventListener.VoidDelegate(this.ClickStatisticBtn); UIEventListener.Get(this.StatisticPvpBtn.gameObject).onClick = new UIEventListener.VoidDelegate(this.ClickStatisticBtn); UIEventListener.Get(this.StatisticBtn1.gameObject).onClick = new UIEventListener.VoidDelegate(this.ClickStatisticBtn); UIEventListener.Get(this.Suspend1.gameObject).onClick = new UIEventListener.VoidDelegate(this.OnSuspend); UIEventListener.Get(this.TestBtn.gameObject).onClick = new UIEventListener.VoidDelegate(this.OnTestBtn); UIEventListener.Get(this.ResetBtn.gameObject).onClick = new UIEventListener.VoidDelegate(this.OnResetBtn); UIEventListener.Get(this.SpeedBtn.gameObject).onClick = new UIEventListener.VoidDelegate(this.OnSpeedBtn); UIEventListener.Get(this.ResetSpeedBtn.gameObject).onClick = new UIEventListener.VoidDelegate(this.OnResetSpeedBtn); UIEventListener.Get(this.LevelBtn.gameObject).onClick = new UIEventListener.VoidDelegate(this.OnLevelBtn); UIEventListener.Get(this.skillBackBg.gameObject).onClick = new UIEventListener.VoidDelegate(this.OnskillBackBg); UIEventListener.Get(this.EnableHeroAIBnt.gameObject).onClick = new UIEventListener.VoidDelegate(this.OnGameCommand); UIEventListener.Get(this.EnableTowerAIBnt.gameObject).onClick = new UIEventListener.VoidDelegate(this.OnGameCommand); UIEventListener.Get(this.EnableMonsterAIBnt.gameObject).onClick = new UIEventListener.VoidDelegate(this.OnGameCommand); UIEventListener.Get(this.EnableAllAIBnt.gameObject).onClick = new UIEventListener.VoidDelegate(this.OnGameCommand); UIEventListener.Get(this.NoMonsterBnt.gameObject).onClick = new UIEventListener.VoidDelegate(this.OnGameCommand); UIEventListener.Get(this.NoSkillCdBnt.gameObject).onClick = new UIEventListener.VoidDelegate(this.OnGameCommand); UIEventListener.Get(this.NoSkillCostBnt.gameObject).onClick = new UIEventListener.VoidDelegate(this.OnGameCommand); UIEventListener.Get(this.WhoIsYourDady.gameObject).onClick = new UIEventListener.VoidDelegate(this.OnGameCommand); UIEventListener.Get(this.AddBlood.gameObject).onClick = new UIEventListener.VoidDelegate(this.OnGameCommand); this.ResetFpsData(); this.mFriendInfo = this.transform.Find("BattleFriendNotice"); this.mLockViewSprite = this.transform.Find("BattleFriendNotice/DragPlayerView/LockSprite").GetComponent <UISprite>(); this.mUnlockViewSprite = this.transform.Find("BattleFriendNotice/DragPlayerView/UnlockSprite").GetComponent <UISprite>(); this.mFriendList = this.transform.Find("BattleFriendNotice/FriendList"); UIEventListener.Get(this.mLockViewSprite.gameObject).onClick = new UIEventListener.VoidDelegate(this.OnPressLockView); UIEventListener.Get(this.mUnlockViewSprite.gameObject).onClick = new UIEventListener.VoidDelegate(this.OnPressUnlockView); Units player = PlayerControlMgr.Instance.GetPlayer(); this.ShowDebugPvp(); this.bInitFriendFinished = false; }
private void OnDisable() { TriggerManager.GetInstance().RemoveTrigger(E_TriggerType.on_game_start, FindPlayer); TriggerManager.GetInstance().RemoveTrigger(E_TriggerType.on_game_over, DelectPlayer); }
/// <summary> /// Load graphics content for the game. /// </summary> public override void LoadContent() { if (content == null) { content = new ContentManager(ScreenManager.Game.Services, "Content"); } gameFont = content.Load <SpriteFont>("gamefont"); // A real game would probably have more content than this sample, so // it would take longer to load. We simulate that by delaying for a // while, giving you a chance to admire the beautiful loading screen. #region Locals spriteBatch = new SpriteBatch(ScreenManager.GraphicsDevice); otherTexture = ScreenManager.Game.Content.Load <Texture2D>("vein256"); #endregion Locals #region Camera Manager cameraManager = new CameraManager(ScreenManager.Game); Costam.CameraManager = cameraManager; DebugCamera camera = new Core.DebugCamera(ScreenManager.Game, new Vector3(-15, 0, 0), Vector3.Zero, Vector3.Up); ChaseCamera chaseCamera = new ChaseCamera(ScreenManager.Game); cameraManager.AddCamera("DebugCamera", camera); cameraManager.AddCamera("ChaseCamera", chaseCamera); #endregion CameraManager #region Triggers triggerManager = new TriggerManager(ScreenManager.Game); Costam.TriggerManager = triggerManager; #endregion Triggers #region Tunnel Manager tunnelManager = new TunnelManager(ScreenManager.Game); Costam.TunnelManager = tunnelManager; #endregion TunnelManager #region Memory Managment objectsProvider = new SimpleMemoryPool(); Costam.MemoryPoolObjectProvider = objectsProvider; #endregion Memory Managment #region Player playerManager = new PlayerManager(ScreenManager.Game); Costam.PlayerManager = playerManager; chaseCamera.ChasedObject = Costam.PlayerManager.players.ElementAt(0).Value; #endregion PLayer #region HUD hud = new Hud(ScreenManager.Game, spriteBatch); Costam.HUD = hud; //ScreenManager.Game.Components.Add(hud); SpriteFont consoleFont = ScreenManager.Game.Content.Load <SpriteFont>("HudFont"); DebugTextWindow = new DebugConsole(new Rectangle(10, 10, 100, 50), consoleFont); hud.AddComponent(DebugDrawWindowName, DebugTextWindow); Vector2 windowDimensions = new Vector2(ScreenManager.Game.GraphicsDevice.Viewport.Width, ScreenManager.Game.GraphicsDevice.Viewport.Height); FPSCounter fpsCounter = new FPSCounter(new Rectangle((int)windowDimensions.X - 60, 5, 30, 20), consoleFont); hud.AddComponent("FPS", fpsCounter); if (playerManager.players.Count < 2) { PlayerHUD player1HUD = new PlayerHUD(new Rectangle((int)windowDimensions.X / 2, 0, 30, 20), consoleFont, playerManager.players.ElementAt(0).Value); hud.AddComponent("player1HUD", player1HUD); } else { PlayerHUD player1HUD = new PlayerHUD(new Rectangle(((int)windowDimensions.X / 2) - 70, 0, 30, 20), consoleFont, playerManager.players.ElementAt(0).Value); hud.AddComponent("player1HUD", player1HUD); PlayerHUD player2HUD = new PlayerHUD(new Rectangle((int)windowDimensions.X / 2, 0, 30, 20), consoleFont, playerManager.players.ElementAt(1).Value); hud.AddComponent("player2HUD", player2HUD); } #endregion HUD #region Object Manager objectManager = new ObjectManager(Costam.Game); Costam.ObjectManager = objectManager; #endregion Object Manager #region Colision Manager collisionManager = new CollisionManager(Costam.Game); Costam.ColisionManager = collisionManager; #endregion Colision Manager #region Debug debugDraw = new DebugDraw(); Costam.DebugDraw = debugDraw; Costam.Random = new Random((int)System.DateTime.Now.Ticks); #endregion Debug AfterLoadContent(); // once the load has finished, we use ResetElapsedTime to tell the game's // timing mechanism that we have just finished a very long frame, and that // it should not try to catch up. ScreenManager.Game.ResetElapsedTime(); }
public override void Init() { this._trigger = TriggerManager.CreateGameEventTrigger(GameEvent.ChangePlayer, null, new TriggerAction(this.OnChangePlayer)); MobaMessageManager.RegistMessage((ClientMsg)25038, new MobaMessageFunc(this.OnSpawnFinished)); }
void Awake() { Instance = this; }
/// <summary> /// Handles the Click event of the btnSave control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void btnSave_Click(object sender, EventArgs e) { Page.Validate(); if (!Page.IsValid) { return; } using (MetaClassManagerEditScope editScope = DataContext.Current.MetaModel.BeginEdit()) { Trigger trigger; if (TriggerName != String.Empty) { trigger = TriggerManager.GetTrigger(ClassName, TriggerName); } else { trigger = new Trigger(); trigger.Name = txtName.Text.Trim(); } trigger.ActionName = ddlAction.SelectedValue; trigger.ConditionName = ddlCondition.SelectedValue; trigger.Create = chkInsert.Checked; trigger.Delete = chkDelete.Checked; trigger.Update = chkUpdate.Checked; trigger.Description = txtDescription.Text; List <string> conditionInParameters = new List <string>(); for (int i = 0; i < tblCondition.Rows.Count; i++) { TextBox txt = (TextBox)tblCondition.Rows[i].Cells[1].Controls[0]; conditionInParameters.Add(txt.Text.Trim()); } trigger.ConditionInParameters = conditionInParameters; List <string> actionInParameters = new List <string>(); for (int i = 0; i < tblAction.Rows.Count; i++) { TextBox txt = (TextBox)tblAction.Rows[i].Cells[1].Controls[0]; actionInParameters.Add(txt.Text.Trim()); } trigger.ActionInParameters = actionInParameters; if (TriggerName == String.Empty) { TriggerManager.AddTrigger(ClassName, trigger); } editScope.SaveChanges(); } // Closing window if (RefreshButton == String.Empty) { CHelper.CloseItAndRefresh(Response); } else // Dialog Mode { CHelper.CloseItAndRefresh(Response, RefreshButton); } }
public override void OnInspectorGUI() { if (SeeInspector.boolValue) // If true Default Inspector is drawn on screen { DrawDefaultInspector(); } serializedObject.Update(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("See Inspector :", GUILayout.Width(85)); EditorGUILayout.PropertyField(SeeInspector, new GUIContent(""), GUILayout.Width(30)); EditorGUILayout.EndHorizontal(); GUIStyle style_Yellow_01 = new GUIStyle(GUI.skin.box); style_Yellow_01.normal.background = Tex_01; GUIStyle style_Blue = new GUIStyle(GUI.skin.box); style_Blue.normal.background = Tex_03; GUIStyle style_Purple = new GUIStyle(GUI.skin.box); style_Purple.normal.background = Tex_04; GUIStyle style_Orange = new GUIStyle(GUI.skin.box); style_Orange.normal.background = Tex_05; GUIStyle style_Yellow_Strong = new GUIStyle(GUI.skin.box); style_Yellow_Strong.normal.background = Tex_02; TriggerManager myScript = (TriggerManager)target; EditorGUILayout.BeginVertical(style_Orange); //EditorGUILayout.HelpBox ("This script allow to setup the fake Joystick cursor behaviour", MessageType.Info); EditorGUILayout.BeginHorizontal(); GUILayout.Label("Trigger Type : ", GUILayout.Width(180)); TriggerType.intValue = EditorGUILayout.Popup(TriggerType.intValue, arrTriggerType); EditorGUILayout.EndHorizontal(); //-> Play a voice if (TriggerType.intValue == 0) { //--> playOnce EditorGUILayout.BeginHorizontal(); GUILayout.Label("Play Once : ", GUILayout.Width(180)); EditorGUILayout.PropertyField(playOnce, new GUIContent("")); EditorGUILayout.EndHorizontal(); //--> playOnlyIfNoOtherVoiceOverIsPlayed EditorGUILayout.BeginHorizontal(); GUILayout.Label("Only If No Other Voice Is Played : ", GUILayout.Width(180)); EditorGUILayout.PropertyField(playOnlyIfNoOtherVoiceOverIsPlayed, new GUIContent("")); EditorGUILayout.EndHorizontal(); //--> b_DisabledPlayerMovement EditorGUILayout.BeginHorizontal(); GUILayout.Label("Disabled Player Movement : ", GUILayout.Width(180)); EditorGUILayout.PropertyField(b_DisabledPlayerMovement, new GUIContent("")); EditorGUILayout.EndHorizontal(); //--> DisabledMovementTimer EditorGUILayout.BeginHorizontal(); GUILayout.Label("Duration (seconds) : ", GUILayout.Width(180)); EditorGUILayout.PropertyField(DisabledMovementTimer, new GUIContent("")); EditorGUILayout.EndHorizontal(); } //-> Spawn points if (TriggerType.intValue == 1) { //--> BuildInSceneIndex EditorGUILayout.BeginHorizontal(); GUILayout.Label("Scenes In Build Index : ", GUILayout.Width(180)); EditorGUILayout.PropertyField(BuildInSceneIndex, new GUIContent("")); EditorGUILayout.EndHorizontal(); //--> spawnPointName EditorGUILayout.BeginHorizontal(); GUILayout.Label("Spawn Point Name : ", GUILayout.Width(180)); EditorGUILayout.PropertyField(spawnPointName, new GUIContent("")); EditorGUILayout.EndHorizontal(); } //-> Call custom method if (TriggerType.intValue == 2) { //--> playOnce EditorGUILayout.BeginHorizontal(); GUILayout.Label("Play Once : ", GUILayout.Width(180)); EditorGUILayout.PropertyField(playOnce, new GUIContent("")); EditorGUILayout.EndHorizontal(); //--> b_DisabledPlayerMovement EditorGUILayout.BeginHorizontal(); GUILayout.Label("Disabled Player Movement : ", GUILayout.Width(180)); EditorGUILayout.PropertyField(b_DisabledPlayerMovement, new GUIContent("")); EditorGUILayout.EndHorizontal(); //--> DisabledMovementTimer EditorGUILayout.BeginHorizontal(); GUILayout.Label("Duration (seconds) : ", GUILayout.Width(180)); EditorGUILayout.PropertyField(DisabledMovementTimer, new GUIContent("")); EditorGUILayout.EndHorizontal(); showCustomMethods(style_Purple, style_Blue); } EditorGUILayout.EndVertical(); serializedObject.ApplyModifiedProperties(); EditorGUILayout.LabelField(""); }
private void RespawnHero() { if (this.MyScene == null) { return; } Units triggerUnit = TriggerManager.GetTriggerUnit(); if (triggerUnit == null) { return; } if (triggerUnit.IsReplayControl) { return; } string text = (triggerUnit.TeamType != TeamType.LM) ? this.MyScene.hero2_spawn_interval : this.MyScene.hero1_spawn_interval; if ("[]" == text) { return; } float[] stringToFloat = StringUtils.GetStringToFloat(text, ','); if (stringToFloat == null) { return; } float num = stringToFloat[0]; float num2 = stringToFloat[1]; float num3 = stringToFloat[2]; float num4 = 0f; float num5 = 45f; if (stringToFloat.Length > 3) { num5 = stringToFloat[3]; } if (stringToFloat.Length > 4) { num4 = stringToFloat[4]; } float totalPlayingSeconds = GameManager.TotalPlayingSeconds; int num6; if (triggerUnit.TeamType == TeamType.LM) { num6 = MyStatistic.Instance.GetDataByTeam(TeamType.BL).heroKill.TotalKill - 1; } else { num6 = MyStatistic.Instance.GetDataByTeam(TeamType.LM).heroKill.TotalKill - 1; } float num7 = num + (float)((int)(totalPlayingSeconds / 30f)) * num2 + (float)num6 * num3 + (float)triggerUnit.level * num4; if (num7 < 0f) { num7 = 5f; } if (num7 > num5) { num7 = num5; } if (triggerUnit.TeamType == TeamType.LM) { this.ShowDeathUI(num7); } this.MyCoroutineManager.StartCoroutine(this.SpawnUtility.RespawnPveHero_Coroutinue(triggerUnit, num7, 0f), true); }
// ** Update Functions ** private void Awake() { triggerManager = GameObject.Find("TriggerManager").GetComponent <TriggerManager>(); }
void Awake () { //编辑模式 MotionPara.isEditor = isEditor; if(MotionPara.isEditor){ ErrorLocation.Initialize(); //初始化表格填写错误报警信息 } cameraAdministrator.State = CurrentState.Old; InterData.InterDataInit(); //任务初始化 MotionPara.taskName = taskName; TaskInitialize(MotionPara.taskName); //Debug.Log("Motion SpeedRate: " + MotionPara.SpeedRate); //MotionPara.SpeedRate = 0.5f; //脚本变量初始化 st_Interface = gameObject.GetComponent<InterfaceManager>(); gameObject.AddComponent<LocationManager>(); st_Location = gameObject.GetComponent<LocationManager>(); GameObject triggerEmpty = new GameObject(); triggerEmpty.name = "TriggerObject"; triggerEmpty.AddComponent<TriggerManager>(); st_Trigger = (TriggerManager)GameObject.FindObjectOfType(typeof(TriggerManager)); st_Trigger.gameObject.SetActive(false); if (isEditor) { gameObject.AddComponent<EditorManager>(); } }
void Start() { triggerManager = triggerObject.GetComponent <TriggerManager>(); parentDamagable = damagableObject.GetComponent <IDamagable>(); parentWallManager = damagableObject.GetComponent <WallManager>(); }
void openingTriggerManager() { kittyHawkNCOpeningCanvasObject.SetActive(false); currentTriggerManager = null; orvilleFirstLine(); }
public QuartzSchedulerService() { var conStr = ConfigurationManager.ConnectionStrings["QUARTZNETJOBDB"]?.ConnectionString; try { NameValueCollection configuration = new NameValueCollection { { "quartz.scheduler.instanceName", "LocalServer" }, { "quartz.scheduler.instanceId", "LocalServer" }, { "quartz.jobStore.type", "Quartz.Impl.AdoJobStore.JobStoreTX, Quartz" }, //{ "quartz.jobStore.useProperties", "true" }, { "quartz.jobStore.dataSource", "default" }, { "quartz.jobStore.tablePrefix", "QRTZ_" }, { "quartz.dataSource.default.connectionString", conStr }, { "quartz.dataSource.default.provider", "SqlServer" }, //{ "quartz.threadPool.threadCount", "1" }, { "quartz.serializer.type", "binary" } }; configuration["quartz.threadPool.type"] = "Quartz.Simpl.SimpleThreadPool, Quartz"; configuration["quartz.threadPool.threadCount"] = "5"; configuration["quartz.threadPool.threadPriority"] = "Normal"; configuration["quartz.plugin.recentHistory.type"] = "Quartz.Plugins.RecentHistory.ExecutionHistoryPlugin, Quartz.Plugins.RecentHistory"; configuration["quartz.plugin.recentHistory.storeType"] = "Quartz.Plugins.RecentHistory.Impl.InProcExecutionHistoryStore, Quartz.Plugins.RecentHistory"; StdSchedulerFactory factory = new StdSchedulerFactory(configuration); scheduler = factory.GetScheduler().GetAwaiter().GetResult(); _timer = new Timer(30000); _timer.Elapsed += (sender, e) => { try { if (scheduler.IsStarted == false || scheduler.IsShutdown) { this.StartScheduler(); } #region FindErrorStateTriggers using (SqlConnection connection = new SqlConnection(conStr)) { var connectionOk = false; try { connection.Open(); if (connection.State == System.Data.ConnectionState.Open) { connectionOk = true; } } catch (Exception sqlCon) { this.StopScheduler(); } if (connectionOk) { var errorStateTriggers = TriggerManager.FindErrorStateTriggers(connection); if (errorStateTriggers.Count > 0) { foreach (var item in errorStateTriggers) { try { scheduler.ResumeTrigger(new TriggerKey(item.Key, item.Value)); } catch (Exception trgErr) { LoggerService.GetLogger("LOGIJMS").Log(new LogItem() { LoggerName = "LOGIJMS", Title = "Scheduler ResumeTrigger Error", Message = trgErr.Message, LogItemProperties = new List <LogItemProperty>() { new LogItemProperty("ServiceName", "JOB"), new LogItemProperty("AppName", "LogiJMS.TopshelfHost"), new LogItemProperty("ActionName", "ResumeTrigger") }, LogLevel = LogLevel.Error, Exception = trgErr }); } } } } } #endregion } catch (Exception expTmr) { LoggerService.GetLogger("LOGIJMS").Log(new LogItem() { LoggerName = "LOGIJMS", Title = "Timer Exception", Message = expTmr.Message, LogItemProperties = new List <LogItemProperty>() { new LogItemProperty("ServiceName", "JOB"), new LogItemProperty("AppName", "LogiJMS.TopshelfHost"), new LogItemProperty("ActionName", "Timer") }, LogLevel = LogLevel.Error, Exception = expTmr }); } }; } catch (System.Exception ex) { LoggerService.GetLogger("LOGIJMS").Log(new LogItem() { LoggerName = "LOGIJMS", Title = "Scheduler Service Create", Message = "Scheduler Service Create", LogItemProperties = new List <LogItemProperty>() { new LogItemProperty("ServiceName", "JOB"), new LogItemProperty("AppName", "LogiJMS.TopshelfHost"), new LogItemProperty("ActionName", "QuartzSchedulerService") }, LogLevel = LogLevel.Error, Exception = ex }); } }
void startedWalkingToPlane() { tapToToggleWalkCanvasObject.SetActive(false); currentTriggerManager = null; }
public void startMoveToPlane() { orvilleAudSource.Stop(); orvilleAudSource.clip = orvilleVoices[clipInd++]; orvilleAudSource.Play(); orvilleManager.startTalking(); var subtitle = "Orville: \"Nice job! Surprisingly, both the yaw and the roll are controlled by a U-shaped hip cradle in the middle of the cockpit. Why don’t you hop in and try it out?\""; subtitleManager.playSubtitleForTime(subtitle, 13f, null); currentTriggerManager = enterPlane; tapToEnterPlaneCanvas.SetActive(true); }
IEnumerator startOrvilleSecondLine() { yield return new WaitForSeconds(1f); orvilleManager.startTalking(); orvilleAudSource.Stop(); orvilleAudSource.clip = orvilleVoices[clipInd++]; orvilleAudSource.Play(); orvilleManager.startTalking(); var subtitle = "Orville: \"Well, come along and follow me to the glider so we can get your last flight of the day in!\""; subtitleManager.playSubtitleForTime(subtitle, 5f, endOrvilleSecondLine); orvilleManager.startMovingToPlane(); walkScript.enabled = true; tapToToggleWalkCanvasObject.SetActive(true); currentTriggerManager = startedWalkingToPlane; }
private void StartTrigger() { var row = (int)NearablePicker.SelectedRowInComponent (0); var rule1 = OrientationRule.OrientationEquals (NearableOrientation.Horizontal, GetTypeForRow (row)); var forgotBagTrigger = new Trigger (new Rule[]{ rule1 }, TriggerId); if (triggerManager == null) { triggerManager = new TriggerManager (); } triggerManager.StartMonitoringForTrigger (forgotBagTrigger); }
void Awake() { instance = this; traversers = new List <TriggerTraverser>(); }
private void RegisterTrigger() { this._changePlayerTrigger = TriggerManager.CreateGameEventTrigger(GameEvent.ChangePlayer, null, new TriggerAction(this.OnChangePlayer)); MobaMessageManager.RegistMessage((ClientMsg)25030, new MobaMessageFunc(this.OnPvpStartGame)); }
public void startEngineTutorialSegment() { tutScript.enabled = false; orvilleAudSource.Stop(); orvilleAudSource.clip = orvilleVoices[clipInd++]; orvilleAudSource.Play(); orvilleManager.startTalking(); var subtitle = "Orville: \"Nice Wilbur! Alright, now that you understand the roll, pitch, and yaw, why don’t we get you flying? As you may recall, our engine there to your right moves a bicycle chain which is connected to the two propellers in the back. It is quite revolutionary. Go ahead and fire it up!\""; subtitleManager.playSubtitleForTime(subtitle, 24f, null); tapToTurnEngineOn.SetActive(true); currentTriggerManager = turnOnEngine; }
void Awake() { instance = this; }
void Awake() { _inst = this; }
public override void OnCreate() { base.OnCreate(); this.triggerHandle = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitBeJifei, null, new TriggerAction(this.OnJifeiTrigger), -1, "Hero"); }
public void OnGUI() { if(stMachine == null) { GUILayout.Label("Please select a valid state machine to edit!"); return; } if(stMachine.transform.parent.GetComponent<Machine>() != null) { if(GUILayout.Button ("Pop")) { Selection.activeGameObject = stMachine.transform.parent.gameObject; stMachine = null; stateInspectorPositions = new Dictionary<State, Rect>(); triggerInspectorPositions = new Dictionary<TriggerManager, Rect>(); return; } } pickingStartState = GUILayout.Toggle(pickingStartState, "Pick Initial State", GUI.skin.button); if(pickingStartState) { if(Event.current.type == EventType.MouseDown) { foreach(State state in stateInspectorPositions.Keys) { if(stateInspectorPositions[state].Contains(Event.current.mousePosition - globalViewOffset)) { Debug.Log (state); stMachine.startingState = state; break; } } pickingStartState = false; Event.current.Use(); } } if(stMachine.controlledStates.Count == 0) { GUILayout.Label("You must add at least one state to this machine!"); } curMousePos = Event.current.mousePosition; foreach(State state in stMachine.controlledStates) { if(!stateInspectorPositions.ContainsKey(state)) { stateInspectorPositions.Add(state, new Rect(state.inspectorCorner.x, state.inspectorCorner.y, 50, 50)); } } foreach(TriggerManager manager in stMachine.controlledTriggers) { if(!triggerInspectorPositions.ContainsKey(manager)) { triggerInspectorPositions.Add(manager, new Rect(manager.inspectorCorner.x, manager.inspectorCorner.y, 50, 50)); } } if(Event.current.type == EventType.MouseDrag && GUIUtility.hotControl == 0) { globalViewOffset += Event.current.delta; EditorGUIUtility.AddCursorRect(new Rect(Event.current.mousePosition.x - 10, Event.current.mousePosition.y - 10, 20, 20), MouseCursor.MoveArrow); Event.current.Use(); } State[] tempStates = new State[stateInspectorPositions.Count]; stateInspectorPositions.Keys.CopyTo(tempStates, 0); Rect[] tempRects = new Rect[stateInspectorPositions.Count]; stateInspectorPositions.Values.CopyTo(tempRects, 0); currentScrollPos = GUILayout.BeginScrollView(currentScrollPos); BeginWindows(); Vector2 bottomCorner = Vector2.zero; for(int i = 0; i < tempStates.Length; ++i) { stateInspectorPositions[tempStates[i]] = GUILayout.Window(i, tempRects[i].OffsetBy(globalViewOffset), DrawStateInspector, tempStates[i].GetNiceName()).OffsetBy(-globalViewOffset); bottomCorner.x = Mathf.Max(bottomCorner.x, tempRects[i].OffsetBy(globalViewOffset).x); bottomCorner.y = Mathf.Max(bottomCorner.y, tempRects[i].OffsetBy(globalViewOffset).y); } TriggerManager[] tempTriggers = new TriggerManager[triggerInspectorPositions.Count]; triggerInspectorPositions.Keys.CopyTo(tempTriggers, 0); tempRects = new Rect[triggerInspectorPositions.Count]; triggerInspectorPositions.Values.CopyTo(tempRects, 0); for(int i = 0; i < tempTriggers.Length; ++i) { triggerInspectorPositions[tempTriggers[i]] = GUILayout.Window(i + tempStates.Length, tempRects[i].OffsetBy(globalViewOffset), DrawTriggerInspector, "Trigger").OffsetBy(-globalViewOffset); bottomCorner.x = Mathf.Max(bottomCorner.x, tempRects[i].OffsetBy(globalViewOffset).x); bottomCorner.y = Mathf.Max(bottomCorner.y, tempRects[i].OffsetBy(globalViewOffset).y); } GUILayoutUtility.GetRect(bottomCorner.x, bottomCorner.y); EndWindows(); //GUI.Box(GUILayoutUtility.GetLastRect(), "BABABHAHHA"); foreach(Line curLine in linesToDraw) { Handles.color = curLine.drawColour; Handles.DrawLine (curLine.start + globalViewOffset, curLine.end + globalViewOffset); switch(curLine.myDir) { case Direction.Forwards: Handles.ArrowCap(0, (Vector3)(curLine.start + globalViewOffset) - new Vector3(0, 0, 10), Quaternion.LookRotation(curLine.end - curLine.start), 70); break; case Direction.Backwards: Handles.ArrowCap(0, (Vector3)(curLine.end + globalViewOffset) - new Vector3(0, 0, 10), Quaternion.LookRotation(curLine.start - curLine.end), 70); break; } } if(EditorApplication.isPlaying) { if(stMachine.GetCurrentState() != null) { Handles.color = Color.white; Handles.DrawSolidRectangleWithOutline(stateInspectorPositions[stMachine.GetCurrentState()].OffsetBy(globalViewOffset).GetCorners(), Color.clear, Color.red); } } else { if(stMachine.startingState != null && stateInspectorPositions.ContainsKey(stMachine.startingState)) { Handles.color = Color.white; Handles.DrawSolidRectangleWithOutline(stateInspectorPositions[stMachine.startingState].OffsetBy(globalViewOffset).GetCorners(), Color.clear, Color.green); } } //foreach( //GUILayout.Label ("BLUH BLAH"); if(Event.current.type == EventType.ContextClick) { DrawContextMenu(); Event.current.Use(); } //GUI.matrix = Matrix4x4.identity; GUILayout.EndScrollView(); }
public override void OnExit() { base.OnExit(); TriggerManager.DestroyTrigger(this.triggerHandle); this.triggerHandle = null; }
void DrawTriggerInspector(int windowID) { TriggerManager[] tempKeys = new TriggerManager[triggerInspectorPositions.Count]; triggerInspectorPositions.Keys.CopyTo(tempKeys, 0); TriggerManager curTrigger = tempKeys[windowID - stateInspectorPositions.Count]; if(Event.current.type == EventType.MouseDown && Event.current.button == 1) { GenericMenu menu = new GenericMenu(); menu.AddItem(new GUIContent("Delete"), false, DeleteTrigger, curTrigger); menu.ShowAsContext (); Event.current.Use(); } GUILayout.Label("From --> Obs --> To"); GUILayout.BeginHorizontal(); curTrigger.owner = LineStateSelector(curTrigger.owner, Color.cyan, windowID, curTrigger.inspectorCorner, null, Direction.Backwards); GUILayout.FlexibleSpace(); curTrigger.watched = LineStateSelector((State)curTrigger.watched, Color.green, windowID, curTrigger.inspectorCorner, null, Direction.None); GUILayout.FlexibleSpace(); curTrigger.target = LineStateSelector(curTrigger.target, Color.blue, windowID, curTrigger.inspectorCorner, null, Direction.Forwards); GUILayout.EndHorizontal(); if(curTrigger.watched != null && curTrigger.watched.GetExposedVariables().Length > 0) { curTrigger.observedIndex = curTrigger.watched.DrawObservableSelector(curTrigger.observedIndex); GUI.contentColor = Color.black; EditorGUIUtility.LookLikeControls(); curTrigger.mode = (TriggerMode)EditorGUILayout.EnumPopup(curTrigger.mode); switch(curTrigger.obsType) { case ObservedType.integer: curTrigger.intTarget = EditorGUILayout.IntField(curTrigger.intTarget, GUILayout.MaxWidth(triggerInspectorPositions[curTrigger].width)); break; case ObservedType.floatingPoint: curTrigger.floatTarget = EditorGUILayout.FloatField(curTrigger.floatTarget, GUILayout.MaxWidth(triggerInspectorPositions[curTrigger].width)); break; case ObservedType.boolean: curTrigger.boolTarget = EditorGUILayout.Toggle(curTrigger.boolTarget, GUILayout.MaxWidth(triggerInspectorPositions[curTrigger].width)); break; } GUI.contentColor = Color.white; EditorGUIUtility.LookLikeInspector(); } if(curTrigger.watched == null) { GUILayout.Label("Observing Memory"); EditorGUIUtility.LookLikeControls(); curTrigger.memoryKey = EditorGUILayout.TextField(curTrigger.memoryKey); curTrigger.mode = (TriggerMode)EditorGUILayout.EnumPopup(curTrigger.mode); curTrigger.floatTarget = EditorGUILayout.FloatField(curTrigger.floatTarget, GUILayout.MaxWidth(triggerInspectorPositions[curTrigger].width)); EditorGUIUtility.LookLikeInspector(); } GUI.DragWindow(); curTrigger.inspectorCorner = new Vector2(triggerInspectorPositions[curTrigger].x, triggerInspectorPositions[curTrigger].y); }
public TriggerEvent(TriggerManager sender, Collider2D cause, CollisionState state) { this.sender = sender; this.cause = cause; this.state = state; }