private void SetCameraNpcDialogueCameraView(Transform target) { Camera mainCam = Camera.main; if (mainCam != null && mainCam.GetComponent <PlayerCameraComponent>()) { PlayerCameraComponent playerCam = mainCam.GetComponent <PlayerCameraComponent>(); playerCam.EnterNpcCameraMotion(target.gameObject); } }
void ResetPlayerCameraState() { Camera mainCam = Camera.main; if (mainCam != null && mainCam.GetComponent <PlayerCameraComponent>()) { PlayerCameraComponent playerCam = mainCam.GetComponent <PlayerCameraComponent>(); playerCam.ResetCameraState(); } }
public static void OpenSceneCamera() { #if UNITY_ANDROID //Debug.Log("OpenSceneCamera"); PlayerCameraComponent playerCamera = CameraBase.GetInstance() as PlayerCameraComponent; if (playerCamera != null) { playerCamera.GetComponent <Camera>().enabled = true; } #endif }
private void OnTriggerExit(Collider collision) { if (!playerController._isLocalPlayer) { return; } GameObject other = collision.gameObject; string npc_id = other.name; if (SceneLogicManager.CurrentSceneLogic != null) { string scene_name = SceneLogicManager.CurrentSceneLogic.CurrentSceneName; if (IsFunctionNPC(npc_id, scene_name)) { if (PlayerController.onCollisionExit != null) { PlayerController.CurNpcCollision = null; PlayerController.onCollisionExit(collision.gameObject.name); } } } LTCameraTrigger ct = other.GetComponent <LTCameraTrigger>(); if (ct != null) { Camera mainCam = getMainCamera(); if (mainCam != null) { PlayerCameraComponent pcc = mainCam.GetComponent <PlayerCameraComponent>(); if (pcc != null) { //pcc.ResetCameraState(); GameCameraParams gameCameraParams = GlobalCameraData.Instance.FindGameCameraParamsByName("game cam default"); CameraLerp motion_lerp = GlobalCameraData.Instance.FindGameCameraLerpByName("dialogue lerp"); List <GameObject> listGO = new List <GameObject>(); listGO.Add(mDMono.gameObject); pcc.EnterInteractionCamera(ref listGO, ref gameCameraParams, motion_lerp); } } } }
public static void SwitchToPlayerCamera(bool isFull) { #if UNITY_ANDROID //Debug.LogFormat("SwitchToPlayerCamera({0})", isFull); if (!isFull) { return; } PlayerCameraComponent playerCamera = CameraBase.GetInstance() as PlayerCameraComponent; if (playerCamera != null) { playerCamera.GetComponent <Camera>().enabled = true; } //if (UICamera.currentCamera) // UICamera.currentCamera.enabled = false; //else //{ // if (UICamera.current) // UICamera.current.cachedCamera.enabled = false; //} #endif }
private void OnTriggerEnter(Collider collision) { if (!playerController._isLocalPlayer || SceneLogicManager.CurrentSceneLogic == null) { return; } GameObject other = collision.gameObject; string npc_id = other.name; string scene_name = SceneLogicManager.CurrentSceneLogic.CurrentSceneName; if (IsFunctionNPC(npc_id, scene_name)) { if (HasUIModel(npc_id, scene_name, "DeliveryDart") && AlliancesManager.Instance.DartData.State == eAllianceDartCurrentState.Transfering) { GlobalMenuManager.Instance.CloseMenu("LTApplyHelpUI"); NpcColliderUI.DeliveryDart(); } else { var ht = Johny.HashtablePool.Claim(); ht.Add("npc", npc_id); ht.Add("scene", scene_name); MainLandEncounterTemplate met = SceneTemplateManager.GetMainLandsNPCData(scene_name, npc_id); if (met.role == "area") { ht.Add("area", true); } if (PlayerController.onCollisionOpen != null) { PlayerController.CurNpcCollision = collision; PlayerController.onCollisionOpen(ht); } } LTCameraTrigger ct = other.GetComponent <LTCameraTrigger>(); if (ct != null) { Camera mainCam = getMainCamera(); if (mainCam != null) { PlayerCameraComponent pcc = mainCam.GetComponent <PlayerCameraComponent>(); if (pcc != null) { if (!string.IsNullOrEmpty(ct.triggerGameCameraParamName)) { GameCameraParams gameCameraParams = GlobalCameraData.Instance.FindGameCameraParamsByName(ct.triggerGameCameraParamName); CameraLerp motion_lerp = GlobalCameraData.Instance.FindGameCameraLerpByName("dialogue lerp"); List <GameObject> listGO = new List <GameObject>(); listGO.Add(mDMono.gameObject); pcc.EnterInteractionCamera(ref listGO, ref gameCameraParams, motion_lerp); } } } else { GameObject cam = GameObject.Find("Main Camera"); if (cam != null) { PlayerCameraComponent pcc = cam.GetComponent <PlayerCameraComponent>(); if (pcc != null) { EB.Debug.Log("Can Find Main Camera!"); if (!string.IsNullOrEmpty(ct.triggerGameCameraParamName)) { GameCameraParams gameCameraParams = GlobalCameraData.Instance.FindGameCameraParamsByName(ct.triggerGameCameraParamName); CameraLerp motion_lerp = GlobalCameraData.Instance.FindGameCameraLerpByName("dialogue lerp"); List <GameObject> listGO = new List <GameObject>(); listGO.Add(mDMono.gameObject); pcc.EnterInteractionCamera(ref listGO, ref gameCameraParams, motion_lerp); } } } } } } else if (other.name.Equals("NPCSpawns_F")) //与决斗场模型碰撞,需移动到出生点 { playerController.transform.position = SceneManager.HeroStart; //如果是角斗场雕像,跳转到初始位置 } else { LTCameraTrigger ct = other.GetComponent <LTCameraTrigger>(); if (ct != null) { Camera mainCam = getMainCamera();//Camera.main; if (mainCam != null) { PlayerCameraComponent pcc = mainCam.GetComponent <PlayerCameraComponent>(); if (pcc != null) { if (!string.IsNullOrEmpty(ct.triggerGameCameraParamName)) { GameCameraParams gameCameraParams = GlobalCameraData.Instance.FindGameCameraParamsByName(ct.triggerGameCameraParamName); CameraLerp motion_lerp = GlobalCameraData.Instance.FindGameCameraLerpByName("dialogue lerp"); List <GameObject> listGO = new List <GameObject>(); listGO.Add(mDMono.gameObject); pcc.EnterInteractionCamera(ref listGO, ref gameCameraParams, motion_lerp); } } } } } }
private void Start() { cc = GetComponent <CharacterController>(); pcc = GetComponent <PlayerCameraComponent>(); }