protected void GetReferences () { if (AdvGame.GetReferences ().cursorManager) { cursorManager = AdvGame.GetReferences ().cursorManager; } }
/// <summary> /// Main program method /// </summary> /// <param name="args"></param> public static void Main(string[] args) { var eventLoop = new EventLoop(); var cursorManager = new CursorManager(); eventLoop.UpHandler += cursorManager.OnUp; eventLoop.RightHandler += cursorManager.OnRight; eventLoop.DownHandler += cursorManager.OnDown; eventLoop.LeftHandler += cursorManager.OnLeft; eventLoop.Run(); }
private static CursorManager EnsureCursorManager(FrameworkElement fe) { if (fe == null) return null; CursorManager cm = GetCursorManager(fe); if (cm == null) { cm = new CursorManager(fe); SetCursorManager(fe, cm); } return cm; }
void Update() { if (hoverName.Length == 0 && GetComponentInParent <WorkbenchInteractive> () != null) { hoverName = GetComponentInParent <WorkbenchInteractive> ().hoverName; } if (hovering) { if (CursorManager.GetCurrentState() == MouseState.ms_interacting) { cursorExit(); } else { hover.position = Input.mousePosition + new Vector3(7f, 3f); } } }
protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { if (keyData == Keys.Escape) { CursorManager.ReleaseMouse(); } bool result = base.ProcessCmdKey(ref msg, keyData); if (keyData == Keys.F10 || keyData == (Keys.F10 | Keys.Shift)) { //Prevent default Windows behavior on F10 / Shift+F10 presses, which causes issues //such as the Shift key not being processed as being released, etc. return(true); } return(result); }
void OnTriggerStay2D(Collider2D other) { if (state != STATUS.NORMAL) { return; } CursorManager cm = other.gameObject.GetComponent <CursorManager>(); if (cm == null) { return; } if (!cm.GetAccel()) { return; } state = STATUS.CLOSE; }
// ---- default handlers ---- void Awake() { if (_instance != null) { throw new UnityException("You can have only one instance of this component"); } else { _instance = this; } // begin with cursor at index defaultCursorIndex if (defaultCursorIndex > -1 && defaultCursorIndex < cursors.Count) { SetCursor(cursors[defaultCursorIndex]); ShowReticle(); } }
protected override void OnShow() { base.OnShow(); if (!this.m_HUDTriggerAttach) { this.m_HUDTriggerAttach = HUDTrigger.GetNormal().transform.Find("Group/Action_0/KeyFrame0"); } Player.Get().BlockRotation(); Player.Get().BlockMoves(); CursorManager.Get().ShowCursor(true); CursorManager.Get().UpdateCursorVisibility(); CursorManager.Get().SetCursor(CursorManager.TYPE.Normal); Vector3 zero = Vector3.zero; if (!Inventory3DManager.Get().gameObject.activeSelf) { zero.x = (float)Screen.width * this.m_CursorOffset.x; zero.y = (float)Screen.height * this.m_CursorOffset.y; CursorManager.Get().SetCursorPos(this.m_HUDTriggerAttach.position + zero); } zero.x = (float)Screen.width * this.m_Offset.x; zero.y = (float)Screen.height * this.m_Offset.y; base.transform.position = this.m_HUDTriggerAttach.position + zero; this.ShowElements(); float a = float.MaxValue; float a2 = float.MaxValue; float a3 = float.MinValue; float a4 = float.MinValue; foreach (HUDItemButton huditemButton in this.m_ActiveButtons) { Vector3[] array = new Vector3[4]; huditemButton.trans.GetWorldCorners(array); Vector2[] array2 = new Vector2[4]; for (int i = 0; i < 4; i++) { array2[i] = RectTransformUtility.WorldToScreenPoint(base.transform.GetComponentInParent <Canvas>().worldCamera, array[i]); a = Mathf.Min(a, array2[i].x); a3 = Mathf.Max(a3, array2[i].x); a2 = Mathf.Min(a2, array2[i].y); a4 = Mathf.Max(a4, array2[i].y); } } }
private void ApriSettingMittenteFattura() { using (UnitOfWork unitOfWork = new UnitOfWork()) { var setItem = unitOfWork.DatiMittenteRepository.Find(a => 1 == 1).FirstOrDefault(); if (setItem == null) { setItem = new DatiMittente(); setItem.ID = 1; unitOfWork.DatiMittenteRepository.Add(setItem); unitOfWork.Commit(); } if (setItem.UfficioRegistroImp == null) { setItem.UfficioRegistroImp = new DatiMittente.UfficioRegistro(); } if (setItem.Indirizzo == null) { setItem.Indirizzo = new Library.Entity.Indirizzo(); } if (setItem.PecConfig == null) { setItem.PecConfig = new Library.Entity.PecConfig(); } var view = new GenericSettingView(setItem); { view.OnSave += (a, b) => { using (var cur = new CursorManager()) { view.Validate(); using (var save = new SaveEntityManager()) { save.UnitOfWork.DatiMittenteRepository.Update(setItem); save.SaveEntity(enSaveOperation.OpSave); } } }; this.ShowView(view, enAmbiente.SettingFatture); } } }
public void OnYesFromDialog() { SaveGame.s_MainSaveName = this.m_Slots[this.m_SlotIdx].m_SaveInfo.file_name; Debug.Log("LoadGameMenu:OnYesFromDialog - " + SaveGame.s_MainSaveName); if (this.m_IsIngame) { GreenHellGame.GetFadeSystem().FadeOut(FadeType.All, new VDelegate(this.OnLoadGame), 0.5f, null); this.m_MenuInGameManager.HideMenu(); if (ConsciousnessController.Get().IsActive()) { ConsciousnessController.Get().Stop(); } CursorManager.Get().ShowCursor(false, false); return; } GreenHellGame.Instance.m_GameMode = this.m_Slots[this.m_SlotIdx].m_GameMode; MainMenuManager.Get().CallLoadGameFadeSequence(); base.EnableSlots(false); }
private void Initialize() { GreenHellGame.ROADSHOW_DEMO = File.Exists(Application.dataPath + "/Resources/scripts/Debug/ROADSHOW_DEMO"); GreenHellGame.DEBUG = File.Exists(Application.dataPath + "/Resources/scripts/Debug/DEBUG"); GreenHellGame.TWITCH_DEMO = File.Exists(Application.dataPath + "/Resources/scripts/Debug/TWITCH_DEMO"); GreenHellGame.FORCE_SURVIVAL = File.Exists(Application.dataPath + "/Resources/scripts/Debug/FORCE_SURVIVAL"); GreenHellGame.GAMESCOM_DEMO = File.Exists(Application.dataPath + "/Resources/scripts/Debug/GAMESCOM_DEMO"); this.InitializeSteam(); this.InitializeRemoteStorage(); this.TryToMoveSavesToRemoteStorage(); this.TryToMoveSettingsToRemoteStorage(); this.InitInputsManager(); this.InitAudioMixer(); this.m_Settings = base.gameObject.AddComponent <GameSettings>(); this.m_Settings.LoadSettings(); this.SetMaxDeltaTime(); this.InitMusic(); this.InitPrefabsMap(); this.CreateLocalization(); this.InitializeLoadingScreen(); if (GreenHellGame.m_FadeSystem == null) { GreenHellGame.CreateFadeSystem(); } if (GreenHellGame.m_YesNoDialog == null) { GreenHellGame.CreateYesNoDialog(); } if (GreenHellGame.m_LocalReplaceManager == null) { GreenHellGame.CreateLocalizationReplaceManager(); } if (base.gameObject.scene.IsValid()) { SceneManager.MoveGameObjectToScene(base.gameObject, SceneManager.GetActiveScene()); } CursorManager.Initialize(); CursorManager.Get().ShowCursor(false, false); this.InitializeChallengesManager(); this.m_Settings.ApplySettings(false); this.InitScenarioScenes(); this.m_SessionJoinHelper = base.gameObject.AddComponent <SessionJoinHelper>(); }
void Update() { if (!Input.GetMouseButton(0) && state == DragState.DRAG) { endDrag(); CursorManager.giveUpCursorFocus(this); } if (state == DragState.DRAG) { CursorManager.takeCursorFocus(this, downCursor, Vector2.zero); DragEvent e = new DragEvent(DragState.DRAG); doDrag(e, dragStartMousePos, Input.mousePosition); foreach (DragModifier m in modifiers()) { m.handleDragEvent(e); } } else if (state == DragState.SNAP) { DragEvent e = new DragEvent(DragState.SNAP); bool isSnapDone = doSnap(e, snapToIndex); foreach (DragModifier m in modifiers()) { m.handleDragEvent(e); } if (isSnapDone) { state = DragState.NONE; foreach (DragModifier m in modifiers()) { m.endSnap(); } } } if (!isActive) { setVisualState(snapToIndex); } }
public void HideMenu() { if (this.m_CurrentScreen) { this.m_CurrentScreen.Hide(); if (this.m_CurrentScreen.ShouldPauseGame()) { MainLevel.Instance.Pause(false); } } this.m_CurrentScreen = null; this.m_PrevoiusScreen = null; Player.Get().UnblockMoves(); Player.Get().UnblockRotation(); CursorManager.Get().SetCursor(CursorManager.TYPE.Normal); CursorManager.Get().ShowCursor(false); this.m_OutlineCamera.enabled = true; PostProcessManager.Get().SetWeight(PostProcessManager.Effect.InGameMenu, 0f); }
private void Start() { this.m_StartStory.GetComponentInChildren <Text>().text = GreenHellGame.Instance.GetLocalization().Get("MainMenu_StartStory"); this.m_StartChallenge.GetComponentInChildren <Text>().text = GreenHellGame.Instance.GetLocalization().Get("MainMenu_StartChallenge"); this.m_StartSurvival.GetComponentInChildren <Text>().text = GreenHellGame.Instance.GetLocalization().Get("MainMenu_StartSurvival"); this.m_LoadGame.GetComponentInChildren <Text>().text = GreenHellGame.Instance.GetLocalization().Get("MainMenu_LoadGame"); this.m_Options.GetComponentInChildren <Text>().text = GreenHellGame.Instance.GetLocalization().Get("MainMenu_Options"); this.m_Credits.GetComponentInChildren <Text>().text = GreenHellGame.Instance.GetLocalization().Get("MainMenu_Credits"); this.m_Quit.GetComponentInChildren <Text>().text = GreenHellGame.Instance.GetLocalization().Get("MainMenu_Quit"); MainMenuScreen.s_ButtonsAlpha = this.m_StartStory.GetComponentInChildren <Text>().color.a; MainMenuScreen.s_InactiveButtonsAlpha = MainMenuScreen.s_ButtonsAlpha * 0.3f; MainMenu.s_ButtonTextStartX = this.m_StartStory.GetComponentInChildren <Text>().rectTransform.position.x; MainMenu.s_SelectedButtonX = MainMenu.s_ButtonShiftX + MainMenu.s_ButtonTextStartX; CursorManager.Get().ResetCursorRequests(); CursorManager.Get().SetCursor(CursorManager.TYPE.Normal); this.m_StartTime = Time.time; this.m_WasButtonsActive = false; this.StoreMenuResolution(); }
private void Awake() { if (this.Manager == null) { this.Manager = FindObjectOfType <MrvcManager>(); } if (this.CursorManager == null) { this.CursorManager = FindObjectOfType <CursorManager>(); } if (this.Manager == null || this.CursorManager == null) { return; } this.Manager.ManagerStateChanged += OnManagerStateChanged; }
internal void Stampa(Pagamento pagamento) { _logger.Info("Avvio stampa"); try { using (var cursorManger = new CursorManager()) { using (var stampa = new StampaPagamento()) { stampa.Stampa(pagamento); _logger.Info("Stampa completata correttamente."); } } } catch (Exception ex) { ExceptionManager.ManageError(ex); } }
protected override void OnShow() { base.OnShow(); this.m_CanvasGroup.alpha = 0f; int num = (int)MainLevel.Instance.m_TODSky.Cycle.Hour; int num2 = (int)((MainLevel.Instance.m_TODSky.Cycle.Hour - (float)num) * 60f); string text = string.Format("{0}:{1:00}", num, num2); this.m_StartTime.text = text; num += SleepController.Get().m_SleepDuration; if (num >= 24) { num -= 24; } text = string.Format("{0}:{1:00}", num, num2); this.m_EndTime.text = text; this.SetBGAlpha(0f); CursorManager.Get().ShowCursor(true); }
//! Open the interaction box public void OpenInteractionBox(bool fill) { // realVolumeSelected = 0.0f; if (fill) { boxToFillSpatula.SetActive(true); } else { boxToUnfillSpatula.SetActive(true); } //CursorManager.SetDefaultCursor (); /* * DEFINE HOW TO BLOCK CLICKS OUTSIDE */ CursorManager.SetMouseState(MouseState.ms_interacting); }
protected override void OnDisable() { base.OnDisable(); this.DestroyMapObject(); MenuNotepad.Get().SetActiveTab(this.m_PrevNotepadTab, false); this.m_Animator.SetBool(this.m_MapHash, false); HUDMap.Get().Deactivate(); if (this.m_CursorVisible) { CursorManager.Get().ShowCursor(false, false); this.m_CursorVisible = false; } this.m_Animator.SetBool(this.m_ZoomHash, false); if (MenuNotepad.Get() != null) { MenuNotepad.Get().gameObject.SetActive(false); } Player.Get().OnHideMap(); }
//UNFILLING INTERACTION //! Open the interaction box to unfill the pipette // Also defines the maximum value for the slider // Case to unfill pipette into a glassware public void OpenGraduatedUnfillingBox(float volumeAvailable, Glassware glassware) //Ok { boxGraduatedUnfilling.SetActive(true); u_volumeSelected = 0.0f; //Defining volume on slider if (volumeAvailable < volumeHeld) { boxGraduatedUnfilling.GetComponentInChildren <Slider>().maxValue = volumeAvailable; } else { boxGraduatedUnfilling.GetComponentInChildren <Slider>().maxValue = volumeHeld; } interactingGlassware = glassware; interactingReagent = null; CursorManager.SetMouseState(MouseState.ms_interacting); }
private void UpdateCursor() { if (this.m_ActiveTab == MenuNotepad.MenuNotepadTab.MapTab) { CursorManager.Get().SetCursor(CursorManager.TYPE.Normal); } else if (this.m_MouseOverConstruction) { CursorManager.Get().SetCursor(CursorManager.TYPE.Hammer); } else if (this.m_MouseOverButton) { CursorManager.Get().SetCursor(CursorManager.TYPE.MouseOver); } else if (!HUDNewWheel.Get().IsSelected()) { CursorManager.Get().SetCursor(CursorManager.TYPE.Normal); } }
public static void Main(string[] args) { _args = args; Logger.LogInfo($"Color Picker started with pid={Environment.ProcessId}"); AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; try { using (var application = new App()) { application.InitializeComponent(); application.Run(); } } catch (Exception ex) { Logger.LogError("Unhandled exception", ex); CursorManager.RestoreOriginalCursors(); } }
private void UpdateButtons() { Color color = this.m_BackButton.GetComponentInChildren <Text>().color; Color color2 = this.m_BackButton.GetComponentInChildren <Text>().color; color.a = MainMenuScreen.s_ButtonsAlpha; color2.a = MainMenuScreen.s_InactiveButtonsAlpha; this.m_BackButton.GetComponentInChildren <Text>().color = color; this.m_Quality.SetColor(color); this.m_SoftShadows.SetColor(color); this.m_ShadowsBlur.SetColor(color); Vector2 screenPoint = Input.mousePosition; this.m_ActiveButton = null; RectTransform component = this.m_BackButton.GetComponent <RectTransform>(); if (RectTransformUtility.RectangleContainsScreenPoint(component, screenPoint)) { this.m_ActiveButton = this.m_BackButton.gameObject; } component = this.m_BackText.GetComponent <RectTransform>(); Vector3 localPosition = component.localPosition; float num = (!(this.m_ActiveButton == this.m_BackButton.gameObject)) ? this.m_ButtonTextStartX : this.m_SelectedButtonX; float num2 = Mathf.Ceil(num - localPosition.x) * Time.unscaledDeltaTime * 10f; localPosition.x += num2; component.localPosition = localPosition; if (this.m_ActiveButton == this.m_BackButton.gameObject) { color = this.m_BackText.color; color.a = 1f; this.m_BackText.color = color; } this.UpdateButton(this.m_Quality); this.UpdateButton(this.m_SoftShadows); this.UpdateButton(this.m_ShadowsBlur); CursorManager.Get().SetCursor((!(this.m_ActiveButton != null)) ? CursorManager.TYPE.Normal : CursorManager.TYPE.MouseOver); if (Input.GetKeyDown(KeyCode.Escape)) { this.OnBack(); } }
public void ShowScreen(Type screen_type) { if (LoadingScreen.Get().m_Active) { return; } if (!this.m_Initialized) { this.Init(); } MenuScreen menuScreen = null; this.m_Screens.TryGetValue(screen_type, out menuScreen); if (!menuScreen) { DebugUtils.Assert("[MenuInGameManager::ShowScreen] Can't find screen " + screen_type.ToString() + "!", true, DebugUtils.AssertType.Info); return; } if (menuScreen == this.m_CurrentScreen) { return; } PostProcessManager.Get().SetWeight(PostProcessManager.Effect.InGameMenu, 1f); this.m_OutlineCamera.enabled = false; this.m_PrevoiusScreen = this.m_CurrentScreen; if (this.m_CurrentScreen) { this.m_CurrentScreen.Hide(); } else { Player.Get().BlockMoves(); Player.Get().BlockRotation(); CursorManager.Get().ShowCursor(true); if (menuScreen.ShouldPauseGame()) { MainLevel.Instance.Pause(true); } } menuScreen.Show(); this.m_CurrentScreen = menuScreen; }
private void ShowNodes(bool show) { if (this.m_NodesVisible == show) { return; } foreach (UISelectDialogNodeData uiselectDialogNodeData in this.m_UINodeDatas) { uiselectDialogNodeData.m_Object.SetActive(show); } this.m_NodesVisible = show; this.m_SelectedNode = 0; if (this.m_NodesVisible) { Player.Get().BlockMoves(); Player.Get().BlockRotation(); this.m_PlayerBlocked = true; this.m_Reply.SetActive(false); CursorManager.Get().ShowCursor(true); CursorManager.Get().UpdateCursorVisibility(); CursorManager.Get().SetCursor(CursorManager.TYPE.Normal); Vector3 zero = Vector3.zero; zero.x = (float)Screen.width * this.m_CursorOffset.x; zero.y = (float)Screen.height * this.m_CursorOffset.y; CursorManager.Get().SetCursorPos(this.m_Dummy.transform.position + zero); HintsManager.Get().ShowHint("Scroll_Dialog", 10f); } else { if (this.m_PlayerBlocked) { Player.Get().UnblockMoves(); Player.Get().UnblockRotation(); CursorManager.Get().ShowCursor(false); CursorManager.Get().SetCursor(CursorManager.TYPE.Normal); this.m_PlayerBlocked = false; } this.m_Reply.SetActive(true); this.m_ReplyCanvasGroup.alpha = 0f; HintsManager.Get().HideHint("Scroll_Dialog"); } }
//设置鼠标在场景上移动的效果.. private void SetMoveSceneObject(SceneEntity so) { if (so == moveCursourSceneEntity) { return; } if (moveCursourSceneEntity != null) { moveCursourSceneEntity.DispatchEvent(ControllerCommand.SET_GLOW, false); } moveCursourSceneEntity = null; if (so == null) { CursorManager.GetInstance().SetCursor(CursorType.ctNormal); SetCursorBySkill(); } else { SceneEntity _hero = so as SceneEntity; if (_hero.property.isDeaded) { CursorManager.GetInstance().SetCursor(CursorType.ctNormal); SetCursorBySkill(); return; } moveCursourSceneEntity = so; moveCursourSceneEntity.DispatchEvent(ControllerCommand.SET_GLOW, true); if (moveCursourSceneEntity.HeroType == KHeroObjectType.hotNpc) { CursorManager.GetInstance().SetCursor(CursorType.ctChat); } else if (moveCursourSceneEntity.HeroType == KHeroObjectType.hotMonster) { CursorManager.GetInstance().SetCursor(CursorType.ctAttack); } else if (moveCursourSceneEntity.HeroType == KHeroObjectType.hotPlayer) { CursorManager.GetInstance().SetCursor(CursorType.ctFriend); } } }
public static void Main(string[] args) { _args = args; AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; try { using (var application = new App()) { application.InitializeComponent(); application.Run(); } } #pragma warning disable CA1031 // Do not catch general exception types catch (Exception ex) #pragma warning restore CA1031 // Do not catch general exception types { Logger.LogError("Unhandled exception", ex); CursorManager.RestoreOriginalCursors(); } }
protected override void Update() { base.Update(); if (this.m_BG.color.a < 1f) { Color color = this.m_BG.color; color.a += Time.deltaTime; color.a = Mathf.Clamp01(color.a); this.m_BG.color = color; } else if (this.m_CanvasGroup.alpha < 1f) { this.m_CanvasGroup.alpha += Time.deltaTime; this.m_CanvasGroup.alpha = Mathf.Clamp01(this.m_CanvasGroup.alpha); if (this.m_CanvasGroup.alpha == 1f) { CursorManager.Get().ShowCursor(true); } } }
public void OnYesFromDialog() { switch (this.m_YesNoQuestion) { case HUDDeath.YesNoQuestion.LoadGame: MenuInGameManager.Get().ShowScreen(typeof(LoadGameMenu)); break; case HUDDeath.YesNoQuestion.LoadLastSave: DeathController.Get().StartRespawn(); CursorManager.Get().SetCursor(CursorManager.TYPE.Normal); break; case HUDDeath.YesNoQuestion.Quit: LoadingScreen.Get().Show(LoadingScreenState.ReturnToMainMenu); GreenHellGame.Instance.ReturnToMainMenu(); break; } this.m_YesNoQuestion = HUDDeath.YesNoQuestion.None; }
private void OnMouseOver() { if (pauseGameplay.isGamePaused || enemyBehaviour.playerIsDead) { return; } enemyHealthBar.DrawEnemyHealthBar(maxLife, life, enemyType.ToString()); if (CursorManager.GetCurrentCursorTextureName() != "attack") { CursorManager.SetAndStoreCursor("attack", Vector2.zero, CursorMode.Auto); if (currentShader != "outline" && !isPlayersTarget) { SetShader("outline"); } isOutlineFromMouseOver = true; } }
//! Uses the spatula to hold a volume of a solid reagent public void FillSpatula(Glassware glassware) //Ok { CursorManager.SetMouseState(MouseState.ms_filledSpatula); CursorManager.SetNewCursor(filledSpatula_CursorTexture, hotSpot); GameObject.Find("GameController").GetComponent <GameController>().GetCurrentState().GetComponent <WorkBench>().cannotEndState = true; if ((spatulaCapacity + capacityError) < glassware.currentVolume) //Volume inside glassware < spatula capacity { volumeHeld = Random.Range(spatulaCapacity - capacityError, spatulaCapacity + capacityError); //glassware.RemoveSolid(volumeHeld); //reagentInSpatula = (Compound)(glassware.compounds [0] as Reagent).Clone (volumeHeld); } else { volumeHeld = glassware.currentVolume; } reagentInSpatula = (Compound)(glassware.content as Compound).Clone(volumeHeld); glassware.RemoveSolid(volumeHeld); CloseInteractionBox(); }
private void UpdateButtons(bool force) { this.m_ButtonsActive = (this.m_State == MainMenuState.MainMenu && this.m_ButtonActivationTime > 0f && Time.time - this.m_ButtonActivationTime > this.m_ButtonsFadeInDuration); if (this.m_ButtonsActive && !this.m_WasButtonsActive) { if (GreenHellGame.IsPCControllerActive()) { CursorManager.Get().ShowCursor(true, false); } this.m_WasButtonsActive = true; } if (force || Time.time - this.m_ButtonActivationTime <= this.m_ButtonsFadeInDuration || this.m_ButtonActivationTime < 0f) { Color color = this.m_StartSurvival.GetComponentInChildren <Text>().color; Color color2 = this.m_StartSurvival.GetComponentInChildren <Text>().color; float num = Mathf.Clamp01((Time.time - this.m_ButtonActivationTime) / this.m_ButtonsFadeInDuration) * MenuScreen.s_ButtonsAlpha; float num2 = Mathf.Clamp01((Time.time - this.m_ButtonActivationTime) / this.m_ButtonsFadeInDuration) * MenuScreen.s_InactiveButtonsAlpha; color.a = (this.m_ButtonsEnabled ? num : 0f); color2.a = (this.m_ButtonsEnabled ? num2 : 0f); this.m_Continue.GetComponentInChildren <Text>().color = (this.m_Continue.interactable ? color : color2); this.m_Tutorial.GetComponentInChildren <Text>().color = (this.m_Tutorial.interactable ? color : color2); this.m_StartStory.GetComponentInChildren <Text>().color = (this.m_StartStory.interactable ? color : color2); this.m_StartChallenge.GetComponentInChildren <Text>().color = (this.m_StartChallenge.interactable ? color : color2); this.m_StartSurvival.GetComponentInChildren <Text>().color = (this.m_StartSurvival.interactable ? color : color2); this.m_LoadGame.GetComponentInChildren <Text>().color = (this.m_LoadGame.interactable ? color : color2); this.m_Options.GetComponentInChildren <Text>().color = (this.m_Options.interactable ? color : color2); this.m_Credits.GetComponentInChildren <Text>().color = (this.m_Credits.interactable ? color : color2); this.m_Quit.GetComponentInChildren <Text>().color = (this.m_Quit.interactable ? color : color2); this.m_VLine.color = color; this.m_VLineWContinue.color = color; this.m_GameVersion.color = color; color = this.m_PadSelectButton.color; color.a = (this.m_ButtonsEnabled ? num : 0f); this.m_PadSelectButton.color = color; this.m_PadSelectButton.GetComponentInChildren <Text>().color = color; } GameObject continueSlot = this.m_ContinueSlot; MenuBase.MenuOptionData activeMenuOption = this.m_ActiveMenuOption; continueSlot.SetActive(((activeMenuOption != null) ? activeMenuOption.m_Button : null) == this.m_Continue); }
//Picke Upable Object. When we double click on the object in the scene. private void OnMouseDown() { if (!clickManager.DoubleClick()) { return; } if (!isInit) { FetchItemInfo(); } //Find Player and Players inventory TargetLE lplayer = FindObjectOfType <TargetLE>(); LEInventory inventory = lplayer.transform.GetComponentInChildren <LEInventory>(); inventory.AddItem(item); transform.parent.parent = inventory.transform; transform.parent.gameObject.SetActive(false); CursorManager.GetInstance().setMouse(); }
void Awake() { mInstance=this; }
void Awake() { cursor = CursorManager.Instance; cursor.SetInputs(this); }
void OnDestroy() { mInstance = null; }
void Start() { _instance = this; }
void Start() { PCursor = null; state = STATUS.None; selectNo = 4; image = GetComponent<Image>(); trans = image.rectTransform; trans.localScale = Vector3.one; timer = 0.0f; trans.localPosition = DEFALTPOS[No]; PREVPOS = transform.position; parentObj = transform.parent.gameObject; ic = parentObj.GetComponent<IconCount>(); ic.selectNo[No+1] = 2; send = false; }
private void Start() { const float rowCount = 4.0f; // 4 status states. Can change if more get added. // float value so the below divisions return float values. //Screen.showCursor = false; instance = this; _cursorDimensions = new Vector2( (float)cursors.width / cursorCount, cursors.height / rowCount); _cursorTileDimensions = new Vector2( 1 / (float)cursorCount, 1 / rowCount); ChangeCursor(CursorType.Normal); ChangeCursorStatus(CursorGestureStatus.Normal); }
private void Initialize() { Inst = this; //Initializing CsDebug CsDebug debug = GetComponent<CsDebug>(); debug.Initialize(); //Initializing DBManager DBManager = new DBManager(); DBManager.Initialize(); //Initializing Event Manager EventManager = new EventManager(); EventManager.Initialize(); ItemManager = new ItemManager(); ItemManager.Initialize(); //Initializing NPC Manager NPCManager = new NPCManager(); NPCManager.Initialize(); PlayerControl = new PlayerControl(); PlayerControl.Initialize(); UIManager = new UIManager(); UIManager.Initialize(); MutantCharacter mutant1 = GameObject.Find("MutantCharacter").GetComponent<MutantCharacter>(); mutant1.Initialize(); mutant1.MyStatus.MaxHealth = 200; mutant1.MyStatus.Health = 200; mutant1.MyAI.BlackBoard.PatrolLoc = new Vector3(70, 0, -54); mutant1.MyAI.BlackBoard.PatrolRange = new Vector3(10, 5, 10); mutant1.MyAI.BlackBoard.CombatRange = new Vector3(20, 5, 20); mutant1.MyAI.BlackBoard.HasPatrolInfo = true; //HumanCharacter enemy1 = GameObject.Find("HumanCharacter2").GetComponent<HumanCharacter>(); HumanCharacter enemy2 = GameObject.Find("HumanCharacter4").GetComponent<HumanCharacter>(); //HumanCharacter enemy3 = GameObject.Find("HumanCharacter5").GetComponent<HumanCharacter>(); //HumanCharacter enemy4 = GameObject.Find("HumanCharacter6").GetComponent<HumanCharacter>(); AISquad enemySquad = new AISquad(); //enemySquad.Members.Add(enemy1); enemySquad.Members.Add(enemy2); //enemySquad.Members.Add(enemy3); //enemySquad.Members.Add(enemy4); /* enemy1.Initialize(); enemy1.MyAI.Squad = enemySquad; ItemManager.LoadNPCInventory(enemy1.Inventory); enemy1.MyAI.WeaponSystem.LoadWeaponsFromInventory(); */ enemy2.Initialize(); enemy2.MyAI.Squad = enemySquad; ItemManager.LoadNPCInventory(enemy2.Inventory); enemy2.MyAI.WeaponSystem.LoadWeaponsFromInventory(); /* enemy3.Initialize(); enemy3.MyAI.Squad = enemySquad; ItemManager.LoadNPCInventory(enemy3.Inventory); enemy3.MyAI.WeaponSystem.LoadWeaponsFromInventory(); enemy4.Initialize(); enemy4.MyAI.Squad = enemySquad; ItemManager.LoadNPCInventory(enemy4.Inventory); enemy4.MyAI.WeaponSystem.LoadWeaponsFromInventory(); */ //enemy1.MyStatus.MaxHealth = 160; //enemy1.MyStatus.Health = 160; enemy2.MyStatus.MaxHealth = 100; enemy2.MyStatus.Health = 100; /* enemy3.MyStatus.MaxHealth = 80; enemy3.MyStatus.Health = 80; enemy4.MyStatus.MaxHealth = 100; enemy4.MyStatus.Health = 100; */ enemySquad.IssueSquadCommand(); CameraController = GameObject.Find("CameraController").GetComponent<CameraController>(); CameraController.Initialize(); CameraShaker = CameraController.GetComponent<CameraShaker>(); CameraShaker.Initialize(); FXManager = new FXManager(); FXManager.Initialize(50); AIScheduler = new AIScheduler(); AIScheduler.Initialize(); CursorManager = new CursorManager(); CursorManager.Initialize(); StartCoroutine(DoPerSecond()); StartCoroutine(DoPerHalfSecond()); }
// ---- default handlers ---- void Awake() { if (_instance != null) throw new UnityException("You can have only one instance of this component"); else _instance = this; // begin with cursor at index defaultCursorIndex if (defaultCursorIndex > -1 && defaultCursorIndex < cursors.Count) { SetCursor(cursors[defaultCursorIndex]); ShowReticle(); } }
void Awake() { main = this; UnityEngine.Cursor.visible = false; }
// Use this for initialization private void Start() { Fader = GetComponentInChildren<SceneFadeInOut>(); CursorManager = GetComponent<CursorManager>(); PlayerController = PlayerCharacter.GetComponent<PawnController>(); DescriptionController = FindObjectOfType<DescriptionController>(); dialogueBlocker = FindObjectOfType<DialogueBlockerController>(); HidingController = FindObjectOfType<HidingController>(); ControlsScreenController = FindObjectOfType<ControlsScreenController>(); if (PlayerController == null) { Debug.LogError("No controller"); return; } var enterData = GetEnterData(PreviousLoadedLevel); PlayerController.SetInitPosition(enterData.StartPoint); PlayerController.SetNewFacing(enterData.Direction); }
void Start() { mang = GameObject.Find("Cursor Manager").GetComponent<CursorManager>(); }
private static void SetCursorManager(DependencyObject obj, CursorManager value) { obj.SetValue(CursorManagerProperty, value); }
void Awake() { CursorManager.instance = this; }
// Use this for initialization void Start() { Cm = GameObject.Find ("Canvas").GetComponentInChildren<CursorManager> (); // récupération du composant }
private CursorMode mode = CursorMode.Auto; // 滑鼠模式的判定 = 自動 void Awake() { _instance = this; }