Tanoda
pb_DeleteButton.cs
Go to the documentation of this file.
1using System;
2using UnityEngine;
3using UnityEngine.UI;
4using System.Collections.Generic;
6
7namespace GILES
8{
10 {
11 protected override void Start()
12 {
13 base.Start();
14
15 pb_Selection.AddOnSelectionChangeListener( OnSelectionChanged );
16 OnSelectionChanged(null);
17 }
18
19 private void Update()
20 {
21 if (Input.GetKeyUp(KeyCode.Delete) && !EventSystem.current.IsPointerOverGameObject())
22 {
23 DoDelete();
24 }
25 }
26
27 public override string tooltip { get { return /*Macro.T*/(""); } }
28
29 public void DoDelete()
30 {
31 Undo.RegisterStates( new IUndo[] { new UndoDelete(pb_Selection.gameObjects), new UndoSelection() }, /*Macro.T*/("") );
33 }
34
35 private void OnSelectionChanged(IEnumerable<GameObject> go)
36 {
38 }
39 }
40}
static void RegisterStates(IEnumerable< IUndo > targets, string message)
Definition: Undo.cs:226
override string tooltip
override void Start()
static List< GameObject > gameObjects
A list of the currently selected GameObjects.
Definition: pb_Selection.cs:56
static void AddOnSelectionChangeListener(Callback< IEnumerable< GameObject > > del)
Definition: pb_Selection.cs:34
static void Clear()
Definition: pb_Selection.cs:61
static GameObject activeGameObject
Definition: pb_Selection.cs:82