Unity work log [Tips]

【1】

The path in Untiy3D uses
// Convert the \ in the path to /
string path = path.Replace(@"\" , "/");
ps: Correct path writing
1.Resources/Texture/sky
2.Resources \Texture\sky


【2】

Reduce the use of enum, use more class


【3】

Reduce the use of foreach, each iteration loop is the creation and destruction of Enumerator objects, increasing GC


【4】

Transform transform;
transform.rotation = Quaternion.Euler(new Vector3(x,y,z));


【5】

Set 4 grid alignment for vs: Tools - Options - All Languages ​​- Tabswrite picture description here

Set code block automatic alignment: ctrl + k , ctrl + f

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325484140&siteId=291194637