// Use this for initialization void Start() { // Saves time at initialization StartTime = Time.time; // Gets a reference of the HoloCameraController for access his SetCamToCenterDistance( float ) method CamCtrl = gameObject.GetComponent <HoloCameraController>(); }
public override void OnInspectorGUI() { base.OnInspectorGUI(); // The variables and GameObject from the MyGameObject script are displayed in the Inspector with appropriate labels EditorGUILayout.Slider(distCamToCenterProp, minVal, maxVal, new GUIContent("Dist to center")); HoloCameraController camCtrl = target as HoloCameraController; // Calls the method ChangeBoxSize from HoloCameraController for update in edit mode the zoom of PyramidCamera camCtrl.SetCamToCenterDistance(camCtrl.cameraToCenterDistance); // Applies changes to the serializedProperty - always do this at the end of OnInspectorGUI. serializedObject.ApplyModifiedProperties(); }