Exemplo n.º 1
0
        void Start()
        {
            primaryHighlighter = Instantiate(primaryHighlighterPrefab);
            primaryHighlighter.SetActive(false);

            // Deselect all by clicking void
            handler.AddMouseHotkey(
                new ClickAction(
                    "Deselect all",
                    HotkeySpecifier.Persistent,
                    predicate: (go) => !go,
                    action: (x) => { Clear(); }
                    )
                );

            // Select new primary
            handler.AddMouseHotkey(
                new ClickAction(
                    "Select Primary",
                    HotkeySpecifier.Persistent,
                    predicate: (go) => go,
                    action: (x) => {
                if (Contains(x))
                {
                    AddPrimary(x);
                }
                else
                {
                    Set(x);
                }
            }
                    )
                );

            // Add to selection
            handler.AddMouseHotkey(
                new ClickAction(
                    "Add to Select",
                    HotkeySpecifier.Persistent | HotkeySpecifier.Shift,
                    predicate: (go) => go,
                    action: AddPrimary
                    )
                );

            // Remove from selection
            handler.AddMouseHotkey(
                new ClickAction(
                    "Remove Selection",
                    HotkeySpecifier.Persistent | HotkeySpecifier.ControlShift,
                    predicate: (go) => go,
                    action: Remove
                    )
                );
        }
Exemplo n.º 2
0
 public void Add(ClickAction mit)
 {
     handler.AddMouseHotkey(mit);
 }