InitializeBackground
How do I use Initialize Background
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
Line | Code | Ex.. |
---|---|---|
18 | InitializeBackground (); | 1 |
28 | void InitializeBackground(){ | 2 |
File name: Background.cs
Copy
28 void InitializeBackground(){
29 mat = GetComponent
30 offset = mat.GetTextureOffset ("_MainTex");
31 float height = Camera.main.orthographicSize * 2f;
32 float width = height * Screen.width / Screen.height;
33
34 transform.localScale = new Vector3 (width, height + 1, transform.position.z);
35 }
InitializeBackground 113 lượt xem
Gõ tìm kiếm nhanh...