/// <summary>Constructor will create the key to store in the EditorPref the state given generic type passed.</summary> /// <param name="defaultValue">If key did not exist, it will be created with this value for initialization.</param> public ExpandedState(TState defaultValue, string prefix = "CoreRP") { String Key = string.Format("{0}:{1}:UI_State", prefix, typeof(TTarget).Name); m_State = new EditorPrefBoolFlags <TState>(Key); //register key if not already there if (!EditorPrefs.HasKey(Key)) { EditorPrefs.SetInt(Key, (int)(object)defaultValue); } }
static HDCameraUI() { Inspector = new[] { CED.space, SectionGeneralSettings, SectionFrameSettings, SectionPhysicalSettings, SectionOutputSettings, SectionXRSettings }; string key = $"HDRP:{typeof(HDCameraUI).Name}:ShutterSpeedState"; m_ShutterSpeedState = new EditorPrefBoolFlags <ShutterSpeedUnit>(key); }
public HDShadowSettingsEditor() { string Key = string.Format("{0}:{1}:UI_State", "HDRP", typeof(HDShadowSettingsEditor).Name); m_State = new EditorPrefBoolFlags <Unit>(Key); }