// 데이터 암호화
public static string Encrypt (string toEncrypt)
{
byte[] keyArray = UTF8Encoding.UTF8.GetBytes ("12345678901234567890123456789012");
// 256-AES key
byte[] toEncryptArray = UTF8Encoding.UTF8.GetBytes (toEncrypt);
RijndaelManaged rDel = new RijndaelManaged ();
rDel.Key = keyArray;
rDel.Mode = CipherMode.ECB;
// http://msdn.microsoft.com/en-us/library/system.security.cryptography.ciphermode.aspx
rDel.Padding = PaddingMode.PKCS7;
// better lang support
ICryptoTransform cTransform = rDel.CreateEncryptor ();
byte[] resultArray = cTransform.TransformFinalBlock (toEncryptArray, 0, toEncryptArray.Length);
return Convert.ToBase64String (resultArray, 0, resultArray.Length);
}
// 데이터 암호 해독
public static string Decrypt (string toDecrypt)
{
byte[] keyArray = UTF8Encoding.UTF8.GetBytes ("12345678901234567890123456789012");
// AES-256 key
byte[] toEncryptArray = Convert.FromBase64String (toDecrypt);
RijndaelManaged rDel = new RijndaelManaged ();
rDel.Key = keyArray;
rDel.Mode = CipherMode.ECB;
// http://msdn.microsoft.com/en-us/library/system.security.cryptography.ciphermode.aspx
rDel.Padding = PaddingMode.PKCS7;
// better lang support
ICryptoTransform cTransform = rDel.CreateDecryptor ();
byte[] resultArray = cTransform.TransformFinalBlock (toEncryptArray, 0, toEncryptArray.Length);
return UTF8Encoding.UTF8.GetString (resultArray);
}
2013년 12월 26일 목요일
Encrypt and Decrypt the XML file(XML 데이터 암호화)
라벨:
C#,
Unity3D,
Unity3D_C#,
Unity3DEnglish
2013년 12월 17일 화요일
Converting Excel data to XML
You may want to use the XML when you create level design and save the scene. However, it is difficult to fix directly by hand.
Even when I was working plist in Xcode, it was difficult for the same reason as this. I do not want to work about plist again.
I hate also be considered.
In such this work, Excel is very useful.
Let write an post about how to using Excel and how to convert to XML .
The first thing most, will launch a new Notepad.
And you must create two of the minimum required to create a node configuration of the XML you want to create.
As shown below.
The following figure is what you have created a data that has two columns of text and id.
And please the order shown in the figure below.
Then, the menu in the menu tab called "Developer" comes out.
Here, you will want to work with the "Import" and "Export" as shown below.
Now, create a new document. And use the 'Import' button, please open "test.xml".
Message box appears. Please press OK.
if you see as in the figure below, you are success.
Please select the desired location. because When you push "Import" button, appeared currently location.
Now you modify the document to put the desired data. And push "Export" button under 'Import' button.
If open the saved file, you will know that the data is inserted correctly.
Even when I was working plist in Xcode, it was difficult for the same reason as this. I do not want to work about plist again.
I hate also be considered.
In such this work, Excel is very useful.
Let write an post about how to using Excel and how to convert to XML .
The first thing most, will launch a new Notepad.
And you must create two of the minimum required to create a node configuration of the XML you want to create.
As shown below.
The following figure is what you have created a data that has two columns of text and id.
Change the extension to XML now and save. (Write like test.xml.)
And please the order shown in the figure below.
Then, the menu in the menu tab called "Developer" comes out.
Here, you will want to work with the "Import" and "Export" as shown below.
Now, create a new document. And use the 'Import' button, please open "test.xml".
Message box appears. Please press OK.
if you see as in the figure below, you are success.
Please select the desired location. because When you push "Import" button, appeared currently location.
Now you modify the document to put the desired data. And push "Export" button under 'Import' button.
If open the saved file, you will know that the data is inserted correctly.
라벨:
C#,
Unity3D,
Unity3D_C#,
Unity3DEnglish
How to start and stop the particle by using code in Unity3D
Method of controlling by code for particle when create a particle at Unity3D.... If necessary, you can stop or play by code.
It do not need play when never used. So, I will want play when is used.
When you produce particle, consider as following.
Particles must fabricated using ParticleSystem Component.
Use both Clear() and Stop() function for In order to disappear on the screen when stopping the particles.
If you want to start a particle, use the Play () function.
Sample code is as follows.
It do not need play when never used. So, I will want play when is used.
When you produce particle, consider as following.
Particles must fabricated using ParticleSystem Component.
Use both Clear() and Stop() function for In order to disappear on the screen when stopping the particles.
If you want to start a particle, use the Play () function.
Sample code is as follows.
ParticleSystem testParticle = null;
// 버튼이 눌러졌을때
if (Input.GetMouseButtonUp(0) == true)
{
// 파티클이 있고
if (testParticle)
{
// 파티클이 재생중이면 재생을 멈추고 지워줍니다
if (testParticle.isPlaying == true)
{
testParticle.Stop();
testParticle.Clear();
//Debug.Log("STOP");
}
// 재생중이 아니라면 재생해주고요
else
{
testParticle.Play();
//Debug.Log("PLAY");
}
}
// 파티클이 없다면 새로 만들어주구요
else
{
Vector3 pos = Vector3.zero;
pos.y = 3;
pos.x = 3 - 30.0f;
Transform particleObject = (Transform)Instantiate(Resources.Load("Prefabs/Effects/pfBlockBomb", typeof(Transform)), pos, Quaternion.identity);
testParticle = (ParticleSystem)particleObject.GetComponent(typeof(ParticleSystem));
//Debug.Log("CREATE");
}
return;
}
라벨:
C#,
Unity3D,
Unity3D_C#,
Unity3DEnglish
2013년 12월 16일 월요일
Tips Korean cracking problem in MonoDevelop
1. If you are using MonoDevelop of windows os, input of Korean is possible.
However, in the case of the source file that you work with Visual studio, there is a case to be able to see Korean is garbled in MonoDevelop.
When you save a file in visual studio, this is encoded set - occurs when you want to save with the settings (Korean - code page 949) incorrect.
Thus, "(UTF-8 signature) Unicode - code page 65001" as shown in the figure above When you save in, garbage Korean is resolved.
2. If you want to use MonoDevelop in mac os, it is output to normal if MonoDevelop's Font does not support Korean even file encoding option on the file are set correctly as No. 1 above not, it will appears garbled.
Therefore, it is resolved by setting to AppleGothic is a basic fonts of mac fonts MonoDevelop.
3. If you want to use MonoDevelop in mac os, Korean input can not be resolved still be set as No. 2 above.
In this way, you will need to use the text editor, you can use cmd + c, cmd + v to enter the Korean, and copy and paste.
It should also be noted here is that the input mode that is attached to normal only in the case of English input mode when you paste.
라벨:
C#,
Unity3D,
Unity3D_C#,
Unity3DEnglish
Correlation of Awake & Start & Update
Awake (once) -> Start (once/enabled) -> [loop : Update]
1. Regardless of the enabled, Awake is the initialization, to call once. In addition, call the script even if it is not enable.
2. Moment it became enable true Awake or later, you call once Start. You need to call script is to enable.
3. (Tick to each fixed) Update is to continually call after Start is called. (Update type applies all)
4. FixedUpdate is called after the Update.
3. (Tick to each fixed) Update is to continually call after Start is called. (Update type applies all)
4. FixedUpdate is called after the Update.
5. Awake function of the Game Object, where they will be called at random between Game Objects.
6. Be specified to force the calling sequence of the Game Objects seems to be impossible.
![]() |
| MonoBehaviour Lifecycle |
Awake (once) -> Start (once/enabled) -> [loop : Update]
1. Regardless of the enabled, Awake is the initialization, to call once. In addition, call the script even if it is not enable.
2. Moment it became enable true Awake or later, you call once Start. You need to call script is to enable.
3. (Tick to each fixed) Update is to continually call after Start is called. (Update type applies all)
4. FixedUpdate is called after the Update.
3. (Tick to each fixed) Update is to continually call after Start is called. (Update type applies all)
4. FixedUpdate is called after the Update.
5. Awake function of the Game Object, where they will be called at random between Game Objects.
6. Be specified to force the calling sequence of the Game Objects seems to be impossible.
라벨:
C#,
Unity3D,
Unity3D_C#,
Unity3DEnglish
피드 구독하기:
덧글 (Atom)






