Test #1
+15
-3
@@ -143,6 +143,9 @@ local function update_facecam(cam, settings)
|
||||
if scroll ~= 0 then distance = distance - scroll * 0.2 end
|
||||
distance = math.max(0.5, math.min(5, distance))
|
||||
_G.__FC_FACE_DISTANCE = distance
|
||||
if scroll ~= 0 then
|
||||
show_ui('<color=#00FF88><b>[FaceCam: ON]</b> Distance: ' .. string.format('%.1f', distance) .. '</color>')
|
||||
end
|
||||
local target = head.position
|
||||
local anchor = _G.__FC_FACE_ANCHOR
|
||||
if not anchor or anchor.transform.parent ~= head then
|
||||
@@ -322,6 +325,7 @@ function _G.__FREECAM_TICK()
|
||||
show_ui("<color=#00FF88><b>[FreeCam: ON]</b> Speed: " .. string.format("%.1f", _G.__FREECAM_SPEED) .. " | Arrows: Fly | PgUp/PgDn: Up/Down | RMB: Look</color>")
|
||||
end
|
||||
else
|
||||
local settings = _G.__GAC_CAMERA_SETTINGS or {mode="freecam"}
|
||||
if cam then
|
||||
set_cinemachine_enabled(cam, true)
|
||||
end
|
||||
@@ -329,12 +333,13 @@ function _G.__FREECAM_TICK()
|
||||
_G.__FC_FACE_ENTITY = nil
|
||||
_G.__FC_FACE_DISTANCE, _G.__FC_FACE_LOCAL_FORWARD = nil, nil
|
||||
if _G.__FC_FACE_ANCHOR then CS.UnityEngine.Object.Destroy(_G.__FC_FACE_ANCHOR); _G.__FC_FACE_ANCHOR = nil end
|
||||
show_ui(rainbow_watermark(Time.unscaledTime or 0))
|
||||
local label = settings.mode == 'facecam' and 'FaceCam' or 'FreeCam'
|
||||
show_ui('<color=#00FF88><b>[' .. label .. ': OFF]</b></color>')
|
||||
end
|
||||
end
|
||||
|
||||
local now = Time.unscaledTime or 0
|
||||
if not _G.__FREECAM_ENABLED or now >= (_G.__FC_STATUS_UNTIL or 0) then
|
||||
if now >= (_G.__FC_STATUS_UNTIL or 0) then
|
||||
if now >= (_G.__FC_WATERMARK_NEXT or 0) then
|
||||
_G.__FC_WATERMARK_NEXT = now + 0.05
|
||||
show_ui(rainbow_watermark(now))
|
||||
@@ -387,9 +392,11 @@ function _G.__FREECAM_TICK()
|
||||
|
||||
-- Raw Unity mouse input remains available to the camera while
|
||||
-- InControl battle clicks are gated separately below.
|
||||
local cameraAdjusted = false
|
||||
if Input.GetMouseButton(1) then
|
||||
local rotX = Input.GetAxis("Mouse X") or 0
|
||||
local rotY = Input.GetAxis("Mouse Y") or 0
|
||||
cameraAdjusted = rotX ~= 0 or rotY ~= 0
|
||||
_G.__FC_EULER = Vector3(_G.__FC_EULER.x - rotY * 2.5,
|
||||
_G.__FC_EULER.y + rotX * 2.5, 0)
|
||||
end
|
||||
@@ -426,6 +433,11 @@ function _G.__FREECAM_TICK()
|
||||
|
||||
if move.sqrMagnitude > 0.0001 then
|
||||
_G.__FC_POS = _G.__FC_POS + move.normalized * (_G.__FREECAM_SPEED * dt)
|
||||
cameraAdjusted = true
|
||||
end
|
||||
if cameraAdjusted and now >= (_G.__FC_INDICATOR_NEXT or 0) then
|
||||
_G.__FC_INDICATOR_NEXT = now + 0.1
|
||||
show_ui('<color=#00FF88><b>[FreeCam: ON]</b> Speed: ' .. string.format('%.1f', _G.__FREECAM_SPEED) .. '</color>')
|
||||
end
|
||||
|
||||
-- Enforce locked free camera transform EVERY frame
|
||||
@@ -452,7 +464,7 @@ if not _G.__FREECAM_REGISTERED then
|
||||
pcall(function() CS.UnityEngine.Application.onBeforeRender = CS.UnityEngine.Application.onBeforeRender + function() _G.__FREECAM_TICK() end end)
|
||||
end
|
||||
|
||||
if not _G.__FREECAM_ENABLED then
|
||||
if not _G.__FREECAM_ENABLED and (Time.unscaledTime or 0) >= (_G.__FC_STATUS_UNTIL or 0) then
|
||||
show_ui(rainbow_watermark(Time.unscaledTime or 0))
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user