public override void OnInspectorGUI() { EditorGUI.BeginChangeCheck(); comp.PPU = EditorGUILayout.IntField("Pixels Per Unit", comp.PPU); comp.screenHeight = EditorGUILayout.IntField("Screen height", comp.screenHeight); comp.screenWidth = EditorGUILayout.IntField("Screen width", comp.screenWidth); if (EditorGUI.EndChangeCheck()) { comp.UpdateOrthoSize(); } EditorGUILayout.LabelField("Calculated Orthographic Size", comp.orthoSize + ""); if (GUILayout.Button("Apply to Main Camera")) { comp.ApplyOrthoSize(); } }
public override void OnInspectorGUI() { PixelPerfectMainCamera cam = (PixelPerfectMainCamera)target; EditorGUI.BeginChangeCheck(); cam.PPU = EditorGUILayout.IntField("Pixels Per Unit", cam.PPU); cam.screenHeight = EditorGUILayout.IntField("Screen height", cam.screenHeight); if (EditorGUI.EndChangeCheck()) { cam.UpdateOrthoSize(); } EditorGUILayout.LabelField("Calculated Orthographic Size", cam.orthoSize + ""); if (GUILayout.Button("Apply to Main Camera")) { cam.ApplyOrthoSize(); } }