- Home /
Question by
alakt · Feb 20 at 09:38 PM ·
visualstudio
[SerializeField] variable not showing up in inspector
I'm using Unity 2020.3 and here's my code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class PlaneCanvas : MonoBehaviour
{
[SerializeField] private Toggle horizontalPlaneToggle;
[SerializeField] private Button startButton;
private ARPlane arPlane;
public bool HorizontalPlaneToggle
{
get => horizontalPlaneToggle.isOn;
set
{
horizontalPlaneToggle.isOn = value;
CheckIfAllAreTrue();
}
}
private void OnEnable()
{
arPlane = FindObjectOfType<ARPlane>();
arPlane.OnHorizontalPlaneFound += () => HorizontalPlaneToggle = true;
}
private void OnDisable()
{
arPlane.OnHorizontalPlaneFound -= () => HorizontalPlaneToggle = true;
}
private void CheckIfAllAreTrue()
{
if (HorizontalPlaneToggle)
startButton.interactable = true;
}
}
but as you can see in this picture nothing happens in the inspector.
screenshot-2022-02-21-000317.jpg
(34.4 kB)
Comment
Your answer
Follow this Question
Related Questions
monodevelop vs visual studio? 1 Answer
Visual Studio Form in unity3d 2 Answers
GetAllAssetPaths : System.Security.SecurityException 1 Answer
MSVSC2013: failed to find SLN File 4 Answers