Beispiel #1
0
    void OnEnable()
    {
        button = ButtonFactory.GetPlatformSpecificButtonImplementation();
        button.Enable("Jump", pairedWithInputManager, GetComponent <GUIElement>().GetScreenRect());

        TypeSpecificOnEnable();
    }
        static void Main(string[] args)
        {
            System.Console.WriteLine("Button:");
            System.Console.WriteLine();

            AbstractButton steelButton = ControlFactory.GetButton(ControlFactory.ButtonType.Steel);

            steelButton.OnClick();

            AbstractButton rubberButton = ControlFactory.GetButton(ControlFactory.ButtonType.Rubber);

            rubberButton.OnClick();

            System.Console.WriteLine();
            System.Console.WriteLine("Text Box:");
            System.Console.WriteLine();

            AbstractTextBox steelTextBox = ControlFactory.GetTextBox(ControlFactory.TextBoxType.Steel);

            steelTextBox.Show();

            AbstractTextBox rubberTextBox = ControlFactory.GetTextBox(ControlFactory.TextBoxType.Rubber);

            rubberTextBox.Show();

            AbstractTextBox woodTextBox = ControlFactory.GetTextBox(ControlFactory.TextBoxType.Wood);

            woodTextBox.Show();

            System.Console.WriteLine();
        }
Beispiel #3
0
 private void DisplaySelectedButton(AbstractButton button)
 {
     AddInstanceButton.Selected          = (button is AddInstanceButton);
     SelectButton.Selected               = (button is SelectButton);
     MoveButton.Selected                 = (button is MoveButton);
     ResizeButton.Selected               = (button is ResizeButton);
     CreateClassButton.Selected          = (button is CreateClassButton);
     AddMethodButton.Selected            = (button is AddMethodButton);
     AddPrimitiveDataTypeButton.Selected = (button is AddPrimitiveDataTypeButton);
     DeleteButton.Selected               = (button is DeleteButton);
 }
        /// <inheritdoc />
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            if (value is AbstractUIViewModelBase)
            {
                return(value);
            }

            return(value switch
            {
                AbstractTextBox textBox => new AbstractTextBoxViewModel(textBox),
                AbstractDataList dataList => new AbstractDataListViewModel(dataList),
                AbstractButton button => new AbstractButtonViewModel(button),
                AbstractBoolean boolean => new AbstractBooleanViewModel(boolean),
                AbstractRichTextBlock richText => new AbstractRichTextBlockViewModel(richText),
                AbstractMultiChoice multiChoiceUIElement => new AbstractMultiChoiceViewModel(multiChoiceUIElement),
                AbstractForm form => new AbstractFormViewModel(form),
                AbstractUICollection elementGroup => new AbstractUICollectionViewModel(elementGroup),
                AbstractProgressIndicator progress => new AbstractProgressIndicatorViewModel(progress),
                AbstractColorPicker color => new AbstractColorPickerViewModel(color),

                _ => throw new NotSupportedException($"No match ViewModel was found for {value.GetType()}."),
            });
Beispiel #5
0
        public override void OnInspectorGUI()
        {
            _target = (AbstractButton)target;

            #if UNITY_4_2
            Undo.RegisterUndo(_target, "Button Editor");
            #elif UNITY_4_3
            Undo.RecordObject(_target, "Button Editor");
            #endif

            GetButtonInputCamera();

            DecideButtonAction();

            if (_target is ScaffoldingButton)
            {
                AddScriptCallbacks();
            }

            SceneView.RepaintAll();

            EditorUtility.SetDirty(target);
        }
Beispiel #6
0
 void OnEnable()
 {
     m_Button = ButtonFactory.GetPlatformSpecificButtonImplementation();
     m_Button.Enable(buttonName, pairedWithInputManager, GetComponent <GUIElement>().GetScreenRect());
 }
Beispiel #7
0
 public Client(WidgetFactory widgetFactory)
 {
     _abstractWindow = widgetFactory.CreateForm();
     _abstractButton = widgetFactory.CreateButton();
 }
Beispiel #8
0
 public abstract void Interact(AbstractButton button);
Beispiel #9
0
 /// <summary>
 /// Constructor of ButtonEvent struct
 /// </summary>
 /// <param name="button">AbstractButton instance</param>
 /// <param name="index">Index of the device</param>
 public ButtonEvent(AbstractButton button, short index)
 {
     Button = button;
     Index = index;
 }
Beispiel #10
0
 public abstract void BindButton(AbstractButton button);
Beispiel #11
0
 public override void Interact(AbstractButton button)
 {
     this.Controls.Add(button);
     this.ShowDialog();
 }
 void OnEnable()
 {
     m_Button = ButtonFactory.GetPlatformSpecificButtonImplementation ();
     m_Button.Enable(buttonName, pairedWithInputManager, GetComponent<GUIElement>().GetScreenRect());
 }
Beispiel #13
0
 public override void BindButton(AbstractButton button)
 {
     this.Controls.Add(button);
 }
Beispiel #14
0
 private void OnEnable()
 {
     this.m_Button = ButtonFactory.GetPlatformSpecificButtonImplementation();
     this.m_Button.Enable(this.buttonName, this.pairedWithInputManager, base.GetComponent<GUIElement>().GetScreenRect());
 }
Beispiel #15
0
 private void OnEnable()
 {
     this.m_Button = ButtonFactory.GetPlatformSpecificButtonImplementation();
     this.m_Button.Enable(this.buttonName, this.pairedWithInputManager, base.GetComponent <GUIElement>().GetScreenRect());
 }
Beispiel #16
0
 public Client(AbstractFactory factory)
 {
     window = factory.CreateWindow();
     button = factory.CreateButton();
 }
Beispiel #17
0
 /// <summary>
 /// Constructor of ButtonEvent struct
 /// </summary>
 /// <param name="button">AbstractButton instance</param>
 public ButtonEvent(AbstractButton button)
 {
     Button = button;
     Index = -1;
 }