コード例 #1
0
        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);
                    }
                }
            }
        }
コード例 #2
0
        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);
                            }
                        }
                    }
                }
            }
        }