blob: 89cc8ed6d2bcd07e8c0c14e7c32cd1f024f2771b (
plain)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
using UnityEditor;
namespace AmplifyShaderEditor
{
[System.Serializable]
public class OptionsWindow
{
private AmplifyShaderEditorWindow m_parentWindow = null;
private bool m_coloredPorts = true;
private bool m_multiLinePorts = true;
private const string MultiLineId = "MultiLinePortsDefault";
private const string ColorPortId = "ColoredPortsDefault";
public OptionsWindow( AmplifyShaderEditorWindow parentWindow )
{
m_parentWindow = parentWindow;
//Load ();
}
public void Init()
{
Load();
}
public void Destroy()
{
Save();
}
public void Save()
{
EditorPrefs.SetBool( ColorPortId, ColoredPorts );
EditorPrefs.SetBool( MultiLineId, m_multiLinePorts );
}
public void Load()
{
ColoredPorts = EditorPrefs.GetBool( ColorPortId, true );
m_multiLinePorts = EditorPrefs.GetBool( MultiLineId, true );
}
public bool ColoredPorts
{
get { return m_coloredPorts; }
set
{
if ( m_coloredPorts != value )
EditorPrefs.SetBool( ColorPortId, value );
m_coloredPorts = value;
}
}
public bool MultiLinePorts
{
get { return m_multiLinePorts; }
set
{
if ( m_multiLinePorts != value )
EditorPrefs.SetBool( MultiLineId, value );
m_multiLinePorts = value;
}
}
public AmplifyShaderEditorWindow ParentWindow { get { return m_parentWindow; } set { m_parentWindow = value; } }
}
}
|