void OnMouseDown() { PopUpInfo pop = GameObject.FindGameObjectWithTag("GameManager").GetComponent <PopUpInfo>(); pop.PopUp(popUp); }
public void EnableActions() { bool work = true; var popUp = new PopUpMultipleChoise("Select a possible option: ", TextOutputs.printmenu2()); while (work) { //TextOutputs.printmenu(); //int res = Convert.ToInt32(Console.ReadLine()); int res = popUp.pop(); try { if (res >= 0 && res <= 6) { switchfunc(res); } else { throw new IndexOutOfRangeException("not in the range"); } } catch (Exception e) { ConsoleGrapher.clear(); var errorPopUp = new PopUpInfo(e.Message); errorPopUp.pop(); } } }
public void AddPopUpInfo(string info, bool highlight = false) { PopUpInfo p = new PopUpInfo(); p.highlight = highlight; p.info = info; popUps.Enqueue(p); }
void OnMouseDown() { if (!IsPointerOverUIObject()) { PopUpInfo pop = GameObject.FindGameObjectWithTag("GameManager").GetComponent <PopUpInfo>(); pop.PopUp(popUp); } }
internal static int DeletePopUpData(PopUpInfo model) { using (var cn = new MySqlConnection(sqlconnectionString)) { cn.Open(); int i = cn.Execute(@" delete from " + database1 + @".PopUpControl where id = " + model.id + @" "); cn.Close(); return(i); } }
private PopUpBase make_PopUp(PopUpInfo _info, bool _bBackGround, PopUpObj _obj = null) { GameObject popObj = CreatePopUp(_info); m_PopBackGround.SetActive(_bBackGround); PopUpBase popUpBase = popObj.GetComponent <PopUpBase>(); popUpBase.Set_Base(_info, _obj); popUpBase.BringIn(); return(popUpBase); }
void OnMouseDown() { PopUpInfo pop = GameObject.FindGameObjectWithTag("GameManager").GetComponent <PopUpInfo>(); if (!IsPointerOverUIObject()) { if (popUp != null && !combatManager.gameObject.activeInHierarchy) { pop.PopUp(popUp); } } }
internal static int AddPopUpData(PopUpInfo model) { using (var cn = new MySqlConnection(sqlconnectionString)) { cn.Open(); int i = cn.Execute(@" insert into " + database1 + @".PopUpControl(Position,Platform,JumpPage,OpenWinNo,StartTime,EndTime,IsOpen) values(" + (int)model.Position + @",'" + model.Platform + @"'," + (int)model.JumpPage + @"," + model.OpenWinNo + @",'" + model.StartTime + @"','" + model.EndTime + @"'," + model.IsOpen + @") "); cn.Close(); return(i); } }
private GameObject CreatePopUp(PopUpInfo _info) { int _nPopUpIdx = (int)_info; if (_nPopUpIdx < m_popUpArr.Length) { return(Instantiate(Resources.Load(m_popUpArr[_nPopUpIdx]), transform) as GameObject); } #if UNITY_EDITOR Debug.LogWarning("popuparr 등록 안됨"); #endif return(null); }
internal static int UpdatePopUpData(PopUpInfo model, int id) { using (var cn = new MySqlConnection(sqlconnectionString)) { cn.Open(); int i = cn.Execute(@" update " + database1 + @".PopUpControl set Position=" + (int)model.Position + @",Platform='" + model.Platform + @"',JumpPage=" + (int)model.JumpPage + @",OpenWinNo=" + model.OpenWinNo + @",StartTime='" + model.StartTime + @"',EndTime='" + model.EndTime + @"',IsOpen=" + model.IsOpen + @" where id = " + id + @" "); cn.Close(); return(i); } }
static void PopUpForTime(object obj) { if (PopUpInfoList.Count > 0) { PopUpInfo popUpInfo = PopUpInfoList.Dequeue(); //SettleResult(popUpInfo.entityModel.GO.transform.position + UnityEngine.Vector3.up * 18,popUpInfo.content,popUpInfo.fightEffectType); SettleResult(getUIPosition(popUpInfo.entityModel), popUpInfo.content, popUpInfo.fightEffectType, false); if (PopUpInfoList.Count > 0) { TweenFloat.Begin(1, 0, 1, null, PopUpForTime); } } }
public void addTimePop(PopUpInfo _info, bool _bBackGround, PopUpObj _obj = null) { PopUpBase popUpBase = make_PopUp(_info, _bBackGround, _obj); GameObject popObj = popUpBase.gameObject; Anime.Play(DefineClass.Vector3One3, DefineClass.Vector3One, Motion.Uniform(DefineClass.PopUpPunchAnimVel)) .Subscribe(_ => popObj.transform.localScale = _).AddTo(this); Observable.Interval(TimeSpan.FromSeconds(DefineClass.PopUpTime)).First().Subscribe(_ => { m_PopBackGround.SetActive(false); popUpBase.BackPopUp(); }).AddTo(this); }
void Update() { string info; PopUpTimer -= Time.deltaTime; if (popUps.Count > 0) { if (PopUpTimer <= 0) { PopUpInfo popUpInfo = popUps.Dequeue(); info = popUpInfo.info; DamagePopUp.Create(gameObject.transform.position + new Vector3(0, (gameObject.GetComponent <TacticsMovement>().halfHeight) + 0.5f), info, popUpInfo.highlight); PopUpTimer = PopUpDelay; } } }
// Start is called before the first frame update void Start() { date = new DateTime(2019, 10, 7); disasterHitDate = date.AddYears(YEARS_WITHOUT_DISASTERS); endDate = date.AddYears(MAX_GAME_TIME_YEARS); Vegetation.setSeedsOrSaplings(typeof(Grass), 4); Vegetation.setSeedsOrSaplings(typeof(Shrub), 2); Vegetation.setSeedsOrSaplings(typeof(LeafTree), 1); Vegetation.setSeedsOrSaplings(typeof(FirTree), 1); Vegetation.setSeedsOrSaplings(typeof(Cactus), 1); _fireTile1 = Resources.Load <Tile>("Tiles/Feuer1_1"); _fireTile2 = Resources.Load <Tile>("Tiles/Feuer1_2"); _bugTile1 = Resources.Load <Tile>("Tiles/Bug1"); _bugTile2 = Resources.Load <Tile>("Tiles/Bug2"); popUpInfo = FindObjectOfType <PopUpInfo>(); popUpInfo.gameObject.SetActive(false); grid = FindObjectOfType <Grid>(); generateMap(); CenterMainCameraOnGrid(); }
public virtual void Set_Base(PopUpInfo _info, PopUpObj _obj) { m_popUpInfo = _info; _popUpObj = _obj; }
private void Tool_EditorEventRaised(IEditorEvent obj) { if (obj is InitEvent) { // At startup initialise a new Wad2 if (_tool.Configuration.Tool_MakeEmptyWadAtStartup) { _tool.DestinationWad = new Wad2 { GameVersion = TRVersion.Game.TR4 }; _tool.RaiseEvent(new WadToolClass.DestinationWadChangedEvent()); } } if (obj is WadToolClass.MessageEvent) { var msg = (WadToolClass.MessageEvent)obj; PopUpInfo.Show(popup, this, panel3D, msg.Message, msg.Type); } if (obj is WadToolClass.SelectedObjectEditedEvent || obj is InitEvent) { } if (obj is WadToolClass.DestinationWadChangedEvent || obj is InitEvent) { treeDestWad.Wad = _tool.DestinationWad; treeDestWad.UpdateContent(); panel3D.UpdateAnimationScrollbar(); panel3D.Invalidate(); if (_tool.DestinationWad != null) { labelStatistics.Text = "Moveables: " + _tool.DestinationWad.Moveables.Count + " | " + "Statics: " + _tool.DestinationWad.Statics.Count + " | " + "Sprites sequences: " + _tool.DestinationWad.SpriteSequences.Count + " | " + "Textures: " + _tool.DestinationWad.MeshTexturesUnique.Count; } else { labelStatistics.Text = ""; } } if (obj is WadToolClass.SourceWadChangedEvent || obj is InitEvent) { panelSource.SectionHeader = "Source"; if (_tool?.SourceWad != null) { panelSource.SectionHeader += (String.IsNullOrEmpty(_tool.SourceWad.FileName) ? " (Imported)" : " (" + Path.GetFileName(_tool.SourceWad.FileName) + ")"); } treeSourceWad.Wad = _tool.SourceWad; treeSourceWad.UpdateContent(); panel3D.UpdateAnimationScrollbar(); panel3D.Invalidate(); } if (obj is WadToolClass.MainSelectionChangedEvent || obj is WadToolClass.DestinationWadChangedEvent || obj is WadToolClass.SourceWadChangedEvent || obj is InitEvent) { var mainSelection = _tool.MainSelection; if (mainSelection == null) { panel3D.CurrentObject = null; butEditAnimations.Visible = false; butEditSkeleton.Visible = false; butEditStaticModel.Visible = false; butEditSpriteSequence.Visible = false; } else { Wad2 wad = _tool.GetWad(mainSelection.Value.WadArea); // Display the object (or set it to Lara's skin instead if it's Lara) if (mainSelection.Value.Id is WadMoveableId) { panel3D.CurrentObject = wad.TryGet(new WadMoveableId(TrCatalog.GetMoveableSkin(wad.GameVersion, ((WadMoveableId)mainSelection.Value.Id).TypeId))); } else { panel3D.CurrentObject = wad.TryGet(mainSelection.Value.Id); } panel3D.AnimationIndex = 0; panel3D.KeyFrameIndex = 0; // Update the toolbar below the rendering area butEditAnimations.Visible = (mainSelection.Value.Id is WadMoveableId); butEditSkeleton.Visible = (mainSelection.Value.Id is WadMoveableId); butEditStaticModel.Visible = (mainSelection.Value.Id is WadStaticId); butEditSpriteSequence.Visible = (mainSelection.Value.Id is WadSpriteSequenceId); panel3D.ResetCamera(); panel3D.Invalidate(); } panel3D.UpdateAnimationScrollbar(); panel3D.Invalidate(); } if (obj is WadToolClass.ReferenceLevelChangedEvent) { if (_tool.ReferenceLevel != null) { butCloseRefLevel.Enabled = true; lblRefLevel.Enabled = true; closeReferenceLevelToolStripMenuItem.Enabled = true; lblRefLevel.Text = Path.GetFileNameWithoutExtension(_tool.ReferenceLevel.Settings.LevelFilePath); } else { butCloseRefLevel.Enabled = false; lblRefLevel.Enabled = false; closeReferenceLevelToolStripMenuItem.Enabled = false; lblRefLevel.Text = "(project not loaded)"; } } if (obj is WadToolClass.UnsavedChangesEvent) { UpdateSaveUI(((WadToolClass.UnsavedChangesEvent)obj).UnsavedChanges); } }
void Update() { Vector3 pos = transform.position; if (Input.mousePosition.y >= Screen.height - panBorderThickness) { pos.z += panSpeed * Time.deltaTime; } if (Input.mousePosition.y <= Screen.height - panBorderThickness) { pos.z -= panSpeed * Time.deltaTime; } if (Input.mousePosition.x >= Screen.width - panBorderThickness) { pos.z += panSpeed * Time.deltaTime; } if (Input.mousePosition.x <= Screen.width - panBorderThickness) { pos.z -= panSpeed * Time.deltaTime; } float scroll = Input.GetAxis("Mouse ScrollWheel"); pos.y += scroll * scrollSpeed * Time.deltaTime; pos.x = Mathf.Clamp(pos.x, -panLimit.x, panLimit.x); pos.z = Mathf.Clamp(pos.z, -panLimit.y, panLimit.y); if (Input.GetMouseButtonDown(0)) { RaycastHit hit; Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray, out hit, 500f)) { if (hit.transform != null) { PrintName(hit.transform.gameObject); // PopUpWIndow(); //} } } } void PrintName(GameObject block) { print(block.name); } void PopUpWIndow() { PopUpInfo pop = GameObject.FindGameObjectWithTag("GameManager").GetComponent <PopUpInfo>(); pop.PopUp(popUp); } }
private void EditorEventRaised(IEditorEvent obj) { if (obj is Editor.ConfigurationChangedEvent) { var o = (Editor.ConfigurationChangedEvent)obj; if (o.UpdateKeyboardShortcuts) { GenerateToolStripCommands(toolStrip.Items, true); } if (o.UpdateToolbarLayout) { UpdateToolStripLayout(); GenerateToolStripCommands(toolStrip.Items, true); } RefreshControls(_editor.Configuration); } // Gray out menu options that do not apply if (obj is Editor.SelectedObjectChangedEvent) { ObjectInstance selectedObject = _editor.SelectedObject; butCopy.Enabled = selectedObject is ISpatial; butStamp.Enabled = selectedObject is ISpatial; } // Update editor mode if (obj is Editor.ModeChangedEvent) { ClipboardEvents_ClipboardChanged(this, EventArgs.Empty); EditorMode mode = ((Editor.ModeChangedEvent)obj).Current; butCenterCamera.Enabled = mode != EditorMode.Map2D; but2D.Checked = mode == EditorMode.Map2D; but3D.Checked = mode == EditorMode.Geometry; butLightingMode.Checked = mode == EditorMode.Lighting; butFaceEdit.Checked = mode == EditorMode.FaceEdit; panel2DMap.Visible = mode == EditorMode.Map2D; panel3D.Visible = mode == EditorMode.FaceEdit || mode == EditorMode.Geometry || mode == EditorMode.Lighting; } // Update flipmap toolbar button if (obj is Editor.SelectedRoomChangedEvent || _editor.IsSelectedRoomEvent(obj as Editor.RoomPropertiesChangedEvent)) { butFlipMap.Enabled = _editor.SelectedRoom.Alternated; butFlipMap.Checked = _editor.SelectedRoom.AlternateBaseRoom != null; } // Update portal opacity controls if (obj is Editor.ObjectChangedEvent || obj is Editor.SelectedObjectChangedEvent) { var portal = _editor.SelectedObject as PortalInstance; butOpacityNone.Enabled = portal != null; butOpacitySolidFaces.Enabled = portal != null; butOpacityTraversableFaces.Enabled = portal != null; butOpacityNone.Checked = portal != null && portal.Opacity == PortalOpacity.None; butOpacitySolidFaces.Checked = portal != null && portal.Opacity == PortalOpacity.SolidFaces; butOpacityTraversableFaces.Checked = portal != null && portal.Opacity == PortalOpacity.TraversableFaces; } // Dismiss any messages if (obj is Editor.LevelChangedEvent) { popup.Hide(); } // Update version-specific controls if (obj is Editor.InitEvent || obj is Editor.LevelChangedEvent || obj is Editor.GameVersionChangedEvent) { bool isT5M = _editor.Level.Settings.GameVersion == TRVersion.Game.TR5Main; butAddBoxVolume.Enabled = isT5M; butAddSphereVolume.Enabled = isT5M; butAddPrismVolume.Enabled = isT5M; butDrawVolumes.Enabled = isT5M; butAddFlybyCamera.Enabled = _editor.Level.Settings.GameVersion >= TRVersion.Game.TR4; } if (obj is Editor.MessageEvent) { var msg = (Editor.MessageEvent)obj; PopUpInfo.Show(popup, FindForm(), this, msg.Message, msg.Type); } if (obj is Editor.UndoStackChangedEvent) { var state = (Editor.UndoStackChangedEvent)obj; butUndo.Enabled = state.UndoPossible; butUndo.Image = state.UndoPossible && !state.UndoReversible ? Properties.Resources.general_undo_irreversible_16 : Properties.Resources.general_undo_16; butRedo.Enabled = state.RedoPossible; } }
public void addPopUpDialog(PopUpInfo _info, bool _bBackGround, PopUpObj _obj = null) { make_PopUp(_info, _bBackGround, _obj); }