コード例 #1
0
    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();
    }
コード例 #2
0
 /// <summary>
 /// Sets the Cam-To-Center distance to value specified in InitZoom field
 /// </summary>
 private void SetInitValues()
 {
     CamCtrl.SetCamToCenterDistance(InitZoom);
 }