using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraInformation : MonoBehaviour
{
public string currentCameraState;
// Start is called before the first frame update
void Start()
{
var components = new List<Component>();
foreach (var component in GetComponents<Component>())
{
if (component != this)
{
var fullName = component.GetType().FullName;
if (fullName.StartsWith("Cinemachine"))
{
currentCameraState = component.
}
}
}
}
// Update is called once per frame
void Update()
{
}
private void OnEnable()
{
}
private void OnDisable()
{
}
}
At this line I want to assign the string the component status if it's enabled true or false.
Component
types in Unity have an enabled state. what specific components do you want to check for? it looks like the relevant Cinemachine types all derive fromMonoBehaviour
, which has anenabled
property you can read, as the barest glance at the documentation would confirm. Did you try searching forMonoBehaviour
instead ofComponent
? \$\endgroup\$