Exemple #1
0
 private void Save(string key, TernaryBoolean value)
 {
     if (value != null)
     {
         EditorPrefs.SetInt(key, value.RawValue);
     }
 }
 public void add(string key, TernaryBoolean get)
 {
     if (get == null)
     {
         throw new ArgumentNullException();
     }
     items[key] = get.BoolValue;
 }
Exemple #3
0
        private void Draw(Rect rect, TernaryBoolean value, string tooltip)
        {
            var content = new GUIContent(value.ToString(), tooltip);

            if (GUI.Button(rect, content))
            {
                value.SwitchToNext();
            }
        }
        private TernaryBoolean getBool(string key)
        {
            TernaryBoolean result = null;

            if (!booleans.TryGetValue(key, out result))
            {
                result        = new TernaryBoolean((byte)EditorPrefs.GetInt(key, 0));
                booleans[key] = result;
            }
            return(result);
        }
Exemple #5
0
        private TernaryBoolean getBool(string key)
        {
#if ONE_LINE_DEFAULTS_ONLY
            return(new TernaryBoolean(null));
#else
            TernaryBoolean result = null;
            if (!booleans.TryGetValue(key, out result))
            {
                result        = new TernaryBoolean((byte)EditorPrefs.GetInt(key, 0));
                booleans[key] = result;
            }
            return(result);
#endif
        }