public override void OnInspectorGUI() { TakeScreenshot baseScript = (TakeScreenshot)target; if (GUILayout.Button("Take Screenshot")) { var folder = Path.Combine(Application.dataPath, "Screenshots"); if (!Directory.Exists(folder)) { Directory.CreateDirectory(folder); } var path = Path.Combine(folder, "screenshot.png"); Debug.Log(path); baseScript.CamCapture(path); } if (GUILayout.Button("Set Frustum To Scene Object")) { baseScript.SetFrustumToSceneObject(); } if (GUILayout.Button("Evaluate Curve")) { if (baseScript.t > 1) { baseScript.t = 0; } baseScript.EvaluateCurve(baseScript.m_sceneObject, baseScript.t); baseScript.t += 0.025f; } DrawDefaultInspector(); }