Firstborn/Library/PackageCache/com.unity.cinemachine@2.8.9/Samples~/Cinemachine Example Scenes/Scenes/CameraMagnets/CameraMagnetProperty.cs
Schaken-Mods b486678290 Library -Artifacts
Library -Artifacts
2023-03-28 12:24:16 -05:00

28 lines
623 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[ExecuteInEditMode]
public class CameraMagnetProperty : MonoBehaviour
{
[Range(0.1f, 50.0f)]
public float MagnetStrength = 5.0f;
[Range(0.1f, 50.0f)]
public float Proximity = 5.0f;
public Transform ProximityVisualization;
[HideInInspector] public Transform myTransform;
void Start()
{
myTransform = transform;
}
void Update()
{
if (ProximityVisualization != null)
ProximityVisualization.localScale = new Vector3(Proximity * 2.0f, Proximity * 2.0f, 1);
}
}