public override void DoAction(PEActionParam para) { if (null == mRopeGun) { return; } if (!viewCmpt.hasView) { return; } m_LastHookPos = mRopeGun.hook.position; motionMgr.SetMaskState(PEActionMask.RopeGunShoot, true); mState = HookGunState.Shooting; m_ShootDir = (ikCmpt.aimTargetPos - mRopeGun.gunMuzzle.position).normalized; m_CurrentMoveIndex = 0; PeCamera.SetFloat("Sensitivity Multiplier", 0); AudioManager.instance.Create(mRopeGun.gunMuzzle.position, mRopeGun.fireSound); // Collider[] hitInfos = Physics.OverlapSphere(mRopeGun.gunMuzzle.position, 0.2f, mRopeGun.effectLayer.value, QueryTriggerInteraction.Ignore); // for(int i = 0; i < hitInfos.Length; ++i) // { // if(!hitInfos[i].transform.IsChildOf(entity.transform)) // { // mState = HookGunState.Null; // return; // } // } }
public override void DoAction(PEActionParam para = null) { motionMgr.SetMaskState(PEActionMask.GetOnTrain, true); PEActionParamS paramS = para as PEActionParamS; mAnim = paramS.str; if (null != equipCmpt) { equipCmpt.HideEquipmentByVehicle(true); } if (!string.IsNullOrEmpty(mAnim) && null != anim) { anim.SetBool(mAnim, true); } if (null != viewCmpt) { viewCmpt.ActivateInjured(false); } if (null != ikCmpt) { ikCmpt.ikEnable = false; } if (motionMgr.Entity == MainPlayer.Instance.entity) { PeCamera.SetBool("OnMonorail", true); } }
void uLink_OnDisconnectedFromServer(uLink.NetworkDisconnection mode) { MessageBox_N.CancelMask(MsgInfoType.ServerLoginMask); if (mode == uLink.NetworkDisconnection.LostConnection) { if (LogFilter.logDebug) { Debug.Log("Lost connection"); } else if (LogFilter.logDebug) { Debug.Log("Disconnected. Mode:" + mode); } } RolesInGame.Clear(); if (null != OnDisconnectEvent) { OnDisconnectEvent(); } Cursor.lockState = Screen.fullScreen? CursorLockMode.Confined: CursorLockMode.None; Cursor.visible = true; PeCamera.SetVar("ForceShowCursor", true); }
public static void PlayHitEffect(float hpDrop) { if (hpDrop > 1) { inst.Hit(hpDrop); PeCamera.PlayShakeEffect(0, 0.2f, 0); } }
void PeLauncher.ILaunchable.Launch() { Object.Instantiate(Resources.Load <GameObject>("Prefab/GameUI/MinmapCamera")).name = "MinmapCamera"; Camera.main.gameObject.AddComponent <GlobalGLs>(); Camera.main.transform.position = Pathea.PlayerSpawnPosProvider.Instance.GetPos(); PeCamera.SetGlobalVector("Default Anchor", Pathea.PlayerSpawnPosProvider.Instance.GetPos()); PeCamera.RecordHistory(); }
void HandleAliveEntityHpChange(SkillSystem.SkEntity caster, float hpChange) { if (hpChange < 0) { Hit(-hpChange); PeCamera.PlayShakeEffect(0, 0.2f, 0); } }
void FixedUpdate() { // 旋转 if (_rotatable) { UpdateRotation(); } // 刷新CD _remainTime -= Time.deltaTime; // 开火 if (_controller.isPlayerHost && _controller.isAttackMode && _remainTime <= 0f && (_weaponType == WeaponType.AI || _controller.IsWeaponGroupEnabled(_groupIndex)) && _controller.IsWeaponControlEnabled(_weaponType) && _controller.isEnergyEnough(_energyPerShot)) { _controller.StartSkill(_skillId, _weaponParam); _controller.ExpendEnergy(_energyPerShot); _currentMuzzleIndex = (_currentMuzzleIndex + 1) % _muzzles.Length; _bulletsCount++; if (_bulletsCount == _groupBulletsCount) { _bulletsCount = 0; _remainTime = _groupIntervalTime; } else { _remainTime = _intervalTime; } if (_cameraShakeRange > 0) { PeCamera.PlayAttackShake(); } } else { if (_remainTime <= -_groupIntervalTime) { _bulletsCount = 0; _remainTime = 0f; } } }
// public static void CamFOV(float v) // { //// if (null == m_Controller || null == m_Controller.m_TargetCam) //// { //// return; //// } // // m_Controller.m_TargetCam.fieldOfView = v; // m_Controller.SaveParams(); // } public static void ApplySysSetting() { if (Camera.main == null) { return; } AAEnable(SystemSettingData.Instance.mAntiAliasing > 0); DepthScEnable(SystemSettingData.Instance.mDepthBlur); SSAOEnable(SystemSettingData.Instance.mSSAO); Camera.main.hdr = SystemSettingData.Instance.HDREffect; PeCamera.SetVar("Camera Inertia", SystemSettingData.Instance.CamInertia); PeCamera.SetVar("Drive Camera Inertia", SystemSettingData.Instance.DriveCamInertia); //log: lz-2016.05.18 功能 #1924在Options内增加载具的摄像机跟随灵敏度调整功能 // CamFOV(SystemSettingData.Instance.CameraFov); }
void OnEndAction() { motionMgr.SetMaskState(PEActionMask.RopeGunShoot, false); if (null != m_Audio) { GameObject.Destroy(m_Audio.gameObject); } PeCamera.SetFloat("Sensitivity Multiplier", 1f); if (Vector3.SqrMagnitude(trans.position - m_LastHookPos) > 40000f) { trans.position = m_LastHookPos + 2f * Vector3.up; } motionMgr.StartCoroutine(FixPhyError()); ResetPhy(); ResetLine(); }
// Cons & Des void Awake() { string gfxName = SystemInfo.graphicsDeviceName; string cpuName = SystemInfo.processorType; Debug.Log("[processorType]:" + cpuName); Debug.Log("[graphicsDeviceName]:" + gfxName); if (gfxName.Contains("Intel")) { if (gfxName.Contains("HD")) // No include Iris { BadGfxDeviceName = gfxName; } } else if (gfxName.Contains("Radeon")) { if (cpuName.Contains("APU")) { if (cpuName.Contains("HD") && gfxName.Contains("HD")) { BadGfxDeviceName = gfxName; } else // Check Rx graphics { string rx = "Rx Graphics"; string sub = cpuName.Substring(cpuName.Length - rx.Length); if (gfxName.Contains(sub)) { BadGfxDeviceName = gfxName; } } } } DontDestroyOnLoad(this.gameObject); LocalDatabase.LoadAllData(); SystemSettingData.Instance.LoadSystemData(); SurfExtractorsMan.CheckGenSurfExtractor(); PeLogicGlobal.Instance.Init(); PeCamera.Init(); StartCoroutine(Behave.Runtime.BTResolver.ApplyCacheBt()); }
public override void EndImmediately() { motionMgr.SetMaskState(PEActionMask.GetOnTrain, false); if (null != equipCmpt) { equipCmpt.HideEquipmentByVehicle(false); } if (!string.IsNullOrEmpty(mAnim) && null != anim) { anim.SetBool(mAnim, false); } if (null != viewCmpt) { viewCmpt.ActivateInjured(true); } if (null != ikCmpt) { ikCmpt.ikEnable = true; } if (motionMgr.Entity == MainPlayer.Instance.entity) { PeCamera.SetBool("OnMonorail", false); } }
void Lobby_OnDisconnected() { MessageBox_N.CancelMask(MsgInfoType.LobbyLoginMask); if (LogFilter.logDebug) { Debug.Log("Disconnected from lobby server"); } if (null != OnLobbyDisconnectedEvent) { OnLobbyDisconnectedEvent(); } Cursor.lockState = Screen.fullScreen? CursorLockMode.Confined: CursorLockMode.None; Cursor.visible = true; PeCamera.SetVar("ForceShowCursor", true); NetworkInterface.Disconnect(); if (Pathea.PeFlowMgr.Instance != null && Pathea.PeFlowMgr.Instance.curScene != Pathea.PeFlowMgr.EPeScene.MainMenuScene) { Pathea.PeFlowMgr.Instance.LoadScene(Pathea.PeFlowMgr.EPeScene.MainMenuScene, false); } }
void LateUpdate() { PeCamera.Update(); currentSceneName = Application.loadedLevelName; SurfExtractorsMan.PostProc(); }
void FadeIn(float speed) { PeCamera.CrossFade("Cutscene Blend", 1, speed); }
void FadeOut(float speed) { PeCamera.CrossFade("Cutscene Blend", 0, speed); }
public override void ApplyCamEff(int camEffId, SkRuntimeInfo info) { base.ApplyCamEff(camEffId, info); PeCamera.ApplySkCameraEffect(camEffId, this); }
public void OnMsg(EMsg msg, params object[] args) { switch (msg) { case EMsg.View_Prefab_Build: BiologyViewCmpt obj = args [0] as BiologyViewCmpt; // TestHitBack hitBack = obj.GetComponentInChildren<TestHitBack> (); // if (null != hitBack) { // hitBack.cam = Camera.main; // obj.transform.position += 1.3f * Vector3.up; // } m_PhyCtrl = obj.monoPhyCtrl; if (obj.monoModelCtrlr != null) { _camTarget = obj.monoModelCtrlr.transform.Find("CamTarget"); } if (obj.monoModelCtrlr != null) { _bneckModel = obj.monoModelCtrlr.transform.Find("Bip01/Bip01 Pelvis/Bip01 Spine1/Bip01 Spine2/Bip01 Spine3/Bip01 Neck"); } if (obj.monoRagdollCtrlr != null) { _bneckRagdoll = obj.monoRagdollCtrlr.transform.Find("Bip01/Bip01 Pelvis/Bip01 Spine1/Bip01 Spine2/Bip01 Spine3/Bip01 Neck"); } if (null != UILoadScenceEffect.Instance && UILoadScenceEffect.Instance.isInProgress) { StartInvincible(); } InitReputationSystem(); Invoke("ResetFirstCtrl", 1f); break; //case EMsg.View_Model_Build: // break; case EMsg.Camera_ChangeMode: PeCamera.cameraModeData = args [0] as CameraModeData; break; case EMsg.Battle_EnterShootMode: m_InShootMode = true; if (null != TestPEEntityCamCtrl.Instance && null != mView.modelTrans) { TestPEEntityCamCtrl.Instance.SetCamMode(PETools.PEUtil.GetChild(mView.modelTrans, "CamTarget"), PETools.PEUtil.GetChild(mView.modelTrans, "Bip01 Neck"), "3rd Person Shoot"); } if (null != UISightingTelescope.Instance) { UISightingTelescope.Instance.Show((UISightingTelescope.SightingType)args [0]); } //lz-2018.01.18 改变持枪状态,改变相机灵敏度的返回值 SystemSettingData.Instance.holdGun = true; break; case EMsg.Battle_ExitShootMode: m_InShootMode = false; if (null != TestPEEntityCamCtrl.Instance) { TestPEEntityCamCtrl.Instance.SetCamMode(PETools.PEUtil.GetChild(mView.modelTrans, "CamTarget"), PETools.PEUtil.GetChild(mView.modelTrans, "Bip01 Neck"), "Normal Mode F1"); } if (null != UISightingTelescope.Instance) { UISightingTelescope.Instance.ExitShootMode(); } SystemSettingData.Instance.holdGun = false; break; case EMsg.Battle_OnShoot: if (null != UISightingTelescope.Instance) { UISightingTelescope.Instance.OnShoot(); } break; case EMsg.UI_ShowChange: m_DisableActionByUI = (bool)args [0]; if (m_DisableActionByUI && mEquip.ISAimWeapon) { mEquip.ActiveWeapon(false); // for(PEActionType type = PEActionType.Move; type <= PEActionType.Stuned; type++) // mMotionMgr.EndImmediately(type); } break; case EMsg.Build_BuildMode: bool enterBuildMode = (bool)args [0]; if (enterBuildMode) { GameUIMode.Instance.GotoBuildMode(); } else { GameUIMode.Instance.GotoBaseMode(); } PeCamera.SetVar("Build Mode", enterBuildMode); if (null != onBuildMode) { onBuildMode(enterBuildMode); } break; case EMsg.Battle_OnAttack: if (null != onEquipmentAttack) { onEquipmentAttack((int)args [2]); } PeEventGlobal.Instance.MainPlayerAttack.Invoke(Entity, (AttackMode)args [0]); break; //case EMsg.Battle_HPChange: // SkEntity skEntity = (SkEntity)args[0]; // float damage = (float)args[1]; // if (skEntity != null && damage < PETools.PEMath.Epsilon) // { // OnDamage(skEntity, Mathf.Abs(damage)); // } // break; case EMsg.Action_DurabilityDeficiency: if (null != onDurabilityDeficiency) { onDurabilityDeficiency(); } break; } }
// Use this for initialization void Start() { PeCamera.SetTransform(VarName, this.transform); }
// Update is called once per frame void Update() { PeCamera.SetTransform(VarName, this.transform); }
void HandleLog(string logString, string stackTrace, LogType type) { #if SAVE_GAME_LOG if (Logs == null) { Logs = new List <GameLogNode> (); } bool found = false; for (int i = 0; i < Logs.Count; i++) { if (Logs[i].Type == type && Logs[i].LogString == logString && Logs[i].StackTrace == stackTrace) { Logs[i].Count = Logs[i].Count + 1; found = true; break; } } if (!found) { GameLogNode log = new GameLogNode(); log.LogTime = DateTime.Now; log.LogString = logString; log.StackTrace = stackTrace; log.Type = type; log.Count = 1; Logs.Add(log); // If there are many logs, delete old and useless log. if (Logs.Count > 512) { for (int i = 0; i < Logs.Count; i++) { if (Logs[i].Type == LogType.Log) { Logs.RemoveAt(i); break; } } } } #endif // // Catch Null pointer error. // // !!!!! DO NOT Delete !!!!! // if (type == LogType.Assert || type == LogType.Error || type == LogType.Exception) { if (string.IsNullOrEmpty(_strRuntimeError)) { int ex_pos = logString.IndexOf("Exception"); int line_end = logString.IndexOf("\n"); if (line_end < 0) { line_end = logString.Length; } if (ex_pos >= 0 && ex_pos < line_end) { _strListInUse = SystemSettingData.Instance.IsChinese ? c_strListCn : c_strListEn; if (logString.Contains("OclKernelError")) { _strRuntimeError = _strListInUse[(int)EStr.OclError]; } else if (logString.Contains("IOException: Win32 IO returned 112.") || logString.Contains("IOException: Disk full.")) { _strRuntimeError = _strListInUse[(int)EStr.NotEnoughSpace] + "\r\n\r\n" + logString + "\r\n" + stackTrace; } else if (logString.Contains("SaveDataCorrupt")) { _strRuntimeError = _strListInUse[(int)EStr.CorruptSave] + "\r\n\r\n" + logString + "\r\n" + stackTrace; } else if (logString.Contains("FilesCorrupt") || logString.Contains("IO.EndOfStreamException")) { _strRuntimeError = _strListInUse[(int)EStr.CorruptFile] + "\r\n\r\n" + logString + "\r\n" + stackTrace; } else if (logString.Contains("IO.FileNotFoundException")) { _strRuntimeError = _strListInUse[(int)EStr.FileNotFound] + "\r\n\r\n" + logString + "\r\n" + stackTrace; } else if (logString.Contains("UnauthorizedAccessException")) { _strRuntimeError = _strListInUse[(int)EStr.NoAuthority] + "\r\n\r\n" + logString + "\r\n" + stackTrace; } else if (logString.Contains("DllNotFoundException")) { _strRuntimeError = _strListInUse[(int)EStr.MissingNetFramework]; } else { _strRuntimeError = logString + "\r\n\r\n" + stackTrace; } _lastLogTime = DateTime.Now; // Force disp cursor try{ Cursor.lockState = Screen.fullScreen? CursorLockMode.Confined: CursorLockMode.None; Cursor.visible = true; PeCamera.SetVar("ForceShowCursor", true); }catch {} } } } }