Generated
How do I use Generated
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
File name: ReorderableListResources.cs
Copy
130 private static void GenerateSpecialTextures()
131 {
132 var splitterColor = EditorGUIUtility.isProSkin
133 ? new Color( 1f, 1f, 1f, 0.14f )
134 : new Color( 0.59f, 0.59f, 0.59f, 0.55f )
135 ;
136 texItemSplitter = CreatePixelTexture( "(Generated) Item Splitter", splitterColor );
137 }
File name: ReorderableListResources.cs
Copy
168 private static void LoadResourceAssets()
169 {
170 var skin = EditorGUIUtility.isProSkin ? s_DarkSkin : s_LightSkin;
171 s_Cached = new Texture2D[ skin.Length ];
172
173 for( int i = 0; i < s_Cached.Length; ++i )
174 {
175 // Get image data (PNG) from base64 encoded strings.
176 byte[] imageData = Convert.FromBase64String( skin[ i ] );
177
178 // Gather image size from image data.
179 int texWidth, texHeight;
180 GetImageSize( imageData, out texWidth, out texHeight );
181
182 // Generate texture asset.
183 var tex = new Texture2D( texWidth, texHeight, TextureFormat.ARGB32, false, true );
184 tex.hideFlags = HideFlags.HideAndDontSave;
185 tex.name = "(Generated) ReorderableList:" + i;
186 tex.filterMode = FilterMode.Point;
187 tex.LoadImage( imageData );
188
189 s_Cached[ i ] = tex;
190 }
191
192 s_LightSkin = null;
193 s_DarkSkin = null;
194 }
File name: VSCode.cs
Copy
1366 private static void OnGeneratedCSProjectFiles()
1367 {
1368 // Force execution of VSCode update
1369 VSCode.UpdateSolution();
1370 }
Download file with original file name:Generated
Generated 145 lượt xem
Gõ tìm kiếm nhanh...