1
This commit is contained in:
@@ -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
|
||||
}
|
23
Unity/Extensions/Cinemachine/CinemachineHelper.cs
Normal file
23
Unity/Extensions/Cinemachine/CinemachineHelper.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user