This commit is contained in:
CortexCore
2023-06-05 16:25:06 +08:00
parent 9027120bb8
commit 4565ff2e35
2947 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
{
"name": "BITKit.Extensions.Cinemachine",
"rootNamespace": "",
"references": [
"GUID:14fe60d984bf9f84eac55c6ea033a8f4",
"GUID:4307f53044263cf4b835bd812fc161a4",
"GUID:49b49c76ee64f6b41bf28ef951cb0e50"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@@ -0,0 +1,23 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Cinemachine;
namespace BITKit
{
public class CinemachineHelper : MonoBehaviour
{
[SerializeReference, SubclassSelector] public References ads;
public CinemachineBrain brain;
void FixedUpdate()
{
var playerConfig = Data.Get<PlayerConfig>();
var currentActive = brain.ActiveVirtualCamera as CinemachineVirtualCamera;
if (currentActive is not null && playerConfig is not null)
{
var currentFov = currentActive.m_Lens.FieldOfView;
var ads = currentFov / playerConfig.fov;
Data.Set<float>(this.ads, ads);
}
}
}
}