public void UpdateFreeCamera() { if (NrTSingleton <FormsManager> .Instance.IsMouseOverForm()) { return; } if (CameraController.EnableControll && NkInputManager.GetButton("Fire2")) { this.UpdateEulerAngle(NkInputManager.GetAxis("Mouse X"), NkInputManager.GetAxis("Mouse Y")); } Vector3 vector = Vector3.zero; if (CameraController.EnableControll && NrTSingleton <UIManager> .Instance.FocusObject == null) { bool flag = NkInputManager.GetKey(KeyCode.W) || NkInputManager.GetKey(KeyCode.Keypad8) || NkInputManager.GetKey(KeyCode.UpArrow); bool flag2 = NkInputManager.GetKey(KeyCode.S) || NkInputManager.GetKey(KeyCode.Keypad2) || NkInputManager.GetKey(KeyCode.DownArrow); bool flag3 = NkInputManager.GetKey(KeyCode.A) || NkInputManager.GetKey(KeyCode.Keypad4) || NkInputManager.GetKey(KeyCode.LeftArrow); bool flag4 = NkInputManager.GetKey(KeyCode.D) || NkInputManager.GetKey(KeyCode.Keypad6) || NkInputManager.GetKey(KeyCode.RightArrow); if (flag) { vector += new Vector3(0f, 0f, this.MoveSpeed); } if (flag2) { vector += new Vector3(0f, 0f, -this.MoveSpeed); } if (flag3) { vector += new Vector3(-this.MoveSpeed, 0f, 0f); } if (flag4) { vector += new Vector3(this.MoveSpeed, 0f, 0f); } } Quaternion rotation = this.QY * this.QX; Vector3 vector2 = rotation * new Vector3(0f, 0f, -this.distance); vector = this.QY * vector; this.SetMovePos(this.GetMovePos() + vector); vector2 += this.GetMovePos(); if (!this.m_bMotionBlurCamera) { Vector3 pos = vector2; pos = NrTSingleton <NrTerrain> .Instance.GetWorldHeight(pos); if (vector2.y < pos.y) { vector2.y = pos.y + 1f; } } this.SetRotation(rotation); this.SetPosision(vector2); if (Camera.main) { Camera.main.fieldOfView = this.ffovMax; } }
public void CameraUpdate(ref NrBattleMap BattleMap) { if (this.m_TargetGo == null) { return; } NrTSingleton <NkBattleCharManager> .Instance.SyncBillboardRotate(); if (this.m_bSetCameraTrigger) { if (Time.time - this.m_fTriggerStartTime < this.m_fActionTime) { Vector3 pos = Vector3.zero; pos = Vector3.Lerp(this.m_veTriggerStartPos, this.m_veTriggerEndPos, (Time.time - this.m_fTriggerStartTime) / this.m_fActionTime); if (this.m_bCalcheight) { this.currentDistance = this.m_TargetGo.transform.position.y; this.desiredDistance = BattleMap.GetBattleMapHeight(pos); pos.y = Mathf.Lerp(this.currentDistance, this.desiredDistance, Time.deltaTime * 4f); } this.SetcameraPos(pos); } else if (Time.time - this.m_fTriggerStartTime > this.m_fDurningTime) { this.m_bSetCameraTrigger = false; this.SetcameraPos(this.m_veTriggerStartPos); } return; } bool flag = false; if (NkInputManager.GetKey(KeyCode.UpArrow) || NkInputManager.GetKey(KeyCode.W)) { flag = true; } if (NkInputManager.GetKey(KeyCode.DownArrow) || NkInputManager.GetKey(KeyCode.S)) { flag = true; } if (NkInputManager.GetKey(KeyCode.LeftArrow) || NkInputManager.GetKey(KeyCode.A)) { flag = true; } if (NkInputManager.GetKey(KeyCode.RightArrow) || NkInputManager.GetKey(KeyCode.D)) { flag = true; } if (NkInputManager.GetKeyUp(KeyCode.RightBracket)) { this.m_fScrollViewSensitive += 0.001f; if (this.m_fScrollViewSensitive < 0f) { this.m_fScrollViewSensitive = 0.01f; } Debug.Log("Set ScrollView Sensitive " + this.m_fScrollViewSensitive); } if (NkInputManager.GetKeyUp(KeyCode.LeftBracket)) { this.m_fScrollViewSensitive -= 0.001f; if (this.m_fScrollViewSensitive > 0.07f) { this.m_fScrollViewSensitive = 0.07f; } Debug.Log("Set ScrollView Sensitive " + this.m_fScrollViewSensitive); } if (!flag && !this.m_bCalcheight) { return; } if (this.m_bScrollView) { return; } if (Camera.main == null) { return; } Transform transform = Camera.main.transform; Vector3 a = transform.TransformDirection(Vector3.forward); a.y = 0f; a = a.normalized; Vector3 normalized = new Vector3(a.z, 0f, -a.x); normalized = normalized.normalized; float d = 0f; float d2 = 0f; if (flag) { d = NkInputManager.GetAxisRaw("Vertical"); d2 = NkInputManager.GetAxisRaw("Horizontal"); } Vector3 vector = d2 * normalized + d * a; Vector3 vector2 = Vector3.zero; if (vector != Vector3.zero) { float num = 0.3f; vector2 = Vector3.RotateTowards(vector2, vector, num * 0.0174532924f * Time.deltaTime, 1f).normalized; } if (vector2 == Vector3.zero && !this.m_bCalcheight) { return; } Vector3 vector3 = Vector3.zero; vector3 = this.m_TargetGo.transform.position + vector2 * Time.deltaTime * this.zoomDampening; if (this.m_TargetGo.transform.position.x < this.m_fMoveLimitX && vector2.x != 0f) { vector3.x = this.m_fMoveLimitX; } if (this.m_TargetGo.transform.position.x > this.m_fMapXSize && vector2.x != 0f) { vector3.x = this.m_fMapXSize; } if (this.m_TargetGo.transform.position.z < this.m_fMoveLimitZ && vector2.z != 0f) { vector3.z = this.m_fMoveLimitZ; } if (this.m_TargetGo.transform.position.z > this.m_fMapZSize && vector2.z != 0f) { vector3.z = this.m_fMapZSize; } if (this.m_bCalcheight) { this.currentDistance = this.m_TargetGo.transform.position.y; this.desiredDistance = BattleMap.GetBattleMapHeight(vector3); vector3.y = Mathf.Lerp(this.currentDistance, this.desiredDistance, Time.deltaTime * 4f); } this.m_TargetGo.transform.position = vector3; }
public override void Update() { NrTSingleton <NrUpdateProcessor> .Instance.MainUpdate(); if (NkInputManager.GetKeyDown(KeyCode.Escape)) { this.m_ResolutionWindow = !this.m_ResolutionWindow; } if (!TsPlatform.IsEditor || NkInputManager.GetKeyUp(KeyCode.Alpha3)) { } if (NkInputManager.GetKey(KeyCode.LeftShift) && NkInputManager.GetKeyUp(KeyCode.Alpha3)) { TsLog.LogError("GetMonoHeapSize = {0}, GetMonoUsedSize = {1} , usedHeapSize = {2} ", new object[] { Profiler.GetMonoHeapSize(), Profiler.GetMonoUsedSize(), Profiler.usedHeapSize }); MemoryCollection.Print(MemoryCollection.Mode.LoadedAll); } if (NkInputManager.GetKey(KeyCode.LeftShift) && NkInputManager.GetKeyUp(KeyCode.Alpha2)) { NrTSingleton <NrMainSystem> .Instance.CleanUpImmediate(); } if (NkInputManager.GetKey(KeyCode.LeftShift) && NkInputManager.GetKeyUp(KeyCode.Alpha4)) { NrTSingleton <FormsManager> .Instance.DeleteAll(); } if (!TsPlatform.IsEditor || !NkInputManager.GetKey(KeyCode.LeftShift) || NkInputManager.GetKeyUp(KeyCode.Alpha0)) { } if (NkInputManager.GetKey(KeyCode.LeftShift) && NkInputManager.GetKeyUp(KeyCode.Alpha5)) { TsPlatform.FileLog("AppMemory : " + NrTSingleton <NrMainSystem> .Instance.AppMemory); } if (TsPlatform.IsMobile && !TsPlatform.IsEditor && Input.GetKeyUp(KeyCode.Escape)) { string text = "FromESC"; MsgBoxUI msgBoxUI = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.MSGBOX_DLG) as MsgBoxUI; if (msgBoxUI != null) { string b = msgBoxUI.GetYesObject() as string; if (text != null && text == b && this.IsBattleStop()) { Battle_Control_Dlg battle_Control_Dlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.BATTLE_CONTROL_DLG) as Battle_Control_Dlg; if (battle_Control_Dlg != null) { battle_Control_Dlg.bESC = false; } this.BattleStopStart(false); } } bool flag = NrTSingleton <FormsManager> .Instance.CloseFormESC(); if (NrTSingleton <FormsManager> .Instance.IsForm(G_ID.ITEMMALL_POPUPSHOP_DLG)) { return; } if (NrTSingleton <FormsManager> .Instance.IsForm(G_ID.TOASTMSG_DLG)) { MsgBoxUI msgBoxUI2 = NrTSingleton <FormsManager> .Instance.LoadForm(G_ID.MSGBOX_DLG) as MsgBoxUI; if (msgBoxUI2 != null) { this.BattleStopStart(false); if (Battle.BATTLE != null && !NrTSingleton <ContentsLimitManager> .Instance.IsBattleStopLimit()) { Battle_Control_Dlg battle_Control_Dlg2 = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.BATTLE_CONTROL_DLG) as Battle_Control_Dlg; if (battle_Control_Dlg2 != null) { battle_Control_Dlg2.ShowRetreatWithCancel(); } } else { msgBoxUI2.SetMsg(new YesDelegate(this.EscQuitGame), null, NrTSingleton <NrTextMgr> .Instance.GetTextFromPreloadText("7"), NrTSingleton <NrTextMgr> .Instance.GetTextFromPreloadText("38"), eMsgType.MB_OK_CANCEL, 2); } } } else if (!flag && Scene.CurScene != Scene.Type.SELECTCHAR) { MsgBoxUI msgBoxUI3 = NrTSingleton <FormsManager> .Instance.LoadForm(G_ID.MSGBOX_DLG) as MsgBoxUI; if (msgBoxUI3 != null) { this.BattleStopStart(true); if (Battle.BATTLE != null && !NrTSingleton <ContentsLimitManager> .Instance.IsBattleStopLimit()) { Battle_Control_Dlg battle_Control_Dlg3 = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.BATTLE_CONTROL_DLG) as Battle_Control_Dlg; if (battle_Control_Dlg3 != null) { battle_Control_Dlg3.ShowRetreatWithCancel(); } } else { msgBoxUI3.SetMsg(new YesDelegate(this.EscQuitGame), null, NrTSingleton <NrTextMgr> .Instance.GetTextFromPreloadText("7"), NrTSingleton <NrTextMgr> .Instance.GetTextFromPreloadText("38"), eMsgType.MB_OK_CANCEL, 2); } } NrTSingleton <FiveRocksEventManager> .Instance.Placement("backbutton_click"); } } if (NkInputManager.GetKeyDown(KeyCode.Alpha1) && NkInputManager.GetKey(KeyCode.RightShift)) { this.m_bSwitchMyCharInfoGUI = !this.m_bSwitchMyCharInfoGUI; } }
public void Other() { if (NkInputManager.GetKeyUp(KeyCode.F9)) { } if (NkInputManager.GetKeyUp(KeyCode.F10)) { NrTSingleton <FormsManager> .Instance.LoadForm(G_ID.NEWEXPLORATION_MAIN_DLG); } if (NkInputManager.GetKeyUp(KeyCode.Z) && NkInputManager.GetKey(KeyCode.LeftShift)) { GameObject gameObject = GameObject.Find("back light"); if (gameObject != null) { gameObject.SetActive(false); } } if (NkInputManager.GetKeyUp(KeyCode.Q) && NkInputManager.GetKey(KeyCode.LeftShift)) { NrTSingleton <FormsManager> .Instance.ShowForm(G_ID.QUEST_GM_DLG); } if (NkInputManager.GetKeyUp(KeyCode.C) && NkInputManager.GetKey(KeyCode.LeftShift)) { Screen.fullScreen = !Screen.fullScreen; } if (NkInputManager.GetKeyUp(KeyCode.C) && NkInputManager.GetKey(KeyCode.RightShift)) { NkWorldMapATB worldMapATB = NrTSingleton <MapManager> .Instance.GetWorldMapATB(); if (worldMapATB != null) { worldMapATB.ShowCellGrid(); } } if (NkInputManager.GetKeyUp(KeyCode.U) && NkInputManager.GetKey(KeyCode.RightShift)) { GUICamera.ShowUI_Toggle(); } if (NkInputManager.GetKeyUp(KeyCode.D) && NkInputManager.GetKey(KeyCode.LeftShift)) { if (!NrTSingleton <FormsManager> .Instance.IsShow(G_ID.MESSAGE_DLG)) { NrTSingleton <FormsManager> .Instance.ShowForm(G_ID.MESSAGE_DLG); } else { NrTSingleton <FormsManager> .Instance.Hide(G_ID.MESSAGE_DLG); } } if (NkInputManager.GetKey(KeyCode.LeftShift) && NkInputManager.GetKey(KeyCode.LeftControl) && NkInputManager.GetKeyUp(KeyCode.D)) { NrTSingleton <MapManager> .Instance.ShowDestPosition(true); } if (NkInputManager.GetKey(KeyCode.LeftShift) && NkInputManager.GetKey(KeyCode.LeftAlt) && NkInputManager.GetKeyUp(KeyCode.D)) { NrTSingleton <MapManager> .Instance.ShowDestPosition(false); } if (NkInputManager.GetKeyDown(KeyCode.Alpha1) && NkInputManager.GetKey(KeyCode.LeftShift) && Scene.CurScene != Scene.Type.BATTLE) { NrTSingleton <NkCharManager> .Instance.ToggleShowCharUnique(); NrTSingleton <NkQuestManager> .Instance.ToggleQeustUnique(); } if (NkInputManager.GetKeyDown(KeyCode.P) && NkInputManager.GetKey(KeyCode.LeftShift)) { NrTSingleton <NrAutoPath> .Instance.ShowRPPoint(); } if (NkInputManager.GetKeyDown(KeyCode.P) && NkInputManager.GetKey(KeyCode.RightShift)) { NrTSingleton <NrAutoPath> .Instance.ClearRPPoint(); } if (!NkInputManager.GetKey(KeyCode.LeftAlt) || NkInputManager.GetKeyUp(KeyCode.K)) { } if (NkInputManager.GetKeyUp(KeyCode.S) && NkInputManager.GetKey(KeyCode.LeftShift)) { if (!NrTSingleton <FormsManager> .Instance.IsShow(G_ID.DLG_AUDIO)) { NrTSingleton <FormsManager> .Instance.ShowForm(G_ID.DLG_AUDIO); } else { NrTSingleton <FormsManager> .Instance.Hide(G_ID.DLG_AUDIO); } } if (!NkInputManager.GetKeyUp(KeyCode.Alpha2) || NkInputManager.GetKey(KeyCode.LeftShift)) { } if (NkInputManager.GetKeyUp(KeyCode.A) && NkInputManager.GetKey(KeyCode.LeftShift) && !Scene.IsCurScene(Scene.Type.SOLDIER_BATCH)) { SoldierBatch.SOLDIER_BATCH_MODE = eSOLDIER_BATCH_MODE.MODE_GUILDBOSS_MAKEUP; SoldierBatch.GUILDBOSS_INFO.m_i16Floor = 1; FacadeHandler.PushStage(Scene.Type.SOLDIER_BATCH); } }
public void Update() { if (!EventTriggerMiniCamera._bUseControll) { return; } if (NkInputManager.GetKeyUp(KeyCode.KeypadEnter)) { EventTriggerMiniCamera.m_bControllPosition = !EventTriggerMiniCamera.m_bControllPosition; } if (NkInputManager.GetKey(KeyCode.Keypad8)) { if (EventTriggerMiniCamera.m_bControllPosition) { base.gameObject.transform.localPosition += base.gameObject.transform.up.normalized * EventTriggerMiniCamera.m_Reaction; } else { base.gameObject.transform.localEulerAngles += new Vector3(-EventTriggerMiniCamera.m_Reaction, 0f, 0f); } } if (NkInputManager.GetKey(KeyCode.Keypad2)) { if (EventTriggerMiniCamera.m_bControllPosition) { base.gameObject.transform.localPosition -= base.gameObject.transform.up.normalized * EventTriggerMiniCamera.m_Reaction; } else { base.gameObject.transform.localEulerAngles += new Vector3(EventTriggerMiniCamera.m_Reaction, 0f, 0f); } } if (NkInputManager.GetKey(KeyCode.Keypad4)) { if (EventTriggerMiniCamera.m_bControllPosition) { base.gameObject.transform.localPosition -= base.gameObject.transform.right.normalized * EventTriggerMiniCamera.m_Reaction; } else { base.gameObject.transform.localEulerAngles += new Vector3(0f, -EventTriggerMiniCamera.m_Reaction, 0f); } } if (NkInputManager.GetKey(KeyCode.Keypad6)) { if (EventTriggerMiniCamera.m_bControllPosition) { base.gameObject.transform.localPosition += base.gameObject.transform.right.normalized * EventTriggerMiniCamera.m_Reaction; } else { base.gameObject.transform.localEulerAngles += new Vector3(0f, EventTriggerMiniCamera.m_Reaction, 0f); } } if (NkInputManager.GetKey(KeyCode.KeypadPeriod)) { if (EventTriggerMiniCamera.m_bControllPosition) { base.gameObject.transform.localPosition += base.gameObject.transform.forward.normalized * EventTriggerMiniCamera.m_Reaction; } else { base.gameObject.transform.localEulerAngles += new Vector3(0f, 0f, EventTriggerMiniCamera.m_Reaction); } } if (NkInputManager.GetKey(KeyCode.Keypad0)) { if (EventTriggerMiniCamera.m_bControllPosition) { base.gameObject.transform.localPosition -= base.gameObject.transform.forward.normalized * EventTriggerMiniCamera.m_Reaction; } else { base.gameObject.transform.localEulerAngles += new Vector3(0f, 0f, -EventTriggerMiniCamera.m_Reaction); } } if (NkInputManager.GetKey(KeyCode.KeypadPlus)) { EventTriggerMiniCamera.m_Reaction += 0.25f; } if (NkInputManager.GetKey(KeyCode.KeypadMinus)) { EventTriggerMiniCamera.m_Reaction -= 0.25f; } if (NkInputManager.GetMouseButton(0)) { base.gameObject.transform.localEulerAngles += new Vector3(-NkInputManager.GetAxisRaw("Mouse Y"), NkInputManager.GetAxisRaw("Mouse X"), 0f); } if (NkInputManager.GetMouseButton(1)) { base.gameObject.transform.localEulerAngles += new Vector3(0f, 0f, NkInputManager.GetAxisRaw("Mouse X")); } if (NkInputManager.GetAxis("Mouse ScrollWheel") != 0f) { base.gameObject.transform.localPosition -= base.gameObject.transform.forward.normalized * NkInputManager.GetAxis("Mouse ScrollWheel"); } }
public void InputKeyBoard() { if (this.m_Battle.CastedTarget == null) { return; } if (this.m_Battle.CastedTarget.InputControlTrigger) { return; } if (NrTSingleton <UIManager> .Instance.FocusObject != null) { return; } if (!TsPlatform.IsEditor) { return; } NkBattleChar currentSelectChar = this.m_Battle.CastedTarget.GetCurrentSelectChar(); if (currentSelectChar != null && NkInputManager.GetKeyUp(KeyCode.Alpha1)) { int battleSkillUnique = currentSelectChar.GetSoldierInfo().SelectBattleSkillByWeapon(1); if (this.m_Battle.CastedTarget.CanSelecActionBattleSkill(battleSkillUnique)) { this.m_Battle.CastedTarget.m_iBattleSkillIndex = 1; this.m_Battle.CastedTarget.REQUEST_ORDER = eBATTLE_ORDER.eBATTLE_ORDER_SKILL; this.m_Battle.CastedTarget.ShowBattleSkillRange(true, battleSkillUnique); } } if (NkInputManager.GetKeyUp(KeyCode.R) && this.m_Battle.CastedTarget.CurrentTurnAlly == this.m_Battle.CastedTarget.MyAlly) { this.m_Battle.CastedTarget.REQUEST_ORDER = eBATTLE_ORDER.eBATTLE_ORDER_CHANGEPOS; Main_UI_SystemMessage.ADDMessage(NrTSingleton <NrTextMgr> .Instance.GetTextFromNotify("364"), SYSTEM_MESSAGE_TYPE.IMPORTANT_MESSAGE); } if (NkInputManager.GetKeyUp(KeyCode.Tab) && this.m_Battle.CastedTarget.CurrentTurnAlly == this.m_Battle.CastedTarget.MyAlly) { this.m_Battle.CastedTarget.SelectNextChar(); } if (NkInputManager.GetKeyUp(KeyCode.Z)) { this.m_Battle.CastedTarget.Send_GS_BF_HOPE_TO_ENDTURN_REQ(); } if (NkInputManager.GetKeyUp(KeyCode.X)) { Battle_Control_Dlg battle_Control_Dlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.BATTLE_CONTROL_DLG) as Battle_Control_Dlg; if (battle_Control_Dlg == null) { return; } battle_Control_Dlg.RequestRetreat(); } if (NkInputManager.GetKeyUp(KeyCode.V) && TsPlatform.IsEditor) { this.m_Battle.CastedTarget.ChangeBattleAuto(); } if (NkInputManager.GetKeyUp(KeyCode.C)) { } if (!NkInputManager.GetKey(KeyCode.LeftShift) || NkInputManager.GetKeyUp(KeyCode.M)) { } if (!NkInputManager.GetKey(KeyCode.LeftShift) || NkInputManager.GetKeyUp(KeyCode.N)) { } }