コード例 #1
0
 void WriteProperty(SerializedProperty propetry, BinaryWriter writer)
 {
     try
     {
         string propetryValue = BinaryUtil.BinaryWriteToString(wirter => WritePropertyValue(propetry, wirter));
         writer.Write(propetry.propertyPath);
         writer.Write(propetry.propertyType.ToString());
         writer.Write(propetryValue);
     }
     catch (Exception e)
     {
         Debug.LogError(e.Message);
     }
 }
コード例 #2
0
        /// <summary>
        /// エディタ上に保存してあるデータをセーブ
        /// </summary>
        protected virtual void Save()
        {
            string str = BinaryUtil.BinaryWriteToString(writer => SerializedObjectHelper.WriteAllVisibleProperties(writer));

            switch (EditorSaveType)
            {
            case SaveType.EditorPrefs:
                EditorPrefs.SetString(SaveKey(), str);
                break;

            case SaveType.EditorUserSettings:
            default:
                EditorUserSettings.SetConfigValue(SaveKey(), str);
                break;
            }
        }