using UnityEngine; /// /// This class uses the singleton to access the distance property. /// public class MyOtherClass : MonoBehaviour { /// /// Draws two buttons to move the camera closer and further away /// from the target object. /// void OnGUI() { GUILayout.BeginVertical(); if (GUILayout.Button("Closer")) { Singleton.instance.distance--; } if (GUILayout.Button("Further")) { Singleton.instance.distance++; } GUILayout.EndVertical(); } }