private void loadmode1_scene_action_allresource(int sceneID) { this.action_allResource_loaded = delegate { Debug.Log("=>预加载完成(allResources)"); this.action_allResource_loaded = null; this.OnLoadEnd(sceneID); }; LoadingRes.total_resource_num += 10; this.LoadScene(sceneID, delegate { if (!this.IsWorldMapSwitch(sceneID)) { CameraGlobal.DestroyCamera(); } this.DealActionsBeforePreloadRes(); this.PreloadFinish(10); if (this.IsPreloadResourceOn && !this.IsWorldMapSwitch(sceneID)) { LoadingRes.Instance.PreloadAllResource(); } else if (this.action_allResource_loaded != null) { this.action_allResource_loaded.Invoke(); } }); }
public void OnCameraButton(float delta) { CameraGlobal cg = CameraGlobal.Instance; cg.m_CameraDist += delta; cg.m_CameraDist = Mathf.Clamp(cg.m_CameraDist, 4.0f, 18.0f); }
public static void CreateCamera() { CameraGlobal.LoadCameraArea(MySceneManager.Instance.CurSceneID); CameraGlobal.cameraType = CameraType.Follow; CamerasMgr.MainCameraRoot.get_gameObject().AddUniqueComponent <FollowCamera>().OnResetCamera(); EventDispatcher.Broadcast(CameraEvent.CameraInited); CamerasMgr.MainCameraRoot.get_gameObject().AddUniqueComponent <CameraRevolve>(); }
private void OnTriggerEnter(Collider other) { if (!CameraGlobal.IsPlayerRole(other.get_transform())) { return; } CameraGlobal.isAreaPointBActive = true; CameraGlobal.areaPointB = this.pointB; }
protected void Release() { NetworkManager.Instance.ShutDownAllServer(); NetworkService.Instance.Release(); BaseServiceMgr.ReleaseManagers(); UIManagerControl.Instance.HideAll(); UIManagerControl.Instance.HideUI("CloseServerTips"); CityInstance.Instance.HasEnteredCityBefore = false; MySceneManager.Instance.CurSceneID = 0; CameraGlobal.DestroyCamera(); XInputManager.EnabledLogic = true; }
private void OnTriggerExit(Collider other) { if (!CameraGlobal.IsPlayerRole(other.get_transform())) { return; } if (this.isClearWhenExit) { CameraGlobal.isAreaPointBActive = false; CameraGlobal.areaPointB = this.pointB; } }
private bool SetPointBMap(ref Vector3 pointB) { List <float> mapPointB = CameraGlobal.GetMapPointB(); if (mapPointB != null) { pointB = new Vector3(mapPointB.get_Item(0), mapPointB.get_Item(1), mapPointB.get_Item(2)); camera camera = DataReader <camera> .Get("3_0"); this.SetProperties(camera); this.cameraAngleMin = camera.cameraAngleMin; this.cameraAngleMax = camera.cameraAngleMax; this.pointBTypeCurr = PointBType.map; return(true); } return(false); }
void FixedUpdate() { CameraGlobal cg = CameraGlobal.Instance; SystemGlobal sg = SystemGlobal.Instance; if (sg.m_FrozeCamera == true) return; if (!sg.m_Enable3DInput) return; bool md = Input.GetMouseButton(0); float x=0, y=0; if(md==true && m_OldMouseDown==false) { m_MouseOldY = -Input.mousePosition.y; m_MouseOldX = Input.mousePosition.x; m_OldRotation = m_Rotation; m_OldCameraHeight = m_CameraHeight; } if (md == true && m_OldMouseDown == true) { y = -Input.mousePosition.y; x = Input.mousePosition.x; m_Rotation = m_OldRotation + (x - m_MouseOldX); m_CameraHeight = m_OldCameraHeight + (y - m_MouseOldY); m_CameraHeight = Mathf.Clamp(m_CameraHeight, 0, 256.0f); Quaternion q = Quaternion.Euler(0, m_Rotation, 0); Vector3 offset = q * Vector3.forward* cg.m_CameraDist; offset += target.position; offset *= Mathf.Cos(m_CameraHeight / 256.0f); offset.y = cg.m_CameraDist * Mathf.Sin(m_CameraHeight/256.0f); this.transform.position = offset; this.transform.LookAt(target); } if (md == false && m_OldMouseDown == true) { y = Input.mousePosition.y; x = Input.mousePosition.x; } m_OldMouseDown = md; }
static private void Init(CameraGlobal sg) { }