예제 #1
0
    private void OnChangeMotionType(IComponentEvent componentEvent)
    {
        MotionType          motionType          = m_Property.GetMotionType();
        MainCameraComponent mainCameraComponent = CameraManager.GetInstance().GetMainCamereComponent();

        switch (motionType)
        {
        case MotionType.Mmo:
            if (mainCameraComponent.GetLastCMType() != MainCameraComponent.CMType.Spacecraft &&
                !mainCameraComponent.HasInChanngingCMs(MainCameraComponent.CMType.Spacecraft))
            {
                mainCameraComponent.RequestChangeCM(MainCameraComponent.CMType.Spacecraft);
            }
            break;

        case MotionType.Dof4:
            if (mainCameraComponent.GetLastCMType() != MainCameraComponent.CMType.Jet &&
                !mainCameraComponent.HasInChanngingCMs(MainCameraComponent.CMType.Jet))
            {
                mainCameraComponent.ForceChangeCM(MainCameraComponent.CMType.Jet);
            }
            break;

        case MotionType.Dof6:
            if (mainCameraComponent.GetLastCMType() != MainCameraComponent.CMType.JetSpeedUp &&
                !mainCameraComponent.HasInChanngingCMs(MainCameraComponent.CMType.JetSpeedUp))
            {
                mainCameraComponent.ForceChangeCM(MainCameraComponent.CMType.JetSpeedUp);
            }
            break;

        default:
            break;
        }
    }
    public void ChangeCamera(EnumCMType type)
    {
        if (m_Property.IsMain())
        {
            MainCameraComponent mainCameraComponent = CameraManager.GetInstance().GetMainCamereComponent();
            switch (type)
            {
            case EnumCMType.LeapPrepare:
                mainCameraComponent.RequestChangeCM(MainCameraComponent.CMType.LeapPrepare);
                break;

            case EnumCMType.Leaping:
                mainCameraComponent.RequestChangeCM(MainCameraComponent.CMType.Leaping);
                break;

            case EnumCMType.LeapFinish:
                mainCameraComponent.RequestChangeCM(MainCameraComponent.CMType.LeapFinish);
                break;

            case EnumCMType.Spacecraft:
                if (m_Property.GetMotionMode() == EnumMotionMode.Dof6ReplaceOverload)
                {
                    mainCameraComponent.RequestChangeCM(MainCameraComponent.CMType.Jet);
                }
                else
                {
                    mainCameraComponent.RequestChangeCM(MainCameraComponent.CMType.Spacecraft);
                }
                break;

            default:
                break;
            }
            BehaviorManager.Instance.LogFormat(m_Agent, $"ChangeCamera type:{type}");
        }
    }