public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            using (Disposables.DisabledScope(!Application.isPlaying)) {
                var @event = FoCsGUI.Layout.Button("Trigger Event");

                if (@event)
                {
                    Target.Trigger();
                }
            }
        }
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            using (var propScope = Disposables.PropertyScope(position, label, property)) {
                label = propScope.content;

                if (GetAttribute.AllowConfirmedEdit)
                {
                    GetAttribute.CurrentlyEditable =
                        FoCsGUI.DrawDisabledPropertyWithMenu(!GetAttribute.CurrentlyEditable, position, property, label, OPTIONS_ARRAY, GetAttribute.CurrentlyEditable? 0 : 1)
                        .Value ==
                        0;
                }
                else
                {
                    using (Disposables.DisabledScope())
                        FoCsGUI.PropertyField(position, property, label, true, false);
                }
            }
        }
Ejemplo n.º 3
0
        private void DrawTakeImageGUI()
        {
            using (Disposables.DisabledScope(!Application.isPlaying)) {
                if (GUILayout.Button("Take Screenshot", GUILayout.MinHeight(40)))
                {
                    if (Owner.path == "")
                    {
                        Owner.path = EditorUtility.SaveFolderPanel("Path to Save Images", Owner.path, Application.persistentDataPath);
                        Debug.Log("Path Set");
                        TakeScreenShot();
                    }
                    else
                    {
                        TakeScreenShot();
                    }
                }
            }

            if (GUILayout.Button("Open Folder", GUILayout.MaxWidth(100), GUILayout.MinHeight(40)))
            {
                //Application.OpenURL("file://" + Owner.path);
                Application.OpenURL("file://" + Owner.path);
            }
        }