Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using MyLibrary;
namespace MagnaEngine
{
public static class PngConverter
{
@Magnagames
Magnagames / Test.cs
Last active December 5, 2019 12:39
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class Test : MonoBehaviour {
[System.Serializable]
public class Player{
[SerializeField]
public int hp;
public float atk;
using UnityEngine;
using System.Collections;
public class GameDataUser : MonoBehaviour {
void Start () {
Debug.Log ("前回セーブしたPlayerのレベルは" + GameData.Player.Level);
GameData.Player.Level = 50;
GameData.Save ();
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
public class GameData : SingletonMonoBehaviour<GameData>{
//セーブしたいデータを定義するクラス
//コンストラクタで値を初期化
class SaveData: SavableSingleton<SaveData>{
public Player Player;
using UnityEngine;
public class SingletonMonoBehaviour<T> : MonoBehaviour where T : MonoBehaviour
{
private static T instance;
public static T Instance {
get {
if (instance == null) {
instance = (T)FindObjectOfType(typeof(T));
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using System.IO;
using System.Security.Cryptography;
abstract public class SavableSingleton<T> where T : SavableSingleton<T>, new()
{
sing System;
using UnityEngine;
using System.Collections;
public class JsonMapper
{
static JsonMapper()
{
LitJson.JsonMapper.RegisterExporter<float>((obj, writer) => writer.Write(Convert.ToDouble(obj)));
LitJson.JsonMapper.RegisterExporter<decimal>((obj, writer) => writer.Write(Convert.ToString(obj)));
using System.IO;
using System.Security.Cryptography;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class Crypt
{
private const string AesIV = @"jCddaOybW3zEh0Kl";
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using UnityEngine;
/// <summary>
/// Json形式でセーブできるクラスを提供します。
/// </summary>