Exemplo n.º 1
0
        private static void cin_start()
        {
            Vehicle vehicle = null;

            if (uConsole.GetNumParameters() == 1)
            {
                string @string = uConsole.GetString();
                vehicle = Vehicles.FindVehicleWithLabel(@string);
                if (vehicle == null)
                {
                    uConsole.Log("Could not find vehicle with label " + @string);
                    return;
                }
                uConsole.Log("Following " + Localize.Get(vehicle.m_DisplayNameLocKey).ToString() + vehicle.GetTextMeshString().ToString());
            }
            CinemaCamera.SaveStart(vehicle);
        }
Exemplo n.º 2
0
        private static void cin_add()
        {
            CinemaCamera.SaveStart(null); // we do this...
            CinemaCamera.SaveEnd();       //   to trick the main Cinema Camera into thinking it's initiated
            // usage: cin_add <float m_DurationSeconds> <bool m_Ease> <int index>
            float m_DurationSeconds = 5;
            bool  m_Ease            = false;
            int   index             = -1;

            if (uConsole.NextParameterIsFloat())
            {
                m_DurationSeconds = uConsole.GetFloat();
            }
            if (uConsole.NextParameterIsBool())
            {
                m_Ease = uConsole.GetBool();
            }
            if (uConsole.GetNumParameters() == 3 && uConsole.NextParameterIsInt())
            {
                index = Math.Max(0, uConsole.GetInt());
            }

            CameraKeyFrame cam = ModdedCinemaCamera.currentCamera();

            cam.m_DurationSeconds = m_DurationSeconds;
            cam.m_Ease            = m_Ease;
            if (index != -1)
            {
                ModdedCinemaCamera.keyFrames.Insert(index, cam);
                ModdedCinemaCamera.InterpolateHandler.controlPointsList.Insert(index, cam.m_StartPos.normalized);
                ModdedCinemaCamera.PivotHandler.controlPointsList.Insert(index, cam.m_StartPivot);
                uConsole.Log($"Inserted keyframe into position {index} of list.");
            }
            else
            {
                ModdedCinemaCamera.keyFrames.Add(cam);
                ModdedCinemaCamera.InterpolateHandler.controlPointsList.Add(cam.m_StartPos.normalized);
                ModdedCinemaCamera.PivotHandler.controlPointsList.Add(cam.m_StartPivot);
                uConsole.Log("Added keyframe to end of list.");
            }
        }
Exemplo n.º 3
0
        private static void cin_modify()
        {
            CinemaCamera.SaveStart(null); // we do this...
            CinemaCamera.SaveEnd();       //   to trick the main Cinema Camera into thinking it's initiated
            // usage: cin_add <float m_DurationSeconds> <bool m_Ease> <int index>
            int index = ModdedCinemaCamera.keyFrames.Count - 1;

            if (uConsole.NextParameterIsInt())
            {
                index = Mathf.Clamp(uConsole.GetInt(), 0, ModdedCinemaCamera.keyFrames.Count - 1);
            }
            CameraKeyFrame cam = ModdedCinemaCamera.keyFrames[index];

            if (uConsole.NextParameterIsFloat())
            {
                cam.m_DurationSeconds = uConsole.GetFloat();
            }
            if (uConsole.NextParameterIsBool())
            {
                cam.m_Ease = uConsole.GetBool();
            }
            uConsole.Log($"Modified keyframe {index}");
        }
Exemplo n.º 4
0
 // Token: 0x060058E3 RID: 22755
 private static void cin_end_restore()
 {
     CinemaCamera.RestoreEnd();
 }
Exemplo n.º 5
0
 // Token: 0x060058E2 RID: 22754
 private static void cin_end()
 {
     CinemaCamera.SaveEnd();
 }
Exemplo n.º 6
0
 // Token: 0x060058E0 RID: 22752
 private static void cin_start_restore()
 {
     CinemaCamera.RestoreStart();
 }
Exemplo n.º 7
0
            public static bool Prefix(
                ref Vector3 ___m_StartPos,
                ref Vector3 ___m_StartPivot,
                ref float ___m_StartOrthographicSize,
                ref Vector3 ___m_EndPos,
                ref Vector3 ___m_EndPivot,
                ref float ___m_EndOrthographicSize,
                ref Quaternion ___m_EndRot,

                ref float ___m_ElapsedSeconds,
                ref float ___m_TransitionSeconds,
                ref bool ___m_Slerping
                )
            {
                if (CinemaCamera.Activated())
                {
                    if (ModdedCinemaCamera.keyFrames.Count == 0)
                    {
                        CameraInterpolate.Cancel();
                        return(false);
                    }
                    else if (ModdedCinemaCamera.keyFrames.Count < 2)
                    {
                        PopUpWarning.Display("You must add at least 2 keyframes to use the cinematic camera!");
                        CameraInterpolate.Cancel();
                        return(false);
                    }
                    ___m_ElapsedSeconds += Time.unscaledDeltaTime;
                    float num = Mathf.Clamp01(___m_ElapsedSeconds / ___m_TransitionSeconds);


                    Vector3 vector      = ModdedCinemaCamera.PivotHandler.Interpolate(ModdedCinemaCamera.current_start, num);
                    Vector3 normalized3 = ModdedCinemaCamera.InterpolateHandler.Interpolate(ModdedCinemaCamera.current_start, num).normalized;
                    // testing smooth movement
                    PointsOfView.m_Pivot = vector;

                    Cameras.MainCamera().transform.position = vector + normalized3 * GameSettings.CamDistFromPivot();
                    Cameras.MainCamera().transform.LookAt(vector);
                    Cameras.SetOrthographicSize(Mathf.SmoothStep(___m_StartOrthographicSize, ___m_EndOrthographicSize, num));
                    Bridge.RefreshZoomDependentVisibility();
                    if (Mathf.Approximately(num, 1f))
                    {
                        ModdedCinemaCamera.current_start += 1;
                        ModdedCinemaCamera.current_end   += 1;
                        if (ModdedCinemaCamera.current_end >= ModdedCinemaCamera.keyFrames.Count)
                        {
                            CameraInterpolate.Cancel();
                        }
                        else
                        {
                            CameraKeyFrame target = ModdedCinemaCamera.keyFrames[ModdedCinemaCamera.current_end];
                            CameraInterpolate.SlerpTo(
                                target.m_StartPivot,
                                target.m_StartPos,
                                target.m_StartRot,
                                target.m_StartOrthographicSize,
                                target.m_DurationSeconds,
                                target.m_Ease
                                );
                        }
                    }
                    CameraControl.RegisterTransformUpdate();

                    return(false);
                }
                return(true);
            }