File size: 817 Bytes
e6b949c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import * as SPLAT from "gsplat";

class SelectionManager {
    private static _instance: SelectionManager;

    private static _selectedSplat: SPLAT.Splat | null;

    public static get instance(): SelectionManager {
        if (!SelectionManager._instance) {
            SelectionManager._instance = new SelectionManager();
        }
        return SelectionManager._instance;
    }

    public static get selectedSplat(): SPLAT.Splat | null {
        return this._selectedSplat;
    }

    public static set selectedSplat(splat: SPLAT.Splat | null) {
        if (this._selectedSplat) {
            this._selectedSplat.selected = false;
        }
        this._selectedSplat = splat;
        if (this._selectedSplat) {
            this._selectedSplat.selected = true;
        }
    }
}

export { SelectionManager };