Saturday, July 8, 2017

How To Animate In Unity



the sprite renderer component displays images that have been imported as the sprite type for use in both 2d and 3d scenes. the primary property of the sprite renderer is sprite.


How To Animate In Unity, this is a reference to the sprite to render. for more information on the sprite import type please see the information linked below. colour is the vertex colour of the rendered sprite


and can be used to tint or recolour the sprite image. colour can also be used to fade the sprite's opacity by changing the value of the colour's alpha channel. the sprite's colour property is independent of the sprite's material, so changing the colour property on a sprite will only effect that particular game object.


material is a reference to the material used to render the sprite. by default a new sprite renderer component will have the material sprite's default assigned. when using this default material the sprite will not be effected by any lighting in the scene. the sprite renderer will simply render the original sprite at full brightness. in many cases lighting is not necessary


when creating a 2d game. to use lights with a sprite renderer a material with a shader that responds to lighting must be selected. sprites diffuse is optimised for use with sprites,33diffuse00:01:32,577 --> 00:01:35,071but many other shaders can be used. due to the nature of shaders, and the sprite renderer, some shaders are incompatible with the sprite renderer. sprites use standard unity materials, however, the sprite renderer handles


materials differently than the mesh renderer. the main difference is that the material's texture property is not needed. the sprite renderer will use the shader, colour and other properties from a compatible material but not the texture property. when using a material that has a sprite shader the texture property is unavailable. if the attached material has a tint colour


it will be combined with the sprite's colour property. it is important to note that lighting and shadow. so when using lights and more complex shaders it is best to balance the lighting with the performance of the scene. for more information on materials and shaders, sorting layer and order in layer are the systems used to define the order in which sprites are drawn. all sprite renderers are placed on a default


sorting layer when they are created. sprites are rendered by the sprite render in the following order of priority. the order of the sorting layer, containing the sprite, the order in layer value for the sprite within that sorting layer and finally the sprite's transform position z compared to the other sprites being rendered and the camera rendering them.


in the case of sorting layers and order-in-layer items with lower values will be behind those with higher values. for more information on layers, including sorting layers, subtitles by the amara.org community


No comments:

Post a Comment

Up