예제 #1
0
 public PlayerPrefStore(string name, string prefType, string valueTxt)
 {
     this.name = name;
     value = new PrefValue();
     initial = new PrefValue();
     switch (prefType) {
         case "integer":
             value.intValue = initial.intValue = int.Parse(valueTxt);
             value.type = initial.type = PlayerPrefsEditor.PrefType.Int;
             break;
         case "real":
             value.floatValue = initial.floatValue = float.Parse(valueTxt);
             value.type = initial.type = PlayerPrefsEditor.PrefType.Float;
             break;
         case "string":
             value.stringValue = initial.stringValue = valueTxt;
             value.type = initial.type = PlayerPrefsEditor.PrefType.String;
             break;
     }
 }
예제 #2
0
    public PlayerPrefStore(string name, string prefType, string valueTxt)
    {
        this.name = name;
        value     = new PrefValue();
        initial   = new PrefValue();
        switch (prefType)
        {
        case "integer":
            value.intValue = initial.intValue = int.Parse(valueTxt);
            value.type     = initial.type = PlayerPrefsEditor.PrefType.Int;
            break;

        case "real":
            value.floatValue = initial.floatValue = float.Parse(valueTxt);
            value.type       = initial.type = PlayerPrefsEditor.PrefType.Float;
            break;

        case "string":
            value.stringValue = initial.stringValue = valueTxt;
            value.type        = initial.type = PlayerPrefsEditor.PrefType.String;
            break;
        }
    }