0:00:01.160,0:00:03.819 The sprite renderer component displays images 0:00:03.819,0:00:06.383 that have been imported as the sprite type 0:00:06.383,0:00:09.412 for use in both 2D and 3D scenes. 0:00:10.112,0:00:12.140 The primary property of the sprite 0:00:12.140,0:00:14.140 renderer is sprite. 0:00:15.648,0:00:18.390 This is a reference to the sprite to render. 0:00:20.216,0:00:22.649 For more information on the sprite import type 0:00:22.649,0:00:25.136 please see the information linked below. 0:00:26.820,0:00:29.805 Colour is the vertex colour of the rendered sprite 0:00:29.805,0:00:31.805 and can be used to tint or recolour 0:00:31.805,0:00:33.266 the sprite image. 0:00:35.009,0:00:37.009 Colour can also be used to fade the 0:00:37.009,0:00:39.009 sprite's opacity by changing the value 0:00:39.009,0:00:41.009 of the colour's alpha channel. 0:00:42.738,0:00:44.738 The sprite's colour property is independent 0:00:44.738,0:00:47.866 of the sprite's material, so changing the colour 0:00:47.866,0:00:49.866 property on a sprite will only effect 0:00:49.866,0:00:51.866 that particular game object. 0:00:53.678,0:00:55.678 Material is a reference to the material 0:00:55.678,0:00:57.915 used to render the sprite. 0:00:59.034,0:01:01.546 By default a new sprite renderer component 0:01:01.546,0:01:04.831 will have the material sprite's default assigned. 0:01:06.049,0:01:08.757 When using this default material the sprite will not 0:01:08.757,0:01:11.299 be effected by any lighting in the scene. 0:01:12.030,0:01:14.030 The sprite renderer will simply render the 0:01:14.030,0:01:16.414 original sprite at full brightness. 0:01:17.234,0:01:19.798 In many cases lighting is not necessary 0:01:19.798,0:01:21.798 when creating a 2D game. 0:01:22.381,0:01:24.381 To use lights with a sprite renderer 0:01:24.381,0:01:26.381 a material with a shader that responds 0:01:26.381,0:01:28.381 to lighting must be selected. 0:01:28.922,0:01:32.577 Sprites Diffuse is optimised for use with sprites, 0:01:32.577,0:01:35.071 but many other shaders can be used. 0:01:40.353,0:01:43.025 Due to the nature of shaders, and the sprite renderer, 0:01:43.025,0:01:46.203 some shaders are incompatible with the sprite renderer. 0:01:47.905,0:01:50.501 Sprites use standard Unity materials, 0:01:50.501,0:01:52.501 however, the sprite renderer handles 0:01:52.501,0:01:55.537 materials differently than the mesh renderer. 0:01:56.465,0:01:58.465 The main difference is that the material's 0:01:58.465,0:02:00.465 texture property is not needed. 0:02:01.393,0:02:03.780 The sprite renderer will use the shader, 0:02:03.780,0:02:07.078 colour and other properties from a compatible material 0:02:07.078,0:02:09.078 but not the texture property. 0:02:11.028,0:02:14.396 When using a material that has a sprite shader 0:02:15.117,0:02:17.766 the texture property is unavailable. 0:02:20.462,0:02:22.930 If the attached material has a tint colour 0:02:22.930,0:02:25.807 it will be combined with the sprite's colour property. 0:02:33.102,0:02:37.206 It is important to note that lighting and shadow. 0:02:37.206,0:02:40.169 So when using lights and more complex shaders 0:02:40.169,0:02:44.053 it is best to balance the lighting with the performance of the scene. 0:02:44.912,0:02:47.617 For more information on materials and shaders, 0:02:47.617,0:02:50.107 please see the information linked below. 0:02:52.783,0:02:54.783 Sorting Layer and Order In Layer are 0:02:54.783,0:02:56.783 the systems used to define the order 0:02:56.783,0:02:58.783 in which sprites are drawn. 0:03:00.443,0:03:02.568 All sprite renderers are placed on a default 0:03:02.568,0:03:04.568 sorting layer when they are created. 0:03:05.800,0:03:08.171 Sprites are rendered by the sprite render 0:03:08.171,0:03:10.171 in the following order of priority. 0:03:11.127,0:03:14.391 The order of the sorting layer, containing the sprite, 0:03:16.106,0:03:18.106 the order in layer value for the sprite 0:03:18.106,0:03:20.106 within that sorting layer 0:03:22.277,0:03:24.277 and finally the sprite's transform position 0:03:24.277,0:03:26.875 Z compared to the other sprites being rendered 0:03:26.875,0:03:28.875 and the camera rendering them. 0:03:29.776,0:03:32.549 In the case of sorting layers and order-in-layer 0:03:32.549,0:03:34.549 items with lower values will be 0:03:34.549,0:03:36.731 behind those with higher values. 0:03:37.477,0:03:40.499 For more information on layers, including sorting layers, 0:03:40.499,0:03:42.943 please see the information linked below.