add sniper
This commit is contained in:
@@ -6,7 +6,7 @@ AnimationClip:
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Emety_Bolt
|
||||
m_Name: Emety_BoltAction
|
||||
serializedVersion: 7
|
||||
m_Legacy: 0
|
||||
m_Compressed: 0
|
@@ -5,5 +5,6 @@ using UnityEngine;
|
||||
public class AnimationProperty : MonoBehaviour
|
||||
{
|
||||
public static implicit operator float(AnimationProperty self) => self.value;
|
||||
public float value;
|
||||
[SerializeField]private float value;
|
||||
public float Value => value;
|
||||
}
|
||||
|
@@ -8,10 +8,35 @@ namespace BITKit
|
||||
public class LocationAdditiveElement : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private LocationAdditive locationAdditive;
|
||||
[SerializeField] private Vector3 positionWeight = Vector3.one;
|
||||
[SerializeField] private Vector3 eulerWeight = Vector3.one;
|
||||
private Transform Transform;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
Transform = transform;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
locationAdditive.AddPosition(transform.localPosition);
|
||||
locationAdditive.AddEuler(transform.localEulerAngles);
|
||||
var localPosition = Transform.localPosition;
|
||||
var localEulerAngles = Transform.localEulerAngles;
|
||||
//locationAdditive.AddPosition(transform.localPosition);
|
||||
//locationAdditive.AddEuler(transform.localEulerAngles);
|
||||
locationAdditive.AddPosition(
|
||||
new Vector3
|
||||
{
|
||||
x = localPosition.x * positionWeight.x,
|
||||
y = localPosition.y * positionWeight.y,
|
||||
z = localPosition.z * positionWeight.z
|
||||
});
|
||||
locationAdditive.AddEuler(
|
||||
new Vector3
|
||||
{
|
||||
x = localEulerAngles.x * eulerWeight.x,
|
||||
y = localEulerAngles.y * eulerWeight.y,
|
||||
z = localEulerAngles.z * eulerWeight.z
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -14,7 +14,6 @@ namespace BITKit
|
||||
public class CinemachineHelper : MonoBehaviour
|
||||
{
|
||||
internal static CinemachineHelper Singleton { get; private set; }
|
||||
[SerializeReference, SubclassSelector] public References ads;
|
||||
public float Ads { get; private set; }
|
||||
public CinemachineBrain brain;
|
||||
private void Awake()
|
||||
@@ -24,13 +23,9 @@ namespace BITKit
|
||||
|
||||
private 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;
|
||||
Ads = currentFov / playerConfig.Fov;
|
||||
}
|
||||
if (brain.ActiveVirtualCamera is not CinemachineVirtualCamera currentActive) return;
|
||||
var currentFov = currentActive.m_Lens.FieldOfView;
|
||||
Ads = currentFov / PlayerConfig.Singleton.Fov;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user