void Start()
 {
     if (GameController.gameController.mainMenu == true)
     {
         MainMenu.SetActive(true);
         ControlButtons.SetActive(false);
     }
 }
示例#2
0
 private void Start()
 {
     buttonSuite    = GetComponent <ControlButtons>();
     movementScript = GetComponent <PlayerMovement>();
     throwScript    = GetComponent <ItemManager>();
     audioSource    = GetComponent <AudioSource>();
     animator       = GetComponent <Animator>();
     spriteRenderer = GetComponent <SpriteRenderer>();
 }
示例#3
0
        public static void RegisterControlButton(String name, String buttonData, Action callback, TriggerCondition condition)
        {
            ControllerState buttonState = XBoxController.TranslateButtonStringToButtonData(buttonData);

            if (buttonState.buttonPressedCount == -1)
            {
                UI.Notify("VRope ControlButton Error:\n Button combination for \"" + name + "\" is invalid. \nThe control was disabled.");
                return;
            }

            ControlButtons.Add(new ControlButton(name, buttonState, callback, condition));
        }
示例#4
0
        public virtual void Init(ControllerIndex controllerIndex)
        {
            ControllerIndex = controllerIndex;
            foreach (object b in Enum.GetValues(typeof(ControlButtons)))
            {
                ControlButtons btn = (ControlButtons)b;
                ButtonPressedLastFrame.Add(btn, false);
                ButtonPressed.Add(btn, false);
                ButtonDown.Add(btn, false);
                ButtonUp.Add(btn, false);
            }

            foreach (object b in Enum.GetValues(typeof(ControlAxis)))
            {
                ControlAxis ca = (ControlAxis)b;
                Axises.Add(ca, 0);
            }
        }
示例#5
0
    private void Start()
    {
        physics     = GetComponent <Rigidbody2D>();
        buttonSuite = GetComponent <ControlButtons>();
        renderer    = GetComponent <SpriteRenderer>();

        //ignore other player's colliders
        PlayerMovement[] players  = FindObjectsOfType <PlayerMovement>();
        Collider2D       collider = GetComponent <Collider2D>();

        foreach (PlayerMovement player in players)
        {
            if (player.gameObject.name == gameObject.name)
            {
                continue;
            }

            Physics2D.IgnoreCollision(collider, player.GetComponent <Collider2D>(), true);
        }
        // Invoke("HardCodeSpeed", 1f);
    }
示例#6
0
 public void UpdateDisplay(string msg, ControlButtons btn)
 {
     TooltipLabel.SetLabel(msg);
 }
示例#7
0
 // Start is called before the first frame update
 void Start()
 {
     buttons = GetComponent <ControlButtons>();
 }
        private void init(string _path, WatchingObjectType _wType, TaskbarIcon _tb, Image _item_image, ControlButtons _buttons)
        {
            tb         = _tb;
            item_image = _item_image;
            Image img = ((Image)this.FindName("item_image"));

            if (_item_image != null)
            {
                img.Source = _item_image.Source;
            }

            this.path = _path;
            this.text_message.Text = _path;
            this.wType             = _wType;

            temp          = new System.Timers.Timer();
            temp.Interval = 2000;
            temp.Elapsed += new System.Timers.ElapsedEventHandler(customballoon_close);

            Button btn_copy_clipboard = ((Button)this.FindName("btn_copy_clipboard"));

            btn_copy_clipboard.Click += (sender, args) =>
            {
                if (tb.CustomBalloon != null)
                {
                    tb.CustomBalloon.IsOpen = false;
                }
                App.copy_clipboard_with_popup(_path);
            };
            if ((_buttons & ControlButtons.Clipboard) == 0)
            {
                btn_copy_clipboard.Visibility = Visibility.Hidden;
            }
            Button btn_execute_file = ((Button)this.FindName("btn_execute_file"));

            btn_execute_file.Click += (sender, args) =>
            {
                if (tb.CustomBalloon != null)
                {
                    tb.CustomBalloon.IsOpen = false;
                }
                if (File.Exists(_path) == true)
                {
                    Process.Start(_path);
                }
                else
                {
                    App.ShowMessage($"Файл {_path} ещё не загружен или удалён.");
                }
            };
            if ((_buttons & ControlButtons.Run) == 0)
            {
                btn_execute_file.Visibility = Visibility.Hidden;
            }


            this.MouseEnter += (sender, args) =>
            {
                tb.ResetBalloonCloseTimer();
                this.Background = new SolidColorBrush(Color.FromArgb(0xFF, 0x04, 0x7A, 0x95));
                //this.Visibility = Visibility.Hidden;
                if (temp.Enabled)
                {
                    temp.Stop();
                }
            };
            this.MouseLeave += (sender, args) =>
            {
                this.Background = new SolidColorBrush(Color.FromArgb(0xCC, 0x00, 0xAB, 0xD1));
                temp.Start();
            };

            /*
             * this.MouseDown += (sender, args) =>
             * {
             *  tb.CustomBalloon.IsOpen = false;
             *  //this.Visibility = Visibility.Hidden;
             *  App.gotoPathByWindowsExplorer(path, wType);
             * };
             * //*/
            this.ToolTipClosing += (sender, args) =>
            {
                temp.Stop();
            };
        }
 /*
  * public TrayPopupMessage(string _path, WatchingObjectType _wType, TaskbarIcon _tb, ControlButtons _buttons)
  * {
  *  InitializeComponent();
  *  init(_path, _wType, _tb, _buttons);
  * }
  * //*/
 public TrayPopupMessage(string _path, string _title, WatchingObjectType _wType, TaskbarIcon _tb, Image _item_image, ControlButtons _buttons)
 {
     InitializeComponent();
     this.title.Text = _title;
     init(_path, _wType, _tb, _item_image, _buttons);
 }