void Awake() { Instance = this; // Debug.Log (string.Join(",", FindObjectsOfType<DialogManager>().Select(x => x.name).ToArray())); if (FindObjectsOfType(this.GetType()).Length > 1) Debug.LogError("More than 1 " + this.GetType().Name + "in scene"); }
private void Awake() { // initialize reference to dman dman = GetComponent<DialogManager>(); //cam = GameObject.FindGameObjectWithTag(Tags.mainCamera).GetComponent<CinematicCamera>(); actor = GameObject.Find("Actor").GetComponent<Actor>(); dialogs = new List<Dialog>(); }
public static DialogManager getInstance() { if(instance == null){ Debug.Log("creating singleton"); instance = new DialogManagerInstance(); } return instance; }
protected override void ActionStart() { base.ActionStart(); dialogMgr = GameObject.Find("UICanvas").GetComponent<UIManager>().Dialog; dialogMgr.DisplayDialog(Dialog, LeftName, RightName); }
void Awake() { instance = this; timer = timeBetweenLetters; dialogText = dialog.GetComponent<Text>(); toScroll = Vector3.zero; numberOfScroll = 0; isAction = false; }
public void Awake() { // get objects _levelManager = GameObject.Find("LevelManager").GetComponent<LevelManager>(); _dialogManager = GameObject.Find("DialogManager").GetComponent<DialogManager>(); _devil = GameObject.FindWithTag("Player"); // listen _devil.GetComponent<Picking>().OnDropped += HumanDropped; }
public void Start() { // get dialog manager _manager = GameObject.Find("DialogManager").GetComponent<DialogManager>(); // get sinner component _sinner = GetComponent<Sinner>(); // say StartCoroutine(Say()); }
public void Awake() { // get devil _devil = GameObject.FindWithTag("Player"); // get manager _dialogManager = GameObject.Find("DialogManager").GetComponent<DialogManager>(); // subscribe _devil.GetComponent<Picking>().OnDropped += HumanDropped; }
// Use this for initialization void Start() { Dialog = transform.Find("DialogBase").GetComponent<DialogManager>(); Puzzle = transform.Find("PuzzleBase").GetComponent<PuzzleBase>(); if (FadeInScene) { if (fadeImage == null) fadeImage = gameObject.AddComponent<Image>(); fadeImage.color = Color.black; startFadingIn = true; } }
public MapView(Provinces provinces, Units units, RenderInstruction[][] standardInstrs, RenderInstruction[][] idleInstrs, DialogManager dialogMgr, Wars wars) { _provinces = provinces; _units = units; _wars = wars; _dialogMgr = dialogMgr; _provinceSelection = new ProvinceSelection(); _unitsSelection = new UnitsSelection(); _standardInstrs = standardInstrs; _idleInstrs = idleInstrs; _labelBoxes = provinces.Boundaries.Select(mpoly => mpoly.Polys[0].FindBestLabelBox()).ToArray(); // The boundary depends on the size of the army text, // so the actual boxes are written in the draw method. _labelClickableBoundaries = new Dictionary<int, AABB>(); _units.OnDelete += _unitsSelection.Deselect; }
private void ShowDialogChangeLog() { DialogManager.ShowMetroDialogAsync(this, _changeLogDlg); }
/** * Creates the gameState for the scene */ protected override IList <GameState> GetGameStatesList() { //Gets the Dialog object from the camera for the dialog action DialogManager dialog = Camera.main.GetComponent <DialogManager>(); GameObject patient = GameObject.Find("patient"); SoundManager soundManager = GameObject.Find("SoundManager").GetComponent <SoundManager> (); GameObject obj = GameObject.FindGameObjectWithTag("MainCamera"); if (obj == null) { Debug.LogError("couldn't find Main Camera"); } soundManager.addSound(new Sound(obj, "Assets/Sounds/surreal_sound1.mp3", "surreal1")); soundManager.addSound(new Sound(GameObject.FindGameObjectWithTag("MainCamera"), "Assets/Sounds/gibberish.mp3", "gibberish")); ActionRunner scene3HallucinateAction = new ParallelAction( new List <ActionRunner>() { new CameraInvertAction(), new LightPulseAction(), //TODO: Corey also sound affect new SoundAction("surreal1", true) } ); GameState scene3Hallucinate = new GameState( "scene3Hallucinate", new Dictionary <Trigger, string> { { new ShakeTrigger(patient), "scene3RoseDialog" } }, scene3HallucinateAction ); ActionRunner scene3RoseDialogAction = new SequentialAction( new List <ActionRunner>() { new DialogAction("Whoa, what are you doing?"), new DialogAction("You okay?"), new DialogAction("I hope the flower Mom brought actually works"), new DialogAction("I mean, it does mean \"get-well-soon\""), } ); GameState scene3RoseDialog = new GameState( "scene3RoseDialog", new Dictionary <Trigger, string> () { { new MainActionFinishedTrigger(), "scene3Rose" } }, scene3RoseDialogAction, scene3HallucinateAction ); GameState scene3Rose = new GameState( "scene3Rose", new Dictionary <Trigger, string> () { { new StareTrigger(patient, "rose"), "scene3Story" } }, new NoAction() ); ActionRunner scene3StoryAction = new SequentialAction(new List <ActionRunner> () { new DialogAction("They weren't originally blue; they were red."), new DialogAction("Some people wanted to clone roses to see if they could breed them " + "true and get a reliable variety they could stock and sell."), new DialogAction("For some reason, " + "they got brown flowers instead of the red ones they wanted so they were about to stop " + "the funding, but they finally tried cloning the brown roses."), new DialogAction("The next clones were blue " + "and bred true enough for commercial purposes."), new DialogAction("The thing is, everyone wasn't too bothered " + "about roses being cloned, but when they moved the project to animals from roses, " + "that was when it went to hell."), new DialogAction("See, after the whole thing with the roses, there were ideas " + "to fix the underpopulation problem with cloning, but there was a crowd of people against " + "it."), new DialogAction("It was risky and unreliable, actually, the whole roses debacle was really a lucky bit."), new DialogAction("Mom is against it, as a matter of fact —it's why you two got into fights.") }); GameState scene3Story = new GameState( "scene3Story", new Dictionary <Trigger, string>(), scene3StoryAction ); return(new List <GameState> { scene3Hallucinate, scene3RoseDialog, scene3Rose, scene3Story }); }
public async Task ProtocolMessages_AreConsistent() { WaterfallStep MakeStep(string text, DialogTurnResult result = null) => async(stepContext, cancellationToken) => { await stepContext.Context.SendActivityAsync(MessageFactory.Text(text), cancellationToken); return(result ?? Dialog.EndOfTurn); }; var dialog = new WaterfallDialog( nameof(ProtocolMessages_AreConsistent), new[] { MakeStep("hello"), MakeStep("world") }); var trace = new List <MockTransport.Event>(); var transport = new MockTransport(trace); var debugger = MakeDebugger(transport); using (new ActiveObject(((IDebugTransport)transport).Accept)) { var storage = new MemoryStorage(); var userState = new UserState(storage); var conversationState = new ConversationState(storage); var adapter = new TestAdapter() .Use(debugger) .UseStorage(storage) .UseBotState(userState, conversationState); var dialogManager = new DialogManager(dialog); await new TestFlow((TestAdapter)adapter, async(turnContext, cancellationToken) => { await dialogManager.OnTurnAsync(turnContext, cancellationToken).ConfigureAwait(false); }) .Send("one") .AssertReply("hello") .Send("two") .AssertReply("world") .StartTestAsync(); } var pathJson = TraceOracle.MakePath(nameof(ProtocolMessages_AreConsistent)); var sorted = TraceOracle.TopologicalSort(trace, source => { var targets = from target in trace let score // responses come after requests = source.Client != target.Client && source.Seq == target.RequestSeq ? 2 // consistent within client xor server : source.Client == target.Client && source.Seq < target.Seq ? 1 // unrelated so remove : 0 where score != 0 orderby score descending, target.Order ascending select target; return(targets.ToArray()); }); var tokens = sorted.Select(JToken.FromObject).Select(TraceOracle.Normalize).ToArray(); await TraceOracle.ValidateAsync(pathJson, tokens, _output).ConfigureAwait(false); }
// Use this for initialization void Start() { dialogManager = GameObject.FindGameObjectWithTag("DialogManager").GetComponent <DialogManager>(); }
public ManagingGroupsViewModel(INavigationManager navigationManager, DialogManager dialogManager) { _navigationManager = navigationManager; _dialogManager = dialogManager; }
protected override void LoadContent() { Content.RootDirectory = "Content"; Graphics.PreferredBackBufferWidth = SCREEN_WIDTH; Graphics.PreferredBackBufferHeight = SCREEN_HEIGHT; Graphics.IsFullScreen = false; Graphics.ApplyChanges(); IsMouseVisible = true; Debug = new CollisionRenderer (GraphicsDevice); StateManager = new StateManager(); SpriteBatch = new SpriteBatch (GraphicsDevice); C = Content; BloomRenderer = new BloomComponent(this); BloomRenderer.LoadContent(); InventoryManager = new InventoryManager(); DialogFont = C.Load<SpriteFont> ("fonts/debug"); HoverFont = C.Load<SpriteFont> ("fonts/debug"); DialogManager = new DialogManager { MessageBounds = new Rectangle(15, 15 + (int)InventoryManager.Bounds.Bottom, SCREEN_WIDTH, 300), Font = DialogFont, }; Player = new Player(); StateManager.Add (new TentState()); StateManager.Add (new CampState()); StateManager.Add (new ForestState()); StateManager.Set ("Tent"); Activated += (s, a) => Active = true; Deactivated += (s, a) => Active = false; FadeIn = new ColorTransition (Graphics.GraphicsDevice, SCREEN_WIDTH, SCREEN_HEIGHT, 0.45f, Color.Black, Color.Transparent); FadeOut = new ColorTransition (Graphics.GraphicsDevice, SCREEN_WIDTH, SCREEN_HEIGHT, 0.45f, Color.Transparent, Color.Black); }
void Start() { _theGameManager = FindObjectOfType<GameManager>(); _mapMovementManager = GetComponent<MapMovementManager>(); _dialogManager = GetComponent<DialogManager>(); switch (GameManager.CurrentFrame) { case FrameType.CHARACTERSELECTION: CharacterSelectionFrame.SetActive(true); MapFrame.SetActive(false); DialogFrame.SetActive(false); break; case FrameType.MAPFOLLOW: CharacterSelectionFrame.SetActive(false); MapFrame.SetActive(true); DialogFrame.SetActive(false); break; case FrameType.DIALOG: CharacterSelectionFrame.SetActive(false); MapFrame.SetActive(false); DialogFrame.SetActive(true); break; default: Debug.LogWarning("Did you add a new frame type?"); break; } }
// Start is called before the first frame update void Start() { instance = this; }
public void OnOk() { EventSystem.current.SetSelectedGameObject(null); DialogManager.Hide("About"); }
// Use this for initialization void Awake() { cg = GetComponent <CanvasGroup>(); DialogManager.RegisterDialog("About", this); }
public DialogService() { _dialogManager = new DialogManager(Application.Current.Dispatcher); }
void Blink(int x, int y) { energizeTime = 0; chargingBlink = false; int mask = 0; if (!phaseWalking) { mask = groundMask | phaseWalkMask; } else { mask = groundMask; } RaycastHit2D hit = Physics2D.Raycast(BlinkPoint.transform.position, new Vector2(x, y), Mathf.Infinity, mask); if (hit) { if (audioSource_charging.isPlaying) { audioSource_charging.Stop(); } audioSource_blink.Play(); inventory.LoseEnergy(BlinkEnergyCost); if (hit.collider.name == "Outer Space") { DialogManager.Find().ShowMessage("You have used your Blink Drive to blink into the depths of space." + " You lose consciousness within seconds." + " :("); inventory.LoseHealth(9999); } else { var blinkPoint = new Vector3(hit.point.x, hit.point.y); var overlapData = Physics2D.OverlapCapsule(blinkPoint, new Vector2(0.9f, 1.84f), CapsuleDirection2D.Vertical, 0f, mask); while (overlapData != null) { if (x > 0) { blinkPoint = new Vector3(blinkPoint.x - 0.5f, blinkPoint.y); } else if (x < 0) { blinkPoint = new Vector3(blinkPoint.x + 0.5f, blinkPoint.y); } else if (y > 0) { blinkPoint = new Vector3(blinkPoint.x, blinkPoint.y - 0.5f); } else if (y < 0) { blinkPoint = new Vector3(blinkPoint.x, blinkPoint.y + 0.5f); } overlapData = Physics2D.OverlapCapsule(blinkPoint, new Vector2(0.9f, 1.84f), CapsuleDirection2D.Vertical, 0f, groundMask); } transform.position = blinkPoint; if ((x == -1 && facingRight) || (x == 1 && !facingRight)) { FlipPlayer(); } } } }
protected override void InitializeModules() { base.InitializeModules(); this.dialogManager = new DialogManager(); this.Container.ComposeExportedValue<IDialogManager>(this.dialogManager); }
void Awake() { #region singleton if(instance == null) { instance = this; } else if(instance != this) { Destroy(gameObject); } #endregion }
void Start() { instance = this; //dialogText.text = dialogLines[currentLine]; }
/// <summary> /// default constructor /// initializes all the GUI components, initializes the internal objects and makes a default selection for all the GUI dropdowns /// In addition, all the jobs and profiles are being loaded from the harddisk /// </summary> public void constructMeGUIInfo() { muxProvider = new MuxProvider(this); this.codecs = new CodecManager(); this.path = System.Windows.Forms.Application.StartupPath; this.jobUtil = new JobUtil(this); this.settings = new MeGUISettings(); addPackages(); this.profileManager = new ProfileManager(this.path); this.profileManager.LoadProfiles(); this.mediaFileFactory = new MediaFileFactory(this); this.loadSettings(); this.dialogManager = new DialogManager(this); }
private void button_export_cancel_Click(object sender, RoutedEventArgs e) { this.DialogResult = false; DialogManager.HideMetroDialogAsync(window, this); }
void Start() { DialogManager.instance = this; dialogGroup = GetComponent<CanvasGroup> (); }
public void Awake() { //Ensure that the latest creation of Dialog manager is the current instance. instance = this; }
void Awake() { if(_instance == null) { //If I am the first instance, make me the Singleton _instance = this; DontDestroyOnLoad(this); _delegates = new Dictionary<int, Action<bool>> (); // set default label SetLabel("YES", "NO", "CLOSE"); } else { //If a Singleton already exists and you find //another reference in scene, destroy it! if(this != _instance) { Destroy(this.gameObject); } } }
private async void btnOK_Click(object sender, RoutedEventArgs e) { #region 新增 if (Om == OperationMode.AddMode) { string strErrorMsg = string.Empty; try { UserEditModel newUserEditModel = new UserEditModel(); //SysUser newSysUser = new SysUser(); newUserEditModel.UserCode = txtUserCode.Text.Trim(); newUserEditModel.Name = txtName.Text.Trim(); newUserEditModel.LoginName = txtLoginName.Text.Trim(); newUserEditModel.Password = "******"; newUserEditModel.Sex = (UserSex)(cmbSex.SelectedIndex + 1); //newSysUser.Picture //newUserEditModel.Picture = this.GetBytesByImagePath(this.image.Tag.ToString()); newUserEditModel.Password = txtPassWord.Password.Trim(); newUserEditModel.Mobile = txtMobile.Text.Trim(); newUserEditModel.OfficialPhone = txtOfficialPhone.Text.Trim(); newUserEditModel.Email = txtEmail.Text.Trim(); newUserEditModel.Position = txtPosition.Text.Trim(); newUserEditModel.Remark = txtRemark.Text.Trim(); newUserEditModel.NeedChangePassword = chkNeedChangePassword.IsChecked.HasValue ? chkNeedChangePassword.IsChecked.Value : false; newUserEditModel.IsLeader = chkIsLeader.IsChecked.HasValue ? chkIsLeader.IsChecked.Value : false; newUserEditModel.IsOnline = false; newUserEditModel.Stopped = false; newUserEditModel = await userAsyncProxy.CallAsync(c => c.Add(newUserEditModel)); //MessageDialogResult result = await DialogManager.ShowMessageAsync(this, UIResources.MsgInfo, "新增用户成功!", MessageDialogStyle.Affirmative, null); this.ShowAutoCloseDialogOwter(UIResources.MsgInfo, "新增用户成功!"); this.DialogResult = true; } catch (TimeoutException timeProblem) { strErrorMsg = timeProblem.Message + UIResources.TimeOut + timeProblem.Message; } catch (FaultException<LCFault> af) { strErrorMsg = af.Detail.Message; } catch (FaultException unknownFault) { strErrorMsg = UIResources.UnKnowFault + unknownFault.Message; } catch (CommunicationException commProblem) { strErrorMsg = UIResources.ConProblem + commProblem.Message + commProblem.StackTrace; } if (strErrorMsg != string.Empty) { await DialogManager.ShowMessageAsync(this, UIResources.MsgError, "新增用户失败!原因:" + strErrorMsg, MessageDialogStyle.Affirmative, null); //AisinoMessageBox.Show("新增用户失败!原因:" + strMsg, UIResources.MsgError, MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK); } } #endregion #region 修改 else { string strErrorMsg = string.Empty; try { SelectSysUser.Name = txtName.Text.Trim(); SelectSysUser.LoginName = txtLoginName.Text.Trim(); SelectSysUser.Sex = (UserSex)(cmbSex.SelectedIndex + 1); //SelectSysUser.User.Picture //SelectSysUser.Picture=this.GetBytesByImagePic(this.image, SelectSysUser.Picture); SelectSysUser.Mobile = txtRemark.Text.Trim(); SelectSysUser.OfficialPhone = txtOfficialPhone.Text.Trim(); SelectSysUser.Email = txtEmail.Text.Trim(); SelectSysUser.Position = txtPosition.Text.Trim(); SelectSysUser.Remark = txtRemark.Text.Trim(); SelectSysUser.NeedChangePassword = chkNeedChangePassword.IsChecked.HasValue ? chkNeedChangePassword.IsChecked.Value : false; SelectSysUser.IsLeader = chkIsLeader.IsChecked.HasValue ? chkIsLeader.IsChecked.Value : false; SelectSysUser.Stopped = false; SelectSysUser.Password = txtPassWord.Password.Trim(); SelectSysUser = await userAsyncProxy.CallAsync(c => c.Update(SelectSysUser)); //MessageDialogResult result = await DialogManager.ShowMessageAsync(this, UIResources.MsgInfo, "修改用户成功!", MessageDialogStyle.Affirmative, null); this.ShowAutoCloseDialogOwter(UIResources.MsgInfo, "修改用户成功!"); this.DialogResult = true; } catch (TimeoutException timeProblem) { strErrorMsg = timeProblem.Message + UIResources.TimeOut + timeProblem.Message; } catch (FaultException<LCFault> af) { strErrorMsg = af.Detail.Message; } catch (FaultException unknownFault) { strErrorMsg = UIResources.UnKnowFault + unknownFault.Message; } catch (CommunicationException commProblem) { strErrorMsg = UIResources.ConProblem + commProblem.Message + commProblem.StackTrace; } if (strErrorMsg != string.Empty) { await DialogManager.ShowMessageAsync(this, UIResources.MsgError, "修改用户失败!原因:" + strErrorMsg, MessageDialogStyle.Affirmative, null); //AisinoMessageBox.Show("修改用户失败!原因:" + strMsg, UIResources.MsgError, MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK); } } #endregion }
public AddNewGroupViewModel(INavigationManager navigationManager, DialogManager dialogManager) { _navigationManager = navigationManager; _dialogManager = dialogManager; }
// Start is called before the first frame update void Start() { //Sending dialog lines to our game object //dialogText.text = dialogLines[currentLine]; instance = this; }
private void Awake() { Instance = this; }
// Start is called before the first frame update void Start() { questCompleted = new bool[quests.Length]; manager = FindObjectOfType <DialogManager>(); }
public void Talk() { DialogManager dialogManager = GameObject.Find("DialogManager").GetComponent <DialogManager>(); dialogManager.Talk(myDialog, StartDialog, EndDialog); }
private TestFlow CreateFlow(ITriggerSelector selector) { TypeFactory.Configuration = new ConfigurationBuilder().Build(); var storage = new MemoryStorage(); var convoState = new ConversationState(storage); var userState = new UserState(storage); var resourceExplorer = new ResourceExplorer(); var adapter = new TestAdapter(TestAdapter.CreateConversation(TestContext.TestName)); adapter .UseStorage(storage) .UseState(userState, convoState) .UseResourceExplorer(resourceExplorer) .UseAdaptiveDialogs() .UseLanguageGeneration(resourceExplorer) .Use(new TranscriptLoggerMiddleware(new FileTranscriptLogger())); var dialog = new AdaptiveDialog() { Selector = selector }; dialog.Recognizer = new RegexRecognizer { Intents = new List <IntentPattern>() { new IntentPattern("a", "a"), new IntentPattern("b", "b"), new IntentPattern("trigger", "trigger"), } }; dialog.Triggers.AddRange(new List <OnCondition>() { new OnIntent("a", actions: new List <Dialog> { new SetProperty { Property = "user.a", Value = "1" } }), new OnIntent("b", actions: new List <Dialog> { new SetProperty { Property = "user.b", Value = "1" } }), new OnIntent("trigger", constraint: "user.a == 1", actions: new List <Dialog> { new SendActivity("ruleA1") }), new OnIntent("trigger", constraint: "user.a == 1", actions: new List <Dialog> { new SendActivity("ruleA2") }), new OnIntent("trigger", constraint: "user.b == 1 || user.c == 1", actions: new List <Dialog> { new SendActivity("ruleBorC") }), new OnIntent("trigger", constraint: "user.a == 1 && user.b == 1", actions: new List <Dialog> { new SendActivity("ruleAandB") }), new OnIntent("trigger", constraint: "user.a == 1 && user.c == 1", actions: new List <Dialog> { new SendActivity("ruleAandC") }), new OnIntent("trigger", constraint: string.Empty, actions: new List <Dialog> { new SendActivity("default") }) }); dialog.AutoEndDialog = false; DialogManager dm = new DialogManager(dialog); return(new TestFlow(adapter, async(turnContext, cancellationToken) => { await dm.OnTurnAsync(turnContext, cancellationToken: cancellationToken).ConfigureAwait(false); })); }
private void ShowDialogAbout() { DialogManager.ShowMetroDialogAsync(this, _aboutDlg); // Move the Dlg a bit to the left _aboutDlg.Margin = new Thickness(-280, _aboutDlg.Margin.Top, _aboutDlg.Margin.Right, _aboutDlg.Margin.Bottom); }
// Start is called before the first frame update void Start() { _dm = DialogManager.Instance; _dm.FinalScene += LoadCredits; StartCoroutine(RunCredits()); }
private void ShowDialogLOKB() { DialogManager.ShowMetroDialogAsync(this, _lOKBDlg); }
void Start () { player = GetComponent<PlayerManager>(); dialogBox = dialog.GetComponent<DialogManager>(); UpdateCollectibleCount(); }
private void OnNavigated(object sender, NavigationEventArgs e) { DialogManager.GetForCurrentThread().DismissPendingDialogs(); }
override public void Update() { if (ActivateBoss == false) { if (MyCamera.Instance.CurrentRoom == myRoom && MyCamera.Instance.m_IsUpdatingPosition == false) { if (InitiatedDialog == false) { DialogManager.OnSpeak(startDialog); InitiatedDialog = true; } if (!DialogBox.IsVisible()) { AudioManager.ChangeBGM(RoomManager.Instance.bossTheme); ActivateBoss = true; } } } if (ActivateBoss == true) { if (UIBossHealthBar.MyInstance.HealthModel == null) { UIBossHealthBar.MyInstance.HealthModel = GetComponentInChildren <AttackableEnemy>(); UIBossHealthBar.MyInstance.RevealImage(); } if (!m_MovementModel.CanAttack()) //this likely wont be here later on { return; } UpdateDirection(); if (m_IsCharacterInRange != null) { Vector2 myPosition = new Vector2(gameObject.transform.position.x + MyBodyCollision.GetComponent <BoxCollider2D>().offset.x, gameObject.transform.position.y + MyBodyCollision.GetComponent <BoxCollider2D>().offset.y); Vector2 otherPosition = new Vector2(m_IsCharacterInRange.transform.position.x + m_IsCharacterInRange.GetComponent <BoxCollider2D>().offset.x, m_IsCharacterInRange.transform.position.y + m_IsCharacterInRange.GetComponent <BoxCollider2D>().offset.y); // Debug.Log(Vector2.Distance(otherPosition, myPosition)); Vector3 direction = m_MovementModel.GetFacingDirection(); if (direction.x == 0 & direction.y == 0) { return; //this makes it so that the character cant shoot something without moving first } if (Vector2.Distance(otherPosition, myPosition) <= 1.3) { if (Attack == true) { closeRangeAttack.OnAttackByEnemy(); Attack = false; StartCoroutine(WaitUntilAbleToAttack(1)); } } if (Vector2.Distance(otherPosition, myPosition) >= 1.3 & Vector2.Distance(otherPosition, myPosition) <= 3) { if (Attack == true) { } } if (Vector2.Distance(otherPosition, myPosition) >= 3) { if (Attack == true) { Debug.Log(gameObject.name + " is making a long range attack"); longRangeAttack.OnAttackByEnemy(); Attack = false; StartCoroutine(WaitUntilAbleToAttack(2)); } } } } }
public void ShowNotEnoughDiskSpace() { DialogManager.ShowMessageAsync(this, null, "디스크 공간이 부족합니다!", MessageDialogStyle.Affirmative); }
public Task <string> ShowInput(string message, MetroDialogSettings settings = null) => DialogManager.ShowInputAsync(this, null, message, settings);
void Start() { // Находим игрока и DialogManager _player = GameObject.FindGameObjectWithTag("Player"); _dialogManager = FindObjectOfType<DialogManager>(); if (_player == null || _gameCamera == null) { Debug.LogError("Игрок или камера не найдены"); // Отключаем объект gameObject.SetActive(false); } // Устанавливаем игровую камеру как камеру для отрисовки на экран Camera.SetupCurrent(_gameCamera); // Изначально отключаем спаунеры для всех волн foreach (var wave in _enemyWaves) { foreach (var spawner in wave._enemySpawners) { spawner.SetActive(false); } } if(_boss != null) _boss.SetActive(false); }
public Task <MessageDialogResult> ShowMessageBox(string message, MessageDialogStyle style = MessageDialogStyle.Affirmative, MetroDialogSettings settings = null) => DialogManager.ShowMessageAsync(this, null, message, style, settings);
/// <summary> /// default constructor /// initializes all the GUI components, initializes the internal objects and makes a default selection for all the GUI dropdowns /// In addition, all the jobs and profiles are being loaded from the harddisk /// </summary> public MeGUIInfo() { this.codecs = new CodecManager(); this.gen = new CommandLineGenerator(); this.path = System.Windows.Forms.Application.StartupPath; this.jobs = new Dictionary<string, Job>(); this.skipJobs = new List<Job>(); this.logBuilder = new StringBuilder(); this.jobUtil = new JobUtil(this); this.settings = new MeGUISettings(); this.calc = new BitrateCalculator(); audioStreams = new AudioStream[2]; audioStreams[0].path = ""; audioStreams[0].output = ""; audioStreams[0].settings = null; audioStreams[1].path = ""; audioStreams[1].output = ""; audioStreams[1].settings = null; this.videoEncoderProvider = new VideoEncoderProvider(); this.audioEncoderProvider = new AudioEncoderProvider(); this.profileManager = new ProfileManager(this.path); this.profileManager.LoadProfiles(videoProfile, audioProfile); this.loadSettings(); this.loadJobs(); this.dialogManager = new DialogManager(this); int index = menuItem1.MenuItems.Count; foreach (IMuxing muxer in PackageSystem.MuxerProviders.Values) { MenuItem newMenuItem = new MenuItem(); newMenuItem.Text = muxer.Name; newMenuItem.Tag = muxer; newMenuItem.Index = index; index++; menuItem1.MenuItems.Add(newMenuItem); newMenuItem.Click += new System.EventHandler(this.mnuMuxer_Click); } index = mnuTools.MenuItems.Count; foreach (ITool tool in PackageSystem.Tools.Values) { MenuItem newMenuItem = new MenuItem(); newMenuItem.Text = tool.Name; newMenuItem.Tag = tool; newMenuItem.Index = index; index++; mnuTools.MenuItems.Add(newMenuItem); newMenuItem.Click += new System.EventHandler(this.mnuTool_Click); } //MessageBox.Show(String.Join("|", this.GetType().Assembly.GetManifestResourceNames())); using (TextReader r = new StreamReader(this.GetType().Assembly.GetManifestResourceStream("MeGUI.Changelog.txt"))) { mainForm.Changelog.Text = r.ReadToEnd(); } }
public override void Start() { base.Start(); DialogManager.GetInstance().Regist(E_DIALOG_TYPE.E_ALERT, this); }
public async Task UpdatePost( int id) { if (id < 1) { if (!NavigationController.Instance.IsCurrentContent <PostOverlayPage>()) { return; } NavigationController.Instance.GoBack(true); var message = LocalizationUtils .GetLocalized("PostNotFound"); await DialogManager.ShowErrorDialog(message) .ConfigureAwait(true); return; } ViewModel.CurrentPostData.Id = id; var result = await PostApi.GetById( SettingsManager.PersistentSettings.CurrentUser.Token, ViewModel.CurrentPostData.Id) .ConfigureAwait(true); if (result.IsError) { if (!NavigationController.Instance.IsCurrentContent <PostOverlayPage>()) { return; } NavigationController.Instance.GoBack(true); await DialogManager.ShowErrorDialog(result.Message) .ConfigureAwait(true); return; } if (result.Data == null) { if (!NavigationController.Instance.IsCurrentContent <PostOverlayPage>()) { return; } NavigationController.Instance.GoBack(true); string message = LocalizationUtils .GetLocalized("PostNotFound"); await DialogManager.ShowErrorDialog(message) .ConfigureAwait(true); return; } ViewModel.CurrentPostData = result.Data; Post.UpdateContextMenus(); if (ViewModel.SourcePost?.CurrentPostData.Id == ViewModel.CurrentPostData.Id) { ViewModel.SourcePost?.SetValue( Post.CurrentPostDataProperty, ViewModel.CurrentPostData); } }
void Start() { ArrayIndex = 0; SelectedCharacter = CharacterArray [ArrayIndex]; SelectedCharacter.SetActive (true); CharacterName = SelectedCharacter.name; _theGameManager = FindObjectOfType<GameManager> (); _theDialogManager = FindObjectOfType<DialogManager> (); }