Skip to content

Instantly share code, notes, and snippets.

@step5748
Last active August 29, 2015 14:19
Show Gist options
  • Save step5748/c7972183b34632c1db91 to your computer and use it in GitHub Desktop.
Save step5748/c7972183b34632c1db91 to your computer and use it in GitHub Desktop.
DeepCopy.csの使い方
// コピーしたいテストクラス
[System.Serializable]
public class item
{
public int id;
public string name;
}
// コピー処理サンプル
void Test()
{
item a = new item();
a.id = 12345;
a.name = "hello";
item b;
// 拡張メソッド
b = ( item )a.DeepCopy();
// ジェネリックメソッド
b = DeepCopyHelper.DeepCopy< item >( a );
b.id = 54635;
b.name = "Fine!";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment